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

Private Member Functions

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

Detailed Description

Definition at line 1 of file ActionTurnOnWhileOnGround.c.

Constructor & Destructor Documentation

◆ ActionTurnOnWhileOnGround()

void ActionTurnOnWhileOnGround::ActionTurnOnWhileOnGround ( )
inlineprivate

Definition at line 3 of file ActionTurnOnWhileOnGround.c.

4 {
5 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_OPENDOORFW;
6 m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH | DayZPlayerConstants.STANCEMASK_ERECT;
7 m_Text = "#switch_on";
8 }
string m_Text
Definition ActionBase.c:49
int m_StanceMask
Definition ActionBase.c:53
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597

References AnimatedActionBase::m_CommandUID, m_StanceMask, and m_Text.

Member Function Documentation

◆ ActionCondition()

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

Definition at line 10 of file ActionTurnOnWhileOnGround.c.

11 {
12 EntityAI target_entity = EntityAI.Cast(target.GetObject());
13
15 target_entity.GetInventory().GetCurrentInventoryLocation(loc);
16
17 return (player.IsAlive() && target_entity.HasEnergyManager() && target_entity.GetCompEM().CanSwitchOn() && target_entity.GetCompEM().CanWork() && loc.GetType() == InventoryLocationType.GROUND);
18 }
InventoryLocationType
types of Inventory Location
InventoryLocation.

◆ OnExecuteServer()

override void ActionTurnOnWhileOnGround::OnExecuteServer ( ActionData action_data)
inlineprivate

Definition at line 20 of file ActionTurnOnWhileOnGround.c.

21 {
22 EntityAI target_entity = EntityAI.Cast(action_data.m_Target.GetObject());
23
24 if (target_entity.GetCompEM().CanWork())
25 {
26 target_entity.GetCompEM().SwitchOn();
27
28 InformPlayers(action_data.m_Player, action_data.m_Target, UA_FINISHED); //Success
29 }
30 else
31 {
32 InformPlayers(action_data.m_Player, action_data.m_Target, UA_FAILED); //No power
33 }
34 }
void InformPlayers(PlayerBase player, ActionTarget target, int state)
DEPRECATED delivers message ids to clients based on given context.
const int UA_FINISHED
Definition constants.c:436
const int UA_FAILED
Definition constants.c:433

References InformPlayers(), UA_FAILED, and UA_FINISHED.


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