Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
Loading...
Searching...
No Matches
actioncardoorsoutside.c
Go to the documentation of this file.
1
class
ActionCarDoorsOutside
:
ActionInteractBase
2
{
3
protected
int
m_CommandUIDPerCrewIdx
[4];
4
protected
bool
m_IsOpening
=
true
;
5
6
void
ActionCarDoorsOutside
()
7
{
8
m_CommandUID
=
DayZPlayerConstants
.CMD_ACTIONMOD_OPENDOORFW;
9
m_StanceMask
=
DayZPlayerConstants
.STANCEMASK_ALL;
10
m_LockTargetOnUse
=
false
;
11
}
12
13
override
void
CreateConditionComponents
()
14
{
15
m_ConditionItem
=
new
CCINone
;
16
m_ConditionTarget
=
new
CCTNone
;
17
}
18
19
override
bool
ActionCondition
(
PlayerBase
player,
ActionTarget
target,
ItemBase
item )
20
{
21
CarScript
car = null;
22
24
if
(!
IsInReach
(player, target,
UAMaxDistances
.
DEFAULT
))
25
{
26
return
false
;
27
}
28
30
if
(
Class
.
CastTo
(car, target.GetParent()))
31
{
32
array<string>
selections =
new
array<string>
();
33
34
CarDoor
carDoor =
CarDoor
.Cast(target.GetObject());
35
if
(carDoor)
36
{
37
carDoor.GetActionComponentNameList(target.GetComponentIndex(), selections);
38
39
string
animSource =
""
;
40
41
for
(
int
i = 0; i < selections.Count(); i++)
42
{
43
animSource = car.
GetAnimSourceFromSelection
(selections[i]);
44
if
(animSource !=
""
)
45
{
46
int
idx = car.
GetSeatIndexFromDoor
(animSource);
47
if
(idx != -1 && !car.IsAreaAtDoorFree(idx))
48
{
49
return
false
;
50
}
51
53
m_CommandUID
=
DayZPlayerConstants
.CMD_ACTIONMOD_OPENDOORFW;
54
55
float
animationPhase = car.GetAnimationPhase(animSource);
57
return
(
m_IsOpening
&& animationPhase <= 0.5 ) || ( !
m_IsOpening
&& animationPhase > 0.5);
58
}
59
}
60
}
61
}
62
63
return
false
;
64
}
65
66
override
void
OnStartServer
(
ActionData
action_data )
67
{
68
super.OnStartServer(action_data);
69
70
float
phase;
71
72
if
(
m_IsOpening
)
73
{
74
phase = 1.0;
75
}
76
else
77
{
78
phase = 0.0;
79
}
80
81
string
animSource =
""
;
82
83
CarScript
car =
CarScript
.Cast(action_data.m_Target.GetParent());
84
if
(car)
85
{
86
array<string>
selections =
new
array<string>
();
87
CarDoor
carDoor =
CarDoor
.Cast(action_data.m_Target.GetObject());
88
if
(carDoor)
89
{
90
carDoor.GetActionComponentNameList(action_data.m_Target.GetComponentIndex(), selections);
91
for
(
int
i = 0; i < selections.Count(); i++)
92
{
93
animSource = car.
GetAnimSourceFromSelection
(selections[i]);
94
if
(animSource !=
""
)
95
{
96
break
;
97
}
98
}
99
}
100
}
101
102
if
(car)
103
{
104
car.ForceUpdateLightsStart();
105
car.SetAnimationPhase(animSource, phase);
106
}
107
}
108
109
override
void
OnEndServer
(
ActionData
action_data)
110
{
111
super.OnEndServer(action_data);
112
113
CarScript
car =
CarScript
.Cast(action_data.m_Target.GetParent());
114
if
(car)
115
{
116
car.ForceUpdateLightsEnd();
117
}
118
}
119
120
//--------- Not used for this class
121
protected
void
FillCommandUIDPerCrewIdx
(
int
crewIdx0,
int
crewIdx1,
int
crewIdx2,
int
crewIdx3)
122
{
123
m_CommandUIDPerCrewIdx
[0] = crewIdx0;
124
m_CommandUIDPerCrewIdx
[1] = crewIdx1;
125
m_CommandUIDPerCrewIdx
[2] = crewIdx2;
126
m_CommandUIDPerCrewIdx
[3] = crewIdx3;
127
}
128
129
protected
void
FillCommandUIDPerCrewIdx
(
int
evenCrewIdx0,
int
unevenCrewIdx1)
130
{
131
FillCommandUIDPerCrewIdx
(evenCrewIdx0, unevenCrewIdx1, evenCrewIdx0, unevenCrewIdx1);
132
}
133
//-----------------------------------
134
};
ActionData
ActionBase ActionData
Definition
actionbase.c:30
ActionTarget
class ActionTargets ActionTarget
ActionBase::IsInReach
bool IsInReach(PlayerBase player, ActionTarget target, float maxDistance=1.0)
Definition
actionbase.c:1181
ActionBase::m_LockTargetOnUse
bool m_LockTargetOnUse
Definition
actionbase.c:66
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
ActionCarDoorsOutside::OnEndServer
override void OnEndServer(ActionData action_data)
Definition
actioncardoorsoutside.c:109
ActionCarDoorsOutside::FillCommandUIDPerCrewIdx
void FillCommandUIDPerCrewIdx(int evenCrewIdx0, int unevenCrewIdx1)
Definition
actioncardoorsoutside.c:129
ActionCarDoorsOutside::CreateConditionComponents
override void CreateConditionComponents()
Definition
actioncardoorsoutside.c:13
ActionCarDoorsOutside::ActionCarDoorsOutside
void ActionCarDoorsOutside()
Definition
actioncardoorsoutside.c:6
ActionCarDoorsOutside::m_CommandUIDPerCrewIdx
int m_CommandUIDPerCrewIdx[4]
Definition
actioncardoorsoutside.c:3
ActionCarDoorsOutside::m_IsOpening
bool m_IsOpening
Definition
actioncardoorsoutside.c:4
ActionCarDoorsOutside::ActionCondition
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Definition
actioncardoorsoutside.c:19
ActionCarDoorsOutside::FillCommandUIDPerCrewIdx
void FillCommandUIDPerCrewIdx(int crewIdx0, int crewIdx1, int crewIdx2, int crewIdx3)
Definition
actioncardoorsoutside.c:121
ActionCarDoorsOutside::OnStartServer
override void OnStartServer(ActionData action_data)
Definition
actioncardoorsoutside.c:66
ActionInteractBase::ActionInteractBase
void ActionInteractBase()
Definition
actioninteractbase.c:43
AnimatedActionBase::m_CommandUID
int m_CommandUID
Definition
animatedactionbase.c:143
CCINone
Definition
ccinone.c:2
CCTNone
Definition
cctnone.c:2
CarDoor
Definition
inventoryitem.c:507
CarScript
Definition
civiliansedan.c:2
CarScript::GetSeatIndexFromDoor
override int GetSeatIndexFromDoor(string pDoorSelection)
Definition
offroadhatchback.c:437
CarScript::GetAnimSourceFromSelection
override string GetAnimSourceFromSelection(string selection)
Definition
civiliansedan.c:337
Class
Super root of all classes in Enforce script.
Definition
enscript.c:11
ItemBase
Definition
inventoryitem.c:742
PlayerBase
Definition
playerbaseclient.c:2
UAMaxDistances
Definition
actionconstants.c:110
UAMaxDistances::DEFAULT
const float DEFAULT
Definition
actionconstants.c:112
array
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
Definition
isboxcollidinggeometryproxyclasses.c:28
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
interact
vehicles
actioncardoorsoutside.c
Generated by
1.17.0