aug.c 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. class Aug_Base : RifleBoltFree_Base
  2. {
  3. override RecoilBase SpawnRecoilObject()
  4. {
  5. return new AUGRecoil(this);
  6. }
  7. //Debug menu Spawn Ground Special
  8. override void OnDebugSpawn()
  9. {
  10. EntityAI entity;
  11. if ( Class.CastTo(entity, this) )
  12. {
  13. entity.SpawnEntityOnGroundPos("Mag_Aug_30Rnd", entity.GetPosition());
  14. }
  15. }
  16. override int GetWeaponSpecificCommand(int weaponAction ,int subCommand)
  17. {
  18. if ( weaponAction == WeaponActions.RELOAD)
  19. {
  20. switch (subCommand)
  21. {
  22. case WeaponActionReloadTypes.RELOADRIFLE_MAGAZINE_BULLET:
  23. return WeaponActionReloadTypes.RELOADSRIFLE_MAGAZINE_BULLET;
  24. case WeaponActionReloadTypes.RELOADRIFLE_NOMAGAZINE_BULLET:
  25. return WeaponActionReloadTypes.RELOADSRIFLE_NOMAGAZINE_BULLET;
  26. case WeaponActionReloadTypes.RELOADRIFLE_MAGAZINE_NOBULLET:
  27. return WeaponActionReloadTypes.RELOADSRIFLE_MAGAZINE_NOBULLET;
  28. case WeaponActionReloadTypes.RELOADRIFLE_NOMAGAZINE_NOBULLET:
  29. return WeaponActionReloadTypes.RELOADSRIFLE_NOMAGAZINE_NOBULLET;
  30. default:
  31. return subCommand;
  32. }
  33. }
  34. return subCommand;
  35. }
  36. };
  37. class Aug extends Aug_Base
  38. {
  39. //Debug menu Spawn Ground Special
  40. override void OnDebugSpawn()
  41. {
  42. GameInventory inventory = GetInventory();
  43. inventory.CreateInInventory( "UniversalLight" );
  44. inventory.CreateInInventory( "Battery9V" );
  45. inventory.CreateInInventory( "ACOGOptic" );
  46. inventory.CreateInInventory( "M4_Suppressor" );
  47. SpawnAttachedMagazine("Mag_Aug_30Rnd");
  48. }
  49. }
  50. class AugShort extends Aug_Base
  51. {
  52. override bool CanEnterIronsights()
  53. {
  54. return true;
  55. }
  56. override void AssembleGun()
  57. {
  58. super.AssembleGun();
  59. if ( !FindAttachmentBySlotName("weaponOpticsAug") )
  60. {
  61. GetInventory().CreateAttachment("AugOptic");
  62. }
  63. }
  64. //Debug menu Spawn Ground Special
  65. override void OnDebugSpawn()
  66. {
  67. SpawnAttachedMagazine("Mag_Aug_30Rnd");
  68. }
  69. }
  70. class AugOptic: ItemOptics
  71. {
  72. override bool CanPutAsAttachment( EntityAI parent )
  73. {
  74. return true;
  75. }
  76. };