DayZ
1.24
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
return
true
;
23
24
return
false
;
25
}
26
27
override
void
OnExecuteServer
(
ActionData
action_data
)
28
{
29
Object
targetObject
=
action_data
.m_Target.GetObject();
30
if
(
targetObject
)
31
{
32
EntityAI
target_EAI
=
EntityAI
.Cast(
targetObject
);
33
target_EAI
.GetCompEM().SwitchOn();
34
}
35
}
36
};
m_Text
string m_Text
Definition
ActionBase.c:49
ActionData
Definition
ActionBase.c:21
ActionInteractBase
Definition
ActionInteractBase.c:50
ActionTurnOnSpotlight
Definition
ActionTurnOnSpotlight.c:2
ActionTurnOnSpotlight::ActionTurnOnSpotlight
void ActionTurnOnSpotlight()
Definition
ActionTurnOnSpotlight.c:3
ActionTurnOnSpotlight::OnExecuteServer
override void OnExecuteServer(ActionData action_data)
Definition
ActionTurnOnSpotlight.c:27
ActionTurnOnSpotlight::ActionCondition
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Definition
ActionTurnOnSpotlight.c:8
EntityAI
Definition
Building.c:6
ItemBase
Definition
InventoryItem.c:697
Object
Definition
ObjectTyped.c:2
Param3
Definition
EntityAI.c:95
PlayerBase
Definition
PlayerBaseClient.c:2
scripts
4_World
Classes
UserActionsComponent
Actions
Interact
ActionTurnOnSpotlight.c
Generated by
1.10.0