actor DukeShotgun : DoomWeapon
{
  Weapon.SelectionOrder 800
  weapon.ammotype "DukeClip"
  weapon.ammouse 1
  weapon.ammogive2 999
  weapon.ammogive1 999
  weapon.ammotype2 "DukeAmmo"
  Inventory.PickupMessage "You got the shotgun! Lock and load!"
  Obituary "%o was blown open by %k's shotgun."
  Decal "BulletChip"
  States
  {
  Ready:
	M1GE A 0 A_JumpIfInventory("thrownade",1,"ThrowGrenade")
    AUG1 A 0 A_JumpIfInventory("IsReloading",1,"Reload")
	AK47 A 0 A_JumpIfInventory("Kinfeammo",1,"UseKnife") 
    DNSG A 1 A_WeaponReady
    Loop
  Deselect:
    DNSG A 0 A_Lower
    DNSG A 0 A_Lower
    DNSG A 1 A_Lower
    Loop
  Select:
    DNSG A 0 A_Raise
    DNSG A 0 A_Raise
    DNSG A 1 A_Raise
    Loop
  Fire:
    AUG1 A 0 A_JumpIfInventory("IsReloading",1,"Reload") 
    DNSG A 0 A_jumpifnoammo("Reload")
    DNSG A 0 A_jumpifinventory("deadshot",1,"Fire_deadshot")
    DNSG A 0 A_jumpifinventory("doubletap",1,"Fire_doubletap")
    DNSG A 3
    DNSG B 1 A_FireBullets (6, 4, 7, random(120,120), "BulletPuff")
    DNSG B 0 A_PlaySound ("DS/Fire")
    DNSG B 0 A_GunFlash
    DNSG CDEDCB 1 bright
    DNSG A 3
    DNSG FGH 1
    DNSG I 2 A_PlaySound ("DS/Pump")
	TNTT A 0 A_FireCustomMissile("ShellCasingSpawner",0,0,-30,2)
    DNSG JKLKJI 2
    DNSG HGF 1
    DNSG A 0 A_jumpifnoammo("Reload")
    AUG1 A 0 A_JumpIfInventory("IsReloading",1,"Reload") 
    DNSG A 7 A_ReFire
    AUG1 A 0 A_JumpIfInventory("IsReloading",1,"Reload") 
    DNSG A 0 A_jumpifnoammo("Reload")
    Goto Ready
  Fire_deadshot:
    AUG1 A 0 A_JumpIfInventory("IsReloading",1,"Reload") 
    DNSG A 0 A_jumpifnoammo("Reload")
    DNSG A 0 A_jumpifinventory("doubletap",1,"Fire_doubletapdeadshot")
    DNSG A 3
    DNSG B 1 A_FireBullets (3, 2, 7, random(120,120), "BulletPuff")
    DNSG B 0 A_PlaySound ("DS/Fire")
    DNSG B 0 A_GunFlash
    DNSG CDEDCB 1 bright
    DNSG A 3
    DNSG FGH 1
    DNSG I 2 A_PlaySound ("DS/Pump")
	TNTT A 0 A_FireCustomMissile("ShellCasingSpawner",0,0,-30,2)
    DNSG JKLKJI 2
    DNSG HGF 1
    DNSG A 0 A_jumpifnoammo("Reload")
    AUG1 A 0 A_JumpIfInventory("IsReloading",1,"Reload") 
    DNSG A 7 A_ReFire
    AUG1 A 0 A_JumpIfInventory("IsReloading",1,"Reload") 
    DNSG A 0 A_jumpifnoammo("Reload")
    Goto Ready
  Fire_doubletapdeadshot:
    AUG1 A 0 A_JumpIfInventory("IsReloading",1,"Reload") 
    DNSG A 0 A_jumpifnoammo("Reload")
    DNSG A 2
    DNSG B 1 A_FireBullets (3, 2, 7, random(120,120), "BulletPuff")
    DNSG B 0 A_PlaySound ("DS/Fire")
    DNSG B 0 A_GunFlash
    DNSG CDEDCB 1 bright
    DNSG A 2
    DNSG FGH 1
    DNSG I 1 A_PlaySound ("DS/Pump")
	TNTT A 0 A_FireCustomMissile("ShellCasingSpawner",0,0,-30,2)
    DNSG JKLKJI 1
    DNSG HGF 1
    DNSG A 0 A_jumpifnoammo("Reload")
    AUG1 A 0 A_JumpIfInventory("IsReloading",1,"Reload") 
    DNSG A 6 A_ReFire
    AUG1 A 0 A_JumpIfInventory("IsReloading",1,"Reload") 
    DNSG A 0 A_jumpifnoammo("Reload")
    Goto Ready
  Fire_Doubletap:
    AUG1 A 0 A_JumpIfInventory("IsReloading",1,"Reload") 
    DNSG A 0 A_jumpifnoammo("Reload")
    DNSG A 2
    DNSG B 1 A_FireBullets (6, 4, 7, random(120,120), "BulletPuff")
    DNSG B 0 A_PlaySound ("DS/Fire")
    DNSG B 0 A_GunFlash
    DNSG CDEDCB 1 bright
    DNSG A 2
    DNSG FGH 1
    DNSG I 1 A_PlaySound ("DS/Pump")
	TNTT A 0 A_FireCustomMissile("ShellCasingSpawner",0,0,-30,2)
    DNSG JKLKJI 1
    DNSG HGF 1
    DNSG A 0 A_jumpifnoammo("Reload")
    AUG1 A 0 A_JumpIfInventory("IsReloading",1,"Reload") 
    DNSG A 6 A_ReFire
    AUG1 A 0 A_JumpIfInventory("IsReloading",1,"Reload") 
    DNSG A 0 A_jumpifnoammo("Reload")
    Goto Ready
  Reload:	
    PIRE A 0 A_takeinventory("IsReloading",1)
    DNSG F 0 A_jumpifinventory("SpeedCola",1,"Reload_speed")
    DNSG F 0 A_jumpifinventory("Dukeclip",8,"ready")
	DNSG F 0 A_jumpifinventory("Dukeammo",1,1)
	goto ready
    DNSG FGHI 2
	goto reload2
  Reload2:
    DNSG I 0 A_playsound("DS/reload")
    DNSG I 5 
    DNSG I 0 A_Giveinventory("Dukeclip",1)
    DNSG I 0 A_Takeinventory("Dukeammo",1)
    DNSG I 3 A_weaponready(WRF_NOBOB)
    DNSG I 0 A_Jumpifinventory("Dukeclip",8,"reloaddone")
    DNSG I 0 A_Jumpifinventory("Dukeammo",1,"reload2")
	goto reloaddone
  Reloaddone:
    DNSG I 0 A_playsound("DS/Pump")
    DNSG JKL 2
	DNSG KJIHGF 2
	goto ready
  Reload_speed:
    DNSG F 0 A_jumpifinventory("Dukeclip",8,"ready")
	DNSG F 0 A_jumpifinventory("Dukeammo",1,1)
	goto ready
    DNSG FGHI 1
	goto reload2_speed
  Reload2_speed:
    DNSG I 0 A_playsound("DS/reload")
    DNSG I 3 
    DNSG I 0 A_Giveinventory("Dukeclip",1)
    DNSG I 0 A_Takeinventory("Dukeammo",1)
    DNSG I 2 A_weaponready(WRF_NOBOB)
    DNSG I 0 A_Jumpifinventory("Dukeclip",8,"reloaddone_speed")
    DNSG I 0 A_Jumpifinventory("Dukeammo",1,"reload2_speed")
	goto reloaddone_speed
  Reloaddone_speed:
    DNSG I 0 A_playsound("DS/Pump")
    DNSG JKL 1
	DNSG KJIHGF 1
	goto ready
  Flash:
    TNT1 A 4 Bright A_Light1
    TNT1 A 3 Bright A_Light2
    Goto LightDone
  ThrowGrenade:
     HNDG BCD 1
     HNDG E 1 A_PlaySound("weapons/grenadepin")
     HNDG FGHH 1
     HNDG I 1 A_PlaySound("weapons/grenadethr") 
     HNDG J 0 A_FireCustomMissile("ThrownGrenade",0,0,0,0)
     HNDG J 0 A_PlaySound("weapons/grenadethr")
     HNDG JKLMNOPQ 1
     HNDG Q 0 A_TakeInventory("thrownade")
     Goto Ready
  Useknife:
     KNFG A 0 A_jumpifinventory("Machete",1,"UseMachete")
     KNFG ABC 2
	 KNFG C 0 A_CustomPunch (110,1,0,"KnifePuff")
	 KNFG DEF 2
	 KNFG F 0 A_TakeInventory("Kinfeammo")
	 goto ready
  UseMachete:
     MHT4 ABC 2
	 MHT4 C 0 A_CustomPunch (450,1,0,"Machetepuff")
	 MHT4 DEFG 2
	 MHT4 G 0 A_TakeInventory("Kinfeammo")
	 goto ready
  Spawn:
    DNSP A -1
    Stop
  }
}


