DayZ
1.24
Loading...
Searching...
No Matches
ActionPullOutPlug.c
Go to the documentation of this file.
1
class
ActionPullOutPlug
:
ActionInteractBase
2
{
3
void
ActionPullOutPlug
()
4
{
5
m_CommandUID
=
DayZPlayerConstants
.CMD_ACTIONMOD_INTERACTONCE;
6
7
m_Text
=
"#pull_out_plug"
;
8
}
9
10
override
bool
ActionCondition
(
PlayerBase
player
, ActionTarget
target
,
ItemBase
item
)
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
}
27
28
override
void
OnExecuteServer
(
ActionData
action_data
)
29
{
30
Object
targetObject
=
action_data
.m_Target.GetObject();
31
if
(
targetObject
)
32
{
33
EntityAI
targetEntity
=
EntityAI
.Cast(
targetObject
);
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
}
45
}
m_Text
string m_Text
Definition
ActionBase.c:49
ActionData
Definition
ActionBase.c:21
ActionInteractBase
Definition
ActionInteractBase.c:50
ActionPullOutPlug
Definition
ActionPullOutPlug.c:2
ActionPullOutPlug::ActionCondition
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Definition
ActionPullOutPlug.c:10
ActionPullOutPlug::ActionPullOutPlug
void ActionPullOutPlug()
Definition
ActionPullOutPlug.c:3
ActionPullOutPlug::OnExecuteServer
override void OnExecuteServer(ActionData action_data)
Definition
ActionPullOutPlug.c:28
AnimatedActionBase::m_CommandUID
int m_CommandUID
Definition
AnimatedActionBase.c:122
EntityAI
Definition
Building.c:6
ItemBase
Definition
InventoryItem.c:697
Object
Definition
ObjectTyped.c:2
Param3
Definition
EntityAI.c:95
PlayerBase
Definition
PlayerBaseClient.c:2
DayZPlayerConstants
DayZPlayerConstants
defined in C++
Definition
dayzplayer.c:597
GetGame
proto native CGame GetGame()
scripts
4_World
Classes
UserActionsComponent
Actions
Interact
ActionPullOutPlug.c
Generated by
1.10.0