DayZ
1.24
Loading...
Searching...
No Matches
ActionUnplugThisByCord.c
Go to the documentation of this file.
1
class
ActionUnplugThisByCord
:
ActionInteractBase
2
{
3
void
ActionUnplugThisByCord
()
4
{
5
m_Text
=
"#unplug_by_cord"
;
6
}
7
8
override
bool
HasProgress
()
9
{
10
return
false
;
11
}
12
13
override
bool
ActionCondition
(
PlayerBase
player
, ActionTarget
target
,
ItemBase
item
)
14
{
15
ItemBase
targetItem
=
ItemBase
.Cast(
target
.GetObject());
16
17
if
(
targetItem
&&
targetItem
.HasEnergyManager())
18
{
19
string
selection =
targetItem
.GetActionComponentName(
target
.GetComponentIndex());
20
if
(selection ==
ComponentEnergyManager
.
SEL_CORD_PLUGGED
)
21
return
true
;
22
23
// Special case for unfolded spotlight
24
if
(selection == Spotlight.SEL_CORD_PLUGGED_U)
25
return
true
;
26
}
27
28
return
false
;
29
}
30
31
override
void
OnExecuteServer
(
ActionData
action_data
)
32
{
33
ItemBase
targetItem
=
ItemBase
.Cast(
action_data
.m_Target.GetObject());
34
targetItem
.GetCompEM().UnplugThis();
35
36
if
(
targetItem
.IsInherited(Spotlight))
37
{
38
targetItem
.HideSelection(Spotlight.SEL_CORD_PLUGGED_U);
39
targetItem
.ShowSelection(Spotlight.SEL_CORD_FOLDED_U);
40
}
41
}
42
};
m_Text
string m_Text
Definition
ActionBase.c:49
ActionData
Definition
ActionBase.c:21
ActionInteractBase
Definition
ActionInteractBase.c:50
ActionUnplugThisByCord
Definition
ActionUnplugThisByCord.c:2
ActionUnplugThisByCord::OnExecuteServer
override void OnExecuteServer(ActionData action_data)
Definition
ActionUnplugThisByCord.c:31
ActionUnplugThisByCord::ActionCondition
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Definition
ActionUnplugThisByCord.c:13
ActionUnplugThisByCord::ActionUnplugThisByCord
void ActionUnplugThisByCord()
Definition
ActionUnplugThisByCord.c:3
ActionUnplugThisByCord::HasProgress
override bool HasProgress()
Definition
ActionUnplugThisByCord.c:8
ComponentEnergyManager
Definition
ComponentEnergyManager.c:19
ComponentEnergyManager::SEL_CORD_PLUGGED
static const string SEL_CORD_PLUGGED
Definition
ComponentEnergyManager.c:65
ItemBase
Definition
InventoryItem.c:697
Param3
Definition
EntityAI.c:95
PlayerBase
Definition
PlayerBaseClient.c:2
scripts
4_World
Classes
UserActionsComponent
Actions
Interact
ActionUnplugThisByCord.c
Generated by
1.10.0