Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
Loading...
Searching...
No Matches
actionturnonwhileinhands.c
Go to the documentation of this file.
1
class
ActionTurnOnWhileInHands
:
ActionSingleUseBase
2
{
3
void
ActionTurnOnWhileInHands
()
4
{
5
m_Text
=
"#switch_on"
;
6
}
7
8
override
void
CreateConditionComponents
()
9
{
10
m_ConditionItem
=
new
CCINonRuined
();
11
m_ConditionTarget
=
new
CCTNone
();
12
}
13
14
override
bool
HasTarget
()
15
{
16
return
false
;
17
}
18
19
override
bool
HasProneException
()
20
{
21
return
true
;
22
}
23
24
override
bool
ActionCondition
(
PlayerBase
player,
ActionTarget
target,
ItemBase
item)
25
{
26
if
(item.IsInherited(
Roadflare
))
27
{
28
m_CommandUID
=
DayZPlayerConstants
.CMD_ACTIONMOD_LIGHTFLARE;
29
m_CommandUIDProne
=
DayZPlayerConstants
.CMD_ACTIONFB_LITCHEMLIGHT;
30
}
31
else
if
(item.IsInherited(
Chemlight_ColorBase
))
32
{
33
m_CommandUID
=
DayZPlayerConstants
.CMD_ACTIONMOD_LITCHEMLIGHT;
34
m_CommandUIDProne
=
DayZPlayerConstants
.CMD_ACTIONFB_LITCHEMLIGHT;
35
}
36
else
if
(item.IsInherited(
GPSReceiver
))
37
{
38
m_CommandUID
=
DayZPlayerConstants
.CMD_ACTIONMOD_PRESS_TRIGGER;
39
m_CommandUIDProne
=
DayZPlayerConstants
.CMD_ACTIONFB_PRESS_TRIGGER;
40
}
41
else
if
(item.IsInherited(
Heatpack
))
42
{
43
m_CommandUID
=
DayZPlayerConstants
.CMD_ACTIONMOD_HEATPACK;
44
m_CommandUIDProne
=
DayZPlayerConstants
.CMD_ACTIONFB_HEATPACK;
45
}
46
else
47
{
48
m_CommandUID
=
DayZPlayerConstants
.CMD_ACTIONMOD_ITEM_ON;
49
m_CommandUIDProne
=
DayZPlayerConstants
.CMD_ACTIONFB_ITEM_ON;
50
}
51
52
return
item.HasEnergyManager() && item.GetCompEM().CanSwitchOn() && item.GetCompEM().CanWork();
53
}
54
55
override
void
OnExecuteServer
(
ActionData
action_data)
56
{
57
if
( action_data.m_MainItem.HasEnergyManager() )
58
{
59
if
(action_data.m_MainItem.GetCompEM().CanWork())
60
{
61
action_data.m_MainItem.GetCompEM().SwitchOn();
62
}
63
}
64
}
65
66
override
void
OnStartClient
(
ActionData
action_data)
67
{
68
if
(action_data.m_MainItem && action_data.m_MainItem.IsInherited(
Roadflare
))
69
{
70
Roadflare
flare =
Roadflare
.Cast(action_data.m_MainItem);
71
flare.
SetModelState
(
RoadflareModelStates
.UNCAPPED_UNIGNITED);
72
}
73
}
74
75
override
void
OnStartServer
(
ActionData
action_data )
76
{
77
super.OnStartServer(action_data);
78
79
if
(action_data.m_MainItem && action_data.m_MainItem.IsInherited(
Roadflare
))
80
{
81
Roadflare
flare =
Roadflare
.Cast(action_data.m_MainItem);
82
flare.
SetModelState
(
RoadflareModelStates
.UNCAPPED_UNIGNITED);
83
}
84
}
85
}
ActionData
ActionBase ActionData
Definition
actionbase.c:30
ActionTarget
class ActionTargets ActionTarget
ActionBase::m_Text
string m_Text
Definition
actionbase.c:64
ActionBase::m_ConditionItem
ref CCIBase m_ConditionItem
Definition
actionbase.c:70
ActionBase::m_ConditionTarget
ref CCTBase m_ConditionTarget
Definition
actionbase.c:71
ActionSingleUseBase::ActionSingleUseBase
void ActionSingleUseBase()
Definition
actionsingleusebase.c:31
ActionTurnOnWhileInHands::ActionTurnOnWhileInHands
void ActionTurnOnWhileInHands()
Definition
actionturnonwhileinhands.c:3
ActionTurnOnWhileInHands::OnExecuteServer
override void OnExecuteServer(ActionData action_data)
Definition
actionturnonwhileinhands.c:55
ActionTurnOnWhileInHands::OnStartClient
override void OnStartClient(ActionData action_data)
Definition
actionturnonwhileinhands.c:66
ActionTurnOnWhileInHands::CreateConditionComponents
override void CreateConditionComponents()
Definition
actionturnonwhileinhands.c:8
ActionTurnOnWhileInHands::ActionCondition
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Definition
actionturnonwhileinhands.c:24
ActionTurnOnWhileInHands::HasTarget
override bool HasTarget()
Definition
actionturnonwhileinhands.c:14
ActionTurnOnWhileInHands::HasProneException
override bool HasProneException()
Definition
actionturnonwhileinhands.c:19
ActionTurnOnWhileInHands::OnStartServer
override void OnStartServer(ActionData action_data)
Definition
actionturnonwhileinhands.c:75
AnimatedActionBase::m_CommandUIDProne
int m_CommandUIDProne
Definition
animatedactionbase.c:144
AnimatedActionBase::m_CommandUID
int m_CommandUID
Definition
animatedactionbase.c:143
CCINonRuined
Definition
ccinonruined.c:2
CCTNone
Definition
cctnone.c:2
Chemlight_ColorBase
Definition
chemlight.c:2
GPSReceiver
Definition
gpsreceiver.c:2
Heatpack
Definition
heatpack.c:2
ItemBase
Definition
inventoryitem.c:742
PlayerBase
Definition
playerbaseclient.c:2
Roadflare
Definition
roadflare.c:25
Roadflare::SetModelState
void SetModelState(int enum_state)
Definition
roadflare.c:88
DayZPlayerConstants
DayZPlayerConstants
defined in C++
Definition
dayzplayer.c:602
RoadflareModelStates
RoadflareModelStates
Definition
roadflare.c:17
Games
Dayz
scripts
4_world
classes
useractionscomponent
actions
singleuse
actionturnonwhileinhands.c
Generated by
1.17.0