File
- Defined in \weapons\SHOTGUN.txt
Flags
Properties
//$category | Weapons |
attacksound | "None" |
game | Doom |
inventory.pickupmessage | "$GOTSHOTGUN" |
inventory.pickupsound | "weapons/shotgun/pump" |
obituary | "$OB_MPSHOTGUN" |
scale | 0.9 |
spawnid | 27 |
weapon.ammogive1 | 0 |
weapon.ammogive2 | 4 |
weapon.ammotype1 | "ShotgunAmmoLoaded" |
weapon.ammotype2 | "Shell" |
weapon.ammouse1 | 0 |
weapon.ammouse2 | 0 |
weapon.selectionorder | 1300 |
weapon.slotnumber | 3 |
States
Spawn:
SHTC A -1
Stop
Ready:
TNT1 A 0 A_PlaySound("weapons/shotgun/pump")
SHTG A 1 Offset(-50, 80)
SHTG A 1 Offset(-30, 65)
SHTG A 1 Offset(-15, 50)
ReadyLoop:
SHTG A 1 A_WeaponReady(WRF_ALLOWRELOAD | WRF_ALLOWZOOM)
Goto ReadyLoop
Deselect:
SHTG A 1 Offset(-15, 50)
SHTG A 1 Offset(-30, 65)
SHTG A 1 Offset(-50, 80)
TNT1 AAAAAAAAAAAAAAAAAA 0 A_Lower
Wait
Fire:
TNT1 A 0 A_JumpIfInventory("ShotgunAmmoLoaded",1,1)
Goto Reload
TNT1 A 0 A_JumpIfInventory("ShotgunWasEmpty", 1, "Pump") //This means we're coming here from a reload from empty
TNT1 A 0 A_AlertMonsters
TNT1 A 0 A_PlaySound("weapons/shotgun/fire", 1)
TNT1 A 0 A_SpawnItemEx("PlayerMuzzle1",30,5,30)
TNT1 AAAAA 0 A_FireCustomMissile("Tracer", random(-5,5), 0, -1, -12, 0, random(-5,5))
TNT1 A 0 A_Takeinventory("ShotgunAmmoLoaded",1)
SHTG A 0 A_FireBullets (3.6, 3.6, 9, 7, "ShotgunPuff")
TNT1 A 0 A_SetPitch(-8.0 + pitch)
SHTF B 1 BRIGHT
SHTF C 1 A_SetPitch(+1.0 + pitch)
SHTF DE 1 A_SetPitch(+1.0 + pitch)
SHTG A 1 A_SetPitch(+3.0 + pitch)
SHTG AA 1 A_SetPitch(+1.0 + pitch)
Pump:
SHTG BD 1
PumpFromVertical:
SHTG H 1 A_PlaySound("weapons/shotgun/pump", 3)
SHTG IJ 1
SHTG KL 1
TNT1 A 0 A_JumpIfInventory("ShotgunWasEmpty", 1, 1) //Okay, I'll keep this bit of detail - don't spawn the case if the shotgun was empty
TNT1 A 0 A_SpawnItemEx("ShotgunCasing", 14, -2, 40, 0, random(2,4), random(2,4)) //forward, right, up, v-forward, v-right, v-up
SHTG KJH 1
TNT1 A 0 A_Takeinventory("ShotgunWasEmpty",1)
SHTG GFEDC 1 A_WeaponReady(WRF_NOFIRE | WRF_ALLOWZOOM)
SHTG A 1 Offset(10,36)
SHTG A 1 Offset(4,40)
SHTG A 1 Offset(0,32)
SHTG A 0 A_Refire
Goto ReadyLoop
Reload:
SHTG A 1
TNT1 A 0 A_JumpIfInventory("ShotgunAmmoLoaded", 0, "ReadyLoop")
TNT1 A 0 A_JumpIfInventory("ShotgunAmmoLoaded", 1, "ReloadNormally")
TNT1 A 0 A_GiveInventory("ShotgunWasEmpty", 1)
ReloadNormally:
TNT1 A 0 A_JumpIfInventory("Shell", 1, 1)
Goto ReadyLoop //Abandon reload and return to ready
SHTG BCDE 1
ReloadLoop:
TNT1 A 0 A_JumpIfInventory("Shell",1,1)
Goto ReloadAfter
TNT1 A 0 A_JumpIfInventory("ShotgunAmmoLoaded", 0, "ReloadAfter")
TNT1 A 0 A_Giveinventory("ShotgunAmmoLoaded",1)
TNT1 A 0 A_Takeinventory("Shell",1)
SSHR ABC 1
SSHR D 1 A_PlaySound("weapons/shotgun/insert")
SSHR EFG 1
SSHR A 1 A_Refire
TNT1 A 0 A_WeaponReady(WRF_NOPRIMARY | WRF_ALLOWZOOM)
Goto ReloadLoop
ReloadAfter:
TNT1 A 0 A_JumpIfInventory("ShotgunWasEmpty", 1, "PumpFromVertical") //Need to pump if there were no shells when we reloaded
SHTG FEDCBA 1 A_WeaponReady(WRF_ALLOWZOOM)
Goto ReadyLoop