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

Private Member Functions

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

Detailed Description

Definition at line 1 of file ActionPullOutPlug.c.

Constructor & Destructor Documentation

◆ ActionPullOutPlug()

void ActionPullOutPlug::ActionPullOutPlug ( )
inlineprivate

Definition at line 3 of file ActionPullOutPlug.c.

4 {
5 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_INTERACTONCE;
6
7 m_Text = "#pull_out_plug";
8 }
string m_Text
Definition ActionBase.c:49
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597

References AnimatedActionBase::m_CommandUID, and m_Text.

Member Function Documentation

◆ ActionCondition()

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

Definition at line 10 of file ActionPullOutPlug.c.

11 {
12 EntityAI targetEntity = EntityAI.Cast(target.GetObject());
13
14 if (targetEntity.HasEnergyManager())
15 {
16 string selection = targetEntity.GetActionComponentName(target.GetComponentIndex());
17
18
19 if (GetGame().IsServer())
20 return targetEntity.GetCompEM().GetPlugOwner(selection) != null;
21 else
22 return targetEntity.GetCompEM().IsSelectionAPlug(selection);
23 }
24
25 return false;
26 }
proto native CGame GetGame()

References GetGame().

◆ OnExecuteServer()

override void ActionPullOutPlug::OnExecuteServer ( ActionData action_data)
inlineprivate

Definition at line 28 of file ActionPullOutPlug.c.

29 {
30 Object targetObject = action_data.m_Target.GetObject();
31 if (targetObject)
32 {
34 string selection = targetObject.GetActionComponentName(action_data.m_Target.GetComponentIndex());
35
36 EntityAI device = EntityAI.Cast(targetEntity.GetCompEM().GetPlugOwner(selection));
37 if (device)
38 device.GetCompEM().UnplugThis();
39
40 // Disable Advanced Placement
41 if (action_data.m_Player.IsPlacingServer())
42 action_data.m_Player.PlacingCancelServer();
43 }
44 }

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