pp19.c 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /**@class PP19_Base
  2. * @brief basic PP19 submachine gun
  3. **/
  4. class PP19_Base : RifleBoltFree_Base
  5. {
  6. void PP19_Base()
  7. {
  8. }
  9. override RecoilBase SpawnRecoilObject()
  10. {
  11. return new PP19Recoil(this);
  12. }
  13. //some command is different for this weapon
  14. override int GetWeaponSpecificCommand(int weaponAction ,int subCommand)
  15. {
  16. if ( weaponAction == WeaponActions.CHAMBERING)
  17. {
  18. switch (subCommand)
  19. {
  20. case WeaponActionChamberingTypes.CHAMBERING_ONEBULLET_UNIQUE_CLOSED:
  21. return WeaponActionChamberingTypes.CHAMBERING_ONEBULLET_OPENED;
  22. default:
  23. return subCommand;
  24. }
  25. }
  26. return subCommand;
  27. }
  28. override bool CanEnterIronsights()
  29. {
  30. ItemOptics optic = GetAttachedOptics();
  31. if (optic && PSO1Optic.Cast(optic) || PSO11Optic.Cast(optic) || KazuarOptic.Cast(optic))
  32. return true;
  33. return super.CanEnterIronsights();
  34. }
  35. //Debug menu Spawn Ground Special
  36. override void OnDebugSpawn()
  37. {
  38. GameInventory inventory = GetInventory();
  39. inventory.CreateInInventory( "PistolSuppressor" );
  40. inventory.CreateInInventory( "PP19_Bttstck" );
  41. inventory.CreateInInventory( "KobraOptic" );
  42. inventory.CreateInInventory( "Battery9V" );
  43. SpawnAttachedMagazine("Mag_PP19_64Rnd");
  44. }
  45. };