1class FirearmActionLoadMultiBullet : FirearmActionBase
6 void FirearmActionLoadMultiBullet()
28 if (!super.ActionCondition( player, target, item ))
32 Magazine mag = Magazine.Cast(target.GetObject());
33 return mag && player.GetWeaponManager().CanLoadMultipleBullet(wpn,mag);
38 super.Start( action_data );
39 Magazine mag = Magazine.Cast(action_data.m_Target.GetObject());
41 action_data.m_Player.GetWeaponManager().LoadMultiBullet(mag,
this);
55 override void OnEndInput(
ActionData action_data )
57 action_data.m_Player.GetWeaponManager().LoadMultiBulletStop();
94class FirearmActionLoadMultiBulletQuick : FirearmActionBase
99 void FirearmActionLoadMultiBulletQuick()
125 override bool ActionCondition(
PlayerBase player, ActionTarget target,
ItemBase item )
127 if (!super.ActionCondition( player, target, item ))
131 return player.GetWeaponManager().CanLoadMultipleBullet(weapon ,player.GetWeaponManager().GetPreparedMagazine());
136 super.Start( action_data );
138 WeaponManager weaponManager = action_data.m_Player.GetWeaponManager();
140 Magazine mag = weaponManager.GetNextPreparedMagazine(idx);
141 Weapon weapon =
Weapon.Cast(action_data.m_Player.GetItemInHands());
143 int internalCount = weapon.GetInternalMagazineCartridgeCount(0);
144 int maxCount = weapon.GetInternalMagazineMaxCartridgeCount(0) + 1;
145 int total = mag.GetAmmoCount() + internalCount;
147 if (total < maxCount)
152 Magazine additionalMag = weaponManager.GetNextPreparedMagazine(idx);
154 while ((additionalMag != null) && (total < maxCount))
156 total += additionalMag.GetAmmoCount();
157 mag.CombineItems(additionalMag);
158 additionalMag = weaponManager.GetNextPreparedMagazine(idx);
162 action_data.m_Player.GetWeaponManager().LoadMultiBullet(mag,
this);
165 override void OnEndInput(
ActionData action_data )
167 action_data.m_Player.GetWeaponManager().LoadMultiBulletStop();
171class FirearmActionLoadMultiBulletRadial : FirearmActionBase
176 void FirearmActionLoadMultiBulletRadial()
191 override bool CanContinue(
ActionData action_data )
193 if (!super.CanContinue( action_data ))
196 return ActionCondition(action_data.m_Player, action_data.m_Target, action_data.m_MainItem);
199 override bool ActionCondition(
PlayerBase player, ActionTarget target,
ItemBase item )
201 if (!super.ActionCondition( player, target, item ))
205 Magazine mag = Magazine.Cast(target.GetObject());
206 return mag && player.GetWeaponManager().CanLoadBullet(wpn,mag);
209 override void OnStart(
ActionData action_data )
211 super.OnStart(action_data);
213 Magazine mag = Magazine.Cast(action_data.m_Target.GetObject());
214 action_data.m_Player.GetWeaponManager().LoadMultiBullet(mag,
this);
219 action_data.m_Player.GetWeaponManager().LoadMultiBulletStop();