actor SSTSSG : SuperShotgun replaces SuperShotgun
{
  Game Doom
  SpawnID 33
  Weapon.SelectionOrder 399
  Weapon.AmmoUse 2
  Weapon.AmmoGive 8
  Weapon.AmmoType "Shell"
  Weapon.AmmoUse2 0
  Weapon.AmmoGive2 0
  Weapon.AmmoType2 "LoadedShell"
  Inventory.PickupMessage "You got the super shotgun!"
  Obituary "%o was blasted by %k's super shotgun."
  Decal "bulletchip"
  attacksound "misc/null"
  +ALT_AMMO_OPTIONAL
  +NOALERT
  +NOAUTOFIRE
	+FORCEXYBILLBOARD
  Weapon.preferredSkin "SSGSkin"
  States
  {
  Ready:
    TNT1 A 0 A_JumpIfInventory("InstantSwitch",1, "ActualReady")
    SHG2 Y 1
  ActualReady:
    TNT1 A 0 A_ZoomFactor(1.0)
    SHG2 A 1 A_WeaponReady(WRF_ALLOWRELOAD)
    Loop
  Deselect:
    RLGG F 0 A_TakeInventory("SSGBarrelCheck", 2)
    TNT1 A 0 ACS_ExecuteAlways(779,0, 2,0,0)
    TNT1 A 0
    SHG2 A 1 A_Lower
    SHG2 A 0 A_Lower
    Goto DeSelect+3
  Select:
    TNT1 A 0 A_JumpIfInventory("InstantSwitch",1, "ActualReady")
    TNT1 A 0 ACS_ExecuteAlways(779,0, 1,0,0)
    TNT1 A 0
    SHG2 Z 0 A_Raise
    SHG2 Z 1 A_Raise
    Goto Select+3
  Fire:
    BG2G E 0 A_JumpIfInventory("Shell", 2, 1)
	Goto Deselect
    BG2G E 0 A_JumpIfInventory("SSGBarrelCheck", 2, "Reload")
    BG2G E 0 A_JumpIfInventory("SSGBarrelCheck", 1, "Reload2")
    SHG2 A 1
	/*
    SHG2 A 0 A_FireBullets (random(6,7), random(6,8), 6, random(2,9), "SSTShotgunPuff",0) 
    SHG2 A 0 A_FireBullets (random(6,7), random(6,8), 10, random(2,4), "SSTShotgunPuff",0) 
    SHG2 A 0 A_FireBullets (random(6,7), random(6,8), 4, random(4,5), "SSTShotgunPuff",0) 
    SHG2 A 0 A_FireBullets (4, 2, 3, random(3,7), "SSTShotgunPuff",1)
	*/
    SHG2 A 0 A_FireBullets(11.2, 7.1, 20, 5, "SSTShotgunPuff") //A_FireShotgun2
  TNT1 AAAAAAAAAA 0 A_FireCustomMissile ("TracerRoundShotgun", random(-11.2,11.2)*0.4, 0, -3, -2, 0, random(-7.1,7.1)*0.4)
  TNT1 AAAAAAAAAA 0 A_FireCustomMissile ("TracerRoundShotgun", random(-11.2,11.2)*0.4, 0, 3, -2, 0, random(-7.1,7.1)*0.4)
	TNT1 A 0 Radius_Quake(3,7,0,1, 0)
    SHG2 A 0 A_PlaySoundEx("weapons/sshotf", "SoundSlot5")
    SHG2 A 0 A_GunFlash
    //RLGG F 0 A_TakeInventory("Shell", 2)
    RLGG F 0 A_GiveInventory("SSGBarrelCheck", 2)
    RLGG F 0 A_TakeInventory("LoadedShell", 2)
	/* deselection stuffs
	SHG2 A 6
    SHG2 A 1 A_WeaponReady
	
	SHG2 B 6
    SHG2 B 1 A_WeaponReady
	*/
	//SHG2 ZY 3 BRIGHT
	SHG2 YZY 2 BRIGHT
	SHG2 BS 2
    SHG2 C 6 A_CheckReload
    SHG2 D 2 A_OpenShotgun2
    SHG2 T 2
    SHG2 P 3
	BERT B 0 A_FireCustomMissile("ShellCasingSpawner2",0,0,2,-2)
	BERT B 0 A_FireCustomMissile("ShellCasingSpawner2",0,0,0,-2)
    SHG2 E 3
    SHG2 Q 4
    RLGG F 0 A_GiveInventory("LoadedShell", 2)
    RLGG F 0 A_TakeInventory("SSGBarrelCheck", 2)
    SHG2 F 7 A_LoadShotgun2
    SHG2 PGR 2
    SHG2 H 4 A_playweaponsound("weapons/sshotc") //A_CloseShotgun2
    SHG2 HA 1 A_Refire//HH
    SHG2 A 1 A_Refire
    SHG2 A 0 A_ReFire
    Goto ActualReady
  // unused states
    SHG2 B 7
    SHG2 A 3
    Goto Deselect
  Altfire:
    BG2G E 0 A_JumpIfInventory("Shell", 1, 1)
	Goto ActualReady
    BG2G E 0 A_JumpIfInventory("SSGBarrelCheck", 2, "Reload")
	
	TNT1 A 0 Radius_Quake(2,3,0,1, 0)
    SHG2 A 0 A_PlaySoundEx("weapons/sshotf2", "SoundSlot5")
    SHTG A 0 A_GunFlash
    RLGG F 0 A_TakeInventory("LoadedShell", 1)
    RLGG F 0 A_TakeInventory("Shell", 1)
    RLGG F 0 A_GiveInventory("SSGBarrelCheck", 1)
    SHG2 A 1 BRIGHT A_ZoomFactor(0.96)
    SHG2 A 1 BRIGHT A_ZoomFactor(0.97)
    SHG2 Y 1 A_ZoomFactor(0.98)
    SHG2 Y 1 A_ZoomFactor(0.99)
    SHG2 A 0 A_ZoomFactor(1.0)
    BG2G E 0 A_JumpIfInventory("Shell", 1, 1)
	Goto ActualReady
    BG2G E 0 A_JumpIfInventory("SSGBarrelCheck", 2, "Reload")
	Goto ActualReady
  Reload:
    BG2G E 0 A_JumpIfInventory("SSGBarrelCheck", 2, 3)
    BG2G E 0 A_JumpIfInventory("SSGBarrelCheck", 1, "Reload2")
	SHG2 A 1 A_WeaponReady
	Goto ActualReady
	SHG2 BS 2
    RLGG F 0 A_TakeInventory("SSGBarrelCheck", 2)
    SHG2 C 6 A_CheckReload
    SHG2 D 2 A_OpenShotgun2
    SHG2 T 2
    SHG2 P 3
	BERT B 0 A_FireCustomMissile("ShellCasingSpawner2",0,0,2,-2)
	BERT B 0 A_FireCustomMissile("ShellCasingSpawner2",0,0,0,-2)
    SHG2 E 3
    SHG2 Q 4
    RLGG F 0 A_GiveInventory("LoadedShell", 2)
    RLGG F 0 A_TakeInventory("SSGBarrelCheck", 2)
    SHG2 F 7 A_LoadShotgun2
    SHG2 PGR 2
    SHG2 H 4 A_playweaponsound("weapons/sshotc") //A_CloseShotgun2
    SHG2 HHHH 1 A_WeaponReady
    SHG2 A 1 A_WeaponReady
    Goto ActualReady
  Reload2:
    RLGG F 0 A_TakeInventory("SSGBarrelCheck", 2)
    SHG2 BS 2
    SHG2 C 2 A_CheckReload
    SHG2 D 2 A_OpenShotgun2
    SHG2 TP 2
	BERT B 0 A_FireCustomMissile("ShellCasingSpawner2",0,0,2,-2)
    SHG2 OQ 3
    RLGG F 0 A_GiveInventory("LoadedShell", 2)
    SHG2 F 6 A_LoadShotgun2
    SHG2 P 3
    SHG2 GR 1
    SHG2 H 2 A_playweaponsound("weapons/sshotc") //A_CloseShotgun2
    SHG2 HHH 1 A_WeaponReady
    SHG2 A 1 A_WeaponReady
    Goto ActualReady
  Flash:
    NULL A 0 A_SpawnItemEx ("SSGEcho", 0,0,0, 0,0,0, 0, 160)
    SHG2 J 0 Bright A_Light2

	TNT1 A 0 A_Jump(64,"CutRight","CutLeft")
	Goto CutUp
  CutUp:
  	//TNT1 A 0 A_SetPitch(pitch-2)
	TNT1 A 0 A_SetPitch(pitch-5)
	
    SHG2 I 1 BRIGHT A_ZoomFactor(0.92)
    MNGF F 0 A_JumpIfInventory("RuneDoubleFiringSpeed", 1, 2)
	//TNT1 A 0 A_SetPitch(pitch-6)
    SHG2 I 1 BRIGHT A_ZoomFactor(0.93)
    SHG2 J 1 BRIGHT A_ZoomFactor(0.95)
	
	RLGG E 0 A_AlertMonsters
    SHG2 I 0 Bright A_Light1
    MNGF F 0 A_JumpIfInventory("RuneDoubleFiringSpeed", 1, 2)
    SHG2 J 1 Bright A_ZoomFactor(0.97)
    SHG2 I 1 Bright A_ZoomFactor(0.99)
    MNGF F 0 A_JumpIfInventory("RuneDoubleFiringSpeed", 1, 2)
    SHG2 I 1 Bright A_ZoomFactor(1.0)
    SHG2 I 0 A_ZoomFactor(1.0)
	TNT1 A 0 A_SetPitch(pitch+2)//+5
    TNT1 A 0 A_Light0
    TNT1 AAA 1 //A_SetAngle(angle-3)

	TNT1 A 1 A_SetPitch(pitch+1)
	TNT1 A 1 A_SetPitch(pitch+0.75)
	TNT1 A 1 A_SetPitch(pitch+0.5)
	TNT1 AAA 1 A_SetPitch(pitch+0.25)
	
    //TNT1 A 0 ACS_ExecuteAlways(925,0, 775,0,0)//700
    Goto LightDone
	
  CutLeft:
	//TNT1 A 0 A_SetAngle(angle-1)
  	//TNT1 A 0 A_SetPitch(pitch-1)
	TNT1 A 0 A_SetAngle(angle-2)
	TNT1 A 0 A_SetPitch(pitch-3.5)
	
    SHG2 I 1 BRIGHT A_ZoomFactor(0.92)
	//TNT1 A 0 A_SetAngle(angle-2)
	//TNT1 A 0 A_SetPitch(pitch-4.5)
    MNGF F 0 A_JumpIfInventory("RuneDoubleFiringSpeed", 1, 2)
    SHG2 I 1 BRIGHT A_ZoomFactor(0.93)
    SHG2 J 1 BRIGHT A_ZoomFactor(0.95)
	
	RLGG E 0 A_AlertMonsters
    SHG2 I 0 Bright A_Light1
    MNGF F 0 A_JumpIfInventory("RuneDoubleFiringSpeed", 1, 2)
    SHG2 J 1 Bright A_ZoomFactor(0.97)
    SHG2 I 1 Bright A_ZoomFactor(0.99)
    MNGF F 0 A_JumpIfInventory("RuneDoubleFiringSpeed", 1, 2)
    SHG2 I 1 Bright A_ZoomFactor(1.0)
    SHG2 I 0 Bright A_ZoomFactor(1.0)
	//TNT1 A 0 A_SetAngle(angle+1)
	TNT1 A 0 A_SetPitch(pitch+0.5)//2.5
    TNT1 A 0 A_Light0
    TNT1 AAA 1 //A_SetAngle(angle+3)
	
    TNT1 A 0 A_SetAngle(angle+0.5)
	TNT1 A 1 A_SetPitch(pitch+1)
    TNT1 A 0 A_SetAngle(angle+0.5)
	TNT1 A 1 A_SetPitch(pitch+0.75)
    TNT1 A 0 A_SetAngle(angle+0.5)
	TNT1 A 1 A_SetPitch(pitch+0.5)
    TNT1 A 0 A_SetAngle(angle+0.25)
	TNT1 A 1 A_SetPitch(pitch+0.5)
    TNT1 A 0 A_SetAngle(angle+0.25)
	TNT1 A 1 A_SetPitch(pitch+0.25)
	TNT1 A 1 A_SetPitch(pitch+0.25)
	
    //TNT1 A 0 ACS_ExecuteAlways(925,0, 775,0,0)//700
    Goto LightDone

  CutRight:
	//TNT1 A 0 A_SetAngle(angle+1)
  	//TNT1 A 0 A_SetPitch(pitch-1)
	TNT1 A 0 A_SetAngle(angle+2)
	TNT1 A 0 A_SetPitch(pitch-3.5)
	
    SHG2 I 1 BRIGHT A_ZoomFactor(0.92)
	//TNT1 A 0 A_SetAngle(angle+2)
	//TNT1 A 0 A_SetPitch(pitch-4.5)
    MNGF F 0 A_JumpIfInventory("RuneDoubleFiringSpeed", 1, 2)
    SHG2 I 1 BRIGHT A_ZoomFactor(0.93)
    SHG2 J 1 BRIGHT A_ZoomFactor(0.95)
	
	RLGG E 0 A_AlertMonsters
    SHG2 I 0 Bright A_Light1
    MNGF F 0 A_JumpIfInventory("RuneDoubleFiringSpeed", 1, 2)
    SHG2 J 1 Bright A_ZoomFactor(0.97)
    SHG2 I 1 Bright A_ZoomFactor(0.99)
    MNGF F 0 A_JumpIfInventory("RuneDoubleFiringSpeed", 1, 2)
    SHG2 I 1 Bright A_ZoomFactor(1.0)
    SHG2 I 0 Bright A_ZoomFactor(1.0)
	//TNT1 A 0 A_SetAngle(angle-1)
	TNT1 A 0 A_SetPitch(pitch+0.5)//2.5
    TNT1 A 0 A_Light0
    TNT1 AAA 1 //A_SetAngle(angle-3)

    TNT1 A 0 A_SetAngle(angle-0.5)
	TNT1 A 1 A_SetPitch(pitch+1)
    TNT1 A 0 A_SetAngle(angle-0.5)
	TNT1 A 1 A_SetPitch(pitch+0.75)
    TNT1 A 0 A_SetAngle(angle-0.5)
	TNT1 A 1 A_SetPitch(pitch+0.5)
    TNT1 A 0 A_SetAngle(angle-0.25)
	TNT1 A 1 A_SetPitch(pitch+0.25)
    TNT1 A 0 A_SetAngle(angle-0.25)
	TNT1 A 1 A_SetPitch(pitch+0.25)
	TNT1 A 1 A_SetPitch(pitch+0.25)
	
    //TNT1 A 0 ACS_ExecuteAlways(925,0, 775,0,0)//700
    Goto LightDone
  AltFlash:
    NULL A 0 A_SpawnItemEx ("ssgsingleEcho", 0,0,0, 0,0,0, 0, 160)
    BG2G E 0 A_JumpIfInventory("SSGBarrelCheck", 1, "AltFlash2")
    BG2G E 0 A_Jump(112,"AltFlashA")
    SAWD A 0 A_FireBullets (3.2, 3.2, -1, random(4,6), "SSTShotgunPuff",0) 
    SAWD A 0 A_FireBullets (3, 3, 2, random(5,6), "SSTShotgunPuff",0) 
    SAWD A 0 A_FireBullets (5.5, 3.3, 1, random(5,6), "SSTShotgunPuff",0)
    SAWD A 0 A_FireBullets (5.5, 3, 1, random(6,7), "SSTShotgunPuff",0) 
    SAWD A 0 A_FireBullets (5, 4, 2, random(3,4), "SSTShotgunPuff",0) 
    SAWD A 0 A_FireBullets (random(4.0,5.0), 4, 3, random(2,3), "SSTShotgunPuff",0) 
  TNT1 AAAAAAAAAA 0 A_FireCustomMissile ("TracerRoundShotgun", random(-5,5)*0.4, 0, 3, -2, 0, random(-4,4)*0.4)
    SHG2 L 1 Bright A_Light2//2
    TNT1 A 0 ACS_ExecuteAlways(925,0, random(300,550),0,0)
    RLGG E 0 A_AlertMonsters
    SHG2 K 1 Bright A_Light1//2
    Goto LightDone
  AltFlashA:
    SAWD A 0 A_FireBullets (6.25, 6.5, 10, 5, "SSTShotgunPuff", 1)
  TNT1 AAAAAAAAAA 0 A_FireCustomMissile ("TracerRoundShotgun", random(-6.25,6.25)*0.4, 0, 3, -2, 0, random(-6.5,6.5)*0.4)
    SHG2 L 1 Bright A_Light2
    TNT1 A 0 ACS_ExecuteAlways(925,0, random(300,550),0,0)
    RLGG E 0 A_AlertMonsters
    SHG2 K 1 Bright A_Light1
    Goto LightDone
  AltFlash2:
    BG2G E 0 A_Jump(112,"AltFlash2A")
    SAWD A 0 A_FireBullets (3.2, 3.2, -1, random(4,6), "SSTShotgunPuff",0) 
    SAWD A 0 A_FireBullets (3, 3, 2, random(5,6), "SSTShotgunPuff",0) 
    SAWD A 0 A_FireBullets (5.5, 3.3, 1, random(5,6), "SSTShotgunPuff",0)
    SAWD A 0 A_FireBullets (5.5, 3, 1, random(6,7), "SSTShotgunPuff",0) 
    SAWD A 0 A_FireBullets (5, 4, 2, random(3,4), "SSTShotgunPuff",0) 
    SAWD A 0 A_FireBullets (random(4.0,5.0), 4, 3, random(2,3), "SSTShotgunPuff",0) 
  TNT1 AAAAAAAAAA 0 A_FireCustomMissile ("TracerRoundShotgun", random(-5,5)*0.4, 0, -3, -2, 0, random(-4,4)*0.4)
    SHG2 N 1 Bright A_Light2
    TNT1 A 0 ACS_ExecuteAlways(925,0, random(300,550),0,0)
    RLGG E 0 A_AlertMonsters
    SHG2 M 1 Bright A_Light1
    Goto LightDone
  AltFlash2A:
    SAWD A 0 A_FireBullets (6.5, 6.25, 10, 5, "SSTShotgunPuff", 1)
  TNT1 AAAAAAAAAA 0 A_FireCustomMissile ("TracerRoundShotgun", random(-6.5,6.5)*0.4, 0, -3, -2, 0, random(-6.25,6.25)*0.4)
    SHG2 N 1 Bright A_Light2
    TNT1 A 0 ACS_ExecuteAlways(925,0, random(300,550),0,0)
    RLGG E 0 A_AlertMonsters
    SHG2 M 1 Bright A_Light1
    Goto LightDone
  Spawn:
    SOT2 A -1
    Stop
  }
}
actor SSGBarrelCheck : Inventory
{
  inventory.amount 1
  inventory.maxamount 2
}
actor LoadedShell : Ammo
{
  +IGNORESKILL
  inventory.pickupmessage "You probably shouldn't see this."
  inventory.amount 1
  inventory.maxamount 2
  inventory.icon "TNT1A0"
  ammo.backpackamount 0
  ammo.backpackmaxamount 2
}
