Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
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};
ref CCIBase m_ConditionItem
Definition actionbase.c:64
ref CCTBase m_ConditionTarget
Definition actionbase.c:65
void Start()
Plays all elements this effects consists of.
Definition effect.c:157