Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
actionmeasurebattery.c
Go to the documentation of this file.
2 {
3 
5  {
6  m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_LICKBATTERY;
7  m_CommandUIDProne = DayZPlayerConstants.CMD_ACTIONFB_LICKBATTERY;
8  m_Text = "#lick_battery";
9  }
10 
11  override void CreateConditionComponents()
12  {
15  }
16 
17  override bool HasProneException()
18  {
19  return true;
20  }
21 
22  override bool HasTarget()
23  {
24  return false;
25  }
26 
27  override void OnExecuteServer( ActionData action_data )
28  {
29 
30  float energy = 0;
31  if ( action_data.m_MainItem.HasEnergyManager() )
32  {
33  energy = action_data.m_MainItem.GetCompEM().GetEnergy();
34  }
35  action_data.m_MainItem.TransferModifiers(action_data.m_Player);
36  if(energy > 0)
37  {
38  InformPlayers(action_data.m_Player,action_data.m_Target,UA_FINISHED);
39  }
40  if(energy == 0)
41  {
42  InformPlayers(action_data.m_Player,action_data.m_Target,UA_FAILED);
43  }
44  }
45 };
CCTNone
Definition: cctnone.c:1
InformPlayers
protected void InformPlayers(PlayerBase player, ActionTarget target, int state)
DEPRECATED delivers message ids to clients based on given context.
UA_FINISHED
const int UA_FINISHED
Definition: constants.c:436
ActionData
Definition: actionbase.c:20
DayZPlayerConstants
DayZPlayerConstants
defined in C++
Definition: dayzplayer.c:601
ActionMeasureBattery
Definition: actionmeasurebattery.c:1
m_Text
protected string m_Text
Definition: actionbase.c:49
ActionSingleUseBase
Definition: actionsingleusebase.c:41
m_ConditionItem
ref CCIBase m_ConditionItem
Definition: actionbase.c:55
CCINonRuined
Definition: ccinonruined.c:1
m_ConditionTarget
ref CCTBase m_ConditionTarget
Definition: actionbase.c:56
UA_FAILED
const int UA_FAILED
Definition: constants.c:433