Advertisement
VermillionX

Colt 45 Code

Dec 22nd, 2019
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.75 KB | None | 0 0
  1. const Colt_loaded = 7;
  2.  
  3. Class Colt45 : TCTOAWeapon replaces Pistol
  4. {
  5. int Loaded;
  6.  
  7. Default
  8. {
  9. Scale 0.2;
  10. Weapon.SelectionOrder 1900;
  11. Weapon.AmmoUse 1;
  12. Weapon.AmmoGive 7;
  13. Weapon.AmmoGive2 14;
  14. Weapon.AmmoType "ColtClipA";
  15. Weapon.AmmoType2 "ColtClip";
  16. AttackSound "Colt45/PrimFire";
  17. Weapon.SlotNumber 2;
  18. Obituary "%o was shot down by %k's Colt45.";
  19. Inventory.Pickupmessage "The Colt 45 is now in your hands!";
  20. +WEAPON.NOAUTOFIRE
  21. +WEAPON.AMMO_OPTIONAL
  22. +WEAPON.NOALERT
  23.  
  24. //$Category "Weapons"
  25. }
  26. States
  27. {
  28. Ready:
  29. COLT A 1 A_WeaponReady(WRF_ALLOWRELOAD|WRF_ALLOWZOOM);
  30. Loop;
  31. Deselect:
  32. COLT A 1 A_Lower();
  33. Loop;
  34. Select:
  35. TNT1 A 0 A_SetInventory("ColtClipA",invoker.Loaded);
  36. COLT A 1 A_Raise();
  37. Loop;
  38. Fire:
  39. TNT1 A 0
  40. {
  41. if(invoker.Loaded<1)
  42. {
  43. player.setpsprite(PSP_WEAPON,invoker.findstate("No"));
  44. A_SetInventory("ColtClipA",invoker.Loaded);
  45. }
  46. }
  47. COLT B 2;
  48. COLT C 1
  49. {
  50. A_FireBullets(5.2,1,1,8);
  51. invoker.loaded--;
  52. A_AlertMonsters();
  53. A_GunFlash();
  54. }
  55. COLT C 2 A_Light2();
  56. COLT C 2 A_Light1();
  57. COLT D 3 A_Light0();
  58. COLT E 3;
  59. TNT1 A 0 A_ReFire();
  60. COLT E 3;
  61. Goto Ready;
  62. Reload:
  63. COLT A 1
  64. {
  65. int ToLoad = min
  66. (
  67. countinv("ColtClip"),
  68. Colt_loaded-invoker.Loaded
  69. );
  70. if(ToLoad<1)
  71. {
  72. A_StartSound("ColtFull", CHAN_WEAPON, CHANF_NOSTOP);
  73. player.setpsprite(PSP_WEAPON,invoker.findstate("No"));
  74. return;
  75. }
  76. }
  77. CLTR A 3
  78. {
  79. int ToLoad = min
  80. (
  81. countinv("ColtClip"),
  82. Colt_loaded-invoker.Loaded
  83. );
  84. invoker.Loaded+=ToLoad;
  85. A_TakeInventory("ColtClip",ToLoad,TIF_NOTAKEINFINITE);
  86. A_SetInventory("ColtClipA",invoker.Loaded);
  87. }
  88. CLTR B 4 A_StartSound("ColtClipOut", CHAN_WEAPON);
  89. CLTR C 3;
  90. CLTR D 3;
  91. CLTR E 3;
  92. CLTR F 4 A_StartSound("ColtClipIn", CHAN_WEAPON);
  93. CLTR G 3;
  94. CLTR H 3;
  95. goto Ready;
  96. No:
  97. COLT A 1 A_WeaponReady(WRF_NOFIRE);
  98. goto ready;
  99. Flash:
  100. COLT C 1 Bright A_Light1();
  101. COLT C 2 Bright A_Light2();
  102. COLT C 0 Bright A_Light0();
  103. Goto LightDone;
  104. Spawn:
  105. COLT Z -1;
  106. Stop;
  107. }
  108. }
  109. /*
  110.  
  111. */
  112. Class ColtClipA : TCTOAAmmo //Don't change this, it's a dummy item to show the ammo count
  113. {
  114. Default
  115. {
  116. Inventory.MaxAmount Colt_loaded;
  117. Ammo.BackpackMaxAmount Colt_loaded;
  118. Ammo.BackpackAmount 0;
  119. }
  120. }
  121. Class ColtClip : Ammo replaces Clip
  122. {
  123. Default
  124. {
  125. Inventory.PickupMessage "Picked up a pistol magazine.";
  126. Inventory.Amount 7;
  127. Inventory.MaxAmount 105; //For a total of 15 Magazines
  128. Ammo.BackpackAmount 7;
  129. Ammo.BackpackMaxAmount 210; //For a total of 30 Magazines
  130. Inventory.Icon "CCLP1A0";
  131. Scale 0.1;
  132. //$Category "Ammunition"
  133. }
  134. States
  135. {
  136. Spawn:
  137. CCLP A -1;
  138. Stop;
  139. }
  140. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement