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

Private Member Functions

void ActionTurnOnWeaponFlashlight ()
 
override void CreateConditionComponents ()
 
override bool HasTarget ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override void OnExecuteServer (ActionData action_data)
 

Private Attributes

ItemBase m_flashlight
 

Detailed Description

Definition at line 1 of file ActionTurnOnWeaponFlashlight.c.

Constructor & Destructor Documentation

◆ ActionTurnOnWeaponFlashlight()

void ActionTurnOnWeaponFlashlight::ActionTurnOnWeaponFlashlight ( )
inlineprivate

Definition at line 5 of file ActionTurnOnWeaponFlashlight.c.

6 {
7 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_ITEM_ON;//CMD_ACTIONMOD_INTERACTONCE
8 m_Text = "#switch_on";
9 }
string m_Text
Definition ActionBase.c:49
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597

References AnimatedActionBase::m_CommandUID, and m_Text.

Member Function Documentation

◆ ActionCondition()

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

Definition at line 22 of file ActionTurnOnWeaponFlashlight.c.

23 {
24 if (item.IsInherited(Rifle_Base))
25 {
26 //m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_LIGHTFLARE;
27 m_flashlight = ItemBase.Cast(item.FindAttachmentBySlotName("weaponFlashlight"));
28 }
29 else if (item.IsInherited(Pistol_Base))
30 {
31 //m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_LITCHEMLIGHT;
32 m_flashlight = ItemBase.Cast(item.FindAttachmentBySlotName("pistolFlashlight"));
33 }
34 else //is not valid item
35 return false;
36
37 if (m_flashlight && m_flashlight.HasEnergyManager() && m_flashlight.GetCompEM().CanSwitchOn() && m_flashlight.GetCompEM().CanWork()) //TODO review conditions for turning off
38 return true;
39
40 return false;
41 }
base for semi auto weapons @NOTE name copies config base class
base for rifles @NOTE name copies config base class
Definition SKS.c:70

References m_flashlight.

◆ CreateConditionComponents()

override void ActionTurnOnWeaponFlashlight::CreateConditionComponents ( )
inlineprivate

Definition at line 11 of file ActionTurnOnWeaponFlashlight.c.

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

References m_ConditionItem, and m_ConditionTarget.

◆ HasTarget()

override bool ActionTurnOnWeaponFlashlight::HasTarget ( )
inlineprivate

Definition at line 17 of file ActionTurnOnWeaponFlashlight.c.

18 {
19 return false;
20 }

◆ OnExecuteServer()

override void ActionTurnOnWeaponFlashlight::OnExecuteServer ( ActionData action_data)
inlineprivate

Definition at line 43 of file ActionTurnOnWeaponFlashlight.c.

44 {
45 if (m_flashlight.HasEnergyManager())
46 {
47 if (m_flashlight.GetCompEM().CanWork())
48 m_flashlight.GetCompEM().SwitchOn();
49 Weapon_Base.Cast(action_data.m_MainItem).FlashlightOn(); //currently seems to be doing nothing
50 }
51 }

References m_flashlight.

Member Data Documentation

◆ m_flashlight

ItemBase ActionTurnOnWeaponFlashlight::m_flashlight
private

Definition at line 3 of file ActionTurnOnWeaponFlashlight.c.

Referenced by ActionCondition(), and OnExecuteServer().


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