DayZ
1.24
Loading...
Searching...
No Matches
ActionTurnOffSpotlight.c
Go to the documentation of this file.
1
class
ActionTurnOffSpotlight
:
ActionInteractBase
2
{
3
void
ActionTurnOffSpotlight
()
4
{
5
m_Text
=
"#switch_off"
;
6
}
7
8
override
bool
ActionCondition
(
PlayerBase
player
, ActionTarget
target
,
ItemBase
item
)
9
{
10
Object
targetObject
=
target
.GetObject();
11
string
selection =
targetObject
.GetActionComponentName(
target
.GetComponentIndex());
12
ItemBase
target_IB
=
ItemBase
.Cast(
target
.GetObject());
13
14
if
(selection == Spotlight.SEL_REFLECTOR_COMP_U &&
target_IB
.HasEnergyManager() &&
target_IB
.GetCompEM().CanSwitchOff())
15
return
true
;
16
17
return
false
;
18
}
19
20
override
void
OnExecuteServer
(
ActionData
action_data
)
21
{
22
Object
targetObject
=
action_data
.m_Target.GetObject();
23
if
(
targetObject
)
24
{
25
EntityAI
target_EAI
=
EntityAI
.Cast(
targetObject
);
26
target_EAI
.GetCompEM().SwitchOff();
27
}
28
}
29
};
m_Text
string m_Text
Definition
ActionBase.c:49
ActionData
Definition
ActionBase.c:21
ActionInteractBase
Definition
ActionInteractBase.c:50
ActionTurnOffSpotlight
Definition
ActionTurnOffSpotlight.c:2
ActionTurnOffSpotlight::OnExecuteServer
override void OnExecuteServer(ActionData action_data)
Definition
ActionTurnOffSpotlight.c:20
ActionTurnOffSpotlight::ActionCondition
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Definition
ActionTurnOffSpotlight.c:8
ActionTurnOffSpotlight::ActionTurnOffSpotlight
void ActionTurnOffSpotlight()
Definition
ActionTurnOffSpotlight.c:3
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
ActionTurnOffSpotlight.c
Generated by
1.10.0