Customizable Weaponry for ZDoom.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CPistol.dec 3.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. actor CPistol : CWeapon replaces Pistol
  2. {
  3. Weapon.SlotNumber 2
  4. Weapon.AmmoType1 "Clip"
  5. Obituary "$CW_PISTOL_OBIT"
  6. Tag "$CW_PISTOL_WTAG"
  7. States
  8. {
  9. // Spawn //
  10. Spawn:
  11. PIST A -1
  12. wait
  13. // Select //
  14. Select:
  15. PISG A 0 A_GiveInventory("DNS")
  16. PISG A 0 A_JumpIfInventory("PistolSil",1,1)
  17. goto SelectLoop
  18. SilSelect:
  19. PISS A 0
  20. SelectLoop:
  21. "####" A 1 A_Raise
  22. wait
  23. Deselect:
  24. PISG A 0 A_GiveInventory("DNS")
  25. PISG A 0 A_JumpIfInventory("PistolSil",1,1)
  26. goto DeselectLoop
  27. SilDeselect:
  28. PISS A 0
  29. DeselectLoop:
  30. "####" A 1 A_Lower
  31. wait
  32. // Ready //
  33. SilReady:
  34. PISS A 1 A_WeaponReady
  35. Ready:
  36. TNT1 A 0 A_TakeInventory("DNS")
  37. TNT1 A 0 A_JumpIfInventory("PistolSil",1,"SilReady")
  38. PISG A 1 A_WeaponReady
  39. loop
  40. // Fire //
  41. Fire:
  42. TNT1 A 0 A_JumpIfInventory("PistolSil",1,"SilFire")
  43. PISG A 9 A_SetTics(CallACS("CW_GETVAL",GV_PSTF1))
  44. TNT1 A 0 A_AlertMonsters
  45. TNT1 A 0 A_GunFlash("Flash2")
  46. TNT1 A 0 A_PlaySound("weapons/pistol",1)
  47. PISG A 4 BRIGHT A_FireBullets(CallACS("CW_GETVAL",GV_PSTF2),0,1,5,"BulletPuff")
  48. PISG DC 3
  49. PISG A 5 A_Refire
  50. goto Ready
  51. SilFire:
  52. PISS A 9 A_SetTics(CallACS("CW_GETVAL",GV_PSTF1))
  53. TNT1 A 0 A_GunFlash
  54. TNT1 A 0 A_PlaySound("weapons/silpistol",1)
  55. PISS A 4 A_FireBullets(CallACS("CW_GETVAL",GV_PSTF2),0,1,4,"BulletPuff")
  56. PISS DC 3
  57. PISS A 5 A_Refire
  58. goto Ready
  59. Flash:
  60. TNT1 A 0 A_Quake(1, 2, 0, 16, "")
  61. TNT1 A 1 A_SetPitch(pitch-0.2)
  62. TNT1 A 1 A_SetPitch(pitch-0.2)
  63. TNT1 A 1 A_SetPitch(pitch-0.1)
  64. TNT1 A 2 A_SetPitch(pitch+0.4)
  65. stop
  66. Flash2:
  67. TNT1 A 0 A_Quake(1, 2, 0, 16, "")
  68. TNT1 A 0 A_SetBlend("99 00 00", 0.02, 4)
  69. TNT1 A 0 A_SetPitch(pitch-0.1)
  70. PISF Z 1 BRIGHT A_Light2
  71. PISF Z 1 BRIGHT A_SetPitch(pitch-0.2)
  72. TNT1 A 0 A_SetPitch(pitch+0.4)
  73. PISF Z 2 BRIGHT A_Light1
  74. goto LightDone
  75. }
  76. }
  77. actor CPistolToSil : Weapon
  78. {
  79. +WEAPON.NOALERT
  80. +WEAPON.CHEATNOTWEAPON
  81. Tag "$CW_PISTOL_WTAG"
  82. States
  83. {
  84. Select:
  85. TNT1 A 0 A_GiveInventory("DNS")
  86. TNT1 AAAAA 0 A_Raise
  87. TNT1 A 1 A_Raise
  88. loop
  89. Deselect:
  90. TNT1 A 0
  91. stop
  92. Ready:
  93. TNT1 A 5 A_PlaySound("weapons/pistolupg",1)
  94. TNT1 A 20
  95. TNT1 A 0 A_GiveInventory("PistolSil")
  96. TNT1 A 0 A_SelectWeapon("CPistol")
  97. TNT1 A 0 A_TakeInventory("CPistolToSil")
  98. stop
  99. Fire:
  100. TNT1 A 0 A_Jump(257,"Ready")
  101. goto Ready
  102. }
  103. }
  104. actor CPistolToNorm : CPistolToSil
  105. {
  106. States
  107. {
  108. Ready:
  109. TNT1 A 0 A_TakeInventory("PistolSil")
  110. TNT1 A 5 A_PlaySound("weapons/pistolupg",1)
  111. TNT1 A 10
  112. TNT1 A 0 A_SelectWeapon("CPistol")
  113. TNT1 A 0 A_TakeInventory("CPistolToNorm")
  114. stop
  115. }
  116. }
  117. actor CPistolCMenu : Weapon
  118. {
  119. +WEAPON.NOALERT
  120. +WEAPON.CHEATNOTWEAPON
  121. Tag "$CW_PISTOL_WTAG"
  122. States
  123. {
  124. // Select //
  125. Select:
  126. TNT1 A 0 A_GiveInventory("DNS")
  127. TNT1 A 0 A_JumpIfInventory("PistolSil",1,1)
  128. goto SelectLoop
  129. SilSelect:
  130. TNT1 B 0
  131. SelectLoop:
  132. TNT1 "#" 0 A_Raise
  133. PISC "#" 1 A_Raise
  134. loop
  135. Deselect:
  136. TNT1 A 0 A_GiveInventory("DNS")
  137. TNT1 A 0 A_JumpIfInventory("PistolSil",1,1)
  138. goto DeselectLoop
  139. SilDeselect:
  140. TNT1 B 0
  141. DeselectLoop:
  142. TNT1 "#" 0 A_Lower
  143. PISC "#" 1 A_Lower
  144. loop
  145. // Ready //
  146. Ready:
  147. TNT1 "#" 0 A_GiveInventory("CMenu")
  148. TNT1 "#" 0 ACS_NamedExecute("CW_MENUOPEN",0,1)
  149. PISC "#" 1 A_WeaponReady(WRF_ALLOWZOOM|WRF_NOSWITCH)
  150. wait
  151. Zoom:
  152. TNT1 "#" 0 A_TakeInventory("CMenu")
  153. TNT1 "#" 0 ACS_NamedExecute("CW_MENUCLOSE",0)
  154. TNT1 "#" 0 A_Lower
  155. PISC "#" 1 A_Lower
  156. TNT1 "#" 0 A_Lower
  157. PISC "#" 1 A_Lower
  158. TNT1 "#" 0 A_Lower
  159. PISC "#" 1 A_Lower
  160. TNT1 "#" 0 A_Lower
  161. PISC "#" 1 A_Lower
  162. TNT1 "#" 0 A_Lower
  163. PISC "#" 1 A_Lower
  164. TNT1 "#" 0 A_SelectWeapon("CPistol")
  165. TNT1 "#" 0 A_TakeInventory("CPistolCMenu")
  166. stop
  167. // Fire //
  168. Fire:
  169. TNT1 "#" 0 A_JumpIfInventory("CMenuNext",1,"Fire2")
  170. TNT1 "#" 0 A_GiveInventory("CMenuNext")
  171. PISC "#" 13 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
  172. goto Ready
  173. Fire2:
  174. TNT1 "#" 0 A_TakeInventory("CMenuNext")
  175. PISC "#" 13 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
  176. goto Ready
  177. }
  178. }