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

Защищенные члены

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

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

void ActionOpenDoors ()
 
override void CreateConditionComponents ()
 

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

ref NoiseParams m_NoisePar
 

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

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

◆ ActionOpenDoors()

void ActionOpenDoors ( )
inlineprivate
6 {
7 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_OPENDOORFW;
8 m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH | DayZPlayerConstants.STANCEMASK_ERECT;
9 m_Text = "#open";
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 )
inlineprotected
29 {
30 if (!target)
31 return false;
32
33 if (!IsBuilding(target))
34 return false;
35
36 Building building;
37 if (Class.CastTo(building, target.GetObject()))
38 {
39 int doorIndex = building.GetDoorIndex(target.GetComponentIndex());
40 if (doorIndex != -1)
41 {
43 return false;
44
45 return building.CanDoorBeOpened(doorIndex, CheckIfDoorIsLocked());
46
47 }
48 }
49
50 return false;
51 }
bool IsInReach(PlayerBase player, ActionTarget target, float maxDistance=1.0)
Definition ActionBase.c:1054
bool IsBuilding(ActionTarget target)
Definition ActionBase.c:1044
bool CheckIfDoorIsLocked()
Definition ActionOpenDoors.c:18
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(), CheckIfDoorIsLocked(), UAMaxDistances::DEFAULT, ActionBase::IsBuilding() и ActionBase::IsInReach().

◆ CheckIfDoorIsLocked()

bool CheckIfDoorIsLocked ( )
inlineprotected
19 {
20 return true;
21 }

Используется в ActionCondition() и OnStartServer().

◆ 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.

◆ CreatesNoise()

bool CreatesNoise ( )
inlineprotected
24 {
25 return true;
26 }

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

◆ IsLockTargetOnUse()

override bool IsLockTargetOnUse ( )
inlineprotected
86 {
87 return false;
88 }

◆ OnEndServer()

override void OnEndServer ( ActionData action_data)
inlineprotected
72 {
73 super.OnEndServer(action_data);
74
75 m_NoisePar = new NoiseParams();
76 m_NoisePar.LoadFromPath("CfgVehicles SurvivorBase NoiseActionDefault");
77 NoiseSystem noise = GetGame().GetNoiseSystem();
78 if (noise && CreatesNoise())
79 {
80 if (action_data.m_Player)
81 noise.AddNoisePos(action_data.m_Player, action_data.m_Target.GetObject().GetPosition(), m_NoisePar, NoiseAIEvaluate.GetNoiseReduction(GetGame().GetWeather()));
82 }
83 }
class NoiseSystem NoiseParams()
Definition Noise.c:15
ref NoiseParams m_NoisePar
Definition ActionOpenDoors.c:3
bool CreatesNoise()
Definition ActionOpenDoors.c:23
Definition SensesAIEvaluate.c:2
static float GetNoiseReduction(Weather weather)
Definition SensesAIEvaluate.c:18
Definition Noise.c:2
proto native CGame GetGame()

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

◆ OnStartServer()

override void OnStartServer ( ActionData action_data)
inlineprotected
54 {
55 super.OnStartServer(action_data);
56
57 Building building;
58 if (Class.CastTo(building, action_data.m_Target.GetObject()))
59 {
60 int doorIndex = building.GetDoorIndex(action_data.m_Target.GetComponentIndex());
61 if (doorIndex != -1)
62 {
63 if (building.CanDoorBeOpened(doorIndex, CheckIfDoorIsLocked()))
64 {
65 building.OpenDoor(doorIndex);
66 }
67 }
68 }
69 }

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

Поля

◆ m_NoisePar

ref NoiseParams m_NoisePar
private

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


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