ACTOR EnragedLegendaryASG : "Enraged Legendary Assault Shotgun" replaces "Enraged Legendary Assault Shotgun"
{
  Tag "Enraged Legendary Assault Shotgun"
  States
  {
  ChangeMode:
	TNT1 A 0 A_TakeInventory("RailgunAction")
	TNT1 A 0 A_JumpIfInventory("EnragedASGMode1",1,"ChangeMode2")
	TNT1 A 0 A_Print("Slug Rounds")
	TNT1 A 0 A_PlaySound("LShotgun/Cock")
	TNT1 A 0 A_GiveInventory("EnragedASGMode1")
	EASG A 3 Offset(0,34)
	EASG A 2 Offset(0,37)
	EASG A 2 Offset(0,40)
	EAS2 A 2 Offset(0,37)
	EAS2 A 3 Offset(0,34)
	TNT1 A 0 Offset(0,32)
	Goto Ready2
  ChangeMode2:
	TNT1 A 0 A_Print("Enraged Shells")
	TNT1 A 0 A_PlaySound("LShotgun/Cock")
	TNT1 A 0 A_TakeInventory("EnragedASGMode1")
	EAS2 A 3 Offset(0,34)
	EAS2 A 2 Offset(0,37)
	EAS2 A 2 Offset(0,40)
	EASG A 2 Offset(0,37)
	EASG A 3 Offset(0,34)
	TNT1 A 0 Offset(0,32)
	Goto Ready+6
  Ready:
    TNT1 A 0 A_PlayWeaponSound("LShotgun/Cock")
	EASG VWXYZ 1
	TNT1 A 0 A_JumpIfInventory("EnragedASGMode1",1,"Ready2")
	TNT1 A 0 A_JumpIfInventory("RailgunAction",1,"ChangeMode")
	TNT1 A 0 A_JumpIfInventory("HandGrenadeAction",1,"GrenadeCheck")
	TNT1 A 0 A_JumpIfInventory("MineAction",1,"MineCheck")
    EASG A 1 A_WeaponReady
    Goto Ready+6
  Ready2:
	TNT1 A 0 A_JumpIfInventory("RailgunAction",1,"ChangeMode")
	TNT1 A 0 A_JumpIfInventory("HandGrenadeAction",1,"GrenadeCheck")
	TNT1 A 0 A_JumpIfInventory("MineAction",1,"MineCheck")
	EAS2 A 1 A_WeaponReady
	Loop
  Deselect: 
    TNT1 A 0 A_PlaySound("weapons/weapondown")
    EASG A 1 A_Lower
    Goto Deselect+1
  Select:
	TNT1 A 0 A_Raise
    Wait	
  Fire:
	TNT1 A 0 A_JumpIfInventory("EnragedASGMode1",1,"Fire2")
	TNT1 A 0 A_JumpIfNoAmmo("Empty")
	TNT1 A 0 A_PlaySound("Weapons/LegAutoShotgun",1)
	TNT1 A 0 A_AlertMonsters
    TNT1 A 0 Radius_Quake(3,3,0,1,0)
    TNT1 A 0 A_GunFlash
	TNT1 A 0 A_Light1
	TNT1 A 0 A_SpawnItemEx("RedShellCasing",30,5,25,Random(2,4),Random(3,6),Random(3,6),0)
	TNT1 AAA 0 A_FireCustomMissile("RedSGTracer",Random(5,-5),0,0,Random(5,-5))
	TNT1 AAA 0 A_FireCustomMissile("RedSGTracer",Random(10,-10),0,0,Random(10,-10))
    TNT1 A 0 A_FireBullets(3,1.5,3,Random(20,28),"EnragedModdedBulletPuff",0)
    EASG B 1 Bright A_FireBullets(6.2,3.4,4,Random(20,28),"EnragedModdedBulletPuff")
    EASG C 1 Bright A_Light2
	TNT1 A 0 A_Light0
    EASG DEFG 1
	EASG HI 2
    Goto Ready+6
  Fire2:
	TNT1 A 0 A_JumpIfInventory("EnragedLegendaryShotgunDrum",3,"ActualFire2")
	Goto Empty2
  ActualFire2:
	TNT1 A 0 A_PlaySound("Weapons/LegAutoShotgun",1)
	TNT1 A 0 A_AlertMonsters
    TNT1 A 0 Radius_Quake(3,3,0,1,0)
    TNT1 A 0 A_GunFlash
	TNT1 A 0 A_Light1
	TNT1 AAA 0 A_SpawnItemEx("RedShellCasing",30,5,25,Random(2,4),Random(3,6),Random(3,6),0)
	TNT1 A 0 A_TakeInventory("EnragedLegendaryShotgunDrum",3,TIF_NOTAKEINFINITE)
    EAS2 B 2 Bright A_FireCustomMissile("EnragedASGRail",0,0,0,0)
    EAS2 CC 1 Bright A_Light2
	TNT1 A 0 A_Light0
    EAS2 DEFG 3
	EAS2 HI 6
    Goto Ready+6
  Empty:
    EASG A 10 A_PlaySound("weapons/click")
	Goto Altfire
  Empty2:
	EAS2 A 10 A_PlaySound("weapons/click")
  AltFire:
  	TNT1 A 0 A_JumpIfInventory("EnragedLegendaryShotgunDrum",16,2)
    TNT1 A 0 A_JumpIfInventory("EnragedLegendaryShell",1,2)
	TNT1 A 0
	Goto Ready+6
	EASG JKLMN 1
	EASG O 2
	EASR A 2 A_PlaySound("lasgguy/asgout")
  	EASR B 3
	EASG U 40 A_FireCustomMissile("EnragedLegendaryEmptyDrumSpawner", 0, 0, 10, 1) 
	EASG TSR 1
	EASG Q 2
  Reload:
	TNT1 A 0 A_TakeInventory("EnragedLegendaryShell",1)
	TNT1 A 0 A_GiveInventory("EnragedLegendaryShotgunDrum",1)
	TNT1 A 0 A_JumpIfInventory("EnragedLegendaryShotgunDrum",16,2)
	TNT1 A 0 A_JumpIfInventory("EnragedLegendaryShell",1,"Reload")
	TNT1 A 0
	Goto Reload2
  Reload2:
	EASG P 3
	EASG O 6 A_PlaySound("lasgguy/asgin")
	EASG NMLKJ 1
	Goto Ready+6
  GrenadeCheck:
	TNT1 A 0 A_JumpIfInventory("HandGrenadeAmmo",1,"GrenadeToss")
	TNT1 A 0 A_TakeInventory("HandGrenadeAction",1)
	Goto Ready+6
  GrenadeToss:
  	TNT1 A 0 A_PlayWeaponSound("weapons/weapondown") 
	EASG ZYXWV 1
	TNT1 A 6
	HGRN ABC 1
	HGRN D 3
	HGRN EFGHI 2
	TNT1 A 14 A_PlayWeaponSound("weapons/hgrenadepin")
	TNT1 A 0 A_PlayWeaponSound("weapons/hgrenadethrow")
	TNT1 A 0 A_TakeInventory("HandGrenadeAmmo",1)
	HGRN J 1 A_FireCustomMissile("ThrownGrenade",0,0,0,0)
	HGRN KLM 2
	TNT1 A 6
	TNT1 A 0 A_JumpIfInventory("HandGrenadeAmmo",1,2)
    TNT1 A 0 A_TakeInventory("Hand Grenade",1)
	TNT1 A 0 A_TakeInventory("HandGrenadeAction",1)
	TNT1 A 0
	EASG VWXYZ 1
	Goto Ready+6
  MineCheck:
	TNT1 A 0 A_JumpIfInventory("MineAmmo",1,"MineToss")
	TNT1 A 0 A_TakeInventory("MineAction",1)
	Goto Ready+6
  MineToss:
  	TNT1 A 0 A_PlayWeaponSound("weapons/weapondown") 
	EASG ZYXWV 1
	TNT1 A 10
	TNT1 A 0 A_PlayWeaponSound("weapons/hgrenadethrow")
	MINE ABCDEF 1		
	TNT1 A 0 A_TakeInventory("MineAmmo",1)	  
	MINE G 1 A_FireCustomMissile("ThrownMine",0,0,0,0)
	MINE HI 1
	MINE JK 2
	TNT1 A 0 A_JumpIfInventory("MineAmmo",1,2)
    TNT1 A 0 A_TakeInventory("Land Mine",1)
	TNT1 A 0 A_TakeInventory("MineAction",1)
	TNT1 A 0
	TNT1 A 5
	Goto Ready+1
  Spawn:
    IMAP A -1
    Stop
	}
}