firearmactionmechanicmanipulate.c 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. class FirearmActionMechanicManipulate : FirearmActionBase
  2. {
  3. void FirearmActionLoadBulletQuick()
  4. {
  5. }
  6. override bool HasTarget()
  7. {
  8. return false;
  9. }
  10. override typename GetInputType()
  11. {
  12. return WeaponManipulationActionInput;
  13. }
  14. override void CreateConditionComponents()
  15. {
  16. m_ConditionItem = new CCINonRuined();
  17. m_ConditionTarget = new CCTSelf;
  18. }
  19. override bool HasProgress()
  20. {
  21. return false;
  22. }
  23. override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item ) //condition for action
  24. {
  25. if (!super.ActionCondition( player, target, item ))
  26. return false;
  27. bool result = false;
  28. Weapon_Base wpn = Weapon_Base.Cast(item);
  29. if ( player.GetWeaponManager().CanEjectBullet(wpn))
  30. {
  31. if( GetGame().IsServer() && GetGame().IsMultiplayer() )
  32. {
  33. result = true;
  34. }
  35. else
  36. {
  37. if( player.GetWeaponManager().CanEjectBulletVerified() )
  38. {
  39. result = true;
  40. }
  41. player.GetWeaponManager().SetEjectBulletTryTimestamp();
  42. }
  43. }
  44. return result;
  45. }
  46. override void Start( ActionData action_data )
  47. {
  48. super.Start( action_data );
  49. action_data.m_Player.GetWeaponManager().EjectBulletVerified( this );
  50. }
  51. };