Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
actionturnoffheadtorch.c
Go to the documentation of this file.
2 {
4  {
5  }
6 
7  override bool IsInstant()
8  {
9  return true;
10  }
11 
12  override bool HasTarget()
13  {
14  return true;
15  }
16 
17  override bool UseMainItem()
18  {
19  return false;
20  }
21 
22  override void CreateConditionComponents()
23  {
26  }
27 
28  override typename GetInputType()
29  {
31  }
32 
33  override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item )
34  {
35  Headtorch_ColorBase headtorch;
36  headtorch = Headtorch_ColorBase.Cast(target.GetObject());
37  if ( !headtorch )
38  return false;
39 
40  if ( headtorch.HasEnergyManager() && headtorch.GetCompEM().CanSwitchOff() ) //TODO review conditions for turning off
41  {
42  return true;
43  }
44 
45  return false;
46  }
47 
48  override void Start( ActionData action_data )
49  {
50  super.Start( action_data );
51 
52  Headtorch_ColorBase headtorch;
53  headtorch = Headtorch_ColorBase.Cast(action_data.m_Target.GetObject());
54  if ( headtorch.HasEnergyManager() )
55  {
56  if ( headtorch.GetCompEM().IsSwitchedOn() )
57  {
58  headtorch.GetCompEM().SwitchOff();
59  }
60  }
61  }
62 };
ItemBase
Definition: inventoryitem.c:730
ToggleLightsActionInput
Definition: actioninput.c:746
CCINone
Definition: ccinone.c:1
UAMaxDistances
Definition: actionconstants.c:104
PlayerBase
Definition: playerbaseclient.c:1
ActionTarget
class ActionTargets ActionTarget
ActionData
Definition: actionbase.c:20
CCTNonRuined
Definition: cctnonruined.c:1
ActionBase
void ActionBase()
Definition: actionbase.c:73
m_ConditionItem
ref CCIBase m_ConditionItem
Definition: actionbase.c:55
m_ConditionTarget
ref CCTBase m_ConditionTarget
Definition: actionbase.c:56
ActionTurnOffHeadtorch
Definition: actionturnoffheadtorch.c:1