Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
Loading...
Searching...
No Matches
actionlockdoors.c
Go to the documentation of this file.
1
class
ActionLockDoorsCB
:
ActionContinuousBaseCB
2
{
3
override
void
CreateActionComponent
()
4
{
5
m_ActionData
.m_ActionComponent =
new
CAContinuousTime
(
UATimeSpent
.
LOCK
);
6
}
7
};
8
9
class
ActionLockDoors
:
ActionContinuousBase
10
{
11
protected
const
float
APPLIED_DMG
= 6;
12
13
void
ActionLockDoors
()
14
{
15
m_CallbackClass
=
ActionLockDoorsCB
;
16
m_CommandUID
=
DayZPlayerConstants
.CMD_ACTIONFB_INTERACT;
17
m_FullBody
=
true
;
18
m_StanceMask
=
DayZPlayerConstants
.STANCEMASK_ERECT |
DayZPlayerConstants
.STANCEMASK_CROUCH;
19
m_SpecialtyWeight
= UASoftSkillsWeight.PRECISE_HIGH;
20
m_Text
=
"#lock_door"
;
21
}
22
23
override
void
CreateConditionComponents
()
24
{
25
m_ConditionItem
=
new
CCINonRuined
;
26
m_ConditionTarget
=
new
CCTCursor
;
27
}
28
29
override
bool
ActionCondition
(
PlayerBase
player,
ActionTarget
target,
ItemBase
item )
30
{
31
if
( !
IsBuilding
(target) )
return
false
;
32
if
( !
IsInReach
(player, target,
UAMaxDistances
.
DEFAULT
) )
return
false
;
33
34
Building
building;
35
ToolBase
tool;
36
if
(
Class
.
CastTo
(building, target.GetObject())&&
Class
.
CastTo
(tool, item))
37
{
38
int
doorIndex = building.
GetDoorIndex
(target.GetComponentIndex());
39
if
(doorIndex != -1 && tool.GetKeyCompatibilityType() & building.
GetLockCompatibilityType
(doorIndex))
40
return
building.
CanDoorBeLocked
(doorIndex);
41
}
42
return
false
;
43
}
44
45
protected
void
LockDoor
(
ActionTarget
target)
46
{
47
Building
building;
48
49
if
(
Class
.
CastTo
(building, target.GetObject()) )
50
{
51
int
doorIndex = building.
GetDoorIndex
(target.GetComponentIndex());
52
if
( doorIndex != -1 )
53
{
54
building.
LockDoor
(doorIndex);
55
}
56
}
57
}
58
59
override
void
OnFinishProgressServer
(
ActionData
action_data )
60
{
61
LockDoor
(action_data.m_Target);
62
63
MiscGameplayFunctions.DealAbsoluteDmg(action_data.m_MainItem,
APPLIED_DMG
);
64
}
65
66
override
bool
IsLockTargetOnUse
()
67
{
68
return
false
;
69
}
70
};
ActionData
ActionBase ActionData
Definition
actionbase.c:30
ActionTarget
class ActionTargets ActionTarget
ActionBaseCB::m_ActionData
ActionData m_ActionData
Definition
animatedactionbase.c:3
ActionBase::m_FullBody
bool m_FullBody
Definition
actionbase.c:67
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_SpecialtyWeight
float m_SpecialtyWeight
Definition
actionbase.c:83
ActionBase::m_ConditionTarget
ref CCTBase m_ConditionTarget
Definition
actionbase.c:71
ActionBase::m_StanceMask
int m_StanceMask
Definition
actionbase.c:68
ActionContinuousBaseCB
Definition
actioncontinuousbase.c:2
ActionContinuousBase::ActionContinuousBase
void ActionContinuousBase()
Definition
actioncontinuousbase.c:124
ActionLockDoorsCB
Definition
actionlockdoors.c:2
ActionLockDoorsCB::CreateActionComponent
override void CreateActionComponent()
Definition
actionlockdoors.c:3
ActionLockDoors::OnFinishProgressServer
override void OnFinishProgressServer(ActionData action_data)
Definition
actionlockdoors.c:59
ActionLockDoors::LockDoor
void LockDoor(ActionTarget target)
Definition
actionlockdoors.c:45
ActionLockDoors::CreateConditionComponents
override void CreateConditionComponents()
Definition
actionlockdoors.c:23
ActionLockDoors::APPLIED_DMG
const float APPLIED_DMG
Definition
actionlockdoors.c:11
ActionLockDoors::ActionCondition
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Definition
actionlockdoors.c:29
ActionLockDoors::IsLockTargetOnUse
override bool IsLockTargetOnUse()
Definition
actionlockdoors.c:66
ActionLockDoors::ActionLockDoors
void ActionLockDoors()
Definition
actionlockdoors.c:13
AnimatedActionBase::m_CommandUID
int m_CommandUID
Definition
animatedactionbase.c:143
AnimatedActionBase::m_CallbackClass
m_CallbackClass
Definition
animatedactionbase.c:145
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::LockDoor
proto native void LockDoor(int index, bool force=false)
Locks the door if not already locked, resets the door health. 'force = true' will close the door if o...
Building::GetLockCompatibilityType
int GetLockCompatibilityType(int doorIdx)
Which door is compatible with which key (door idx supplied).
Definition
building.c:167
Building::CanDoorBeLocked
bool CanDoorBeLocked(int doorIndex)
Check if the door is closed and if the door is unlocked.
Definition
building.c:154
CAContinuousTime
Definition
cacontinuoustime.c:2
CCINonRuined
Definition
ccinonruined.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
PlayerBase
Definition
playerbaseclient.c:2
ToolBase
Definition
boneknife.c:2
UAMaxDistances
Definition
actionconstants.c:110
UAMaxDistances::DEFAULT
const float DEFAULT
Definition
actionconstants.c:112
UATimeSpent
Definition
actionconstants.c:28
UATimeSpent::LOCK
const float LOCK
Definition
actionconstants.c:84
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.
Games
Dayz
scripts
4_world
classes
useractionscomponent
actions
continuous
actionlockdoors.c
Generated by
1.17.0