3 override void CreateActionComponent()
19 override bool HasProneException()
24 override void CreateConditionComponents()
34 return (
Class.CastTo(trg, target.GetObject()) &&
Class.CastTo(itm, item) && itm.GetAmmoCount() < itm.GetAmmoMax() && trg.GetAmmoCount() != 0 && itm.IsCompatiableAmmo( trg ) );
37 override bool ActionConditionContinue(
ActionData action_data )
39 return CanLoadMagazine(action_data.m_Target, action_data.m_MainItem);
44 return CanLoadMagazine(target, item);
47 override bool CanBePerformedFromQuickbar()
52 override void OnExecuteServer(
ActionData action_data )
59 if (
Class.CastTo(trg, action_data.m_Target.GetObject()) &&
Class.CastTo(itm, action_data.m_MainItem) )
64 if ( trg.ServerAcquireCartridge(dmg, ammoType) )
66 if ( !itm.ServerStoreCartridge(dmg, ammoType) )
67 trg.ServerStoreCartridge(dmg, ammoType);
69 itm.ApplyManipulationDamage();
84 override void CreateActionComponent()
99 override bool HasProneException()
104 override typename GetInputType()
109 override void CreateConditionComponents()
115 override bool HasTarget()
122 Magazine mag = Magazine.Cast( item );
124 return mag && player.GetWeaponManager().GetPreparedMagazine() !=
null && mag.GetAmmoCount() < mag.GetAmmoMax();
127 override bool ActionConditionContinue(
ActionData action_data )
129 return CanLoadMagazine(action_data.m_Player, action_data.m_MainItem);
134 return CanLoadMagazine(player, item);
137 override void OnExecuteServer(
ActionData action_data )
142 Magazine itm = Magazine.Cast(action_data.m_MainItem);
143 Magazine trg = action_data.m_Player.GetWeaponManager().GetPreparedMagazine();
151 if ( trg.ServerAcquireCartridge(dmg, ammoType) )
153 if ( !itm.ServerStoreCartridge(dmg, ammoType) )
154 trg.ServerStoreCartridge(dmg, ammoType);
156 itm.ApplyManipulationDamage();