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

Private Member Functions

void ActionLoadMagazineQuick ()
 
override bool HasProneException ()
 
override GetInputType ()
 
override void CreateConditionComponents ()
 
override bool HasTarget ()
 
bool CanLoadMagazine (PlayerBase player, ItemBase item)
 
override bool ActionConditionContinue (ActionData action_data)
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
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 90 of file ActionLoadMagazine.c.

Constructor & Destructor Documentation

◆ ActionLoadMagazineQuick()

void ActionLoadMagazineQuick::ActionLoadMagazineQuick ( )
inlineprivate

Member Function Documentation

◆ ActionCondition()

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

Definition at line 132 of file ActionLoadMagazine.c.

133 {
134 return CanLoadMagazine(player, item);
135 }
bool CanLoadMagazine(PlayerBase player, ItemBase item)

References CanLoadMagazine().

◆ ActionConditionContinue()

override bool ActionLoadMagazineQuick::ActionConditionContinue ( ActionData action_data)
inlineprivate

Definition at line 127 of file ActionLoadMagazine.c.

128 {
129 return CanLoadMagazine(action_data.m_Player, action_data.m_MainItem);
130 }

References CanLoadMagazine().

◆ CanLoadMagazine()

bool ActionLoadMagazineQuick::CanLoadMagazine ( PlayerBase player,
ItemBase item )
inlineprivate

Definition at line 120 of file ActionLoadMagazine.c.

121 {
122 Magazine mag = Magazine.Cast(item);
123
124 return mag && player.GetWeaponManager().GetPreparedMagazine() != null && mag.GetAmmoCount() < mag.GetAmmoMax();
125 }

Referenced by ActionCondition(), and ActionConditionContinue().

◆ CreateConditionComponents()

override void ActionLoadMagazineQuick::CreateConditionComponents ( )
inlineprivate

Definition at line 109 of file ActionLoadMagazine.c.

110 {
113 }
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56

References m_ConditionItem, and m_ConditionTarget.

◆ GetInputType()

override ActionLoadMagazineQuick::GetInputType ( )
inlineprivate

◆ HasProneException()

override bool ActionLoadMagazineQuick::HasProneException ( )
inlineprivate

Definition at line 99 of file ActionLoadMagazine.c.

100 {
101 return true;
102 }

◆ HasTarget()

override bool ActionLoadMagazineQuick::HasTarget ( )
inlineprivate

Definition at line 115 of file ActionLoadMagazine.c.

116 {
117 return false;
118 }

◆ OnExecuteServer()

override void ActionLoadMagazineQuick::OnExecuteServer ( ActionData action_data)
inlineprivate

Definition at line 137 of file ActionLoadMagazine.c.

138 {
139 //Param1<float> timeSpendParam;
140 //if( !Class.CastTo(timeSpendParam, action_data.m_ActionComponent.GetACData()) ) return;
141
142 Magazine itm = Magazine.Cast(action_data.m_MainItem);
143 Magazine trg = action_data.m_Player.GetWeaponManager().GetPreparedMagazine();
144
145 if (!itm || !trg)
146 return;
147
148 float dmg;
149 string ammoType;
150
151 if (trg.ServerAcquireCartridge(dmg, ammoType))
152 {
153 if (!itm.ServerStoreCartridge(dmg, ammoType))
154 trg.ServerStoreCartridge(dmg, ammoType);
155 else
156 itm.ApplyManipulationDamage(); //damages magazine
157 }
158
159 trg.SetSynchDirty();
160 itm.SetSynchDirty();
161 //manipulationDamage
162 //if(trg.GetAmmoCount() > 0 )
163 //trg.SetSynchDirty();
164 //itm.SetSynchDirty();
165 }

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