DayZ
1.24
Loading...
Searching...
No Matches
ActionTurnOffPowerGenerator.c
Go to the documentation of this file.
1
class
ActionTurnOffPowerGenerator
:
ActionInteractBase
2
{
3
void
ActionTurnOffPowerGenerator
()
4
{
5
m_CommandUID
=
DayZPlayerConstants
.CMD_ACTIONMOD_INTERACTONCE;
6
m_Text
=
"#switch_off"
;
7
}
8
9
override
bool
ActionCondition
(
PlayerBase
player
, ActionTarget
target
,
ItemBase
item
)
10
{
11
Object
targetObject
=
target
.GetObject();
12
ItemBase
target_IB
=
ItemBase
.Cast(
targetObject
);
13
14
if
(
target_IB
.HasEnergyManager() &&
target_IB
.GetCompEM().CanSwitchOff())
15
return
true
;
16
else
17
return
false
;
18
}
19
20
override
void
OnExecuteServer
(
ActionData
action_data
)
21
{
22
Object
targetObject
=
action_data
.m_Target.GetObject();
23
if
(
targetObject
)
24
{
25
ItemBase
target_IB
=
ItemBase
.Cast(
targetObject
);
26
target_IB
.GetCompEM().SwitchOff();
27
target_IB
.GetCompEM().InteractBranch(
target_IB
);
28
}
29
}
30
};
m_Text
string m_Text
Definition
ActionBase.c:49
ActionData
Definition
ActionBase.c:21
ActionInteractBase
Definition
ActionInteractBase.c:50
ActionTurnOffPowerGenerator
Definition
ActionTurnOffPowerGenerator.c:2
ActionTurnOffPowerGenerator::OnExecuteServer
override void OnExecuteServer(ActionData action_data)
Definition
ActionTurnOffPowerGenerator.c:20
ActionTurnOffPowerGenerator::ActionTurnOffPowerGenerator
void ActionTurnOffPowerGenerator()
Definition
ActionTurnOffPowerGenerator.c:3
ActionTurnOffPowerGenerator::ActionCondition
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Definition
ActionTurnOffPowerGenerator.c:9
AnimatedActionBase::m_CommandUID
int m_CommandUID
Definition
AnimatedActionBase.c:122
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
scripts
4_World
Classes
UserActionsComponent
Actions
Interact
ActionTurnOffPowerGenerator.c
Generated by
1.10.0