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

Private Member Functions

void ActionTurnOnWhileInHands ()
 
override void CreateConditionComponents ()
 
override bool HasTarget ()
 
override bool HasProneException ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override void OnExecuteServer (ActionData action_data)
 
override void OnStartClient (ActionData action_data)
 
override void OnStartServer (ActionData action_data)
 

Detailed Description

Definition at line 1 of file ActionTurnOnWhileInHands.c.

Constructor & Destructor Documentation

◆ ActionTurnOnWhileInHands()

void ActionTurnOnWhileInHands::ActionTurnOnWhileInHands ( )
inlineprivate

Definition at line 3 of file ActionTurnOnWhileInHands.c.

4 {
5 m_Text = "#switch_on";
6 }
string m_Text
Definition ActionBase.c:49

References m_Text.

Member Function Documentation

◆ ActionCondition()

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

Definition at line 24 of file ActionTurnOnWhileInHands.c.

25 {
26 if (item.IsInherited(Roadflare))
27 {
28 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_LIGHTFLARE;
29 m_CommandUIDProne = DayZPlayerConstants.CMD_ACTIONFB_LITCHEMLIGHT;
30 }
31 else if (item.IsInherited(Chemlight_ColorBase))
32 {
33 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_LITCHEMLIGHT;
34 m_CommandUIDProne = DayZPlayerConstants.CMD_ACTIONFB_LITCHEMLIGHT;
35 }
36 else if (item.IsInherited(GPSReceiver))
37 {
38 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_PRESS_TRIGGER;
39 m_CommandUIDProne = DayZPlayerConstants.CMD_ACTIONFB_PRESS_TRIGGER;
40 }
41 else if (item.IsInherited(Heatpack))
42 {
43 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_HEATPACK;
44 m_CommandUIDProne = DayZPlayerConstants.CMD_ACTIONFB_HEATPACK;
45 }
46 else
47 {
48 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_ITEM_ON;
49 m_CommandUIDProne = DayZPlayerConstants.CMD_ACTIONFB_ITEM_ON;
50 }
51
52 return item.HasEnergyManager() && item.GetCompEM().CanSwitchOn() && item.GetCompEM().CanWork();
53 }
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597

References AnimatedActionBase::m_CommandUID, and AnimatedActionBase::m_CommandUIDProne.

◆ CreateConditionComponents()

override void ActionTurnOnWhileInHands::CreateConditionComponents ( )
inlineprivate

Definition at line 8 of file ActionTurnOnWhileInHands.c.

9 {
12 }
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56

References m_ConditionItem, and m_ConditionTarget.

◆ HasProneException()

override bool ActionTurnOnWhileInHands::HasProneException ( )
inlineprivate

Definition at line 19 of file ActionTurnOnWhileInHands.c.

20 {
21 return true;
22 }

◆ HasTarget()

override bool ActionTurnOnWhileInHands::HasTarget ( )
inlineprivate

Definition at line 14 of file ActionTurnOnWhileInHands.c.

15 {
16 return false;
17 }

◆ OnExecuteServer()

override void ActionTurnOnWhileInHands::OnExecuteServer ( ActionData action_data)
inlineprivate

Definition at line 55 of file ActionTurnOnWhileInHands.c.

56 {
57 if (action_data.m_MainItem.HasEnergyManager())
58 {
59 if (action_data.m_MainItem.GetCompEM().CanWork())
60 action_data.m_MainItem.GetCompEM().SwitchOn();
61 }
62 }

◆ OnStartClient()

override void ActionTurnOnWhileInHands::OnStartClient ( ActionData action_data)
inlineprivate

Definition at line 64 of file ActionTurnOnWhileInHands.c.

65 {
66 if (action_data.m_MainItem && action_data.m_MainItem.IsInherited(Roadflare))
67 {
68 Roadflare flare = Roadflare.Cast(action_data.m_MainItem);
69 flare.SetModelState(RoadflareModelStates.UNCAPPED_UNIGNITED);
70 }
71 }
RoadflareModelStates
Definition Roadflare.c:17

◆ OnStartServer()

override void ActionTurnOnWhileInHands::OnStartServer ( ActionData action_data)
inlineprivate

Definition at line 73 of file ActionTurnOnWhileInHands.c.

74 {
75 if (action_data.m_MainItem && action_data.m_MainItem.IsInherited(Roadflare))
76 {
77 Roadflare flare = Roadflare.Cast(action_data.m_MainItem);
78 flare.SetModelState(RoadflareModelStates.UNCAPPED_UNIGNITED);
79 }
80 }

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