actor "Franchi SPAS-12" : RGUWeapon
{
  obituary "%k smacked %o over with the SPAS-12."
  inventory.pickupmessage "You got the Franchi SPAS-12 dual-mode shotgun."
  //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:
    M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    GRNA L 0 A_TakeInventory("weapondropper",2)
    SPSA C 0 A_PlaySoundEx("weapon/draw","SoundSlot5")
    SPSA DEFG 2 A_WeaponReady(WRF_NOPRIMARY|WRF_ALLOWZOOM)
	SPSA HIJKLMNOP 2 A_WeaponReady(WRF_ALLOWZOOM)
    SPSA P 0 A_JumpIfNoAmmo("Reload")
	W18A J 0 A_JumpIfInventory("weapondropper",1,"DropWeapon")
    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(WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
    Goto Ready+17
    SPSF F 0 A_JumpIfInventory("Reloading",1,"Reload")
  ReadyAim:
    SPSF F 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    SPSF F 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	W18A I 0 A_JumpIfInventory("weapondropper",1,"AltFire3")
    SPSF F 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
    Goto Ready+23
  Deselect:
    SPSA P 0 A_PlaySoundEx("weapon/down","SoundSlot5")
    SPSA P 0 A_TakeInventory("Aiming",1)
    SPSA P 0 A_TakeInventory("Reloading",1)
    SPSA P 0 A_TakeInventory("ReloadingShot",1)
    SPSA P 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    SPSA P 0 A_ZoomFactor(1.0)
    SPSA P 0 A_Lower
    SPSA P 1 A_Lower
    Goto Deselect+6
  Select:
    SPSA A 0
    SPSA A 0 A_TakeInventory("ReloadingShot",1)
    SPSA A 0 A_Raise
    Goto Select+2
  Fire:
    SPSA P 0 A_JumpIfInventory("ReloadingShot",1,"ReloadEndStop")
    SPSA P 0 A_JumpIfInventory("Aiming",1,"FireAim")
    SPSA P 1 A_JumpIfNoAmmo("ReloadStart")
    SPSB A 0 A_JumpIfInventory("SPASBolt",1,"Pump")
    SPSB A 0 A_JumpIfInventory("Perk3_SteadyAim",1,"Fire_SteadyAim")
	SPSB A 0 A_JumpIfInventory("SPASClip",2,1)
	Goto FireEmpty
    SPSB A 0 A_PlayWeaponSound("spas/fireempty")
    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_ShotMuzzle",0,0,8,3)
    SPSB AAAAA 0 BRIGHT A_FireCustomMissile("HHCBSPAS1", frandom(-6.00,6.00), 0, 0, 4, 0, frandom(-5.00,5.00))
    SPSB AAAAAAA 0 BRIGHT A_FireCustomMissile("HHCBSPAS2", frandom(-6.00,6.00), 0, 0, 4, 0, frandom(-5.00,5.00))
    SPSB A 1 BRIGHT A_FireCustomMissile("HHCBSPAS2", frandom(-6.00,6.00), 1, 0, 4, 0, +frandom(-5.00,5.00))
    SPSB A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    SPSB B 1 BRIGHT A_GunFlash
    SPSB C 1 BRIGHT
    SPSB DEFG 1
    SPSB HIJ 2
    SPSB K 2 A_PlaySoundEx("spas/pump","SoundSlot6")
	SPSB K 0 A_SpawnItemEx("ShellCasing",Cos(Pitch)*30,-2,25-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    SPSB LMNOP 2
    SPSB Q 1
    SPSB QRR 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    SPSB A 0 A_JumpIfInventory("SPAS12Ammo",1,1)
    Goto Ready+17
    SPSB A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+17
  FireEmpty:
    SPSB A 0 A_PlayWeaponSound("spas/fireempty")
    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_ShotMuzzle",0,0,8,3)
    SPSB AAAAA 0 BRIGHT A_FireCustomMissile("HHCBSPAS1", frandom(-6.00,6.00), 0, 0, 4, 0, frandom(-5.00,5.00))
    SPSB AAAAAAA 0 BRIGHT A_FireCustomMissile("HHCBSPAS2", frandom(-6.00,6.00), 0, 0, 4, 0, frandom(-5.00,5.00))
    SPSB A 1 BRIGHT A_FireCustomMissile("HHCBSPAS2", frandom(-6.00,6.00), 1, 0, 4, 0, frandom(-5.00,5.00))
    SPSB A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    SPSB B 1 BRIGHT A_GunFlash
    SPSB C 1 BRIGHT
    SPSB DEF 1
    SPSB G 1 A_GiveInventory("SPASBolt",1)
    SPSB A 0 A_JumpIfInventory("SPAS12Ammo",1,1)
    Goto Ready+17
    SPSB A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+17
  Pump:
    SPSB HIJ 2
    SPSB K 2 A_PlaySoundEx("spas/pump","SoundSlot6")
	SPSB K 0 A_SpawnItemEx("ShellCasing",Cos(Pitch)*30,-2,25-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    SPSB LMNOPQR 2 A_TakeInventory("SPASBolt",1)
    Goto Ready+17
  PumpAim:
    SPSF NO 2
	SPSF P 2 A_PlaySoundEx("spas/pump","SoundSlot6")
	SPSF P 0 A_SpawnItemEx("ShellCasing",Cos(Pitch)*30,-2,32-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    SPSF QR 2 A_TakeInventory("SPASBolt",1)
    SPSF STUVW 2
    Goto Ready+23
  PumpAimAlt:
    SPSX NO 2
	SPSX P 2 A_PlaySoundEx("spas/pump","SoundSlot6")
	SPSF P 0 A_SpawnItemEx("ShellCasing",Cos(Pitch)*30,-2,32-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    SPSX QR 2 A_TakeInventory("SPASBolt",1)
    SPSX STUVW 2
    Goto Ready+23
  Reload: //AltFire:
    VECC A 0 A_JumpIfInventory("SPASClip",8,2)
    VECC A 0 A_JumpIfInventory("SPAS12Ammo",1,"ReloadStart")
    VECC A 0 A_TakeInventory("Reloading",1)
    VECC A 0 A_JumpIfInventory("Aiming",1,"ReadyAim")
    Goto Ready+20
  ReloadStart:
    SPSC A 0 A_JumpIfInventory("SPASClip",5,2)
    SPSC A 0 ACS_NamedExecuteAlways("RefSpeak",0,4,0,0)
    SPSC A 0 A_JumpIfInventory("Aiming",1,"ReloadStartAim")
    SPSC A 3 A_JumpIfInventory("Perk1_SOH",1,"ReloadStart_SOH")
    SPSC B 0 A_GiveInventory("ReloadingShot",1)
    SPSC B 3 A_PlaySoundEx("m9/select","SoundSlot5")
    SPSC C 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SPSC DEF 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    Goto ReloadAmmo
  ReloadAmmo:
    SPSC O 0 A_JumpIfInventory("SPASClip",8,"ReloadEnd")
    SPSC O 0 A_JumpIfInventory("SPAS12Ammo",1,1)
    Goto ReloadEnd
    SPSC HIJ 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SPSC K 0 A_GiveInventory("SPASClip",1)
    SPSC K 0 A_TakeInventory("SPAS12Ammo",1)
    SPSC K 3 A_PlaySoundEx("spas/insert","SoundSlot6")
    SPSC LMNO 3 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    SPSC O 0 A_JumpIfInventory("SPASClip",8,"ReloadEnd")
    SPSC O 0 A_JumpIfInventory("SPASBolt",1,"ReloadPump")
    Goto ReloadAmmo
  ReloadPump:
    SPSC QRS 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SPSC T 2 A_PlaySoundEx("spas/pump","SoundSlot6")
    SPSC U 2 A_TakeInventory("SPASBolt",1)
	SPSC VUTSRQ 2 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    SPSC Q 0 A_JumpIfInventory("SPASClip",8,"ReloadEnd")
    SPSC Q 0 A_JumpIfInventory("SPAS12Ammo",1,"ReloadAmmo")
  ReloadEndStop:
    SPSC Q 0 A_JumpIfInventory("Perk1_SOH",1,"ReloadEnd_SOH")
  ReloadEnd:
    SPSC Q 0 A_JumpIfInventory("SPASBolt",1,"ReloadEndPump")
    SPSC FEDCBA 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SPSC A 0 A_TakeInventory("ReloadingShot",1)
    SPSC A 0 A_TakeInventory("Reloading",1)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+17
  ReloadEndPump:
    SPSC QRS 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SPSC T 2 A_PlaySoundEx("spas/pump","SoundSlot6")
    SPSC T 0 A_TakeInventory("SPASBolt",1)
    SPSC UV 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SPSC WXYZ 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SPSD A 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SPSD A 0 A_TakeInventory("ReloadingShot",1)
    SPSD A 0 A_TakeInventory("Reloading",1)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+17
  Zoom:
  PostReloadAlt:
    SPSF F 0 A_ZoomFactor(1.2)
    SPSF E 0 A_GiveInventory("Aiming",1)
	SPSF A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    SPSF ABCDEF 1
    Goto AltHold
  ReloadBreak:
    SPSF F 0 A_ZoomFactor(1.0)
    SPSF FE 1
    SPSF E 0 A_TakeInventory("Aiming",1)
    SPSF DCBA 1
    SPSF A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
	TNT1 A 0 A_ClearReFire
    Goto Reload
  ClearRefire:
    SPSF F 1 A_ClearReFire
	Goto AltHold
  FireAimAltHold:
    "####" "#" 0 A_JumpIfInventory("SPASClip",1,1)
	Goto ReloadBreak
    //SPSB A 0 A_JumpIfInventory("SPASBolt",1,"PumpAim")
    SPSF G 0 A_PlayWeaponSound("spas/fireempty")
	GRNA L 0 A_TakeInventory("SPASClip",1)
    SPSF G 0 A_FireCustomMissile("WeaponSmokePuffShotgun",3,0,-4,2)
    SPSF G 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,0,5)
    SPSF G 0 A_FireCustomMissile("WeaponSmokePuffShotgun",-3,0,4,2)
    SPSF G 0 A_FireCustomMissile("WeaponSmokePuff_ShotMuzzle",0,0,0,5)
    SPSF GGGGG 0 BRIGHT A_FireCustomMissile("HHCBSPAS1", frandom(-2.00,2.00), 0, 0, 4, 0, frandom(-2.00,2.00))
    SPSF GGGGGGG 0 BRIGHT A_FireCustomMissile("HHCBSPAS2", frandom(-2.00,2.00), 0, 0, 4, 0, frandom(-2.00,2.00))
    SPSF G 1 BRIGHT A_FireCustomMissile("HHCBSPAS2", frandom(-2.00,2.00), 1, 0, 4, 0, frandom(-2.00,2.00))
    SPSF G 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    SPSF G 0 A_JumpIfInventory("SPASSwitch",1,"FireAimAlt2")
    SPSF H 1 BRIGHT A_GunFlash
    SPSF I 1 BRIGHT
    SPSF JKLM 1
    SPSF NO 2
    SPSF P 2 A_PlaySoundEx("spas/pump","SoundSlot6")
	SPSF P 0 A_SpawnItemEx("ShellCasing",Cos(Pitch)*30,-2,32-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    SPSF QRSTUV 2
    SPSF W 1
    SPSF W 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    "####" "#" 0 A_JumpIfInventory("SPASClip",1,1)
	Goto ReloadBreak
	TNT1 A 0
    Goto AltHold
  FireAimAlt2:
    SPSF H 1 BRIGHT A_GunFlash
    SPSF I 1 BRIGHT
    SPSF JKLM 1
    SPSX NO 2
    SPSX P 2 A_PlaySoundEx("spas/pump","SoundSlot6")
	SPSF P 0 A_SpawnItemEx("ShellCasing",Cos(Pitch)*30,-2,32-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    SPSX QRSTUV 2
    SPSX W 1
    SPSX W 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    "####" "#" 0 A_JumpIfInventory("SPASClip",1,1)
	Goto ReloadBreak
	TNT1 A 0
    Goto AltHold
  AltHold:
    A12C C 0 A_JumpIfInventory("FireHeld",1,"ClearRefire")
    SPSF F 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
	A12C C 0 A_JumpIfInventory("FireHeld",1,"FireAimAltHold")
	A12C C 0 A_JumpIfInventory("Reloading",1,"ReloadBreak")
	U45A L 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    U45A L 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	G18A I 0 A_JumpIfInventory("weapondropper",1,"AltFire3")
	A12C F 0 A_Refire("AltHold")
	A12C C 0 A_JumpIfInventory("Aiming",1,"AltFire2")
	Goto Ready+23
  AltFire:
    GRNA L 0 A_TakeInventory("weapondropper",2)
    SPSA P 0 A_JumpIfInventory("ReloadingShot",1,"ReloadEnd")
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"AltHold")
    SPSF A 0 A_JumpIfInventory("Aiming",1,"AltFire2")
    SPSF A 0 A_ZoomFactor(1.2)
    SPSF AB 1
    SPSF B 0 A_GiveInventory("Aiming",1)
    SPSF CDEF 1
    SPSF F 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
	A12C F 0 A_Refire("AltHold")
    Goto Ready+23
  AltFire2:
    SPSF F 0 A_ZoomFactor(1.0)
    SPSF FE 1
    SPSF E 0 A_TakeInventory("Aiming",1)
    SPSF DCBA 1
    SPSF A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    Goto Ready+17
  AltFire3:
    SPSF F 0 A_ZoomFactor(1.0)
    SPSF FE 1
    SPSF E 0 A_TakeInventory("Aiming",1)
    SPSF DCBA 1
    SPSF A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
	goto DropWeapon
  ReloadStartAim:
    SPSF F 0 A_ZoomFactor(1.0)
    SPSF FE 1
    SPSF E 0 A_TakeInventory("Aiming",1)
    SPSF DCBA 1
    SPSF A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    Goto ReloadStart+3
  Flash:
    TNT1 A 3 BRIGHT A_Light1
    TNT1 A 0 BRIGHT A_Light0
	TNT1 A 10
	TNT1 A 0 A_Jump(80,2)
	TNT1 A 10 A_GiveInventory("SPASSwitch",1)
    Stop
	TNT1 A 10 A_TakeInventory("SPASSwitch",1)
	Stop
  Spawn:
    WEAP M 0
    WEAP M 0 A_SpawnItem("SPASDrop")
    Stop
  FireAim:
    SPSF F 1 A_JumpIfNoAmmo("ReloadStart")
    SPSB A 0 A_JumpIfInventory("SPASBolt",1,"PumpAim")
	SPSB A 0 A_JumpIfInventory("SPASClip",2,1)
	Goto FireAimEmpty
    SPSF G 0 A_PlayWeaponSound("spas/fireempty")
    SPSF G 0 A_FireCustomMissile("WeaponSmokePuffShotgun",3,0,-4,2)
    SPSF G 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,0,5)
    SPSF G 0 A_FireCustomMissile("WeaponSmokePuffShotgun",-3,0,4,2)
    SPSF G 0 A_FireCustomMissile("WeaponSmokePuff_ShotMuzzle",0,0,0,5)
    SPSF GGGGG 0 BRIGHT A_FireCustomMissile("HHCBSPAS1", frandom(-2.00,2.00), 0, 0, 4, 0, frandom(-2.00,2.00))
    SPSF GGGGGGG 0 BRIGHT A_FireCustomMissile("HHCBSPAS2", frandom(-2.00,2.00), 0, 0, 4, 0, frandom(-2.00,2.00))
    SPSF G 1 BRIGHT A_FireCustomMissile("HHCBSPAS2", frandom(-2.00,2.00), 1, 0, 4, 0, frandom(-2.00,2.00))
    SPSF G 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    SPSF G 0 A_JumpIfInventory("SPASSwitch",1,"FireAimAlt")
    SPSF H 1 BRIGHT A_GunFlash
    SPSF I 1 BRIGHT
    SPSF JKLM 1
    SPSF NO 2
    SPSF P 2 A_PlaySoundEx("spas/pump","SoundSlot6")
	SPSF P 0 A_SpawnItemEx("ShellCasing",Cos(Pitch)*30,-2,32-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    SPSF QRSTUV 2
    SPSF W 1
    SPSF WFF 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    SPSF A 0 A_JumpIfInventory("SPAS12Ammo",1,1)
    Goto Ready+23
    SPSF A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+23
  FireAimAlt:
    SPSF H 1 BRIGHT A_GunFlash
    SPSF I 1 BRIGHT
    SPSF JKLM 1
    SPSX NO 2
    SPSX P 2 A_PlaySoundEx("spas/pump","SoundSlot6")
	SPSF P 0 A_SpawnItemEx("ShellCasing",Cos(Pitch)*30,-2,32-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    SPSX QRSTUV 2
    SPSX W 1
    SPSX W 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    SPSF FF 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    SPSF A 0 A_JumpIfInventory("SPAS12Ammo",1,1)
    Goto Ready+23
    SPSF A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+23
  FireAimEmpty:
    SPSF G 0 A_PlayWeaponSound("spas/fireempty")
    SPSF G 0 A_FireCustomMissile("WeaponSmokePuffShotgun",3,0,-4,2)
    SPSF G 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,0,5)
    SPSF G 0 A_FireCustomMissile("WeaponSmokePuffShotgun",-3,0,4,2)
    SPSF G 0 A_FireCustomMissile("WeaponSmokePuff_ShotMuzzle",0,0,0,5)
    SPSF GGGGG 0 BRIGHT A_FireCustomMissile("HHCBSPAS1", frandom(-2.00,2.00), 0, 0, 4, 0, frandom(-2.00,2.00))
    SPSF GGGGGGG 0 BRIGHT A_FireCustomMissile("HHCBSPAS2", frandom(-2.00,2.00), 0, 0, 4, 0, frandom(-2.00,2.00))
    SPSF G 1 BRIGHT A_FireCustomMissile("HHCBSPAS2", frandom(-2.00,2.00), 1, 0, 4, 0, frandom(-2.00,2.00))
    SPSF G 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    SPSF H 1 BRIGHT A_GunFlash
    SPSF I 1 BRIGHT
    SPSF JKL 1
    SPSF M 1 A_GiveInventory("SPASBolt",1)
    SPSF A 0 A_JumpIfInventory("SPAS12Ammo",1,1)
    Goto Ready+23
    SPSF A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+23
  Fire_SteadyAim:
	SPSB A 0 A_JumpIfInventory("SPASClip",2,1)
	Goto FireEmpty_SteadyAim
    SPSB A 0 A_PlayWeaponSound("spas/fireempty")
    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_ShotMuzzle",0,0,8,3)
    SPSB AAAAA 0 BRIGHT A_FireCustomMissile("HHCBSPAS1", frandom(-5.00,5.00), 0, 0, 4, 0, frandom(-4.00,4.00))
    SPSB AAAAAAA 0 BRIGHT A_FireCustomMissile("HHCBSPAS2", frandom(-5.00,5.00), 0, 0, 4, 0, frandom(-4.00,4.00))
    SPSB A 1 BRIGHT A_FireCustomMissile("HHCBSPAS2", frandom(-5.00,5.00), 1, 0, 4, 0, frandom(-4.00,4.00))
    SPSB A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    SPSB B 1 BRIGHT A_GunFlash
    SPSB C 1 BRIGHT
    SPSB DEFG 1
    SPSB HIJ 2
    SPSB K 2 A_PlaySoundEx("spas/pump","SoundSlot6")
	SPSB K 0 A_SpawnItemEx("ShellCasing",Cos(Pitch)*30,-2,25-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    SPSB LMNOP 2
    SPSB Q 1
    SPSB QRR 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    SPSB A 0 A_JumpIfInventory("SPAS12Ammo",1,1)
    Goto Ready+17
    SPSB A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+17
  FireEmpty_SteadyAim:
    SPSB A 0 A_PlayWeaponSound("spas/fireempty")
    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_ShotMuzzle",0,0,8,3)
    SPSB AAAAA 0 BRIGHT A_FireCustomMissile("HHCBSPAS1", frandom(-5.00,5.00), 0, 0, 4, 0, frandom(-4.00,4.00))
    SPSB AAAAAAA 0 BRIGHT A_FireCustomMissile("HHCBSPAS2", frandom(-5.00,5.00), 0, 0, 4, 0, frandom(-4.00,4.00))
    SPSB A 1 BRIGHT A_FireCustomMissile("HHCBSPAS2", frandom(-5.00,5.00), 1, 0, 4, 0, frandom(-4.00,4.00))
    SPSB A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    SPSB B 1 BRIGHT A_GunFlash
    SPSB C 1 BRIGHT
    SPSB DEF 1
    SPSB G 1 A_GiveInventory("SPASBolt",1)
    SPSB A 0 A_JumpIfInventory("SPAS12Ammo",1,1)
    Goto Ready+17
    SPSB A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+17
  ReloadStart_SOH:
    SPSD A 2 A_GiveInventory("ReloadingShot",1)
    SPSC B 2 A_PlaySoundEx("m9/select","SoundSlot5")
    SPSC C 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SPSC DEF 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    Goto ReloadAmmo_SOH
  ReloadAmmo_SOH:
    SPSC O 0 A_JumpIfInventory("SPASClip",8,"ReloadEnd_SOH")
    SPSC O 0 A_JumpIfInventory("SPAS12Ammo",1,1)
    Goto ReloadEnd_SOH
    SPSC HIJ 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SPSC K 0 A_GiveInventory("SPASClip",1)
    SPSC K 0 A_TakeInventory("SPAS12Ammo",1)
    SPSC K 2 A_PlaySoundEx("spas/insert","SoundSlot6")
    SPSC LMNO 2 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    SPSC O 0 A_JumpIfInventory("SPASClip",8,"ReloadEnd_SOH")
    SPSC O 0 A_JumpIfInventory("SPASBolt",1,"ReloadPump_SOH")
    Goto ReloadAmmo_SOH
  ReloadPump_SOH:
    SPSC QRS 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SPSC T 2 A_PlaySoundEx("spas/pump","SoundSlot6")
    SPSC U 2 A_TakeInventory("SPASBolt",1)
	SPSC VUTSRQ 2 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    SPSC Q 0 A_JumpIfInventory("SPASClip",8,"ReloadEnd_SOH")
    SPSC Q 0 A_JumpIfInventory("SPAS12Ammo",1,"ReloadAmmo_SOH")
  ReloadEnd_SOH:
    SPSC Q 0 A_JumpIfInventory("SPASBolt",1,"ReloadEndPump_SOH")
    SPSC FEDCBA 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SPSC A 0 A_TakeInventory("ReloadingShot",1)
    SPSC A 0 A_TakeInventory("Reloading",1)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+17
  ReloadEndPump_SOH:
    SPSC QRS 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SPSC T 2 A_PlaySoundEx("spas/pump","SoundSlot6")
    SPSC T 0 A_TakeInventory("SPASBolt",1)
    SPSC UVWXYZ 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SPSD A 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SPSD A 0 A_TakeInventory("ReloadingShot",1)
    SPSD A 0 A_TakeInventory("Reloading",1)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+17
  FragGrenade:
    U45F A 0 ACS_NamedExecuteAlways("RefSpeak",0,1,0,0)
    U45F A 0 A_ZoomFactor(1.0)
    U45A L 0 A_TakeInventory("Aiming",1)
    U45A L 0 A_TakeInventory("Reloading",1)
    U45A L 0 A_TakeInventory("ReloadingShot",1)
    U45F A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
	M4CA J 0 A_JumpIfInventory("ThrowingStun",1,"StunGrenade")
	M4CA J 0 A_JumpIfInventory("ThrowingIncd",1,"IncGrenade")
    U45A L 0 A_JumpIfInventory("Perk1_SOH_Pro",1,"FragGrenade_SOH")
    GRNA ABC 2
    GRNA D 2 A_PlaySound("grenade/pinpull")
    GRNA EFGH 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("GrenadeAmmo",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",frandom(-2.00,2.00),0,0,16,0,frandom(-1.50,1.50))
    GRNA MN 2
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+3
  FragGrenade_SOH:
    GRNA ABC 1
    GRNA D 1 A_PlaySound("grenade/pinpull")
    GRNA EFGH 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("GrenadeAmmo",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",frandom(-2.00,2.00),0,0,16,0,frandom(-1.50,1.50))
    GRNA MN 1
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+3
  KnifeAttack:
    GRNA L 0 A_TakeInventory("weapondropper",2)
    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)
    U45A L 0 A_TakeInventory("ReloadingShot",1)
    U45F A 0 ACS_NamedExecuteAlways("RefSpeed",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_NamedExecuteAlways("RefSlash",0,0,0,0)
    KNFA AB 1
    KNFA B 0 A_PlaySound("knife/swing")
    KNFA C 1 A_CustomPunch(102,1,0,"KnifePuff",104)
    KNFA DEFGHIJKL 1
    TNT1 A 20
    GRNA L 0 A_TakeInventory("ThrowingGrenade",1)
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+3
  KnifeAttack_Commando:
    KNFA A 0 ACS_NamedExecuteAlways("RefSlash",0,0,0,0)
    KNFA AB 1
    KNFA B 0 A_PlaySound("knife/swing")
    KNFA C 1 A_CustomPunch(102,1,0,"KnifePuff",160)
    KNFA DEFGHIJKL 1
    TNT1 A 20
    GRNA L 0 A_TakeInventory("ThrowingGrenade",1)
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+3
  KnifeAttack_SOH:
    U45C A 0 A_JumpIfInventory("Perk3_Commando",1,"KnifeAttack_SOH_Commando")
    KNFA A 0 ACS_NamedExecuteAlways("RefSlash",0,0,0,0)
    KNFA AB 1
    KNFA B 0 A_PlaySound("knife/swing")
    KNFA C 1 A_CustomPunch(102,1,0,"KnifePuff",104)
    KNFA DEFGHIJKL 1
    TNT1 A 10
    GRNA L 0 A_TakeInventory("ThrowingGrenade",1)
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+3
  KnifeAttack_SOH_Commando:
    KNFA A 0 ACS_NamedExecuteAlways("RefSlash",0,0,0,0)
    KNFA AB 1
    KNFA B 0 A_PlaySound("knife/swing")
    KNFA C 1 A_CustomPunch(102,1,0,"KnifePuff",160)
    KNFA DEFGHIJKL 1
    TNT1 A 10
    GRNA L 0 A_TakeInventory("ThrowingGrenade",1)
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+3
  StunGrenade:
    U45A L 0 A_JumpIfInventory("Perk1_SOH_Pro",1,"StunGrenade_SOH")
    GRNA ABC 2
    GRNA D 2 A_PlaySound("grenade/pinpull")
    GRNA EFGH 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("StunAmmo",1)
    GRNA L 0 A_TakeInventory("ThrowingGrenade",1)
	GRNA L 0 A_TakeInventory("ThrowingStun",1)
	GRNA L 0 A_TakeInventory("ThrowingIncd",1)
    U45A L 0 A_TakeInventory("Aiming",1)
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
    GRNA L 2 A_FireCustomMissile("StunGrenade",frandom(-2.00,2.00),0,0,16,0,frandom(-1.50,1.50))
    GRNA MN 2
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+3
  IncGrenade:
    U45A L 0 A_JumpIfInventory("Perk1_SOH_Pro",1,"IncGrenade_SOH")
    GRNA ABC 2
    GRNA D 2 A_PlaySound("grenade/pinpull")
    GRNA EFGH 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("IncdAmmo",1)
    GRNA L 0 A_TakeInventory("ThrowingGrenade",1)
	GRNA L 0 A_TakeInventory("ThrowingStun",1)
	GRNA L 0 A_TakeInventory("ThrowingIncd",1)
    U45A L 0 A_TakeInventory("Aiming",1)
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
    GRNA L 2 A_FireCustomMissile("IncGrenade",frandom(-2.00,2.00),0,0,16,0,frandom(-1.50,1.50))
    GRNA MN 2
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+3
  StunGrenade_SOH:
    GRNA ABC 1
    GRNA D 1 A_PlaySound("grenade/pinpull")
    GRNA EFGH 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("StunAmmo",1)
    GRNA L 0 A_TakeInventory("ThrowingGrenade",1)
	GRNA L 0 A_TakeInventory("ThrowingStun",1)
	GRNA L 0 A_TakeInventory("ThrowingIncd",1)
    U45A L 0 A_TakeInventory("Aiming",1)
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
    GRNA L 1 A_FireCustomMissile("StunGrenade",frandom(-2.00,2.00),0,0,16,0,frandom(-1.50,1.50))
    GRNA MN 1
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+3
  IncGrenade_SOH:
    GRNA ABC 1
    GRNA D 1 A_PlaySound("grenade/pinpull")
    GRNA EFGH 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("IncdAmmo",1)
    GRNA L 0 A_TakeInventory("ThrowingGrenade",1)
	GRNA L 0 A_TakeInventory("ThrowingStun",1)
	GRNA L 0 A_TakeInventory("ThrowingIncd",1)
    U45A L 0 A_TakeInventory("Aiming",1)
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
    GRNA L 1 A_FireCustomMissile("IncGrenade",frandom(-2.00,2.00),0,0,16,0,frandom(-1.50,1.50))
    GRNA MN 1
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+3
  DropWeapon:
    SPSA ONMLKJIHGFEDCB 2 A_WeaponReady(WRF_NOPRIMARY)
	SPSA A 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	M4CC F 0 A_JumpIfInventory("weapondropper",2,"ThrowWeapon")
    KNFA A 0 ACS_NamedExecuteAlways("RefDropW",0,0,0,0)
	GRNA L 0 A_TakeInventory("weapondropper",1)
	M4CB A 0 A_FireCustomMissile("SpasDropped",0,0,7,2)
	stop
  ThrowWeapon:
    GRNA IKMN 1
	KNFA B 0 A_PlaySound("knife/swing")
    KNFA A 0 ACS_NamedExecuteAlways("RefDropW",0,0,0,0)
	GRNA L 0 A_TakeInventory("weapondropper",2)
	M4CB A 0 A_FireCustomMissile("SpasThrown",0,0,7,2)
	stop
  }
}

actor SPASClip : Ammo
{
    inventory.icon "CLIPA0"
    inventory.amount 0
    inventory.maxamount 8
    ammo.backpackamount 0
    ammo.backpackmaxamount 8
    +IGNORESKILL
}
actor SPASBolt : Inventory
{
    inventory.amount 0
    inventory.maxamount 1
}

actor "Franchi SPAS-12 Ex Mags" : "Franchi SPAS-12"
{
  obituary "%k smacked %o over with the SPAS-12."
  inventory.pickupmessage "You got the Franchi SPAS-12 dual-mode shotgun."
  //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
  {
  Ready:
    M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    GRNA L 0 A_TakeInventory("weapondropper",2)
    SPSA C 0 A_PlaySoundEx("weapon/draw","SoundSlot5")
    SPSA DEFG 2 A_WeaponReady(WRF_NOPRIMARY|WRF_ALLOWZOOM)
	SPSA HIJKLMNOP 2 A_WeaponReady(WRF_ALLOWZOOM)
    SPSA P 0 A_JumpIfNoAmmo("Reload")
	W18A J 0 A_JumpIfInventory("weapondropper",1,"DropWeapon")
    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(WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
    Goto Ready+17
    SPSF F 0 A_JumpIfInventory("Reloading",1,"Reload")
  ReadyAim:
    SPSF F 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    SPSF F 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	W18A I 0 A_JumpIfInventory("weapondropper",1,"AltFire3")
    SPSF F 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
    Goto Ready+23
  Fire:
    SPSA P 0 A_JumpIfInventory("ReloadingShot",1,"ReloadEndStop")
    SPSA P 0 A_JumpIfInventory("Aiming",1,"FireAim")
    SPSA P 1 A_JumpIfNoAmmo("ReloadStart")
    SPSB A 0 A_JumpIfInventory("SPASBolt",1,"Pump")
    SPSB A 0 A_JumpIfInventory("Perk3_SteadyAim",1,"Fire_SteadyAim")
	SPSB A 0 A_JumpIfInventory("SPASClip2",2,1)
	Goto FireEmpty
    SPSB A 0 A_PlayWeaponSound("spas/fireempty")
    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_ShotMuzzle",0,0,8,3)
    SPSB AAAAA 0 BRIGHT A_FireCustomMissile("HHCBSPAS1", frandom(-6.00,6.00), 0, 0, 4, 0, frandom(-5.00,5.00))
    SPSB AAAAAAA 0 BRIGHT A_FireCustomMissile("HHCBSPAS2", frandom(-6.00,6.00), 0, 0, 4, 0, frandom(-5.00,5.00))
    SPSB A 1 BRIGHT A_FireCustomMissile("HHCBSPAS2", frandom(-6.00,6.00), 1, 0, 4, 0, frandom(-5.00,5.00))
    SPSB A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    SPSB B 1 BRIGHT A_GunFlash
    SPSB C 1 BRIGHT
    SPSB DEFG 1
    SPSB HIJ 2
    SPSB K 2 A_PlaySoundEx("spas/pump","SoundSlot6")
	SPSB K 0 A_SpawnItemEx("ShellCasing",Cos(Pitch)*30,-2,25-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    SPSB LMNOP 2
    SPSB Q 1
    SPSB QRR 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    SPSB A 0 A_JumpIfInventory("SPAS12Ammo",1,1)
    Goto Ready+17
    SPSB A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+17
  FireEmpty:
    SPSB A 0 A_PlayWeaponSound("spas/fireempty")
    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_ShotMuzzle",0,0,8,3)
    SPSB AAAAA 0 BRIGHT A_FireCustomMissile("HHCBSPAS1", frandom(-6.00,6.00), 0, 0, 4, 0, frandom(-5.00,5.00))
    SPSB AAAAAAA 0 BRIGHT A_FireCustomMissile("HHCBSPAS2", frandom(-6.00,6.00), 0, 0, 4, 0, frandom(-5.00,5.00))
    SPSB A 1 BRIGHT A_FireCustomMissile("HHCBSPAS2", frandom(-6.00,6.00), 1, 0, 4, 0, frandom(-5.00,5.00))
    SPSB A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    SPSB B 1 BRIGHT A_GunFlash
    SPSB C 1 BRIGHT
    SPSB DEF 1
    SPSB G 1 A_GiveInventory("SPASBolt",1)
    SPSB A 0 A_JumpIfInventory("SPAS12Ammo",1,1)
    Goto Ready+17
    SPSB A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+17
  FireAim:
    SPSF F 1 A_JumpIfNoAmmo("ReloadStart")
    SPSB A 0 A_JumpIfInventory("SPASBolt",1,"PumpAim")
	SPSB A 0 A_JumpIfInventory("SPASClip2",2,1)
	Goto FireAimEmpty
    SPSF G 0 A_PlayWeaponSound("spas/fireempty")
    SPSF G 0 A_FireCustomMissile("WeaponSmokePuffShotgun",3,0,-4,2)
    SPSF G 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,0,5)
    SPSF G 0 A_FireCustomMissile("WeaponSmokePuffShotgun",-3,0,4,2)
    SPSF G 0 A_FireCustomMissile("WeaponSmokePuff_ShotMuzzle",0,0,0,5)
    SPSF G 0 A_FireCustomMissile("WeaponSmokePuff_ShotMuzzle",0,0,0,5)
    SPSF GGGGG 0 BRIGHT A_FireCustomMissile("HHCBSPAS1", frandom(-2.00,2.00), 0, 0, 4, 0, frandom(-2.00,2.00))
    SPSF GGGGGGG 0 BRIGHT A_FireCustomMissile("HHCBSPAS2", frandom(-2.00,2.00), 0, 0, 4, 0, frandom(-2.00,2.00))
    SPSF G 1 BRIGHT A_FireCustomMissile("HHCBSPAS2", frandom(-2.00,2.00), 1, 0, 4, 0, frandom(-2.00,2.00))
    SPSF G 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    SPSF G 0 A_JumpIfInventory("SPASSwitch",1,"FireAimAlt")
    SPSF H 1 BRIGHT A_GunFlash
    SPSF I 1 BRIGHT
    SPSF JKLM 1
    SPSF NO 2
    SPSF P 2 A_PlaySoundEx("spas/pump","SoundSlot6")
	SPSF P 0 A_SpawnItemEx("ShellCasing",Cos(Pitch)*30,-2,32-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    SPSF QRSTUV 2
    SPSF W 1
    SPSF WFF 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    SPSF A 0 A_JumpIfInventory("SPAS12Ammo",1,1)
    Goto Ready+23
    SPSF A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+23
  FireAimAlt:
    SPSF H 1 BRIGHT A_GunFlash
    SPSF I 1 BRIGHT
    SPSF JKLM 1
    SPSX NO 2
    SPSX P 2 A_PlaySoundEx("spas/pump","SoundSlot6")
	SPSF P 0 A_SpawnItemEx("ShellCasing",Cos(Pitch)*30,-2,32-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    SPSX QRSTUV 2
    SPSX W 1
    SPSX W 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    SPSF FF 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    SPSF A 0 A_JumpIfInventory("SPAS12Ammo",1,1)
    Goto Ready+23
    SPSF A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+23
  FireAimEmpty:
    SPSF G 0 A_PlayWeaponSound("spas/fireempty")
    SPSF G 0 A_FireCustomMissile("WeaponSmokePuffShotgun",3,0,-4,2)
    SPSF G 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,0,5)
    SPSF G 0 A_FireCustomMissile("WeaponSmokePuffShotgun",-3,0,4,2)
    SPSF G 0 A_FireCustomMissile("WeaponSmokePuff_ShotMuzzle",0,0,0,5)
    SPSF GGGGG 0 BRIGHT A_FireCustomMissile("HHCBSPAS1", frandom(-2.00,2.00), 0, 0, 4, 0, frandom(-2.00,2.00))
    SPSF GGGGGGG 0 BRIGHT A_FireCustomMissile("HHCBSPAS2", frandom(-2.00,2.00), 0, 0, 4, 0, frandom(-2.00,2.00))
    SPSF G 1 BRIGHT A_FireCustomMissile("HHCBSPAS2", frandom(-2.00,2.00), 1, 0, 4, 0, frandom(-2.00,2.00))
    SPSF G 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    SPSF H 1 BRIGHT A_GunFlash
    SPSF I 1 BRIGHT
    SPSF JKL 1
    SPSF M 1 A_GiveInventory("SPASBolt",1)
    SPSF A 0 A_JumpIfInventory("SPAS12Ammo",1,1)
    Goto Ready+23
    SPSF A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+23
  Fire_SteadyAim:
	SPSB A 0 A_JumpIfInventory("SPASClip2",2,1)
	Goto FireEmpty_SteadyAim
    SPSB A 0 A_PlayWeaponSound("spas/fireempty")
    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_ShotMuzzle",0,0,8,3)
    SPSB AAAAA 0 BRIGHT A_FireCustomMissile("HHCBSPAS1", frandom(-5.00,5.00), 0, 0, 4, 0, frandom(-4.00,4.00))
    SPSB AAAAAAA 0 BRIGHT A_FireCustomMissile("HHCBSPAS2", frandom(-5.00,5.00), 0, 0, 4, 0, frandom(-4.00,4.00))
    SPSB A 1 BRIGHT A_FireCustomMissile("HHCBSPAS2", frandom(-5.00,5.00), 1, 0, 4, 0, frandom(-4.00,4.00))
    SPSB A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    SPSB B 1 BRIGHT A_GunFlash
    SPSB C 1 BRIGHT
    SPSB DEFG 1
    SPSB HIJ 2
    SPSB K 2 A_PlaySoundEx("spas/pump","SoundSlot6")
	SPSB K 0 A_SpawnItemEx("ShellCasing",Cos(Pitch)*30,-2,25-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    SPSB LMNOP 2
    SPSB Q 1
    SPSB QRR 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    SPSB A 0 A_JumpIfInventory("SPAS12Ammo",1,1)
    Goto Ready+17
    SPSB A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+17
  FireEmpty_SteadyAim:
    SPSB A 0 A_PlayWeaponSound("spas/fireempty")
    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_ShotMuzzle",0,0,8,3)
    SPSB AAAAA 0 BRIGHT A_FireCustomMissile("HHCBSPAS1", frandom(-5.00,5.00), 0, 0, 4, 0, frandom(-4.00,4.00))
    SPSB AAAAAAA 0 BRIGHT A_FireCustomMissile("HHCBSPAS2", frandom(-5.00,5.00), 0, 0, 4, 0, frandom(-4.00,4.00))
    SPSB A 1 BRIGHT A_FireCustomMissile("HHCBSPAS2", frandom(-5.00,5.00), 1, 0, 4, 0, frandom(-4.00,4.00))
    SPSB A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    SPSB B 1 BRIGHT A_GunFlash
    SPSB C 1 BRIGHT
    SPSB DEF 1
    SPSB G 1 A_GiveInventory("SPASBolt",1)
    SPSB A 0 A_JumpIfInventory("SPAS12Ammo",1,1)
    Goto Ready+17
    SPSB A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+17
  Reload: //AltFire:
    VECC A 0 A_JumpIfInventory("SPASClip2",12,2)
    VECC A 0 A_JumpIfInventory("SPAS12Ammo",1,"ReloadStart")
    VECC A 0 A_TakeInventory("Reloading",1)
    VECC A 0 A_JumpIfInventory("Aiming",1,"ReadyAim")
    Goto Ready+20
  ReloadStart:
    SPSC A 0 A_JumpIfInventory("SPASClip2",7,2)
    SPSC A 0 ACS_NamedExecuteAlways("RefSpeak",0,4,0,0)
    SPSC A 0 A_JumpIfInventory("Aiming",1,"ReloadStartAim")
    SPSC A 3 A_JumpIfInventory("Perk1_SOH",1,"ReloadStart_SOH")
    SPSD B 0 A_GiveInventory("ReloadingShot",1)
    SPSC B 3 A_PlaySoundEx("m9/select","SoundSlot5")
    SPSC C 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SPSC DEF 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    Goto ReloadAmmo
  ReloadAmmo:
    SPSC O 0 A_JumpIfInventory("SPASClip2",12,"ReloadEnd")
    SPSC O 0 A_JumpIfInventory("SPAS12Ammo",1,1)
    Goto ReloadEnd
    SPSC HI 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SPSC J 0 A_GiveInventory("SPASClip2",1)
    SPSC J 0 A_TakeInventory("SPAS12Ammo",1)
    SPSC J 3 A_PlaySoundEx("spas/insert","SoundSlot6")
    SPSC LMNO 3 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    SPSC O 0 A_JumpIfInventory("SPASClip2",12,"ReloadEnd")
    SPSC O 0 A_JumpIfInventory("SPASBolt",1,"ReloadPump")
    Goto ReloadAmmo
  ReloadPump:
    SPSC QRS 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SPSC T 2 A_PlaySoundEx("spas/pump","SoundSlot6")
    SPSC U 2 A_TakeInventory("SPASBolt",1)
	SPSC VUTSRQ 2 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    SPSC Q 0 A_JumpIfInventory("SPASClip2",12,"ReloadEnd")
    SPSC Q 0 A_JumpIfInventory("SPAS12Ammo",1,"ReloadAmmo")
  ReloadStart_SOH:
    SPSD A 2 A_GiveInventory("ReloadingShot",1)
    SPSC B 2 A_PlaySoundEx("m9/select","SoundSlot5")
    SPSC C 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SPSC DEF 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    Goto ReloadAmmo_SOH
  ReloadAmmo_SOH:
    SPSC O 0 A_JumpIfInventory("SPASClip2",12,"ReloadEnd_SOH")
    SPSC O 0 A_JumpIfInventory("SPAS12Ammo",1,1)
    Goto ReloadEnd_SOH
    SPSC HI 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SPSC J 0 A_GiveInventory("SPASClip2",1)
    SPSC J 0 A_TakeInventory("SPAS12Ammo",1)
    SPSC J 2 A_PlaySoundEx("spas/insert","SoundSlot6")
    SPSC LMNO 2 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    SPSC O 0 A_JumpIfInventory("SPASClip2",12,"ReloadEnd_SOH")
    SPSC O 0 A_JumpIfInventory("SPASBolt",1,"ReloadPump_SOH")
    Goto ReloadAmmo_SOH
  ReloadPump_SOH:
    SPSC QRS 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SPSC T 2 A_PlaySoundEx("spas/pump","SoundSlot6")
    SPSC U 2 A_TakeInventory("SPASBolt",1)
	SPSC VUTSRQ 2 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    SPSC Q 0 A_JumpIfInventory("SPASClip2",12,"ReloadEnd_SOH")
    SPSC Q 0 A_JumpIfInventory("SPAS12Ammo",1,"ReloadAmmo_SOH")
  ReloadStartAim:
    SPSF F 0 A_ZoomFactor(1.0)
    SPSF FE 1
    SPSF E 0 A_TakeInventory("Aiming",1)
    SPSF DCBA 1
    SPSF A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    Goto ReloadStart+3
  ReloadBreak:
    SPSF F 0 A_ZoomFactor(1.0)
    SPSF FE 1
    SPSF E 0 A_TakeInventory("Aiming",1)
    SPSF DCBA 1
    SPSF A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
	TNT1 A 0 A_ClearReFire
    Goto Reload
  FireAimAltHold:
    "####" "#" 0 A_JumpIfInventory("SPASClip2",1,1)
	Goto ReloadBreak
    //SPSB A 0 A_JumpIfInventory("SPASBolt",1,"PumpAim")
    SPSF G 0 A_PlayWeaponSound("spas/fireempty")
	GRNA L 0 A_TakeInventory("SPASClip2",1)
    SPSF G 0 A_FireCustomMissile("WeaponSmokePuffShotgun",3,0,-4,2)
    SPSF G 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,0,5)
    SPSF G 0 A_FireCustomMissile("WeaponSmokePuffShotgun",-3,0,4,2)
    SPSF G 0 A_FireCustomMissile("WeaponSmokePuff_ShotMuzzle",0,0,0,5)
    SPSF GGGGG 0 BRIGHT A_FireCustomMissile("HHCBSPAS1", frandom(-2.00,2.00), 0, 0, 4, 0, frandom(-2.00,2.00))
    SPSF GGGGGGG 0 BRIGHT A_FireCustomMissile("HHCBSPAS2", frandom(-2.00,2.00), 0, 0, 4, 0, frandom(-2.00,2.00))
    SPSF G 1 BRIGHT A_FireCustomMissile("HHCBSPAS2", frandom(-2.00,2.00), 1, 0, 4, 0, frandom(-2.00,2.00))
    SPSF G 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    SPSF G 0 A_JumpIfInventory("SPASSwitch",1,"FireAimAlt2")
    SPSF H 1 BRIGHT A_GunFlash
    SPSF I 1 BRIGHT
    SPSF JKLM 1
    SPSF NO 2
    SPSF P 2 A_PlaySoundEx("spas/pump","SoundSlot6")
	SPSF P 0 A_SpawnItemEx("ShellCasing",Cos(Pitch)*30,-2,32-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    SPSF QRSTUV 2
    SPSF W 1
    SPSF W 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    "####" "#" 0 A_JumpIfInventory("SPASClip2",1,1)
	Goto ReloadBreak
	TNT1 A 0
    Goto AltHold
  FireAimAlt2:
    SPSF H 1 BRIGHT A_GunFlash
    SPSF I 1 BRIGHT
    SPSF JKLM 1
    SPSX NO 2
    SPSX P 2 A_PlaySoundEx("spas/pump","SoundSlot6")
	SPSF P 0 A_SpawnItemEx("ShellCasing",Cos(Pitch)*30,-2,32-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    SPSX QRSTUV 2
    SPSX W 1
    SPSX W 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    "####" "#" 0 A_JumpIfInventory("SPASClip2",1,1)
	Goto ReloadBreak
	TNT1 A 0
    Goto AltHold
  }
}

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

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

actor "Franchi SPAS-12 Grip" : "Franchi SPAS-12"
{
  obituary "%k smacked %o over with the SPAS-12."
  inventory.pickupmessage "You got the Franchi SPAS-12 dual-mode shotgun."
  //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("ReloadingShot",1,"ReloadEndStop")
    SPSA P 0 A_JumpIfInventory("Aiming",1,"FireAim")
    SPSA P 1 A_JumpIfNoAmmo("ReloadStart")
    SPSB A 0 A_JumpIfInventory("SPASBolt",1,"Pump")
    SPSB A 0 A_JumpIfInventory("Perk3_SteadyAim",1,"Fire_SteadyAim")
	SPSB A 0 A_JumpIfInventory("SPASClip",2,1)
	Goto FireEmpty
    SPSB A 0 A_PlayWeaponSound("spas/fireempty")
    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_ShotMuzzle",0,0,8,3)
    SPSB AAAAA 0 BRIGHT A_FireCustomMissile("HHCBSPAS1G", frandom(-5.00,5.00), 0, 0, 4, 0, frandom(-4.00,4.00))
    SPSB AAAAAAA 0 BRIGHT A_FireCustomMissile("HHCBSPAS2G", frandom(-5.00,5.00), 0, 0, 4, 0, frandom(-4.00,4.00))
    SPSB A 1 BRIGHT A_FireCustomMissile("HHCBSPAS2G", frandom(-5.00,5.00), 1, 0, 4, 0, frandom(-4.00,4.00))
    SPSB A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    SPSB B 1 BRIGHT A_GunFlash
    SPSB C 1 BRIGHT
    SPSB DEFG 1
    SPSB HIJ 2
    SPSB K 2 A_PlaySoundEx("spas/pump","SoundSlot6")
	SPSB K 0 A_SpawnItemEx("ShellCasing",Cos(Pitch)*30,-2,25-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    SPSB LMNOP 2
    SPSB Q 1
    SPSB QRR 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    SPSB A 0 A_JumpIfInventory("SPAS12Ammo",1,1)
    Goto Ready+17
    SPSB A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+17
  FireEmpty:
    SPSB A 0 A_PlayWeaponSound("spas/fireempty")
    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_ShotMuzzle",0,0,8,3)
    SPSB AAAAA 0 BRIGHT A_FireCustomMissile("HHCBSPAS1G", frandom(-5.00,5.00), 0, 0, 4, 0, frandom(-4.00,4.00))
    SPSB AAAAAAA 0 BRIGHT A_FireCustomMissile("HHCBSPAS2G", frandom(-5.00,5.00), 0, 0, 4, 0, frandom(-4.00,4.00))
    SPSB A 1 BRIGHT A_FireCustomMissile("HHCBSPAS2G", frandom(-5.00,5.00), 1, 0, 4, 0, frandom(-4.00,4.00))
    SPSB A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    SPSB B 1 BRIGHT A_GunFlash
    SPSB C 1 BRIGHT
    SPSB DEF 1
    SPSB G 1 A_GiveInventory("SPASBolt",1)
    SPSB A 0 A_JumpIfInventory("SPAS12Ammo",1,1)
    Goto Ready+17
    SPSB A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+17
  FireAim:
    SPSF F 1 A_JumpIfNoAmmo("ReloadStart")
    SPSB A 0 A_JumpIfInventory("SPASBolt",1,"PumpAim")
	SPSB A 0 A_JumpIfInventory("SPASClip",2,1)
	Goto FireAimEmpty
    SPSF G 0 A_PlayWeaponSound("spas/fireempty")
    SPSF G 0 A_FireCustomMissile("WeaponSmokePuffShotgun",3,0,-4,2)
    SPSF G 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,0,5)
    SPSF G 0 A_FireCustomMissile("WeaponSmokePuffShotgun",-3,0,4,2)
    SPSF G 0 A_FireCustomMissile("WeaponSmokePuff_ShotMuzzle",0,0,0,5)
    SPSF GGGGG 0 BRIGHT A_FireCustomMissile("HHCBSPAS1G", frandom(-1.35,1.35), 0, 0, 4, 0, frandom(-1.35,1.35))
    SPSF GGGGGGG 0 BRIGHT A_FireCustomMissile("HHCBSPAS2G", frandom(-1.35,1.35), 0, 0, 4, 0, frandom(-1.35,1.35))
    SPSF G 1 BRIGHT A_FireCustomMissile("HHCBSPAS2G", frandom(-1.35,1.35), 1, 0, 4, 0, frandom(-1.35,1.35))
    SPSF G 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    SPSF G 0 A_JumpIfInventory("SPASSwitch",1,"FireAimAlt")
    SPSF H 1 BRIGHT A_GunFlash
    SPSF I 1 BRIGHT
    SPSF JKLM 1
    SPSF NO 2
    SPSF P 2 A_PlaySoundEx("spas/pump","SoundSlot6")
	SPSF P 0 A_SpawnItemEx("ShellCasing",Cos(Pitch)*30,-2,32-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    SPSF QRSTUV 2
    SPSF W 1
    SPSF WFF 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    SPSF A 0 A_JumpIfInventory("SPAS12Ammo",1,1)
    Goto Ready+23
    SPSF A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+23
  FireAimAlt:
    SPSF H 1 BRIGHT A_GunFlash
    SPSF I 1 BRIGHT
    SPSF JKLM 1
    SPSX NO 2
    SPSX P 2 A_PlaySoundEx("spas/pump","SoundSlot6")
	SPSF P 0 A_SpawnItemEx("ShellCasing",Cos(Pitch)*30,-2,32-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    SPSX QRSTUV 2
    SPSX W 1
    SPSX W 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    SPSF FF 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    SPSF A 0 A_JumpIfInventory("SPAS12Ammo",1,1)
    Goto Ready+23
    SPSF A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+23
  FireAimEmpty:
    SPSF G 0 A_PlayWeaponSound("spas/fireempty")
    SPSF G 0 A_FireCustomMissile("WeaponSmokePuffShotgun",3,0,-4,2)
    SPSF G 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,0,5)
    SPSF G 0 A_FireCustomMissile("WeaponSmokePuffShotgun",-3,0,4,2)
    SPSF G 0 A_FireCustomMissile("WeaponSmokePuff_ShotMuzzle",0,0,0,5)
    SPSF GGGGG 0 BRIGHT A_FireCustomMissile("HHCBSPAS1G", frandom(-1.35,1.35), 0, 0, 4, 0, frandom(-1.35,1.35))
    SPSF GGGGGGG 0 BRIGHT A_FireCustomMissile("HHCBSPAS2G", frandom(-1.35,1.35), 0, 0, 4, 0, frandom(-1.35,1.35))
    SPSF G 1 BRIGHT A_FireCustomMissile("HHCBSPAS2G", frandom(-1.35,1.35), 1, 0, 4, 0, frandom(-1.35,1.35))
    SPSF G 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    SPSF H 1 BRIGHT A_GunFlash
    SPSF I 1 BRIGHT
    SPSF JKL 1
    SPSF M 1 A_GiveInventory("SPASBolt",1)
    SPSF A 0 A_JumpIfInventory("SPAS12Ammo",1,1)
    Goto Ready+23
    SPSF A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+23
  Fire_SteadyAim:
	SPSB A 0 A_JumpIfInventory("SPASClip",2,1)
	Goto FireEmpty_SteadyAim
    SPSB A 0 A_PlayWeaponSound("spas/fireempty")
    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_ShotMuzzle",0,0,8,3)
    SPSB AAAAA 0 BRIGHT A_FireCustomMissile("HHCBSPAS1G", frandom(-4.00,4.00), 0, 0, 4, 0, frandom(-3.00,3.00))
    SPSB AAAAAAA 0 BRIGHT A_FireCustomMissile("HHCBSPAS2G", frandom(-4.00,4.00), 0, 0, 4, 0, frandom(-3.00,3.00))
    SPSB A 1 BRIGHT A_FireCustomMissile("HHCBSPAS2G", frandom(-4.00,4.00), 1, 0, 4, 0, frandom(-3.00,3.00))
    SPSB A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    SPSB B 1 BRIGHT A_GunFlash
    SPSB C 1 BRIGHT
    SPSB DEFG 1
    SPSB HIJ 2
    SPSB K 2 A_PlaySoundEx("spas/pump","SoundSlot6")
	SPSB K 0 A_SpawnItemEx("ShellCasing",Cos(Pitch)*30,-2,25-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    SPSB LMNOP 2
    SPSB Q 1
    SPSB QRR 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    SPSB A 0 A_JumpIfInventory("SPAS12Ammo",1,1)
    Goto Ready+17
    SPSB A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+17
  FireEmpty_SteadyAim:
    SPSB A 0 A_PlayWeaponSound("spas/fireempty")
    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_ShotMuzzle",0,0,8,3)
    SPSB AAAAA 0 BRIGHT A_FireCustomMissile("HHCBSPAS1G", frandom(-4.00,4.00), 0, 0, 4, 0, frandom(-3.00,3.00))
    SPSB AAAAAAAAA 0 BRIGHT A_FireCustomMissile("HHCBSPAS2G", frandom(-4.00,4.00), 0, 0, 4, 0, frandom(-3.00,3.00))
    SPSB A 1 BRIGHT A_FireCustomMissile("HHCBSPAS2G", frandom(-4.00,4.00), 1, 0, 4, 0, frandom(-3.00,3.00))
    SPSB A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    SPSB B 1 BRIGHT A_GunFlash
    SPSB C 1 BRIGHT
    SPSB DEF 1
    SPSB G 1 A_GiveInventory("SPASBolt",1)
    SPSB A 0 A_JumpIfInventory("SPAS12Ammo",1,1)
    Goto Ready+17
    SPSB A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+17
  FireAimAltHold:
    "####" "#" 0 A_JumpIfInventory("SPASClip",1,1)
	Goto ReloadBreak
    //SPSB A 0 A_JumpIfInventory("SPASBolt",1,"PumpAim")
    SPSF G 0 A_PlayWeaponSound("spas/fireempty")
	GRNA L 0 A_TakeInventory("SPASClip",1)
    SPSF G 0 A_FireCustomMissile("WeaponSmokePuffShotgun",3,0,-4,2)
    SPSF G 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,0,5)
    SPSF G 0 A_FireCustomMissile("WeaponSmokePuffShotgun",-3,0,4,2)
    SPSF G 0 A_FireCustomMissile("WeaponSmokePuff_ShotMuzzle",0,0,0,5)
    SPSF GGGGG 0 BRIGHT A_FireCustomMissile("HHCBSPAS1G", frandom(-1.35,1.35), 0, 0, 4, 0, frandom(-1.35,1.35))
    SPSF GGGGGGG 0 BRIGHT A_FireCustomMissile("HHCBSPAS2G", frandom(-1.35,1.35), 0, 0, 4, 0, frandom(-1.35,1.35))
    SPSF G 1 BRIGHT A_FireCustomMissile("HHCBSPAS2G", frandom(-1.35,1.35), 1, 0, 4, 0, frandom(-1.35,1.35))
    SPSF G 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    SPSF G 0 A_JumpIfInventory("SPASSwitch",1,"FireAimAlt2")
    SPSF H 1 BRIGHT A_GunFlash
    SPSF I 1 BRIGHT
    SPSF JKLM 1
    SPSF NO 2
    SPSF P 2 A_PlaySoundEx("spas/pump","SoundSlot6")
	SPSF P 0 A_SpawnItemEx("ShellCasing",Cos(Pitch)*30,-2,32-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    SPSF QRSTUV 2
    SPSF W 1
    SPSF W 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    "####" "#" 0 A_JumpIfInventory("SPASClip",1,1)
	Goto ReloadBreak
	TNT1 A 0
    Goto AltHold
  FireAimAlt2:
    SPSF H 1 BRIGHT A_GunFlash
    SPSF I 1 BRIGHT
    SPSF JKLM 1
    SPSX NO 2
    SPSX P 2 A_PlaySoundEx("spas/pump","SoundSlot6")
	SPSF P 0 A_SpawnItemEx("ShellCasing",Cos(Pitch)*30,-2,32-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    SPSX QRSTUV 2
    SPSX W 1
    SPSX W 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    "####" "#" 0 A_JumpIfInventory("SPASClip",1,1)
	Goto ReloadBreak
	TNT1 A 0
    Goto AltHold
  }
}

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

actor "Franchi SPAS-12 Rapid Fire" : "Franchi SPAS-12"
{
  obituary "%k smacked %o around with the Semi-Auto SPAS-12."
  inventory.pickupmessage "You got the Franchi SPAS-12 dual-mode shotgun."
  //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("ReloadingShot",1,"ReloadEndStop")
    SPSA P 0 A_JumpIfInventory("Aiming",1,"FireAim")
    SPSA P 1 A_JumpIfNoAmmo("ReloadStart")
    SPSB A 0 A_JumpIfInventory("Perk3_SteadyAim",1,"Fire_SteadyAim")
    SPSB A 0 A_PlayWeaponSound("spas/fireempty")
    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_ShotMuzzle",0,0,8,3)
    SPSB AAAAA 0 BRIGHT A_FireCustomMissile("HHCBSPAS1R", frandom(-7.00,7.00), 0, 0, 4, 0, frandom(-6.00,6.00))
    SPSB AAAAAAA 0 BRIGHT A_FireCustomMissile("HHCBSPAS2R", frandom(-7.00,7.00), 0, 0, 4, 0, frandom(-6.00,6.00))
    SPSB A 1 BRIGHT A_FireCustomMissile("HHCBSPAS2R", frandom(-7.00,7.00), 1, 0, 4, 0, frandom(-6.00,6.00))
	SPSB A 0 A_SpawnItemEx("ShellCasing",Cos(Pitch)*30,-2,25-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    SPSB A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    SPSB A 0 A_JumpIfNoAmmo("FireEmpty")
    SPSB B 1 BRIGHT A_GunFlash
    SPSB C 1 BRIGHT
    SPSB DE 1
    SPSB FG 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    SPSA P 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    SPSB A 0 A_JumpIfInventory("SPAS12Ammo",1,1)
    Goto Ready+17
    SPSB A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+17
  FireEmpty:
    SPSB B 1 BRIGHT A_GunFlash
    SPSB C 1 BRIGHT
    SPSB DEFG 1
    SPSA P 1
    SPSB A 0 A_JumpIfInventory("SPAS12Ammo",1,1)
    Goto Ready+17
    SPSB A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+17
  FireAim:
    SPSF F 1 A_JumpIfNoAmmo("ReloadStart")
    SPSF G 0 A_PlayWeaponSound("spas/fireempty")
    SPSF G 0 A_FireCustomMissile("WeaponSmokePuffShotgun",3,0,-4,1)
    SPSF G 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,0,4)
    SPSF G 0 A_FireCustomMissile("WeaponSmokePuffShotgun",-3,0,4,1)
    SPSF G 0 A_FireCustomMissile("WeaponSmokePuff_ShotMuzzle",0,0,0,4)
    SPSF GGGGG 0 BRIGHT A_FireCustomMissile("HHCBSPAS1R", frandom(-2.15,2.15), 0, 0, 4, 0, frandom(-2.15,2.15))
    SPSF GGGGGGG 0 BRIGHT A_FireCustomMissile("HHCBSPAS2R", frandom(-2.15,2.15), 0, 0, 4, 0, frandom(-2.15,2.15))
    SPSF G 1 BRIGHT A_FireCustomMissile("HHCBSPAS2R", frandom(-2.15,2.15), 1, 0, 4, 0, frandom(-2.15,2.15))
	SPSF G 0 A_SpawnItemEx("ShellCasing",Cos(Pitch)*30,-2,32-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    SPSF G 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    SPSF G 0 A_JumpIfNoAmmo("FireAimEmpty")
    SPSF H 1 BRIGHT A_GunFlash
    SPSF I 1 BRIGHT
    SPSF JK 1
    SPSF LM 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    SPSF F 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    SPSF A 0 A_JumpIfInventory("SPAS12Ammo",1,1)
    Goto Ready+23
    SPSF A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+23
  FireAimEmpty:
    SPSF H 1 BRIGHT A_GunFlash
    SPSF I 1 BRIGHT
	SPSF JKLM 1
    SPSF F 1
    SPSF A 0 A_JumpIfInventory("SPAS12Ammo",1,2)
    SPSF A 0 A_ReFire
    Goto Ready+23
    SPSF A 0 A_JumpIfNoAmmo("ReloadStart")
    SPSF A 0 A_ReFire
    Goto Ready+23
  Fire_SteadyAim:
    SPSB A 0 A_PlayWeaponSound("spas/fireempty")
    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_ShotMuzzle",0,0,8,3)
    SPSB AAAAA 0 BRIGHT A_FireCustomMissile("HHCBSPAS1R", frandom(-6.00,6.00), 0, 0, 4, 0, frandom(-5.00,5.00))
    SPSB AAAAAAA 0 BRIGHT A_FireCustomMissile("HHCBSPAS2R", frandom(-6.00,6.00), 0, 0, 4, 0, frandom(-5.00,5.00))
    SPSB A 1 BRIGHT A_FireCustomMissile("HHCBSPAS2R", frandom(-6.00,6.00), 1, 0, 4, 0, frandom(-5.00,5.00))
	SPSB A 0 A_SpawnItemEx("ShellCasing",Cos(Pitch)*30,-2,25-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    SPSB A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    SPSB A 0 A_JumpIfNoAmmo("FireEmpty")
    SPSB B 1 BRIGHT A_GunFlash
    SPSB C 1 BRIGHT
    SPSB DE 1
    SPSB FG 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    SPSA P 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    SPSB A 0 A_JumpIfInventory("SPAS12Ammo",1,1)
    Goto Ready+17
    SPSB A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+17
  Reload: //AltFire:
    VECC A 0 A_JumpIfInventory("SPASClip",8,2)
    VECC A 0 A_JumpIfInventory("SPAS12Ammo",1,"ReloadStart")
    VECC A 0 A_TakeInventory("Reloading",1)
    VECC A 0 A_JumpIfInventory("Aiming",1,"ReadyAim")
    Goto Ready+20
  ReloadStart:
    SPSC A 0 A_JumpIfInventory("SPASClip",5,2)
    SPSC A 0 ACS_NamedExecuteAlways("RefSpeak",0,4,0,0)
    SPSC A 0 A_JumpIfInventory("Aiming",1,"ReloadStartAim")
    SPSC A 3 A_JumpIfInventory("Perk1_SOH",1,"ReloadStart_SOH")
    SPSD B 0 A_GiveInventory("ReloadingShot",1)
    SPSC B 3 A_PlaySoundEx("m9/select","SoundSlot5")
    SPSC C 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SPSC DEF 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    Goto ReloadAmmo
  ReloadAmmo:
    SPSC O 0 A_JumpIfInventory("SPASClip",8,"ReloadEnd")
    SPSC O 0 A_JumpIfInventory("SPAS12Ammo",1,1)
    Goto ReloadEnd
    SPSC HI 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SPSC J 0 A_GiveInventory("SPASClip",1)
    SPSC J 0 A_TakeInventory("SPAS12Ammo",1)
    SPSC J 3 A_PlaySoundEx("spas/insert","SoundSlot6")
    SPSC LMNO 3 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    Goto ReloadAmmo
  ReloadEndStop:
    SPSC F 0 A_JumpIfInventory("Perk1_SOH",1,"ReloadEnd_SOH")
  ReloadEnd:
    SPSC FEDCBA 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SPSC A 0 A_TakeInventory("ReloadingShot",1)
    SPSC A 0 A_TakeInventory("Reloading",1)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+16
  ReloadStart_SOH:
    SPSD A 2 A_GiveInventory("ReloadingShot",1)
    SPSC B 2 A_PlaySoundEx("m9/select","SoundSlot5")
    SPSC C 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SPSC DEF 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    Goto ReloadAmmo_SOH
  ReloadAmmo_SOH:
    SPSC O 0 A_JumpIfInventory("SPASClip",8,"ReloadEnd_SOH")
    SPSC O 0 A_JumpIfInventory("SPAS12Ammo",1,1)
    Goto ReloadEnd_SOH
    SPSC HI 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SPSC J 0 A_GiveInventory("SPASClip",1)
    SPSC J 0 A_TakeInventory("SPAS12Ammo",1)
    SPSC J 2 A_PlaySoundEx("spas/insert","SoundSlot6")
    SPSC LMNO 2 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    Goto ReloadAmmo_SOH
  ReloadEnd_SOH:
    SPSC FEDCBA 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    SPSC A 0 A_TakeInventory("ReloadingShot",1)
    SPSC A 0 A_TakeInventory("Reloading",1)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+17
  FireAimAltHold:
    "####" "#" 0 A_JumpIfInventory("SPASClip",1,1)
	Goto ReloadBreak
    SPSF G 0 A_PlayWeaponSound("spas/fireempty")
	SPSC J 0 A_TakeInventory("SPASClip",1)
    SPSF G 0 A_FireCustomMissile("WeaponSmokePuffShotgun",3,0,-4,1)
    SPSF G 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,0,4)
    SPSF G 0 A_FireCustomMissile("WeaponSmokePuffShotgun",-3,0,4,1)
    SPSF G 0 A_FireCustomMissile("WeaponSmokePuff_ShotMuzzle",0,0,0,4)
    SPSF GGGGG 0 BRIGHT A_FireCustomMissile("HHCBSPAS1R", frandom(-2.15,2.15), 0, 0, 4, 0, frandom(-2.15,2.15))
    SPSF GGGGGGG 0 BRIGHT A_FireCustomMissile("HHCBSPAS2R", frandom(-2.15,2.15), 0, 0, 4, 0, frandom(-2.15,2.15))
    SPSF G 1 BRIGHT A_FireCustomMissile("HHCBSPAS2R", frandom(-2.15,2.15), 1, 0, 4, 0, frandom(-2.15,2.15))
	SPSF G 0 A_SpawnItemEx("ShellCasing",Cos(Pitch)*30,-2,32-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    SPSF G 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    SPSF H 1 BRIGHT A_GunFlash
    SPSF I 1 BRIGHT
    SPSF JK 1
    "####" "#" 0 A_JumpIfInventory("SPASClip",1,1)
	Goto ReloadBreak
	TNT1 A 0
    Goto AltHold
  Flash:
    TNT1 A 2 BRIGHT A_Light1
    TNT1 A 0 BRIGHT A_Light0
	Stop
  }
}

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

actor "Franchi SPAS-12 Dragon" : "Franchi SPAS-12"
{
  obituary "%k scorched %o with the SPAS-12."
  inventory.pickupmessage "You got the Franchi SPAS-12 dual-mode shotgun."
  //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:
    //No steady aim effect
    SPSA P 0 A_JumpIfInventory("ReloadingShot",1,"ReloadEnd")
    SPSA P 0 A_JumpIfInventory("Aiming",1,"FireAim")
    SPSA P 1 A_JumpIfNoAmmo("ReloadStart")
    SPSB A 0 A_JumpIfInventory("SPASBolt",1,"Pump")
	SPSB A 0 A_JumpIfInventory("SPASClip",2,1)
	Goto FireEmpty
    SPSB A 0 A_PlayWeaponSound("spas/fireempty")
    SPSB A 0 A_PlaySound("dragon/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)
    SPSB AAAA 0 A_FireCustomMissile("FlameThrowerFire3",frandom(-8.00,10.00),0,8,random(0,6),0,frandom(-9.00,10.00))
    SPSB AAAAAAA 0 A_FireCustomMissile("FlameThrowerFire",frandom(-9.00,11.00),0,8,random(-1,7),0,frandom(-10.00,11.00))
    SPSB AAAA 0 A_FireCustomMissile("FlameThrowerFire2",frandom(-9.00,11.00),0,8,random(-1,7),0,frandom(-10.00,11.00))
    SPSB A 0 A_FireCustomMissile("WeaponSmokePuff_ShotMuzzle",0,0,8,3)
    SPSB AAA 0 BRIGHT A_FireCustomMissile("HHCBSPAS1D", frandom(-6.00,6.00), 0, 0, 4, 0, frandom(-5.00,5.00))
    SPSB AA 0 BRIGHT A_FireCustomMissile("HHCBSPAS2D", frandom(-6.00,6.00), 0, 0, 4, 0, frandom(-5.00,5.00))
    SPSB A 1 BRIGHT A_FireCustomMissile("HHCBSPAS2D", frandom(-6.00,6.00), 1, 0, 4, 0, frandom(-5.00,5.00))
    SPSB A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    SPSB B 1 BRIGHT A_GunFlash
    SPSB C 1 BRIGHT
    SPSB DEFG 1
    SPSB HIJ 2
    SPSB K 2 A_PlaySoundEx("spas/pump","SoundSlot6")
	SPSB K 0 A_SpawnItemEx("OrangeShellCasing",Cos(Pitch)*30,-2,25-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    SPSB LMNOP 2
    SPSB Q 1
    SPSB QRR 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    SPSB A 0 A_JumpIfInventory("SPAS12Ammo",1,1)
    Goto Ready+17
    SPSB A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+17
  FireEmpty:
    SPSB A 0 A_PlayWeaponSound("spas/fireempty")
    SPSB A 0 A_PlaySound("dragon/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)
    SPSB AAAA 0 A_FireCustomMissile("FlameThrowerFire3",frandom(-8.00,10.00),0,8,random(0,6),0,frandom(-9.00,10.00))
    SPSB AAAAAAA 0 A_FireCustomMissile("FlameThrowerFire",frandom(-9.00,11.00),0,8,random(-1,7),0,frandom(-10.00,11.00))
    SPSB AAAA 0 A_FireCustomMissile("FlameThrowerFire2",frandom(-9.00,11.00),0,8,random(-1,7),0,frandom(-10.00,11.00))
    SPSB A 0 A_FireCustomMissile("WeaponSmokePuff_ShotMuzzle",0,0,8,3)
    SPSB AAA 0 BRIGHT A_FireCustomMissile("HHCBSPAS1D", frandom(-6.00,6.00), 0, 0, 4, 0, frandom(-5.00,5.00))
    SPSB AA 0 BRIGHT A_FireCustomMissile("HHCBSPAS2D", frandom(-6.00,6.00), 0, 0, 4, 0, frandom(-5.00,5.00))
    SPSB A 1 BRIGHT A_FireCustomMissile("HHCBSPAS2D", frandom(-6.00,6.00), 1, 0, 4, 0, frandom(-5.00,5.00))
    SPSB A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    SPSB B 1 BRIGHT A_GunFlash
    SPSB C 1 BRIGHT
    SPSB DEF 1
    SPSB G 1 A_GiveInventory("SPASBolt",1)
    SPSB A 0 A_JumpIfInventory("SPAS12Ammo",1,1)
    Goto Ready+17
    SPSB A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+17
  FireAim:
    SPSF F 1 A_JumpIfNoAmmo("ReloadStart")
    SPSB A 0 A_JumpIfInventory("SPASBolt",1,"PumpAim")
	SPSB A 0 A_JumpIfInventory("SPASClip",2,1)
	Goto FireAimEmpty
    SPSF G 0 A_PlayWeaponSound("spas/fireempty")
    SPSF G 0 A_PlaySound("dragon/fire")
    SPSF G 0 A_FireCustomMissile("WeaponSmokePuffShotgun",3,0,-4,2)
    SPSF G 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,0,5)
    SPSF G 0 A_FireCustomMissile("WeaponSmokePuffShotgun",-3,0,4,2)
    SPSF GGGG 0 A_FireCustomMissile("FlameThrowerFire3",frandom(-7.00,7.00),0,0,random(2,8),0,frandom(-7.00,8.00))
    SPSF GGGGGGG 0 A_FireCustomMissile("FlameThrowerFire",frandom(-8.00,8.00),0,0,random(1,9),0,frandom(-8.00,9.00))
    SPSF GGGG 0 A_FireCustomMissile("FlameThrowerFire2",frandom(-8.00,8.00),0,0,random(1,9),0,frandom(-8.00,9.00))
    SPSF G 0 A_FireCustomMissile("WeaponSmokePuff_ShotMuzzle",0,0,0,5)
    SPSF GGG 0 BRIGHT A_FireCustomMissile("HHCBSPAS1D", frandom(-2.00,2.00), 0, 0, 4, 0, frandom(-2.00,2.00))
    SPSF GG 0 BRIGHT A_FireCustomMissile("HHCBSPAS2D", frandom(-2.00,2.00), 0, 0, 4, 0, frandom(-2.00,2.00))
    SPSF G 1 BRIGHT A_FireCustomMissile("HHCBSPAS2D", frandom(-2.00,2.00), 1, 0, 4, 0, frandom(-2.00,2.00))
    SPSF G 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    SPSF G 0 A_JumpIfInventory("SPASSwitch",1,"FireAimAlt")
    SPSF H 1 BRIGHT A_GunFlash
    SPSF I 1 BRIGHT
    SPSF JKLM 1
    SPSF NO 2
    SPSF P 2 A_PlaySoundEx("spas/pump","SoundSlot6")
	SPSF P 0 A_SpawnItemEx("OrangeShellCasing",Cos(Pitch)*30,-2,32-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    SPSF QRSTUV 2
    SPSF W 1
    SPSF WFF 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    SPSF A 0 A_JumpIfInventory("SPAS12Ammo",1,1)
    Goto Ready+23
    SPSF A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+23
  FireAimAlt:
    SPSF H 1 BRIGHT A_GunFlash
    SPSF I 1 BRIGHT
    SPSF JKLM 1
    SPSX NO 2
    SPSX P 2 A_PlaySoundEx("spas/pump","SoundSlot6")
	SPSF P 0 A_SpawnItemEx("OrangeShellCasing",Cos(Pitch)*30,-2,32-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    SPSX QRSTUV 2
    SPSX W 1
    SPSX W 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    SPSF FF 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    SPSF A 0 A_JumpIfInventory("SPAS12Ammo",1,1)
    Goto Ready+23
    SPSF A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+23
  FireAimEmpty:
    SPSF G 0 A_PlayWeaponSound("spas/fireempty")
    SPSF G 0 A_PlaySound("dragon/fire")
    SPSF G 0 A_FireCustomMissile("WeaponSmokePuffShotgun",3,0,-4,2)
    SPSF G 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,0,5)
    SPSF G 0 A_FireCustomMissile("WeaponSmokePuffShotgun",-3,0,4,2)
    SPSF GGGG 0 A_FireCustomMissile("FlameThrowerFire3",frandom(-7.00,7.00),0,0,random(2,8),0,frandom(-7.00,8.00))
    SPSF GGGGGGG 0 A_FireCustomMissile("FlameThrowerFire",frandom(-8.00,8.00),0,0,random(1,9),0,frandom(-8.00,9.00))
    SPSF GGGG 0 A_FireCustomMissile("FlameThrowerFire2",frandom(-8.00,8.00),0,0,random(1,9),0,frandom(-8.00,9.00))
    SPSF G 0 A_FireCustomMissile("WeaponSmokePuff_ShotMuzzle",0,0,0,5)
    SPSF GGG 0 BRIGHT A_FireCustomMissile("HHCBSPAS1D", frandom(-2.00,2.00), 0, 0, 4, 0, frandom(-2.00,2.00))
    SPSF GG 0 BRIGHT A_FireCustomMissile("HHCBSPAS2D", frandom(-2.00,2.00), 0, 0, 4, 0, frandom(-2.00,2.00))
    SPSF G 1 BRIGHT A_FireCustomMissile("HHCBSPAS2D", frandom(-2.00,2.00), 1, 0, 4, 0, frandom(-2.00,2.00))
    SPSF G 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    SPSF H 1 BRIGHT A_GunFlash
    SPSF I 1 BRIGHT
    SPSF JKL 1
    SPSF M 1 A_GiveInventory("SPASBolt",1)
    SPSF A 0 A_JumpIfInventory("SPAS12Ammo",1,1)
    Goto Ready+23
    SPSF A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+23
  FireAimAltHold:
    "####" "#" 0 A_JumpIfInventory("SPASClip",1,1)
	Goto ReloadBreak
    //SPSB A 0 A_JumpIfInventory("SPASBolt",1,"PumpAim")
    SPSF G 0 A_PlayWeaponSound("spas/fireempty")
	GRNA L 0 A_TakeInventory("SPASClip",1)
    SPSF G 0 A_FireCustomMissile("WeaponSmokePuffShotgun",3,0,-4,2)
    SPSF G 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,0,5)
    SPSF G 0 A_FireCustomMissile("WeaponSmokePuffShotgun",-3,0,4,2)
	SPSF GGGG 0 A_FireCustomMissile("FlameThrowerFire3",frandom(-7.00,7.00),0,0,random(2,8),0,frandom(-7.00,8.00))
    SPSF GGGGGGG 0 A_FireCustomMissile("FlameThrowerFire",frandom(-8.00,8.00),0,0,random(1,9),0,frandom(-8.00,9.00))
    SPSF GGGG 0 A_FireCustomMissile("FlameThrowerFire2",frandom(-8.00,8.00),0,0,random(1,9),0,frandom(-8.00,9.00))
    SPSF G 0 A_FireCustomMissile("WeaponSmokePuff_ShotMuzzle",0,0,0,5)
    SPSF GGG 0 BRIGHT A_FireCustomMissile("HHCBSPAS1D", frandom(-2.00,2.00), 0, 0, 4, 0, frandom(-2.00,2.00))
    SPSF GG 0 BRIGHT A_FireCustomMissile("HHCBSPAS2D", frandom(-2.00,2.00), 0, 0, 4, 0, frandom(-2.00,2.00))
    SPSF G 1 BRIGHT A_FireCustomMissile("HHCBSPAS2D", frandom(-2.00,2.00), 1, 0, 4, 0, frandom(-2.00,2.00))
    SPSF G 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    SPSF G 0 A_JumpIfInventory("SPASSwitch",1,"FireAimAlt2")
    SPSF H 1 BRIGHT A_GunFlash
    SPSF I 1 BRIGHT
    SPSF JKLM 1
    SPSF NO 2
    SPSF P 2 A_PlaySoundEx("spas/pump","SoundSlot6")
	SPSF P 0 A_SpawnItemEx("OrangeShellCasing",Cos(Pitch)*30,-2,32-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    SPSF QRSTUV 2
    SPSF W 1
    SPSF W 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    "####" "#" 0 A_JumpIfInventory("SPASClip",1,1)
	Goto ReloadBreak
	TNT1 A 0
    Goto AltHold
  FireAimAlt2:
    SPSF H 1 BRIGHT A_GunFlash
    SPSF I 1 BRIGHT
    SPSF JKLM 1
    SPSX NO 2
    SPSX P 2 A_PlaySoundEx("spas/pump","SoundSlot6")
	SPSF P 0 A_SpawnItemEx("OrangeShellCasing",Cos(Pitch)*30,-2,32-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    SPSX QRSTUV 2
    SPSX W 1
    SPSX W 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    "####" "#" 0 A_JumpIfInventory("SPASClip",1,1)
	Goto ReloadBreak
	TNT1 A 0
    Goto AltHold
  }
}

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

actor SPASPickup : CustomInventory
{
  inventory.pickupmessage "You got the Franchi SPAS-12 dual-mode shotgun."
  inventory.pickupsound "spas/pump"
  +INVENTORY.AUTOACTIVATE
  //inventory.respawntics 70
  scale 0.12
  States
  {
  Spawn:
    WEAP M -1
    Stop
  Pickup:
    WEAP M 0
    WEAP M 0 A_JumpIf((ACS_NamedExecuteWithResult("RefCheckVar",0,0,0)) == 1, "PickupStay")
    WEAP M 0 A_JumpIfInventory("Franchi SPAS-12",1,"AmmoPickup") // If the player already has this weapon, they get more ammo for it
    WEAP M 0 A_JumpIfInventory("Franchi SPAS-12 Ex Mags",1,"AmmoPickup")
    WEAP M 0 A_JumpIfInventory("Franchi SPAS-12 Grip",1,"AmmoPickup")
    WEAP M 0 A_JumpIfInventory("Franchi SPAS-12 Rapid Fire",1,"AmmoPickup")
    WEAP M 0 A_JumpIfInventory("Franchi SPAS-12 Dragon",1,"AmmoPickup")
	WEAP M 0 A_JumpIfInventory("Perk1_OneManArmy",1,"OneManArmy")
    WEAP M 0 A_JumpIfInventory("MaxWeaponsFilled",81,"FailPickup2")
	WEAP M 0 A_GiveInventory("MaxWeaponsFilled",20)
    WEAP M 0 ACS_NamedExecuteWithResult("RefPickU",7,0,0)
    Stop
  PickupStay:
    WEAP M 0
    WEAP M 0 A_JumpIfInventory("Franchi SPAS-12",1,"FailPickup") // If the player already has this weapon, they get more ammo for it
    WEAP M 0 A_JumpIfInventory("Franchi SPAS-12 Ex Mags",1,"FailPickup")
    WEAP M 0 A_JumpIfInventory("Franchi SPAS-12 Grip",1,"FailPickup")
    WEAP M 0 A_JumpIfInventory("Franchi SPAS-12 Rapid Fire",1,"FailPickup")
    WEAP M 0 A_JumpIfInventory("Franchi SPAS-12 Dragon",1,"FailPickup")
	WEAP M 0 A_JumpIfInventory("Perk1_OneManArmy",1,"OneManArmy")
    WEAP M 0 A_JumpIfInventory("MaxWeaponsFilled",81,"FailPickup2")
	WEAP M 0 A_GiveInventory("MaxWeaponsFilled",20)
    WEAP M 0 ACS_NamedExecuteWithResult("RefPickU",7,0,0)
    WEAP M 0 ACS_NamedExecuteWithResult("RefPickC",7,0,0)
    WEAP M 0 A_PlaySound("spas/pump")
    fail
  AmmoPickup:
    WEAP M 0
    WEAP M 0 A_JumpIfInventory("SPAS12Ammo",0,"FailPickup")
    WEAP M 0 A_GiveInventory("SPAS12Ammo",8)
    Stop
  OneManArmy:
    WEAP M 0
	WEAP M 0 A_JumpIfInventory("MaxWeaponsFilled",118,"FailPickup2")
	WEAP M 0 A_GiveInventory("MaxWeaponsFilled",20)
	WEAP M 0 ACS_NamedExecuteWithResult("RefPickU",7,0,0)
	stop
  FailPickup:
    WEAP M 1
    fail
  FailPickup2:
    WEAP M 1
    WEAP M 0 ACS_NamedExecuteAlways("RefSlots",0,14,0,0)
    fail
  }
}

actor SPASDrop : SPASPickup
{
  States
  {
  Spawn:
    WEAP M -1
    Stop
  Pickup:
    WEAP M 0
    WEAP M 0 A_JumpIfInventory("Franchi SPAS-12",1,"AmmoPickup") // If the player already has this weapon, they get more ammo for it
    WEAP M 0 A_JumpIfInventory("Franchi SPAS-12 Ex Mags",1,"AmmoPickup")
    WEAP M 0 A_JumpIfInventory("Franchi SPAS-12 Grip",1,"AmmoPickup")
    WEAP M 0 A_JumpIfInventory("Franchi SPAS-12 Rapid Fire",1,"AmmoPickup")
    WEAP M 0 A_JumpIfInventory("Franchi SPAS-12 Dragon",1,"AmmoPickup")
	WEAP M 0 A_JumpIfInventory("Perk1_OneManArmy",1,"OneManArmy")
    WEAP M 0 A_JumpIfInventory("MaxWeaponsFilled",81,"FailPickup2")
	WEAP M 0 A_GiveInventory("MaxWeaponsFilled",20)
    WEAP M 0 ACS_NamedExecuteWithResult("RefPickU",7,0,0)
    Stop
  }
}

actor SPASDrop2 : SPASDrop
{
  States
  {
  Spawn:
    WEAP M -1
    Stop
  Pickup:
    WEAP M 0
    WEAP M 0 A_JumpIfInventory("Franchi SPAS-12",1,"AmmoPickup") // If the player already has this weapon, they get more ammo for it
    WEAP M 0 A_JumpIfInventory("Franchi SPAS-12 Ex Mags",1,"AmmoPickup")
    WEAP M 0 A_JumpIfInventory("Franchi SPAS-12 Grip",1,"AmmoPickup")
    WEAP M 0 A_JumpIfInventory("Franchi SPAS-12 Rapid Fire",1,"AmmoPickup")
    WEAP M 0 A_JumpIfInventory("Franchi SPAS-12 Dragon",1,"AmmoPickup")
	WEAP M 0 A_JumpIfInventory("Perk1_OneManArmy",1,"OneManArmy")
    WEAP M 0 A_JumpIfInventory("MaxWeaponsFilled",81,"FailPickup2")
	WEAP M 0 A_GiveInventory("MaxWeaponsFilled",20)
    WEAP M 0 ACS_NamedExecuteWithResult("RefPickU",7,0,0)
    Stop
  AmmoPickup:
    WEAP M 0
    Stop
  }
}

actor HHCBSPAS1 : HHBullet
{
  damage (random(12,14))
  Speed 200
  decal none
  damagetype "Shotgungib"
  -NOEXTREMEDEATH
  states
  {
  Spawn:
    TNT1 A 2 BRIGHT
    Stop
  Death:
    TNT1 A 0 A_SpawnItemEx("ImpactSmokePuff_2", 0, 0, 0, 0, 0, 0, 0, 128, 0)
    TNT1 A 5 A_PlaySound("generic/ricochet")
    Stop
  XDeath:
    TNT1 A 0 A_GiveToTarget("HitIndicator",1)//
    TNT1 A 5 A_PlaySound("generic/ricochets")
    Stop
  Crash:
    TNT1 A 0 A_GiveToTarget("HitIndicator",1)//
	TNT1 A 0 A_Jump(48,2)
    TNT1 A 0 A_SpawnItemEx("ImpactSmokePuff_3", 0, 0, 0, 0, 0, 0, 0, 128, 0)
    TNT1 A 5 A_PlaySound("generic/ricochet")
    Stop
  }
}

actor HHCBSPAS2 : HHCBSPAS1
{
  damage (random(12,14))
  Speed 200
  decal ShotChip
  damagetype "Shotgun"
  +NOEXTREMEDEATH
  states
  {
  Spawn:
    TNT1 A 10
    Stop
  Death:
    TNT1 A 0 A_SpawnItemEx("ImpactSmokePuff_2", 0, 0, 0, 0, 0, 0, 0, 128, 0)
    TNT1 A 4 A_PlaySound("generic/ricochet")
    Stop
  XDeath:
	//TNT1 A 0 A_Jump(190,2)
    TNT1 A 0 A_GiveToTarget("HitIndicator",1)
    TNT1 A 4 A_PlaySound("generic/ricochets")
    Stop
  Crash:
	//TNT1 A 0 A_Jump(190,2)
    TNT1 A 0 A_GiveToTarget("HitIndicator",1)
	TNT1 A 0 A_Jump(48,2)
    TNT1 A 0 A_SpawnItemEx("ImpactSmokePuff_3", 0, 0, 0, 0, 0, 0, 0, 128, 0)
    TNT1 A 4 A_PlaySound("generic/ricochet")
    Stop
  }
}

actor HHCBSPAS1G : HHCBSPAS1
{
  Speed 230
}

actor HHCBSPAS2G : HHCBSPAS2
{
  damage (random(12,16))
  Speed 230
}

actor HHCBSPAS1R : HHCBSPAS1
{
  damage (random(12,14))
  Speed 160
}
actor HHCBSPAS2R : HHCBSPAS2
{
  Speed 160
}

actor HHCBSPAS1D : HHBullet
{
  damage (random(10,14))
  Speed 200
  decal none
  +FORCERADIUSDMG
  damagetype "Dragon"
  states
  {
  Spawn:
    TNT1 A 1
    TNT1 A 2 A_ScaleVelocity(0.75)
    Stop
  Death:
    TNT1 A 0 A_SpawnItemEx("FireballPuff", 0, 0, 0, 0, 0, 0, 0, 128, 0)
    TNT1 A 0 A_PlaySound("generic/ricochet")
    TNT1 AA 12 A_Explode(2,32,0)
    Stop
  XDeath:
	//TNT1 A 0 A_Jump(144,2)
    TNT1 A 0 A_GiveToTarget("HitIndicator",1)
    TNT1 A 0 A_SpawnItemEx("FireballPuff", 0, 0, 0, 0, 0, 0, 0, 128, 0)
	TNT1 A 0 A_Jump(32,2)
    TNT1 A 0 A_PlaySound("generic/ricochets")
    TNT1 AA 12 A_Explode(2,32,0)
    Stop
  Crash:
	//TNT1 A 0 A_Jump(144,2)
    TNT1 A 0 A_GiveToTarget("HitIndicator",1)
    TNT1 A 0 A_SpawnItemEx("FireballPuff", 0, 0, 0, 0, 0, 0, 0, 128, 0)
    TNT1 A 0 A_PlaySound("generic/ricochet")
    TNT1 AA 12 A_Explode(2,32,0)
    Stop
  }
}
actor HHCBSPAS2D : HHCBSPAS1D
{
  damage (random(10,18))
  Speed 200
  decal none
  +FORCERADIUSDMG
  damagetype "Dragon"
  states
  {
  Spawn:
    TNT1 A 5
    Stop
  Death:
    TNT1 A 0 A_SpawnItemEx("FireballPuff", 0, 0, 0, 0, 0, 0, 0, 128, 0)
    TNT1 A 0 A_PlaySound("generic/ricochet")
    TNT1 AA 12 A_Explode(2,32,0)
    Stop
  XDeath:
	//TNT1 A 0 A_Jump(144,2)
    TNT1 A 0 A_GiveToTarget("HitIndicator",1)
    TNT1 A 0 A_SpawnItemEx("FireballPuff", 0, 0, 0, 0, 0, 0, 0, 128, 0)
	TNT1 A 0 A_Jump(32,2)
    TNT1 A 0 A_PlaySound("generic/ricochets")
    TNT1 AA 12 A_Explode(2,32,0)
    Stop
  Crash:
	//TNT1 A 0 A_Jump(144,2)
    TNT1 A 0 A_GiveToTarget("HitIndicator",1)
    TNT1 A 0 A_SpawnItemEx("FireballPuff", 0, 0, 0, 0, 0, 0, 0, 128, 0)
    TNT1 A 0 A_PlaySound("generic/ricochet")
    TNT1 AA 12 A_Explode(2,32,0)
    Stop
  }
}