11 override int GetActionCategory()
28 if (!super.ActionCondition( player, target, item ))
32 Magazine mag = Magazine.Cast(target.GetObject());
33 return mag && player.GetWeaponManager().CanLoadBullet(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);
45 override bool CanBePerformedFromInventory()
50 override bool CanBeSetFromInventory()
55 override void OnEndInput(
ActionData action_data )
57 action_data.m_Player.GetWeaponManager().LoadMultiBulletStop();
60 override bool CanBePerformedFromQuickbar()
65 override bool HasProgress()
87 override typename GetInputType()
103 override bool HasTarget()
108 override bool HasProgress()
113 override typename GetInputType()
118 override void CreateConditionComponents()
127 if (!super.ActionCondition( player, target, item ))
131 return player.GetWeaponManager().CanLoadBullet(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();
180 override bool HasProgress()
185 override void CreateConditionComponents()
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);
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();