actor "SPAS-12" : RGUWeapon
{
  obituary "%k smacked %o over with the SPAS-12."
  inventory.pickupmessage "SPAS-12"  
  //attacksound "spas/fire"
  weapon.selectionorder 9
  weapon.ammotype "SPASClip"
  weapon.ammouse 1
  weapon.ammogive 0
  weapon.ammotype2 "SPAS12Ammo"
  weapon.ammouse2 0
  weapon.ammogive2 0
  states
  {
  Ready:
    SPSA A 2 //A_PlayWeaponSound( "fal/select")
    SPSA BCDEFGHIJKLMNOP 2 A_WeaponReady(WRF_NOPRIMARY)
    SPSA P 0 A_JumpIfNoAmmo("Reload")
    SPSA P 0 A_JumpIfInventory("Aiming",1,5)
    SPSA P 0 A_JumpIfInventory("Reloading",1,"Reload")
    SPSA P 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    SPSA P 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SPSA P 1 A_WeaponReady
    goto Ready+16
    SPSF F 0 A_JumpIfInventory("Reloading",1,"Reload")    
    SPSF F 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    SPSF F 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SPSF F 1 A_WeaponReady(WRF_NOBOB)
    goto Ready+22
  Deselect:
    SPSA L 0 A_TakeInventory("Aiming",1)
    SPSA L 0 ACS_ExecuteAlways(602,0,0,0,0)
    SPSA L 0 A_TakeInventory("Reloading",1)
    INTA L 0 A_ZoomFactor(1.0)
    SPSA L 0 A_Lower
    SPSA L 1 A_Lower
    goto Deselect+2
  Select:
    SPSA A 0 A_Raise
	SPSA A 0 ACS_ExecuteAlways(602,0,0,0,0)
	TNT1 F 0 A_GiveInventory("InCombatCrosshair", 35)
    loop
  Fire:	
    SPSA P 0 A_JumpIfInventory("Reloading",1,"ReloadEnd")
    SPSA P 0 A_JumpIfInventory("Aiming",1,"FireAim")
    SPSA P 1 A_JumpIfNoAmmo("ReloadStart")
    //SPSB B 0 A_JumpIfInventory("Perk3_SteadyAim",1,"Fire_SteadyAim")
    SPSB A 0 A_PlayWeaponSound("spas/fire")
    TNT1 F 0 A_GiveInventory("InCombatCrosshair",35)
    TNT1 F 0 A_GiveInventory("InCombat", 5)
    SPSB A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",3,0,4,0)
    SPSB A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,8,3)
    SPSB A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",-3,0,12,0)
    SPSB A 0 A_FireCustomMissile("WeaponSmokePuff_BigMuzzle",0,0,8,3)
    SPSB G 0 BRIGHT A_FireBullets (6.0, 6.0, 5, 5, "ShotgunPuff", 0, 200)
    SPSB G 1 BRIGHT A_FireBullets (6.0, 6.0, 8, 7, "ShotgunPuff", 1, 500)
	SPSB G 1 BRIGHT A_FireBullets (6.0, 6.0, 2, 2, "ShotgunPuff", 0, 700)
    SPSB A 0 BRIGHT ACS_ExecuteAlways(600,0,0,0,0)
    SPSB A 0 A_JumpIfNoAmmo("FireEmpty")
    SPSB BC 1 BRIGHT A_GunFlash
    SPSB DEFG 1
    SPSA P 2
    SPSB HIJ 2
    SPSB K 2 
    SPSB LMNOPQR 2
    SPSB A 0 A_JumpIfInventory("SPAS12Ammo",1,2)
    SPSB A 0 A_ReFire
    goto Ready+14
    SPSB A 0 A_JumpIfNoAmmo("ReloadStart")
    SPSB A 0 A_ReFire
    goto Ready+14
  FireEmpty:
    SPSB BC 2 BRIGHT A_GunFlash
    SPSB DEFG 2
    SPSA P 2
    SPSB HIJ 2
    SPSB K 2 
    SPSB LMNOPQR 2
    SPSB A 0 A_JumpIfInventory("SPAS12Ammo",1,2)
    SPSB A 0 A_ReFire
    goto Ready+14
    SPSB A 0 A_JumpIfNoAmmo("ReloadStart")
    SPSB A 0 A_ReFire
    goto Ready+14
  Hold:
    SPSA P 3 A_JumpIfInventory("Aiming",1,"HoldAim")
    SPSA P 1 A_ReFire
    goto Ready+16
  HoldAim:
    SPSF F 3
    SPSF F 1 A_ReFire
    goto Ready+22
  Reload: //AltFire:
    VECC A 0 A_JumpIfInventory("SPAS12Ammo",1,"ReloadStart")
    VECC A 0 A_TakeInventory("Reloading",1)
    goto Ready+19
  ReloadStart:
  	TNT1 A 0 ACS_ExecuteAlways(652,0,0,0,0) // Shout "Reloading" 
    SPSC A 0 A_JumpIfInventory("Aiming",1,"ReloadStartAim")
    SPSC A 2 A_JumpIfInventory("Perk1_SOH",1,"ReloadStart_SOH")
    SPSD B 0 A_GiveInventory("Reloading",1)
    SPSC B 2 A_PlaySoundEx("m9/select","SoundSlot5")
    SPSC CDEF 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    goto ReloadAmmo
  ReloadAmmo:
    SPSC X 0 A_GiveInventory("SPASClip",1)
    SPSC X 0 A_TakeInventory("SPAS12Ammo",1)
    SPSC HIJ 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SPSC K 3 A_PlaySoundEx("spas/insert","SoundSlot6")
    SPSC LMNO 3 A_WeaponReady
    SPSC X 0 A_JumpIfInventory("SPASClip",8,"ReloadEnd")
    SPSC X 0 A_JumpIfInventory("SPAS12Ammo",1,"ReloadAmmo")
    goto ReloadEnd
  ReloadEnd:
    SPSC PQRS 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SPSC T 2 A_PlaySoundEx("spas/pump","SoundSlot6")
    SPSC UVWXYZ 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SPSD A 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SPSD B 0 A_TakeInventory("Reloading",1)
    SPSD B 0 A_ReFire
    goto Ready+10
  AltFire:
    SPSA P 0 A_JumpIfInventory("Reloading",1,"ReloadEnd")
    SPSF A 0 A_JumpIfInventory("Aiming",1,"AltFire2")
    U45F A 0 A_ZoomFactor(1.2)
    SPSF ABCDEF 1
    SPSF F 0 A_GiveInventory("Aiming",1)
    SPSF F 0 ACS_ExecuteAlways(602,0,0,0,0)
    goto Ready+22
  AltFire2:
    U45F A 0 A_ZoomFactor(1.0)
    SPSF FEDCBA 1
    SPSF A 0 A_TakeInventory("Aiming",1)
    SPSF A 0 ACS_ExecuteAlways(602,0,0,0,0)
    goto Ready+16
  ReloadStartAim:
    U45F A 0 A_ZoomFactor(1.0)
    SPSF FEDCBA 1
    SPSF A 0 A_TakeInventory("Aiming",1)
    SPSF A 0 ACS_ExecuteAlways(602,0,0,0,0)
    goto ReloadStart+1
  Flash:
    TNT1 A 2 bright A_Light1
    TNT1 A 0 bright A_Light0
    stop
  Spawn:
    WEAP M 15
    TNT1 A 0 A_SpawnItem("SPASPickup")
    stop
  FireAim:
    SPSF F 1 A_JumpIfNoAmmo("ReloadStart")
    SPSF G 0 A_PlayWeaponSound("spas/fire")
    TNT1 F 0 A_GiveInventory("InCombatCrosshair",35)
    TNT1 F 0 A_GiveInventory("InCombat", 5)
    SPSF G 0 A_FireCustomMissile("WeaponSmokePuffShotgun",3,0,-4,0)
    SPSF G 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,0,3)
    SPSF G 0 A_FireCustomMissile("WeaponSmokePuffShotgun",-3,0,4,0)
    A12B A 0 A_FireCustomMissile("WeaponSmokePuff_BigMuzzle",0,0,0,3)
    SPSF G 0 BRIGHT A_FireBullets (5.0, 5.0, 5, 5, "ShotgunPuff", 0, 200)
    SPSF G 1 BRIGHT A_FireBullets (5.0, 5.0, 8, 7, "ShotgunPuff", 1, 500)
	SPSF G 1 BRIGHT A_FireBullets (5.0, 5.0, 2, 2, "ShotgunPuff", 0, 700)
    SPSF G 0 BRIGHT ACS_ExecuteAlways(600,0,0,0,0)
    SPSF G 0 A_JumpIfNoAmmo("FireAimEmpty")
    SPSF HIJKLM 1 BRIGHT A_GunFlash
    SPSF NOPQ 2
    SPSF R 2 
    SPSF STUVWF 2
    SPSF A 0 A_JumpIfInventory("SPAS12Ammo",1,2)
    SPSF A 0 A_ReFire
    goto Ready+22
    SPSF A 0 A_JumpIfNoAmmo("ReloadStart")
    SPSF A 0 A_ReFire
    goto Ready+22
  FireAimEmpty:
    SPSF HI 2 BRIGHT A_GunFlash
    SPSF JKLMNOPQ 2
    SPSF R 2 
    SPSF STUVWF 2
    SPSF A 0 A_JumpIfInventory("SPAS12Ammo",1,2)
    SPSF A 0 A_ReFire
    goto Ready+22
    SPSF A 0 A_JumpIfNoAmmo("ReloadStart")
    SPSF A 0 A_ReFire
    goto Ready+22
  Fire_SteadyAim:
    SPSB A 0 A_PlayWeaponSound("spas/fire")
    TNT1 F 0 A_GiveInventory("InCombatCrosshair",35)
    TNT1 F 0 A_GiveInventory("InCombat", 5)
    SPSB A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",3,0,4,0)
    SPSB A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,8,3)
    SPSB A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",-3,0,12,0)
    A12B A 0 A_FireCustomMissile("WeaponSmokePuff_BigMuzzle",0,0,8,3)
    SPSB G 0 BRIGHT A_FireBullets (5.0, 5.0, 5, 5, "ShotgunPuff", 0, 200)
    SPSB G 1 BRIGHT A_FireBullets (5.0, 5.0, 8, 7, "ShotgunPuff", 1, 500)
	SPSB G 1 BRIGHT A_FireBullets (5.0, 5.0, 2, 2, "ShotgunPuff", 0, 700)
    SPSB A 0 BRIGHT ACS_ExecuteAlways(600,0,0,0,0)
    SPSB A 0 A_JumpIfNoAmmo("FireEmpty")
    SPSB BC 1 BRIGHT A_GunFlash
    SPSB DEFG 1
    SPSA P 2
    SPSB HIJ 2
    SPSB K 2 
    SPSB LMNOPQR 2
    SPSB A 0 A_JumpIfInventory("SPAS12Ammo",1,2)
    SPSB A 0 A_ReFire
    goto Ready+14
    SPSB A 0 A_JumpIfNoAmmo("ReloadStart")
    SPSB A 0 A_ReFire
    goto Ready+14
  ReloadStart_SOH:
    SPSD B 0 A_GiveInventory("Reloading",1)
    SPSC B 2 A_PlaySoundEx("m9/select","SoundSlot5")
    SPSC CDEF 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    goto ReloadAmmo_SOH
  ReloadAmmo_SOH:
    SPSC X 0 A_GiveInventory("SPASClip",1)
    SPSC X 0 A_TakeInventory("SPAS12Ammo",1)
    SPSC HIJ 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SPSC K 2 A_PlaySoundEx("spas/insert","SoundSlot6")
    SPSC LMNO 2 A_WeaponReady    
    SPSC X 0 A_JumpIfInventory("SPASClip",8,"ReloadEnd_SOH")
    SPSC X 0 A_JumpIfInventory("SPAS12Ammo",1,"ReloadAmmo_SOH")
    goto ReloadEnd_SOH
  ReloadEnd_SOH:
    SPSC PQRS 1 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SPSC T 1 A_PlaySoundEx("spas/pump","SoundSlot6")
    SPSC UVWXYZ 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SPSD A 1 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SPSD B 0 A_TakeInventory("Reloading",1)
    SPSD B 0 A_ReFire
    goto Ready+10
  FragGrenade:
    U45F A 0 A_ZoomFactor(1.0)
    U45A L 0 A_TakeInventory("Aiming",1)
    U45A L 0 A_TakeInventory("Reloading",1)
    U45F A 0 ACS_ExecuteAlways(602,0,0,0,0)
    U45A L 0 A_JumpIfInventory("Perk1_SOH_Pro",1,"FragGrenade_SOH")
    GRNA A 2 A_PlaySound("grenade/pinpull")
    GRNA BCDEFGH 2
    TNT1 A 15 
    TNT1 A 0 A_PlaySound("grenade/throw")
    GRNA A 0 A_PlaySoundEx("us/grenades","Voice")
    GRNA IJK 2
    GRNA L 0 A_TakeInventory("FragGrenadeAmmo",1)
    GRNA L 0 A_TakeInventory("ThrowingGrenade",1)
    U45A L 0 A_TakeInventory("Aiming",1)
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
    GRNA L 2 A_FireCustomMissile("FragGrenade",0,0,0,16)
    GRNA MN 2 
    goto Ready+1
  FragGrenade_SOH:
    GRNA A 1 A_PlaySound("grenade/pinpull")
    GRNA BCDEFGH 1
    TNT1 A 10
    TNT1 A 0 A_PlaySound("grenade/throw")
    GRNA A 0 A_PlaySoundEx("us/grenades","Voice")
    GRNA IJK 1
    GRNA L 0 A_TakeInventory("FragGrenadeAmmo",1)
    GRNA L 0 A_TakeInventory("ThrowingGrenade",1)
    U45A L 0 A_TakeInventory("Aiming",1)
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
    GRNA L 1 A_FireCustomMissile("FragGrenade",0,0,0,16)
    GRNA MN 1 
    goto Ready+1
  KnifeAttack:
    U45F A 0 A_ZoomFactor(1.0)
    U45A L 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    U45A L 0 A_TakeInventory("Aiming",1)
    U45A L 0 A_TakeInventory("Reloading",1)
    U45F A 0 ACS_ExecuteAlways(602,0,0,0,0)
    U45A L 0 A_JumpIfInventory("Perk1_SOH_Pro",1,"KnifeAttack_SOH")
    U45C A 0 A_JumpIfInventory("Perk3_Commando",1,"KnifeAttack_Commando")
    KNFA A 0 ACS_ExecuteAlways(599,0,0,0,0)
    KNFA AB 1
    KNFA B 0 A_PlaySound("knife/swing")
    KNFA CDE 1 A_CustomPunch(34,1,0,"KnifePuff",96)
    KNFA FGHIJKL 1 
    TNT1 A 20
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
    goto Ready+1
  KnifeAttack_Commando:
    KNFA A 0 ACS_ExecuteAlways(599,0,0,0,0)
    KNFA AB 1
    KNFA B 0 A_PlaySound("knife/swing")
    KNFA CDE 1 A_CustomPunch(34,1,0,"KnifePuff",160)
    KNFA FGHIJKL 1 
    TNT1 A 20
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
    goto Ready+1
  KnifeAttack_SOH:
    U45C A 0 A_JumpIfInventory("Perk3_Commando",1,"KnifeAttack_SOH_Commando")
    KNFA A 0 ACS_ExecuteAlways(599,0,0,0,0)
    KNFA AB 1
    KNFA B 0 A_PlaySound("knife/swing")
    KNFA CDE 1 A_CustomPunch(34,1,0,"KnifePuff",96)
    KNFA FGHIJKL 1 
    TNT1 A 10
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
    goto Ready+1
  KnifeAttack_SOH_Commando:
    KNFA A 0 ACS_ExecuteAlways(599,0,0,0,0)
    KNFA AB 1
    KNFA B 0 A_PlaySound("knife/swing")
    KNFA CDE 1 A_CustomPunch(34,1,0,"KnifePuff",160)
    KNFA FGHIJKL 1 
    TNT1 A 10
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
    goto Ready+1
  }
}

