ACTOR EnragedLegendaryChainsaw : LegendaryChainsaw
{
+INVENTORY.UNDROPPABLE
Weapon.AmmoType "ILDemonAmmo"
Weapon.AmmoType2 "ILDemonAmmo"
Inventory.PickupSound "weapons/pickupsaw"
Inventory.PickupMessage "Absolutely Furious Chainsaw"
Obituary "%o was sawed into many small pieces by %k with Enraged Legendary Chainsaw"
Tag "Enraged Legendary Chainsaw"
States
  {
  Spawn:
	ELSW A -1 Bright
	Loop
  Ready:
	TNT1 AAA 0
	TNT1 AAA 0 A_TakeInventory("LegendaryChainHold",1)
	TNT1 AAA 0 A_TakeInventory("LegendaryChainAltHold",1)
	TNT1 AAA 0 A_JumpIfInventory("LegendaryCell",1,"Ready1")
	Goto Empty
  Ready1:
	TNT1 A 0 A_PlaySound("MadSaw/Idle",7,1.0,1)
	ESWH ABC 1
	ESWH D 1 A_WeaponReady
  ReadyLoop:
	ESWH ABCD 1 A_WeaponReady
	Loop
  Empty:
	TNT1 AAA 0 A_StopSound(7)
  EmptyLoop:
	ESWH A 1 A_WeaponReady(WRF_NOFIRE)
	TNT1 A 0 A_JumpIfInventory("ILDemonAmmo",1,"Ready1")
	Loop
  Select:
	ESWH A 1 A_Raise
	Loop
  Deselect:
	TNT1 A 0
	TNT1 A 0 A_TakeInventory("HandGrenadeAction",1)
	TNT1 A 0 A_TakeInventory("MineAction",1)
	TNT1 A 0 A_TakeInventory("RailgunAction",1)
	TNT1 AAA 0 A_TakeInventory("LegendaryChainHold",1)
	TNT1 AAA 0 A_TakeInventory("LegendaryChainAltHold",1)
  DeselectLoop:
	TNT1 A 0 A_StopSound(7)
	ESWH A 1 A_Lower
	Loop
  Fire:
	TNT1 AAA 0 A_JumpIfNoAmmo("Ready")
	TNT1 A 0 A_JumpIfInventory("ILDemonAmmo",1,1)
	Goto Ready
	ESWL AB 1 Bright
	TNT1 A 0 Radius_Quake(1,2,0,1,0)
	TNT1 A 0 A_PlaySound("MadSaw/Attack",7,1.0,1)
	TNT1 AAA 0
	TNT1 A 0 Radius_Quake(1,2,0,1,0)
	TNT1 A 0 A_Recoil(-6)
	ESWN B 2 Bright A_Saw("weapons","weapons/sawhit",Random(80,120),"PlayerELegSawScreech",SF_NOUSEAMMOMISS)//|SF_STEALARMOR,65,2.8125,0,1)
	TNT1 AAA 0
	TNT1 A 0 A_JumpIfInventory("ILDemonAmmo",1,1)
	Goto HoldEnd
	TNT1 A 0 A_Refire
	Goto HoldEnd
  Hold:
	TNT1 AAA 0 A_JumpIfNoAmmo("Ready")
	TNT1 A 0 A_JumpIfInventory("ILDemonAmmo",1,1)
	Goto Ready
	TNT1 AAA 0 A_JumpIfInventory("LegendaryChainHold",1,"Holdloop")
	TNT1 A 0 A_PlaySound("MadSaw/Attack",7,1.0,1)
  Holdloop:
	TNT1 A 0 Radius_Quake(1,2,0,1,0)
	TNT1 A 0 A_Recoil(-6)
	ESWN C 2 Bright A_Saw("weapons","weapons/sawhit",Random(50,70),"PlayerELegSawScreech",SF_NOUSEAMMOMISS)//|SF_STEALARMOR,65,2.8125,0,1)
	TNT1 AAA 0
	TNT1 A 0 A_JumpIfInventory("ILDemonAmmo",1,1)
	Goto HoldEnd
	TNT1 A 0 Radius_Quake(1,2,0,1,0)
	TNT1 A 0 A_Recoil(-6)
	ESWN D 2 Bright A_Saw("weapons","weapons/sawhit",Random(50,70),"PlayerELegSawScreech",SF_NOUSEAMMOMISS)//|SF_STEALARMOR,65,2.8125,0,1)
	TNT1 AAA 0
	TNT1 A 0 A_JumpIfInventory("ILDemonAmmo",1,1)
	Goto HoldEnd
	TNT1 AAA 0 A_JumpIfInventory("LegendaryChainHold",1,"HoldRefire")
	TNT1 AAA 0
	TNT1 A 0 A_GiveInventory("LegendaryChainHold",1)
  HoldRefire:
	TNT1 A 0 A_Refire
	TNT1 A 0 Radius_Quake(1,2,0,1,0)
	TNT1 A 0 A_Recoil(-6)
	ESWN E 2 Bright A_Saw("weapons","weapons/sawhit",Random(50,70),"PlayerELegSawScreech",SF_NOUSEAMMOMISS)//|SF_STEALARMOR,65,2.8125,0,1)
	TNT1 AAA 0
	TNT1 A 0 A_JumpIfInventory("ILDemonAmmo",1,1)
	Goto HoldEnd
	TNT1 A 0 Radius_Quake(1,2,0,1,0)
	TNT1 A 0 A_Recoil(-6)
	ESWN F 2 Bright A_Saw("weapons","weapons/sawhit",Random(50,70),"PlayerELegSawScreech",SF_NOUSEAMMOMISS)//|SF_STEALARMOR,65,2.8125,0,1)
  HoldEnd:
	TNT1 AAA 0 A_StopSound(7)
	ESWL BA 4
	ESWH A 10
	Goto Ready
  AltFire:
	TNT1 AAA 0
	TNT1 A 0 A_JumpIfNoAmmo("Ready")
	TNT1 A 0 A_JumpIfInventory("ILDemonAmmo",9,1)
	Goto Ready
	TNT1 AAA 0 A_JumpIfInventory("LegendaryChainAltHold",1,"AltFireLoop")
  AltFireLoop:
	ESWN ABCDE 1 Bright
	ESWN F 1 Bright A_FireCustomMissile("PlayerELegPChainRipper",0,1,-15,-20)
	ESWN A 1 Bright A_FireCustomMissile("PlayerELegPChainRipper",0,1,15,-20)
	ESWN BCDEF 1 Bright
	TNT1 AAA 0 A_JumpIfInventory("LegendaryChainAltHold",1,"AltFireRefire")
	TNT1 A 0 A_GiveInventory("LegendaryChainAltHold",1)
  AltFireRefire:
	TNT1 A 0 A_Refire
	TNT1 AAA 0 A_StopSound(7)
	ESWL BA 4
	ESWH A 10
	Goto Ready
    }
}

ACTOR ELegSawScreech : LegSawScreech
{
  States
  {
  Spawn:
	TNT1 A 0
	TNT1 A 0 A_SpawnItemEx("SawParticleSpawner",0,0,0,0,0,0,0,SXF_CLIENTSIDE,0)
	TNT1 A 0 A_Jump(128,"Alt")
	EX97 ABCDEFGHIJ 1 Bright A_FadeOut(0.08,1)
	Stop
  Alt:
	EX98 ABCDEFGHIJ 1 Bright A_FadeOut(0.08,1)
	Stop   
  }
}

ACTOR PlayerELegSawScreech : ELegSawScreech
{
DamageType "Legendary"
}

Actor PlayerELegPChainRipper : ELegChainRipper
{
Radius 4
Height 6
Damage 15
BounceCount 4
DamageType "Legendary"
+MTHRUSPECIES
}