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

Private Member Functions

void ActionLoadMagazine ()
 
override bool HasProneException ()
 
override void CreateConditionComponents ()
 
bool CanLoadMagazine (ActionTarget target, ItemBase item)
 
override bool ActionConditionContinue (ActionData action_data)
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override bool CanBePerformedFromQuickbar ()
 
override void OnExecuteServer (ActionData action_data)
 
- Private Member Functions inherited from ActionContinuousBase
void OnStartAnimationLoopServer (ActionData action_data)
 
void OnStartAnimationLoopClient (ActionData action_data)
 
void OnEndAnimationLoopServer (ActionData action_data)
 
void OnEndAnimationLoopClient (ActionData action_data)
 
void OnFinishProgressServer (ActionData action_data)
 
void OnFinishProgressClient (ActionData action_data)
 

Detailed Description

Definition at line 9 of file ActionLoadMagazine.c.

Constructor & Destructor Documentation

◆ ActionLoadMagazine()

void ActionLoadMagazine::ActionLoadMagazine ( )
inlineprivate

Member Function Documentation

◆ ActionCondition()

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

Definition at line 42 of file ActionLoadMagazine.c.

43 {
45 }
bool CanLoadMagazine(ActionTarget target, ItemBase item)

References CanLoadMagazine().

◆ ActionConditionContinue()

override bool ActionLoadMagazine::ActionConditionContinue ( ActionData action_data)
inlineprivate

Definition at line 37 of file ActionLoadMagazine.c.

38 {
39 return CanLoadMagazine(action_data.m_Target, action_data.m_MainItem);
40 }

References CanLoadMagazine().

◆ CanBePerformedFromQuickbar()

override bool ActionLoadMagazine::CanBePerformedFromQuickbar ( )
inlineprivate

Definition at line 47 of file ActionLoadMagazine.c.

48 {
49 return true;
50 }

◆ CanLoadMagazine()

bool ActionLoadMagazine::CanLoadMagazine ( ActionTarget target,
ItemBase item )
inlineprivate

Definition at line 30 of file ActionLoadMagazine.c.

31 {
34 return (Class.CastTo(trg, target.GetObject()) && Class.CastTo(itm, item) && itm.GetAmmoCount() < itm.GetAmmoMax() && trg.GetAmmoCount() != 0 && itm.IsCompatiableAmmo(trg));
35 }
Super root of all classes in Enforce script.
Definition EnScript.c:11
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.

References Class::CastTo().

Referenced by ActionCondition(), and ActionConditionContinue().

◆ CreateConditionComponents()

override void ActionLoadMagazine::CreateConditionComponents ( )
inlineprivate

Definition at line 24 of file ActionLoadMagazine.c.

25 {
28 }
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
const float DEFAULT

References UAMaxDistances::DEFAULT, m_ConditionItem, and m_ConditionTarget.

◆ HasProneException()

override bool ActionLoadMagazine::HasProneException ( )
inlineprivate

Definition at line 19 of file ActionLoadMagazine.c.

20 {
21 return true;
22 }

◆ OnExecuteServer()

override void ActionLoadMagazine::OnExecuteServer ( ActionData action_data)
inlineprivate

Definition at line 52 of file ActionLoadMagazine.c.

53 {
54 //Param1<float> timeSpendParam;
55 //if( !Class.CastTo(timeSpendParam, action_data.m_ActionComponent.GetACData()) ) return;
56
59 if (Class.CastTo(trg, action_data.m_Target.GetObject()) && Class.CastTo(itm, action_data.m_MainItem))
60 {
61 float dmg;
62 string ammoType;
63
64 if (trg.ServerAcquireCartridge(dmg, ammoType))
65 {
66 if (!itm.ServerStoreCartridge(dmg, ammoType))
67 trg.ServerStoreCartridge(dmg, ammoType);
68 else
69 itm.ApplyManipulationDamage(); //damages magazine
70 }
71
72 trg.SetSynchDirty();
73 itm.SetSynchDirty();
74 //manipulationDamage
75 //if(trg.GetAmmoCount() > 0 )
76 //trg.SetSynchDirty();
77 //itm.SetSynchDirty();
78 }
79 }

References Class::CastTo().


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