actor DukeClip : Ammo
{
    inventory.icon "CLIPA0"
    inventory.amount 0
    inventory.maxamount 8
    ammo.backpackamount 0
    ammo.backpackmaxamount 8
    +IGNORESKILL
}


actor DukeAmmo : Ammo
{
    inventory.icon "CLIPA0"
    inventory.amount 8
    inventory.maxamount 56
    ammo.backpackamount 8
    ammo.backpackmaxamount 56
    +IGNORESKILL
    inventory.pickupmessage "Got Duke Shotgun Shells!!"  
    States
    {
    Spawn:
      CLIP A -1
      Stop
    }
}

actor PAPDukeAmmo : Ammo
{
    inventory.icon "CLIPA0"
    inventory.amount 8
    inventory.maxamount 80
    ammo.backpackamount 8
    ammo.backpackmaxamount 80
    +IGNORESKILL
    inventory.pickupmessage "Got Duke Shotgun Shells!!"  
    States
    {
    Spawn:
      CLIP A -1
      Stop
    }
}

actor PAPDukeShotgun : DoomWeapon
{
  Weapon.SelectionOrder 1300
  weapon.ammotype "PAPDukeClip"
  weapon.ammouse 1
  weapon.ammogive2 999
  weapon.ammogive1 999
  weapon.ammotype2 "PAPDukeAmmo"
  Inventory.PickupMessage "You got the shotgun! Lock and load!"
  Obituary "%o was blown open by %k's shotgun."
  Attacksound "DS/Fire"
  Decal "BulletChip"
  States
  {
  Ready:
	M1GE A 0 A_JumpIfInventory("thrownade",1,"ThrowGrenade")
    AUG1 A 0 A_JumpIfInventory("IsReloading",1,"Reload") 
	AK47 A 0 A_JumpIfInventory("Kinfeammo",1,"UseKnife")
    DNSG A 1 A_WeaponReady
    Loop
  Deselect:
    DNSG A 0 A_Lower
    DNSG A 0 A_Lower
    DNSG A 1 A_Lower
    Loop
  Select:
    DNSG A 0 A_Raise
    DNSG A 0 A_Raise
    DNSG A 1 A_Raise
    Loop
  Useknife:
     KNFG A 0 A_jumpifinventory("Machete",1,"UseMachete")
     KNFG ABC 2
	 KNFG C 0 A_CustomPunch (110,1,0,"KnifePuff")
	 KNFG DEF 2
	 KNFG F 0 A_TakeInventory("Kinfeammo")
	 goto ready
  UseMachete:
     MHT4 ABC 2
	 MHT4 C 0 A_CustomPunch (450,1,0,"Machetepuff")
	 MHT4 DEFG 2
	 MHT4 G 0 A_TakeInventory("Kinfeammo")
	 goto ready
  Fire:
    AUG1 A 0 A_JumpIfInventory("IsReloading",1,"Reload") 
    DNSG A 0 A_jumpifnoammo("Reload")
    DNSG A 0 A_jumpifinventory("deadshot",1,"Fire_deadshot")
    DNSG A 0 A_jumpifinventory("doubletap",1,"Fire_doubletap")
    DNSG A 2
    DNSG B 1 A_FireBullets (3.3, 2.2, 8, random(500,500), "BulletPuff")
    DNSG B 0 A_PlaySound ("DS/Fire")
    DNSG B 0 A_GunFlash
    DNSG CDEDCB 1 bright
    DNSG A 3
    DNSG FGH 1
    DNSG I 2 A_PlaySound ("DS/Pump")
	TNTT A 0 A_FireCustomMissile("ShellCasingSpawner",0,0,-30,2)
    DNSG JKLKJI 2
    DNSG HGF 1
    DNSG A 0 A_jumpifnoammo("Reload")
    AUG1 A 0 A_JumpIfInventory("IsReloading",1,"Reload") 
    DNSG A 7 A_ReFire
    AUG1 A 0 A_JumpIfInventory("IsReloading",1,"Reload") 
    DNSG A 0 A_jumpifnoammo("Reload")
    Goto Ready
  Fire_deadshot:
    AUG1 A 0 A_JumpIfInventory("IsReloading",1,"Reload") 
    DNSG A 0 A_jumpifnoammo("Reload")
    DNSG A 0 A_jumpifinventory("doubletap",1,"Fire_doubletapdeadshot")
    DNSG A 2
    DNSG B 1 A_FireBullets (2, 1.1, 8, random(500,500), "BulletPuff")
    DNSG B 0 A_PlaySound ("DS/Fire")
    DNSG B 0 A_GunFlash
    DNSG CDEDCB 1 bright
    DNSG A 3
    DNSG FGH 1
    DNSG I 2 A_PlaySound ("DS/Pump")
	TNTT A 0 A_FireCustomMissile("ShellCasingSpawner",0,0,-30,2)
    DNSG JKLKJI 2
    DNSG HGF 1
    DNSG A 0 A_jumpifnoammo("Reload")
    AUG1 A 0 A_JumpIfInventory("IsReloading",1,"Reload") 
    DNSG A 7 A_ReFire
    AUG1 A 0 A_JumpIfInventory("IsReloading",1,"Reload") 
    DNSG A 0 A_jumpifnoammo("Reload")
    Goto Ready
  Fire_doubletapdeadshot:
    DNSG A 0 A_jumpifnoammo("Reload")
    AUG1 A 0 A_JumpIfInventory("IsReloading",1,"Reload") 
    DNSG A 1
    DNSG B 1 A_FireBullets (2, 1.1, 8, random(500,500), "BulletPuff")
    DNSG B 0 A_PlaySound ("DS/Fire")
    DNSG B 0 A_GunFlash
    DNSG CDEDCB 1 bright
    DNSG A 2
    DNSG FGH 1
    DNSG I 1 A_PlaySound ("DS/Pump")
	TNTT A 0 A_FireCustomMissile("ShellCasingSpawner",0,0,-30,2)
    DNSG JKLKJI 1
    DNSG HGF 1
    DNSG A 0 A_jumpifnoammo("Reload")
    AUG1 A 0 A_JumpIfInventory("IsReloading",1,"Reload") 
    DNSG A 6 A_ReFire
    AUG1 A 0 A_JumpIfInventory("IsReloading",1,"Reload") 
    DNSG A 0 A_jumpifnoammo("Reload")
    Goto Ready
  Fire_Doubletap:
    DNSG A 0 A_jumpifnoammo("Reload")
    AUG1 A 0 A_JumpIfInventory("IsReloading",1,"Reload") 
    DNSG A 1
    DNSG B 1 A_FireBullets (3.3, 2.2, 8, random(500,500), "BulletPuff")
    DNSG B 0 A_PlaySound ("DS/Fire")
    DNSG B 0 A_GunFlash
    DNSG CDEDCB 1 bright
    DNSG A 2
    DNSG FGH 1
    DNSG I 1 A_PlaySound ("DS/Pump")
	TNTT A 0 A_FireCustomMissile("ShellCasingSpawner",0,0,-30,2)
    DNSG JKLKJI 1
    DNSG HGF 1
    DNSG A 0 A_jumpifnoammo("Reload")
    AUG1 A 0 A_JumpIfInventory("IsReloading",1,"Reload") 
    DNSG A 6 A_ReFire
    AUG1 A 0 A_JumpIfInventory("IsReloading",1,"Reload") 
    DNSG A 0 A_jumpifnoammo("Reload")
    Goto Ready
  Reload:	
    PIRE A 0 A_takeinventory("IsReloading",1)
    DNSG F 0 A_jumpifinventory("SpeedCola",1,"Reload_speed")
    DNSG F 0 A_jumpifinventory("PAPDukeclip",10,"ready")
	DNSG F 0 A_jumpifinventory("PAPDukeammo",1,1)
	goto ready
    DNSG FGHI 2
	goto reload2
  Reload2:
    DNSG I 0 A_Jumpifinventory("PAPDukeclip",9,"reload3")
    DNSG I 0 A_playsound("DS/reload")
    DNSG I 5 
    DNSG I 0 A_Giveinventory("PAPDukeclip",2)
    DNSG I 0 A_Takeinventory("PAPDukeammo",2)
    DNSG I 3 A_weaponready(WRF_NOBOB)
    DNSG I 0 A_Jumpifinventory("PAPDukeclip",10,"reloaddone")
    DNSG I 0 A_Jumpifinventory("PAPDukeammo",1,"reload2")
	goto reloaddone
  Reload3:
    DNSG I 0 A_playsound("DS/reload")
    DNSG I 5 
    DNSG I 0 A_Giveinventory("PAPDukeclip",1)
    DNSG I 0 A_Takeinventory("PAPDukeammo",1)
    DNSG I 3 A_weaponready(WRF_NOBOB)
    DNSG I 0 A_Jumpifinventory("PAPDukeclip",10,"reloaddone")
	goto reloaddone
  Reloaddone:
    DNSG I 0 A_playsound("DS/Pump")
    DNSG JKL 2
	DNSG KJIHGF 2
	goto ready
  Reload_speed:
    DNSG F 0 A_jumpifinventory("PAPDukeclip",10,"ready")
	DNSG F 0 A_jumpifinventory("PAPDukeammo",1,1)
	goto ready
    DNSG FGHI 1
	goto reload2_speed
  Reload2_speed:
    DNSG I 0 A_Jumpifinventory("PAPDukeclip",9,"reload3_speed")
    DNSG I 0 A_playsound("DS/reload")
    DNSG I 3 
    DNSG I 0 A_Giveinventory("PAPDukeclip",2)
    DNSG I 0 A_Takeinventory("PAPDukeammo",2)
    DNSG I 2
    DNSG I 0 A_Jumpifinventory("PAPDukeclip",10,"reloaddone_speed")
    DNSG I 0 A_Jumpifinventory("PAPDukeammo",1,"reload2_speed")
	goto reloaddone_speed
  Reload3_speed:
    DNSG I 0 A_playsound("DS/reload")
    DNSG I 3 
    DNSG I 0 A_Giveinventory("PAPDukeclip",1)
    DNSG I 0 A_Takeinventory("PAPDukeammo",1)
    DNSG I 2
    DNSG I 0 A_Jumpifinventory("PAPDukeclip",10,"reloaddone_speed")
	goto reloaddone_speed
  Reloaddone_speed:
    DNSG I 0 A_playsound("DS/Pump")
    DNSG JKL 1
	DNSG KJIHGF 1
	goto ready
  Flash:
    TNT1 A 4 Bright A_Light1
    TNT1 A 3 Bright A_Light2
    Goto LightDone
  ThrowGrenade:
     HNDG BCD 1
     HNDG E 1 A_PlaySound("weapons/grenadepin")
     HNDG FGHH 1
     HNDG I 1 A_PlaySound("weapons/grenadethr") 
     HNDG J 0 A_FireCustomMissile("ThrownGrenade",0,0,0,0)
     HNDG J 0 A_PlaySound("weapons/grenadethr")
     HNDG JKLMNOPQ 1
     HNDG Q 0 A_TakeInventory("thrownade")
     Goto Ready
  Spawn:
    DNSP A -1
    Stop
  }
}


actor PAPDukeClip : Ammo
{
    inventory.icon "CLIPA0"
    inventory.amount 0
    inventory.maxamount 10
    ammo.backpackamount 0
    ammo.backpackmaxamount 10
    +IGNORESKILL
}
