Advertisement
Guest User

Untitled

a guest
Jun 14th, 2021
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.98 KB | None | 0 0
  1. ACTOR ShotgunAmmo : Ammo
  2. {
  3.     Game Doom
  4.     Inventory.Amount 10
  5.     Inventory.MaxAmount 10
  6.     Ammo.BackpackAmount 0
  7.     Ammo.BackpackMaxAmount 10
  8. }
  9.  
  10. Actor TangoShotgun : DoomWeapon replaces Shotgun
  11. {
  12.     Tag "Shotgun"
  13.     +WEAPON.AMMO_OPTIONAL
  14.     +WEAPON.NOALERT
  15.     Weapon.KickBack 100
  16.     Weapon.SlotNumber 3
  17.     decal "bulletchip"
  18.     Weapon.AmmoUse1 1
  19.     Weapon.AmmoUse2 0
  20.     Weapon.AmmoType1 "ShotgunAmmo"
  21.     Weapon.AmmoType2 "TangoShell"
  22.     Weapon.AmmoGive1 0
  23.     Weapon.AmmoGive2 8
  24.     Inventory.PickupSound "weapons/shotguncock"
  25.     Inventory.PickupMessage "SHOTGUN"
  26.    
  27.     States
  28.     {
  29.     Spawn:
  30.         SHOT A -1
  31.         Stop
  32.     Ready:
  33.         SHTG A 1 A_WeaponReady(WRF_ALLOWRELOAD)
  34.         Loop
  35.     Fire:
  36.         TNT1 A 0 A_JumpIfInventory("Reloading",1,"ReloadFinish")
  37.         TNT1 A 0 A_JumpIfNoAmmo("Reload")
  38.         TNT1 A 0 A_AlertMonsters
  39.         TNT1 A 0 A_PlaySound("weapons/shotgunfire", CHAN_WEAPON)
  40.         TNT1 A 0 A_FireBullets(3.6, 1.5, 10, 9, "ShotgunPuff", FBF_USEAMMO|FBF_NORANDOM, 8192) // , "BulletTracer", 0)
  41.  
  42.         TNT1 A 0 A_GunFlash
  43.         TNT1 A 0 A_Light1
  44.         TNT1 A 0
  45.        
  46.         SHTF A 2 Bright
  47.        
  48.         SHTF B 1 Bright A_Light2
  49.        
  50.         SHTF C 1 A_Light0
  51.         SHTF DEF 1
  52.         SHTG BCDEFG 1
  53.         SHTG G 1 A_PlaySound("weapons/shotguncock")
  54.         SHTG H 2
  55.         SHTG I 1
  56.         TNT1 A 0 A_SpawnItemEx("ShotgunCasing",random(-7,-9),cos(pitch)*-25,sin(-pitch)*25+random(26,28), random(3,5),0,random(4,6), random(-80,-90))
  57.         SHTG J 1
  58.         SHTG IH 1
  59.         SHTG GF 1
  60.         Goto FireFinish
  61.     FireFinish:
  62.         SHTG EDCB 1
  63.         TNT1 A 0 A_JumpIfNoAmmo("ReloadPreBuffer")
  64.         Goto Ready
  65.     ReloadPreBuffer:
  66.         SHTG A 1 A_WeaponReady(WRF_NOFIRE)
  67.         Goto Reload
  68.     NoAmmo:
  69.         SHTG A 2 A_PlaySound("weapons/empty")
  70.         Goto Ready
  71.     Reload:
  72.         // if we have at least 1 shell to load, jump to continue
  73.         TNT1 A 0 A_JumpIfInventory("TangoShell", 1, 1)
  74.         Goto NoAmmo
  75.         // if we're full on shotgunammo, just go back to ready
  76.         TNT1 A 0 A_JumpIfInventory("ShotgunAmmo", 0, "Ready")
  77.         SHTG BCD 1
  78.         SHTG EFG 1 // 2
  79.         TNT1 A 0 A_GiveInventory("Reloading", 1)
  80.         Goto ReloadRepeat
  81.     ReloadRepeat:
  82.         // if we have max shotgunammo, finish reload
  83.         TNT1 A 0 A_JumpIfInventory("ShotgunAmmo", 0, "ReloadFinish")
  84.         // if we have at least 1 shell, go to LoadShell
  85.         TNT1 A 0 A_JumpIfInventory("TangoShell", 1, "LoadShell")
  86.         Goto ReloadFinish
  87.     LoadShell:
  88. //      SHTR A 1
  89.         SHTR BC 1
  90.         TNT1 A 0 A_GiveInventory("ShotgunAmmo", 1)
  91.         TNT1 A 0 A_Takeinventory("TangoShell", 1)
  92.         SHTR D 1 A_PlaySound("weapons/shellin", CHAN_AUTO)
  93.         SHTR E 1
  94.         // SHTR FGHI 1 A_WeaponReady(WRF_NOBOB)
  95.         SHTR FHI 1 A_WeaponReady(WRF_NOBOB)
  96.         // TNT1 A 0 A_WeaponReady(WRF_NOBOB)
  97.         Goto ReloadRepeat
  98.     ReloadFinish:
  99.         SHTG GFEDCB 1
  100.         TNT1 A 0 A_TakeInventory("Reloading", 1)
  101.         Goto Ready
  102.     Select:
  103.         TNT1 A 0 A_PlaySound("weapons/shotguncock", CHAN_WEAPON)
  104.         SHTG A 0 A_Raise
  105.         Loop
  106.     Deselect:
  107.         TNT1 A 0 A_JumpIfInventory("Reloading", 1, "Deselect2")
  108.     DeselectLoop:
  109.         SHTG A 0 A_Lower
  110.         Goto DeselectLoop
  111.     Deselect2:
  112.         TNT1 A 0 A_Takeinventory("Reloading", 1)
  113.         SHTG GFEDCB 1
  114.     Deselect2Loop:
  115.         SHTG A 0 A_Lower
  116.         Goto Deselect2Loop
  117.     }
  118. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement