Advertisement
ijontichy

jpistol.dec

Jun 2nd, 2012
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.52 KB | None | 0 0
  1. actor JPistolCounter: Ammo
  2. {
  3. Inventory.MaxAmount 14
  4. }
  5.  
  6. actor " J-Pistol ": Weapon
  7. {
  8. weapon.SelectionOrder 1200
  9.  
  10. Weapon.AmmoType1 "JPistolCounter"
  11. Weapon.AmmoType2 "Clip"
  12. Weapon.AmmoUse1 1
  13. Weapon.AmmoUse2 0
  14. Weapon.AmmoGive1 28
  15. Weapon.AmmoGive2 40
  16.  
  17. +AMMO_OPTIONAL
  18. +NOALERT
  19.  
  20. Weapon.SisterWeapon " Power J-Pistol "
  21.  
  22. Decal BulletChip
  23.  
  24. Inventory.PickupMessage "$JKE_PK_JPISTOL"
  25. Obituary "$JKE_MP_JPISTOL"
  26.  
  27. states
  28. {
  29. Select:
  30. PIS3 A 0 A_Raise
  31. PIS3 A 1 A_Raise
  32. loop
  33.  
  34. Deselect:
  35. PIS3 A 0 A_Lower
  36. PIS3 A 1 A_Lower
  37. loop
  38.  
  39. Ready:
  40. PIS3 A 1 A_WeaponReady
  41. PIS3 A 0 A_JumpIfInventory("ReloadButton", 1, "AltFire")
  42. loop
  43.  
  44. Fire:
  45. PIS3 A 0 A_JumpIfNoAmmo("AltFire")
  46.  
  47. PIS3 B 0 A_AlertMonsters
  48. PIS3 B 0 A_PlaySound("jkemod/jpistol/fire", CHAN_WEAPON)
  49. PIS3 B 2 bright A_FireBullets(2, 2, 1, 6, "Bulletpuff", 1)
  50.  
  51. PIS3 C 3 bright
  52. PIS3 D 3
  53. PIS3 A 0 A_ReFire
  54. goto Ready
  55.  
  56. AltFire:
  57. PIS3 A 0 A_JumpIfInventory("JPistolCounter", 0, "NoReload")
  58. PIS3 A 0 A_JumpIfInventory("Clip", 1, "ReloadStart")
  59. goto NoReload
  60.  
  61. ReloadStart:
  62. PIS3 C 2 offset(0, 40)
  63. PIS3 C 2 offset(0, 50) A_PlaySound("jkemod/assorted/click", CHAN_WEAPON)
  64. PIS3 C 2 offset(0, 60)
  65. PIS3 C 0 offset(0, 70)
  66. goto ReloadLoop
  67.  
  68. ReloadLoop:
  69. PIS3 A 0 A_TakeInventory("Clip", 1)
  70. PIS3 A 0 A_GiveInventory("JPistolCounter", 1)
  71.  
  72. PIS3 A 0 A_JumpIfInventory("JPistolCounter", 0, "ReloadEnd")
  73. PIS3 A 0 A_JumpIfInventory("Clip", 1, "ReloadLoop")
  74. goto ReloadEnd
  75.  
  76. ReloadEnd:
  77. PIS3 C 12 offset(0, 70)
  78. PIS3 C 6 A_PlaySound("jkemod/jpistol/load", CHAN_WEAPON)
  79. PIS3 C 2 offset(0, 60)
  80. PIS3 C 2 offset(0, 50)
  81. PIS3 C 2 offset(0, 40)
  82. PIS3 A 2
  83. goto Ready
  84.  
  85. NoReload:
  86. PIS3 A 1 A_WeaponReady(8)
  87. goto Ready
  88.  
  89. Spawn:
  90. PWFL A -1 // see sprites/weapons/powerful/
  91. stop
  92. }
  93. }
  94.  
  95.  
  96. actor " Power J-Pistol ": " J-Pistol "
  97. {
  98. Weapon.AmmoGive1 0
  99. Weapon.AmmoGive2 0
  100.  
  101. Weapon.SisterWeapon " J-Pistol "
  102. +POWERED_UP
  103.  
  104. Decal BulletScorch
  105.  
  106. Obituary "$JKE_MP_JPISTOL_POWER"
  107.  
  108. states
  109. {
  110. Fire:
  111. PIS3 A 0 A_JumpIfNoAmmo("AltFire")
  112.  
  113. PIS3 B 0 A_AlertMonsters
  114. PIS3 B 0 A_PlaySound("jkemod/jpistol/fire", CHAN_WEAPON)
  115. PIS3 B 1 bright A_FireBullets(2, 2, 1, 8, "ExplosiveBulletPuff", 1)
  116.  
  117. PIS3 C 2 bright
  118. PIS3 A 0 A_ReFire
  119. goto Ready
  120.  
  121. AltFire:
  122. PIS3 A 0 A_JumpIfInventory("JPistolCounter", 0, "NoReload")
  123. PIS3 A 0 A_JumpIfInventory("Clip", 2, "ReloadStart")
  124. goto NoReload
  125.  
  126. ReloadStart:
  127. PIS3 C 2 offset(0, 40)
  128. PIS3 C 2 offset(0, 50) A_PlaySound("jkemod/assorted/click", 6)
  129. PIS3 C 2 offset(0, 60)
  130. PIS3 C 8 offset(0, 70)
  131.  
  132. ReloadLoop:
  133. PIS3 A 0 A_TakeInventory("Clip", 2)
  134. PIS3 A 0 A_GiveInventory("JPistolCounter", 1)
  135.  
  136. PIS3 A 0 A_JumpIfInventory("JPistolCounter", 0, "ReloadEnd")
  137. PIS3 A 0 A_JumpIfInventory("Clip", 2, "ReloadLoop")
  138. goto ReloadEnd
  139.  
  140. ReloadEnd:
  141. PIS3 C 12 offset(0, 70) A_PlaySound("jkemod/jpistol/load", CHAN_WEAPON)
  142. PIS3 C 2 offset(0, 60)
  143. PIS3 C 2 offset(0, 50)
  144. PIS3 C 2 offset(0, 40)
  145. PIS3 A 2
  146. goto Ready
  147.  
  148. NoReload:
  149. PIS3 A 1
  150. PIS3 A 0 A_ReFire
  151. goto Ready
  152. }
  153. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement