DayZ 1.24
Loading...
Searching...
No Matches
ActionTurnOnSpotlight Class Reference
Inheritance diagram for ActionTurnOnSpotlight:
[legend]
Collaboration diagram for ActionTurnOnSpotlight:
[legend]

Private Member Functions

void ActionTurnOnSpotlight ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override void OnExecuteServer (ActionData action_data)
 

Detailed Description

Definition at line 1 of file ActionTurnOnSpotlight.c.

Constructor & Destructor Documentation

◆ ActionTurnOnSpotlight()

void ActionTurnOnSpotlight::ActionTurnOnSpotlight ( )
inlineprivate

Definition at line 3 of file ActionTurnOnSpotlight.c.

4 {
5 m_Text = "#switch_on";
6 }
string m_Text
Definition ActionBase.c:49

References m_Text.

Member Function Documentation

◆ ActionCondition()

override bool ActionTurnOnSpotlight::ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )
inlineprivate

Definition at line 8 of file ActionTurnOnSpotlight.c.

9 {
10 Object targetObject = target.GetObject();
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 }

◆ OnExecuteServer()

override void ActionTurnOnSpotlight::OnExecuteServer ( ActionData action_data)
inlineprivate

Definition at line 27 of file ActionTurnOnSpotlight.c.

28 {
29 Object targetObject = action_data.m_Target.GetObject();
30 if (targetObject)
31 {
33 target_EAI.GetCompEM().SwitchOn();
34 }
35 }

The documentation for this class was generated from the following file: