mosin9130.c 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /**@class Mosin9130
  2. * @brief base for Mosin
  3. * @NOTE name copies config base class
  4. **/
  5. class Mosin9130_Base extends BoltActionRifle_InnerMagazine_Base
  6. {
  7. void Mosin9130_Base ()
  8. {
  9. }
  10. override bool CanEnterIronsights()
  11. {
  12. ItemOptics optic = GetAttachedOptics();
  13. if (optic && PUScopeOptic.Cast(optic))
  14. return true;
  15. return super.CanEnterIronsights();
  16. }
  17. };
  18. class Mosin9130 extends Mosin9130_Base
  19. {
  20. override RecoilBase SpawnRecoilObject()
  21. {
  22. return new MosinRecoil(this);
  23. }
  24. //Debug menu Spawn Ground Special
  25. override void OnDebugSpawn()
  26. {
  27. super.OnDebugSpawn();
  28. GameInventory inventory = GetInventory();
  29. inventory.CreateInInventory( "PUScopeOptic" );
  30. inventory.CreateInInventory( "Mosin_Compensator" );
  31. EntityAI entity;
  32. if ( Class.CastTo(entity, this) )
  33. {
  34. entity.SpawnEntityOnGroundPos("Ammo_762x54", entity.GetPosition());
  35. }
  36. }
  37. };
  38. class SawedoffMosin9130_Base extends Mosin9130_Base
  39. {
  40. override RecoilBase SpawnRecoilObject()
  41. {
  42. return new MosinSawedOffRecoil(this);
  43. }
  44. };