firearmactionunjam.c 844 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. class FirearmActionUnjam : FirearmActionBase
  2. {
  3. void FirearmActionUnjam()
  4. {
  5. }
  6. override bool HasTarget()
  7. {
  8. return false;
  9. }
  10. override typename GetInputType()
  11. {
  12. return ContinuousWeaponManipulationActionInput;
  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. Weapon_Base wpn = Weapon_Base.Cast(item);
  28. return player.GetWeaponManager().CanUnjam(wpn);
  29. }
  30. override void Start( ActionData action_data )
  31. {
  32. super.Start( action_data );
  33. action_data.m_Player.GetWeaponManager().Unjam( this );
  34. }
  35. };