DayZ 1.26
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
Класс ActionCloseDoors
+ Граф наследования:ActionCloseDoors:

Закрытые члены

void ActionCloseDoors ()
 
override void CreateConditionComponents ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override void OnStartServer (ActionData action_data)
 
override void OnEndServer (ActionData action_data)
 
override bool IsLockTargetOnUse ()
 

Закрытые данные

ref NoiseParams m_NoisePar
 

Подробное описание

Конструктор(ы)

◆ ActionCloseDoors()

void ActionCloseDoors ( )
inlineprivate
6 {
7 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_OPENDOORFW;
8 m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH | DayZPlayerConstants.STANCEMASK_ERECT;
9 m_Text = "#close";
10 }
string m_Text
Definition ActionBase.c:58
int m_StanceMask
Definition ActionBase.c:62
int m_CommandUID
Definition AnimatedActionBase.c:143
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602

Перекрестные ссылки AnimatedActionBase::m_CommandUID, ActionBase::m_StanceMask и ActionBase::m_Text.

Методы

◆ ActionCondition()

override bool ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )
inlineprivate
19 {
20 if (!target)
21 return false;
22
23 if (!IsBuilding(target))
24 return false;
25
26 Building building;
27 if (Class.CastTo(building, target.GetObject()))
28 {
29 int doorIndex = building.GetDoorIndex(target.GetComponentIndex());
30 if (doorIndex != -1)
31 {
33 return false;
34
35 return building.CanDoorBeClosed(doorIndex);
36 }
37 }
38
39 return false;
40 }
bool IsInReach(PlayerBase player, ActionTarget target, float maxDistance=1.0)
Definition ActionBase.c:1054
bool IsBuilding(ActionTarget target)
Definition ActionBase.c:1044
Super root of all classes in Enforce script.
Definition EnScript.c:11
Definition EntityAI.c:95
Definition ActionConstants.c:106
const float DEFAULT
Definition ActionConstants.c:108
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.

Перекрестные ссылки Class::CastTo(), UAMaxDistances::DEFAULT, ActionBase::IsBuilding() и ActionBase::IsInReach().

◆ CreateConditionComponents()

override void CreateConditionComponents ( )
inlineprivate
13 {
16 }
ref CCIBase m_ConditionItem
Definition ActionBase.c:64
ref CCTBase m_ConditionTarget
Definition ActionBase.c:65
Definition CCINone.c:2
Definition CCTCursor.c:2

Перекрестные ссылки ActionBase::m_ConditionItem и ActionBase::m_ConditionTarget.

◆ IsLockTargetOnUse()

override bool IsLockTargetOnUse ( )
inlineprivate
75 {
76 return false;
77 }

◆ OnEndServer()

override void OnEndServer ( ActionData action_data)
inlineprivate
61 {
62 super.OnEndServer(action_data);
63
64 m_NoisePar = new NoiseParams();
65 m_NoisePar.LoadFromPath("CfgVehicles SurvivorBase NoiseActionDefault");
66 NoiseSystem noise = GetGame().GetNoiseSystem();
67 if (noise)
68 {
69 if (action_data.m_Player)
70 noise.AddNoisePos(action_data.m_Player, action_data.m_Target.GetObject().GetPosition(), m_NoisePar, NoiseAIEvaluate.GetNoiseReduction(GetGame().GetWeather()));
71 }
72 }
class NoiseSystem NoiseParams()
Definition Noise.c:15
ref NoiseParams m_NoisePar
Definition ActionCloseDoors.c:3
Definition SensesAIEvaluate.c:2
static float GetNoiseReduction(Weather weather)
Definition SensesAIEvaluate.c:18
Definition Noise.c:2
proto native CGame GetGame()

Перекрестные ссылки GetGame(), NoiseAIEvaluate::GetNoiseReduction(), m_NoisePar и NoiseParams().

◆ OnStartServer()

override void OnStartServer ( ActionData action_data)
inlineprivate
43 {
44 super.OnStartServer(action_data);
45
46 Building building;
47 if (Class.CastTo(building, action_data.m_Target.GetObject()))
48 {
49 int doorIndex = building.GetDoorIndex(action_data.m_Target.GetComponentIndex());
50 if (doorIndex != -1)
51 {
52 if (building.CanDoorBeClosed(doorIndex))
53 {
54 building.CloseDoor(doorIndex);
55 }
56 }
57 }
58 }

Перекрестные ссылки Class::CastTo().

Поля

◆ m_NoisePar

ref NoiseParams m_NoisePar
private

Используется в OnEndServer().


Объявления и описания членов класса находятся в файле: