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