Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
Loading...
Searching...
No Matches
actionopendoors.c
Go to the documentation of this file.
1
class
ActionOpenDoors
:
ActionInteractBase
2
{
3
ref
NoiseParams
m_NoisePar
;
4
5
void
ActionOpenDoors
()
6
{
7
m_CommandUID
=
DayZPlayerConstants
.CMD_ACTIONMOD_OPENDOORFW;
8
m_StanceMask
=
DayZPlayerConstants
.STANCEMASK_CROUCH |
DayZPlayerConstants
.STANCEMASK_ERECT;
9
m_Text
=
"#open"
;
10
}
11
12
override
void
CreateConditionComponents
()
13
{
14
m_ConditionItem
=
new
CCINone
();
15
m_ConditionTarget
=
new
CCTCursor
();
16
}
17
18
protected
bool
CheckIfDoorIsLocked
()
19
{
20
return
true
;
21
}
22
23
protected
bool
CreatesNoise
()
24
{
25
return
true
;
26
}
27
28
override
bool
ActionCondition
(
PlayerBase
player,
ActionTarget
target,
ItemBase
item)
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
{
42
if
(!
IsInReach
(player, target,
UAMaxDistances
.
DEFAULT
))
43
return
false
;
44
45
return
building.
CanDoorBeOpened
(doorIndex,
CheckIfDoorIsLocked
());
46
47
}
48
}
49
50
return
false
;
51
}
52
53
override
void
OnStartServer
(
ActionData
action_data)
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
}
70
71
override
void
OnEndServer
(
ActionData
action_data)
72
{
73
super.OnEndServer(action_data);
74
75
m_NoisePar
=
new
NoiseParams
();
76
m_NoisePar
.LoadFromPath(
"CfgVehicles SurvivorBase NoiseActionDefault"
);
77
NoiseSystem
noise =
g_Game
.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
(
g_Game
.GetWeather()));
82
}
83
}
84
85
override
bool
IsLockTargetOnUse
()
86
{
87
return
false
;
88
}
89
}
90
91
class
ActionLockedDoors
:
ActionOpenDoors
92
{
93
override
bool
CheckIfDoorIsLocked
()
94
{
95
return
false
;
96
}
97
98
override
protected
bool
CreatesNoise
()
99
{
100
return
false
;
101
}
102
};
ActionData
ActionBase ActionData
Definition
actionbase.c:30
CreatesNoise
bool CreatesNoise()
Definition
actionopendoors.c:114
CheckIfDoorIsLocked
ActionOpenDoors ActionInteractBase CheckIfDoorIsLocked()
Definition
actionopendoors.c:93
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
ActionInteractBase::ActionInteractBase
void ActionInteractBase()
Definition
actioninteractbase.c:43
ActionLockedDoors
Definition
actionlockeddoors.c:2
ActionOpenDoors
Definition
actionopendoors.c:2
ActionOpenDoors::ActionOpenDoors
void ActionOpenDoors()
Definition
actionopendoors.c:5
ActionOpenDoors::OnEndServer
override void OnEndServer(ActionData action_data)
Definition
actionopendoors.c:71
ActionOpenDoors::m_NoisePar
ref NoiseParams m_NoisePar
Definition
actionopendoors.c:3
ActionOpenDoors::CreateConditionComponents
override void CreateConditionComponents()
Definition
actionopendoors.c:12
ActionOpenDoors::ActionCondition
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Definition
actionopendoors.c:28
ActionOpenDoors::IsLockTargetOnUse
override bool IsLockTargetOnUse()
Definition
actionopendoors.c:85
ActionOpenDoors::CreatesNoise
bool CreatesNoise()
Definition
actionopendoors.c:23
ActionOpenDoors::CheckIfDoorIsLocked
bool CheckIfDoorIsLocked()
Definition
actionopendoors.c:18
ActionOpenDoors::OnStartServer
override void OnStartServer(ActionData action_data)
Definition
actionopendoors.c:53
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::OpenDoor
proto native void OpenDoor(int index)
Attempts to open the door.
Building::CanDoorBeOpened
bool CanDoorBeOpened(int doorIndex, bool checkIfLocked=false)
Definition
building.c:130
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
actionopendoors.c
Generated by
1.17.0