actor SPASClip : Ammo
{
    inventory.icon "CLIPA0"
    inventory.amount 0
    inventory.maxamount 8
    ammo.backpackamount 0
    ammo.backpackmaxamount 8
    +IGNORESKILL
}
actor "SPAS-12 Ex Mags" : "SPAS-12"
{
  obituary "%k smacked %o over with the SPAS-12."
  inventory.pickupmessage "SPAS-12"  
  //attacksound "spas/fire"
  weapon.selectionorder 9
  weapon.ammotype "SPASClip2"
  weapon.ammouse 1
  weapon.ammogive 0
  weapon.ammotype2 "SPAS12Ammo"
  weapon.ammouse2 0
  weapon.ammogive2 0
  states
  {
  Reload: //AltFire:
    VECC A 0 A_JumpIfInventory("SPAS12Ammo",1,"ReloadStart")
    VECC A 0 A_TakeInventory("Reloading",1)
    goto Ready+19
  ReloadStart:
  	TNT1 A 0 ACS_ExecuteAlways(652,0,0,0,0) // Shout "Reloading" 
    SPSC A 0 A_JumpIfInventory("Aiming",1,"ReloadStartAim")
    SPSC A 2 A_JumpIfInventory("Perk1_SOH",1,"ReloadStart_SOH")
    SPSD B 0 A_GiveInventory("Reloading",1)
    SPSC B 2 A_PlaySoundEx("m9/select","SoundSlot5")
    SPSC CDEF 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    goto ReloadAmmo
  ReloadAmmo:
    SPSC X 0 A_GiveInventory("SPASClip2",1)
    SPSC X 0 A_TakeInventory("SPAS12Ammo",1)
    SPSC HIJ 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SPSC K 3 A_PlaySoundEx("spas/insert","SoundSlot6")
    SPSC LMNO 3 A_WeaponReady
    SPSC X 0 A_JumpIfInventory("SPASClip2",16,"ReloadEnd")
    SPSC X 0 A_JumpIfInventory("SPAS12Ammo",1,"ReloadAmmo")
    goto ReloadEnd
  ReloadEnd:
    SPSC PQRS 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SPSC T 2 A_PlaySoundEx("spas/pump","SoundSlot6")
    SPSC UVWXYZ 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SPSD A 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SPSD B 0 A_TakeInventory("Reloading",1)
    SPSD B 0 A_ReFire
    goto Ready+10
  ReloadStart_SOH:
    SPSD B 0 A_GiveInventory("Reloading",1)
    SPSC B 2 A_PlaySoundEx("m9/select","SoundSlot5")
    SPSC CDEF 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    goto ReloadAmmo_SOH
  ReloadAmmo_SOH:
    SPSC X 0 A_GiveInventory("SPASClip2",1)
    SPSC X 0 A_TakeInventory("SPAS12Ammo",1)
    SPSC HIJ 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SPSC K 2 A_PlaySoundEx("spas/insert","SoundSlot6")
    SPSC LMNO 2 A_WeaponReady    
    SPSC X 0 A_JumpIfInventory("SPASClip2",16,"ReloadEnd_SOH")
    SPSC X 0 A_JumpIfInventory("SPAS12Ammo",1,"ReloadAmmo_SOH")
    goto ReloadEnd_SOH
  ReloadEnd_SOH:
    SPSC PQRS 1 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SPSC T 1 A_PlaySoundEx("spas/pump","SoundSlot6")
    SPSC UVWXYZ 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SPSD A 1 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SPSD B 0 A_TakeInventory("Reloading",1)
    SPSD B 0 A_ReFire
    goto Ready+10
  ReloadStartAim:
    U45F A 0 A_ZoomFactor(1.0)
    SPSF FEDCBA 1
    SPSF A 0 A_TakeInventory("Aiming",1)
    SPSF A 0 ACS_ExecuteAlways(602,0,0,0,0)
    goto ReloadStart+1
  }
}

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

