DayZ 1.24
Loading...
Searching...
No Matches
ActionTurnOnPowerGenerator.c
Go to the documentation of this file.
2{
4 {
5 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_INTERACTONCE;
6 m_Text = "#switch_on";
7 }
8
9 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
10 {
11 PowerGeneratorBase pg = PowerGeneratorBase.Cast(target.GetObject());
12
13 if (pg)
14 {
15 if (pg.HasEnergyManager() && pg.GetCompEM().CanSwitchOn() && pg.HasSparkplug() && pg.GetCompEM().CanWork())
16 return true;
17 }
18
19 return false;
20 }
21
23 {
24 Object targetObject = action_data.m_Target.GetObject();
25 if (targetObject)
26 {
28 target_IB.GetCompEM().SwitchOn();
29 target_IB.GetCompEM().InteractBranch(target_IB);
30 }
31 }
32};
string m_Text
Definition ActionBase.c:49
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
override void OnExecuteServer(ActionData action_data)
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597