Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
Loading...
Searching...
No Matches
actionturnonspotlight.c
Go to the documentation of this file.
1
class
ActionTurnOnSpotlight
:
ActionInteractBase
2
{
3
void
ActionTurnOnSpotlight
()
4
{
5
m_Text
=
"#switch_on"
;
6
}
7
8
override
bool
ActionCondition
(
PlayerBase
player,
ActionTarget
target,
ItemBase
item )
9
{
10
Object
targetObject = target.GetObject();
11
ItemBase
target_IB =
ItemBase
.Cast( targetObject );
12
13
Spotlight s = Spotlight.Cast(target_IB);
14
15
if
(s && s.IsFolded())
16
return
false
;
17
18
int
component_id = target.GetComponentIndex();
19
string
selection = targetObject.GetActionComponentName(component_id);
20
21
if
( selection == Spotlight.SEL_REFLECTOR_COMP_U && target_IB.HasEnergyManager() && target_IB.GetCompEM().CanSwitchOn() )
22
{
23
return
true
;
24
}
25
26
return
false
;
27
}
28
29
override
void
OnExecuteServer
(
ActionData
action_data )
30
{
31
Object
targetObject = action_data.m_Target.GetObject();
32
if
(targetObject)
33
{
34
EntityAI
target_EAI =
EntityAI
.Cast( targetObject );
35
target_EAI.GetCompEM().
SwitchOn
();
36
}
37
}
38
};
ActionData
ActionBase ActionData
Definition
actionbase.c:30
ActionTarget
class ActionTargets ActionTarget
ActionBase::m_Text
string m_Text
Definition
actionbase.c:64
ActionInteractBase::ActionInteractBase
void ActionInteractBase()
Definition
actioninteractbase.c:43
ActionTurnOnSpotlight::OnExecuteServer
override void OnExecuteServer(ActionData action_data)
Definition
actionturnonspotlight.c:29
ActionTurnOnSpotlight::ActionCondition
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Definition
actionturnonspotlight.c:8
ActionTurnOnSpotlight::ActionTurnOnSpotlight
void ActionTurnOnSpotlight()
Definition
actionturnonspotlight.c:3
EntityAI
Definition
inventoryitem.c:2
EntityAI::SwitchOn
proto native void SwitchOn(bool onOff)
Some inventoryItem devices can be switched on/off (radios, transmitters).
ItemBase
Definition
inventoryitem.c:742
Object
Definition
objecttyped.c:2
PlayerBase
Definition
playerbaseclient.c:2
Games
Dayz
scripts
4_world
classes
useractionscomponent
actions
interact
actionturnonspotlight.c
Generated by
1.17.0