actor SPASExMags : Inventory
{
    inventory.amount 0
    inventory.maxamount 1
}

actor "SPAS-12 Grip" : "SPAS-12"
{
  /*obituary "%k smacked %o over with the SPAS-12."
  inventory.pickupmessage "SPAS-12"  
  //attacksound "spas/fire"
  weapon.selectionorder 9
  weapon.ammotype "SPASClip"
  weapon.ammouse 1
  weapon.ammogive 0
  weapon.ammotype2 "SPAS12Ammo"
  weapon.ammouse2 0
  weapon.ammogive2 0
  states
  {
  Fire:
    SPSA P 0 A_JumpIfInventory("Reloading",1,"ReloadEnd")
    SPSA P 0 A_JumpIfInventory("Aiming",1,"FireAim")
    SPSA P 1 A_JumpIfNoAmmo("ReloadStart")
    SPSB B 0 A_JumpIfInventory("Perk3_SteadyAim",1,"Fire_SteadyAim")
    SPSB A 0 A_PlayWeaponSound("spas/fire")
    SPSB A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",3,0,4,0)
    SPSB A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,8,3)
    SPSB A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",-3,0,12,0)
    A12B A 0 A_FireCustomMissile("WeaponSmokePuff_BigMuzzle",0,0,8,3)
    SPSB A 0 BRIGHT A_FireBullets (4.0, 4.0, 5, 5, "ShotgunPuff", 0, 200)
    SPSB A 1 BRIGHT A_FireBullets (4.0, 4.0, 10, 7, "ShotgunPuff", 1, 2000)
    SPSB A 0 BRIGHT ACS_ExecuteAlways(600,0,0,0,0)
    SPSB A 0 A_JumpIfNoAmmo("FireEmpty")
    SPSB BC 1 BRIGHT A_GunFlash
    SPSB DEFG 1
    SPSA P 2
    SPSB HIJ 2
    SPSB K 2 
    SPSB LMNOPQR 2
    SPSB A 0 A_JumpIfInventory("SPAS12Ammo",1,2)
    SPSB A 0 A_ReFire
    goto Ready+14
    SPSB A 0 A_JumpIfNoAmmo("ReloadStart")
    SPSB A 0 A_ReFire
    goto Ready+14
  FireAim:
    SPSF F 1 A_JumpIfNoAmmo("ReloadStart")
    SPSF G 0 A_PlayWeaponSound("spas/fire")
    SPSF G 0 A_FireCustomMissile("WeaponSmokePuffShotgun",3,0,-4,0)
    SPSF G 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,0,3)
    SPSF G 0 A_FireCustomMissile("WeaponSmokePuffShotgun",-3,0,4,0)
    A12B A 0 A_FireCustomMissile("WeaponSmokePuff_BigMuzzle",0,0,0,3)
    SPSF G 0 BRIGHT A_FireBullets (4.0, 4.0, 5, 5, "ShotgunPuff", 0, 200)
    SPSF G 1 BRIGHT A_FireBullets (4.0, 4.0, 10, 7, "ShotgunPuff", 1, 2000)
    SPSF G 0 BRIGHT ACS_ExecuteAlways(600,0,0,0,0)
    SPSF G 0 A_JumpIfNoAmmo("FireAimEmpty")
    SPSF HIJKLM 1 BRIGHT A_GunFlash
    SPSF NOPQ 2
    SPSF R 2 
    SPSF STUVWF 2
    SPSF A 0 A_JumpIfInventory("SPAS12Ammo",1,2)
    SPSF A 0 A_ReFire
    goto Ready+22
    SPSF A 0 A_JumpIfNoAmmo("ReloadStart")
    SPSF A 0 A_ReFire
    goto Ready+22
  Fire_SteadyAim:
    SPSB A 0 A_PlayWeaponSound("spas/fire")
    SPSB A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",3,0,4,0)
    SPSB A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,8,3)
    SPSB A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",-3,0,12,0)
    A12B A 0 A_FireCustomMissile("WeaponSmokePuff_BigMuzzle",0,0,8,3)
    SPSB A 0 BRIGHT A_FireBullets (3.0, 3.0, 5, 5, "ShotgunPuff", 0, 200)
    SPSB A 1 BRIGHT A_FireBullets (3.0, 3.0, 10, 7, "ShotgunPuff", 1, 2000)
    SPSB A 0 BRIGHT ACS_ExecuteAlways(600,0,0,0,0)
    SPSB A 0 A_JumpIfNoAmmo("FireEmpty")
    SPSB BC 1 BRIGHT A_GunFlash
    SPSB DEFG 1
    SPSA P 2
    SPSB HIJ 2
    SPSB K 2 
    SPSB LMNOPQR 2
    SPSB A 0 A_JumpIfInventory("SPAS12Ammo",1,2)
    SPSB A 0 A_ReFire
    goto Ready+14
    SPSB A 0 A_JumpIfNoAmmo("ReloadStart")
    SPSB A 0 A_ReFire
    goto Ready+14
  }*/
}

