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

Private Member Functions

void FirearmActionLoadMultiBulletQuick ()
 
override bool HasTarget ()
 
override bool HasProgress ()
 
override GetInputType ()
 
override void CreateConditionComponents ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override void Start (ActionData action_data)
 
override void OnEndInput (ActionData action_data)
 

Detailed Description

Definition at line 94 of file FirearmActionLoadMultiBullet.c.

Constructor & Destructor Documentation

◆ FirearmActionLoadMultiBulletQuick()

void FirearmActionLoadMultiBulletQuick::FirearmActionLoadMultiBulletQuick ( )
inlineprivate

Definition at line 99 of file FirearmActionLoadMultiBullet.c.

100 {
101 }

Member Function Documentation

◆ ActionCondition()

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

Definition at line 125 of file FirearmActionLoadMultiBullet.c.

126 {
127 if (!super.ActionCondition(player, target, item))
128 return false;
129
131 return player.GetWeaponManager().CanLoadBullet(weapon, player.GetWeaponManager().GetPreparedMagazine());
132 }

◆ CreateConditionComponents()

override void FirearmActionLoadMultiBulletQuick::CreateConditionComponents ( )
inlineprivate

Definition at line 118 of file FirearmActionLoadMultiBullet.c.

119 {
122 }
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56

References m_ConditionItem, and m_ConditionTarget.

◆ GetInputType()

override FirearmActionLoadMultiBulletQuick::GetInputType ( )
inlineprivate

◆ HasProgress()

override bool FirearmActionLoadMultiBulletQuick::HasProgress ( )
inlineprivate

Definition at line 108 of file FirearmActionLoadMultiBullet.c.

109 {
110 return false;
111 }

◆ HasTarget()

override bool FirearmActionLoadMultiBulletQuick::HasTarget ( )
inlineprivate

Definition at line 103 of file FirearmActionLoadMultiBullet.c.

104 {
105 return false;
106 }

◆ OnEndInput()

override void FirearmActionLoadMultiBulletQuick::OnEndInput ( ActionData action_data)
inlineprivate

Definition at line 165 of file FirearmActionLoadMultiBullet.c.

166 {
167 action_data.m_Player.GetWeaponManager().LoadMultiBulletStop();
168 }

◆ Start()

override void FirearmActionLoadMultiBulletQuick::Start ( ActionData action_data)
inlineprivate

Definition at line 134 of file FirearmActionLoadMultiBullet.c.

135 {
136 super.Start(action_data);
137
138 WeaponManager weaponManager = action_data.m_Player.GetWeaponManager();
139 int idx = 0;
140 Magazine mag = weaponManager.GetNextPreparedMagazine(idx);
141 Weapon weapon = Weapon.Cast(action_data.m_Player.GetItemInHands());
142
143 int internalCount = weapon.GetInternalMagazineCartridgeCount(0);
144 int maxCount = weapon.GetInternalMagazineMaxCartridgeCount(0) + 1;
145 int total = mag.GetAmmoCount() + internalCount;
146
147 if (total < maxCount)
148 {
149 //Increment index for the first additional mag find, since GetNextPreparedMagazine does not do that
150 //Normally the mag at found index is combined right after, removing it from the suitable magazine array
151 ++idx;
152 Magazine additionalMag = weaponManager.GetNextPreparedMagazine(idx);
153
154 while ((additionalMag != null) && (total < maxCount))
155 {
156 total += additionalMag.GetAmmoCount();
157 mag.CombineItems(additionalMag);
158 additionalMag = weaponManager.GetNextPreparedMagazine(idx);
159 }
160 }
161
162 action_data.m_Player.GetWeaponManager().LoadMultiBullet(mag, this);
163 }
script counterpart to engine's class Weapon

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