Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
Loading...
Searching...
No Matches
actionclosedoors.c
Go to the documentation of this file.
1
class
ActionCloseDoors
:
ActionInteractBase
2
{
3
ref
NoiseParams
m_NoisePar
;
4
5
void
ActionCloseDoors
()
6
{
7
m_CommandUID
=
DayZPlayerConstants
.CMD_ACTIONMOD_OPENDOORFW;
8
m_StanceMask
=
DayZPlayerConstants
.STANCEMASK_CROUCH |
DayZPlayerConstants
.STANCEMASK_ERECT;
9
m_Text
=
"#close"
;
10
}
11
12
override
void
CreateConditionComponents
()
13
{
14
m_ConditionItem
=
new
CCINone
();
15
m_ConditionTarget
=
new
CCTCursor
();
16
}
17
18
override
bool
ActionCondition
(
PlayerBase
player,
ActionTarget
target,
ItemBase
item)
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
{
32
if
(!
IsInReach
(player, target,
UAMaxDistances
.
DEFAULT
))
33
return
false
;
34
35
return
building.
CanDoorBeClosed
(doorIndex);
36
}
37
}
38
39
return
false
;
40
}
41
42
override
void
OnStartServer
(
ActionData
action_data)
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
}
59
60
override
void
OnEndServer
(
ActionData
action_data)
61
{
62
super.OnEndServer(action_data);
63
64
m_NoisePar
=
new
NoiseParams
();
65
m_NoisePar
.LoadFromPath(
"CfgVehicles SurvivorBase NoiseActionDefault"
);
66
NoiseSystem
noise =
g_Game
.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
(
g_Game
.GetWeather()));
71
}
72
}
73
74
override
bool
IsLockTargetOnUse
()
75
{
76
return
false
;
77
}
78
}
ActionData
ActionBase ActionData
Definition
actionbase.c:30
ActionTarget
class ActionTargets ActionTarget
ActionBase::m_Text
string m_Text
Definition
actionbase.c:64
ActionBase::IsInReach
bool IsInReach(PlayerBase player, ActionTarget target, float maxDistance=1.0)
Definition
actionbase.c:1181
ActionBase::IsBuilding
bool IsBuilding(ActionTarget target)
Definition
actionbase.c:1171
ActionBase::m_ConditionItem
ref CCIBase m_ConditionItem
Definition
actionbase.c:70
ActionBase::m_ConditionTarget
ref CCTBase m_ConditionTarget
Definition
actionbase.c:71
ActionBase::m_StanceMask
int m_StanceMask
Definition
actionbase.c:68
ActionCloseDoors::OnEndServer
override void OnEndServer(ActionData action_data)
Definition
actionclosedoors.c:60
ActionCloseDoors::m_NoisePar
ref NoiseParams m_NoisePar
Definition
actionclosedoors.c:3
ActionCloseDoors::CreateConditionComponents
override void CreateConditionComponents()
Definition
actionclosedoors.c:12
ActionCloseDoors::ActionCondition
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Definition
actionclosedoors.c:18
ActionCloseDoors::IsLockTargetOnUse
override bool IsLockTargetOnUse()
Definition
actionclosedoors.c:74
ActionCloseDoors::ActionCloseDoors
void ActionCloseDoors()
Definition
actionclosedoors.c:5
ActionCloseDoors::OnStartServer
override void OnStartServer(ActionData action_data)
Definition
actionclosedoors.c:42
ActionInteractBase::ActionInteractBase
void ActionInteractBase()
Definition
actioninteractbase.c:43
AnimatedActionBase::m_CommandUID
int m_CommandUID
Definition
animatedactionbase.c:143
Building
Definition
building.c:11
Building::GetDoorIndex
proto native int GetDoorIndex(int componentIndex)
Gets the index of the door based on the view geometry component index.
Building::CanDoorBeClosed
bool CanDoorBeClosed(int doorIndex)
Definition
building.c:148
Building::CloseDoor
proto native void CloseDoor(int index)
Attempts to close the door.
CCINone
Definition
ccinone.c:2
CCTCursor
Definition
cctcursor.c:2
Class
Super root of all classes in Enforce script.
Definition
enscript.c:11
ItemBase
Definition
inventoryitem.c:742
NoiseAIEvaluate
Definition
sensesaievaluate.c:2
NoiseAIEvaluate::GetNoiseReduction
static float GetNoiseReduction(Weather weather)
Definition
sensesaievaluate.c:18
NoiseSystem
Definition
noise.c:2
NoiseSystem::AddNoisePos
proto void AddNoisePos(EntityAI source_entity, vector pos, NoiseParams noise_params, float external_strenght_multiplier=1.0)
PlayerBase
Definition
playerbaseclient.c:2
UAMaxDistances
Definition
actionconstants.c:110
UAMaxDistances::DEFAULT
const float DEFAULT
Definition
actionconstants.c:112
g_Game
DayZGame g_Game
Definition
dayzgame.c:3942
DayZPlayerConstants
DayZPlayerConstants
defined in C++
Definition
dayzplayer.c:602
Class::CastTo
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
NoiseParams
class NoiseSystem NoiseParams()
Definition
noise.c:15
Games
Dayz
scripts
4_world
classes
useractionscomponent
actions
interact
actionclosedoors.c
Generated by
1.17.0