actor SPASGrip : Inventory
{
    inventory.amount 0
    inventory.maxamount 1
}

actor SPASPickup : CustomInventory
{
  inventory.pickupmessage "SPAS-12"  
  inventory.pickupsound "misc/w_pkup"
  +INVENTORY.AUTOACTIVATE
  inventory.respawntics 35
  scale 0.15
  States
  {
  Spawn:
    WEAP M -1
    stop
  Pickup:
    JDGP A 0
    JDGP A 0 A_JumpIfInventory("SPAS-12",1,"FailPickup") // If the player already has this weapon, they get more ammo for it
    JDGP A 0 A_JumpIfInventory("SPAS-12 Ex Mags",1,"FailPickup")
    JDGP A 0 A_JumpIfInventory("SPAS-12 Grip",1,"FailPickup")
    JDGP A 0 A_JumpIfInventory("MaxWeaponsFilled",0,"FailPickup2")
    BKPK A 0 ACS_ExecuteWithResult(618,7,0,0)
    stop
  AmmoPickup:
    JDGP A 0
    JDGP A 0 A_JumpIfInventory("SPAS12Ammo",0,"FailPickup")
    JDGP A 0 A_GiveInventory("SPAS12Ammo",8)
    stop
  FailPickup:
    WEAP M 1
    fail
  FailPickup2:
    WEAP M 1 
    BKPK A 0 ACS_ExecuteAlways(620,0,1,0,0)
    fail
  }
}
