Actor ActuallyGoodLegendaryDoomguy replaces LegendaryDoomguy
{
  Monster
  Height 56
  Radius 16
  Health 2000
  Mass 500
  Speed 40
  FastSpeed 60
  MaxStepHeight 32
  MaxDropOffHeight 32
  MeleeRange 80
  BloodColor "Blue"
  PainChance 40
  PainChance "Crush", 256
  +BRIGHT
  +BOSS
  +NOFEAR
  +NOICEDEATH
  +NOTIMEFREEZE
  +FLOORCLIP
  +MISSILEMORE
  +MISSILEEVENMORE
  +QUICKTORETALIATE
  +NODROPOFF
  +NOTARGET
  +DONTGIB
  +DONTRIP
  +DONTMORPH
  +DONTBLAST
  +NORADIUSDMG
  +CANUSEWALLS
  +NOBLOCKMONST
  +THRUSPECIES
  +DONTHARMSPECIES
  +LOOKALLAROUND
  +DONTHARMCLASS
  +SEEINVISIBLE
  +CANTSEEK
  Species "LegendaryDoomguy"
  Damagetype "Legendary1"
  DamageFactor 0.3
  DamageFactor "Legendary", 0.0
  DamageFactor "LegendaryGuruPlayer", 0.0
  DamageFactor "LegendaryGuru", 0.0
  DamageFactor "LegendaryPlayer", 0.0 //no leg rev morph for you
  DamageFactor "PlayerNemesisPlasma", 0.5
  DamageFactor "Explosion", 0.5
  DamageFactor "Ice", 0.4
  DamageFactor "PyroShot", 0.1
  DamageFactor "PlayerPyro", 0.1
  DamageFactor "BFG9500Ball", 0.5
  DamageFactor "BFGSplash", 0.5
  DamageFactor "UpBFG9500Ball", 0.5
  DamageFactor "UpBFGSplash", 0.25
  DamageFactor "PDTBFG", 0.02
  DamageFactor "PDTBFGTracer", 0.02
  DamageFactor "PlayerDevBall", 0.01
  DamageFactor "PlayerDevBall2", 0.01
  DamageFactor "PlayerDevTracer", 0.01
  DamageFactor "PlayerDBFG2", 0.45
  DamageFactor "PlayerDBFG10K2", 0.45
  DamageFactor "PlayerDBFGSplash2", 0.45
  DamageFactor "PlayerBHole", 0.05
//anti infighting shits
  DamageFactor "Legendary1", 0.0
  DamageFactor "UltimateLegendary", 0.0
  DamageFactor "LegendaryZombie", 0.0
  DamageFactor "LACGrenade", 0.0
  DamageFactor "SoapOpera", 0.2
  DamageFactor "ZombieDev", 0.2
  DamageFactor "GeneralTracer", 0.0
  DamageFactor "SatanGuard", 0.0
  DamageFactor "CurseComet", 0.0
  DamageFactor "DementedTerminator", 0.0
  DamageFactor "Terminator", 0.0
  DamageFactor "Commander", 0.0
  DamageFactor "CerChainguns", 0.0	
  DamageFactor "CerEnergyBall", 0.0
  DamageFactor "Hell", 0.0
  DamageFactor "HFCyber", 0.0
  DamageFactor "DBFG2", 0.0
  DamageFactor "DBFG10K2", 0.0
  DamageFactor "DBFGSplash2", 0.0
  DamageFactor "NobleComet", 0.0
  DamageFactor "Cyber10k", 0.0
  DropItem "LegAmmoSphere" 256
  DropItem "LegendaryPowerShard" 135
  DropItem "LegendaryRune" 200
  DropItem "LegendaryArmor" 100
  DropItem "ModdedBackPack" 256
  DropItem "LDemonAmmo" 256 100
  SeeSound "LDoomguy/Sight"
  ActiveSound "LDoomguy/Active"
  PainSound "LDoomguy/Pain"
  DeathSound "legdoomguy/death"
  AttackSound " "
  Obituary "%o was sent a ticket back to hell by the Legendary Doomguy."
  Tag "\c[z3]Legendary\c- \c[l5]Doomguy\c-"
  var int user_music;
  var int user_missile;
  var int user_powershard;
  var int user_powershardlimit;
  var int user_powersphere;
  var int user_resistancebufflimit;
  var int user_resistancebuff;
  var int user_skullofpower;
  var int user_infammo;
  var int user_bfg;
  States
  {
  Spawn:
	NLD0 A 10 A_Look
	TNT1 A 0 A_SpawnItemEx("NewLegDoomguySmokeSpawner")
	Loop
  See:
	TNT1 A 0 A_JumpIf(user_music == 1,3)
	TNT1 A 0 ACS_NamedExecuteAlways("StartMonsterMusic",0,807)
	TNT1 A 0 A_SetUserVar("user_music",1)
	TNT1 A 0 A_JumpIfInventory("RunesCheck",1,2)
	TNT1 A 0 ACS_NamedExecuteWithResult("CheckRunes")
	TNT1 A 0 A_UnSetInvulnerable
	TNT1 A 0 A_JumpIfInventory("MarineKilled",1,"Taunt")
	TNT1 A 0 A_JumpIfTargetInLOS("Strafing")
	TNT1 A 0 A_SpawnItemEx("NewLegDoomguySmokeSpawner")
	NLD0 AA 3 A_Chase
	TNT1 A 0 A_SpawnItemEx("NewLegDoomguySmokeSpawner")
	NLD0 BB 3 A_Chase
	TNT1 A 0 A_SpawnItemEx("FootStep")
	TNT1 A 0 A_JumpIfTargetInLOS("Strafing")
	TNT1 A 0 A_SpawnItemEx("NewLegDoomguySmokeSpawner")
	NLD0 CC 3 A_Chase
	TNT1 A 0 A_SpawnItemEx("NewLegDoomguySmokeSpawner")
	NLD0 DD 3 A_Chase
	TNT1 A 0 A_SpawnItemEx("FootStep")
	TNT1 A 0 A_Jump(64,"Mine")
	TNT1 A 0 A_Jump(80,"Rush")
	Loop
  Rush:
	TNT1 A 0 A_JumpIfInventory("MarineKilled",1,"Taunt")
	TNT1 A 0 A_JumpIfTargetInLOS("Strafing")
	TNT1 A 0 A_SpawnItemEx("NewLegDoomguySmokeSpawner")
	TNT1 A 0 A_SpawnItemEx("LegendaryDoomguyGhostA")
	NLD0 A 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("LegendaryDoomguyGhostA")
	NLD0 A 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("NewLegDoomguySmokeSpawner")
	TNT1 A 0 A_SpawnItemEx("LegendaryDoomguyGhostB")
	NLD0 B 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("LegendaryDoomguyGhostB")
	NLD0 B 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("FootStep")
	TNT1 A 0 A_JumpIfTargetInLOS("Strafing")
	TNT1 A 0 A_SpawnItemEx("NewLegDoomguySmokeSpawner")
	TNT1 A 0 A_SpawnItemEx("LegendaryDoomguyGhostC")
	NLD0 C 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("LegendaryDoomguyGhostC")
	NLD0 C 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("NewLegDoomguySmokeSpawner")
	TNT1 A 0 A_SpawnItemEx("LegendaryDoomguyGhostD")
	NLD0 D 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("LegendaryDoomguyGhostD")
	NLD0 D 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("FootStep")
	TNT1 A 0 A_Jump(80,"See")
	Loop
  Strafing:
	TNT1 A 0 A_JumpIfInventory("MarineKilled",1,"Taunt")
	TNT1 A 0 A_SpawnItemEx("FootStep")
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	NLD0 AA 3 A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	NLD0 BB 3 A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_SpawnItemEx("FootStep")
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	NLD0 CC 3 A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	NLD0 DD 3 A_GiveInventory("LegZombieStrafing",1)
	Goto See
  Taunt:
	TNT1 A 0 A_PlaySound("legdoomguy/rekt",2,0.8,0,ATTN_NONE)
	TNT1 A 0 A_TakeInventory("MarineKilled",1)
	Goto See
  Missile:
	TNT1 A 0 A_SetShootable
	TNT1 A 0 A_UnSetInvulnerable
	TNT1 A 0 A_SetTranslucent(1)
	TNT1 A 0 A_MonsterRefire(0,"See")
	TNT1 A 0 A_Jump(64,2)
	TNT1 A 0 A_JumpIfHealthLower(500,"TryShard2")
	TNT1 A 0 A_Jump(32,"AmmoSphere","PowerSphere","SkullOfPower")
  MissileContinue:
	TNT1 A 0 A_JumpIfTargetInLOS("FarRange",360,JLOSF_CLOSENOJUMP|JLOSF_DEADNOJUMP|JLOSF_TARGETLOS,0,1000)
	TNT1 A 0 A_JumpIfTargetInLOS("LongRange",360,JLOSF_CLOSENOJUMP|JLOSF_DEADNOJUMP|JLOSF_TARGETLOS,0,750)
	TNT1 A 0 A_JumpIfTargetInLOS("NearRange",360,JLOSF_CLOSENOJUMP|JLOSF_DEADNOJUMP|JLOSF_TARGETLOS,0,500)
	TNT1 A 0 A_JumpIfTargetInLOS("CloseRange",360,JLOSF_DEADNOJUMP|JLOSF_TARGETLOS,500,0)
	Goto LMG
  FarRange:
	TNT1 A 0 A_Jump(256,"BFGAlt","10k","10kAlt","CannonAlt","BFG")
	Goto LMG
  LongRange:
	TNT1 A 0 A_Jump(200,"PlasmaticRifle","Cannon")
	TNT1 A 0 A_Jump(256,"BFG","BFGAlt","10k","10kAlt","CannonAlt")
	Goto LMG
  NearRange:	
	TNT1 A 0 A_Jump(200,"LMG","PlasmaticRifle","Cannon","SaberAlt")
	TNT1 A 0 A_Jump(256,"BFG","BFGAlt","10k","10kAlt","CannonAlt")
	Goto LMG
  CloseRange:
	TNT1 A 0 A_Jump(128,"ASG","Coachgun")
	TNT1 A 0 A_Jump(200,"LMG","PlasmaticRifle","Cannon","SaberAlt")
	TNT1 A 0 A_Jump(256,"BFGAlt","10k","CannonAlt")
	Goto LMG
	
	
  TryShard2:
	TNT1 A 0 A_Jump(128,"TryResistance2")
	TNT1 A 0 A_JumpIf(user_powershardlimit >= 3,"TryResistance2")
	TNT1 A 0 A_JumpIf(user_powershard == 1,"TryResistance2")
	Goto PowerShard
  TryResistance2:
	TNT1 A 0 A_JumpIf(user_resistancebufflimit >= 4,"MissileContinue")
	TNT1 A 0 A_JumpIf(user_resistancebuff == 1,"MissileContinue")
	Goto ResistanceBuff
	
	
  AmmoSphere:
	TNT1 A 0 A_JumpIf(user_infammo == 1,"MissileContinue")
	TNT1 A 0 A_SpawnItemEx("NewLegDoomguySmokeSpawner")
	NLD0 E 10
	TNT1 A 0 A_SpawnItemEx("NewLegDoomguySmokeSpawner")
	TNT1 A 0 ACS_NamedExecuteAlways("EnemyInfiniteAmmo",0)
	TNT1 A 0 A_PlaySound("legammo/use",6,1.0,0,0.4)
	TNT1 A 0 A_PlaySound("LDoomguy/Taunt",2,1.0,0,0.4)
	Goto See
  SkullOfPower:
	TNT1 A 0 A_JumpIf(user_skullofpower == 1,"MissileContinue")
	TNT1 A 0 A_JumpIfHealthLower(800,2)
	TNT1 A 0 A_Jump(256,"MissileContinue")
	TNT1 A 0 A_SpawnItemEx("NewLegDoomguySmokeSpawner")
	NLD0 E 10
	TNT1 A 0 A_SpawnItemEx("NewLegDoomguySmokeSpawner")
	TNT1 A 0 A_GiveInventory("LegDoomguySkullOfPower")
	TNT1 A 0 ACS_NamedExecuteAlways("LegDoomguySkullOfPower",0)
	TNT1 A 0 A_PlaySound("legdoomguy/quaddmg",7,1.0,0,0.4)
	TNT1 A 0 A_PlaySound("soterror/use",6,1.0,0,0.4)
	TNT1 A 0 A_PlaySound("LDoomguy/Taunt",2,1.0,0,0.4)
	Goto See
  PowerSphere:
	TNT1 A 0 A_JumpIf(user_powersphere == 1,"MissileContinue")
	TNT1 A 0 A_SpawnItemEx("NewLegDoomguySmokeSpawner")
	NLD0 E 10
	TNT1 A 0 A_SpawnItemEx("NewLegDoomguySmokeSpawner")
	TNT1 A 0 A_ChangeFlag("ALWAYSFAST",1)
	TNT1 A 0 ACS_NamedExecuteAlways("LegDoomguyPowerSphere",0)
	TNT1 A 0 A_PlaySound("legpowersphere/use",6,1.0,0,0.4)
	TNT1 A 0 A_PlaySound("LDoomguy/Taunt",2,1.0,0,0.4)
	Goto See
  PowerShard:
	TNT1 A 0 A_JumpIf(user_powershardlimit >= 3,"See")
	TNT1 A 0 A_SetUserVar(user_powershardlimit,user_powershardlimit+1)
	TNT1 A 0 A_JumpIf(user_powershard == 1,"See")
	TNT1 A 0 A_SpawnItemEx("NewLegDoomguySmokeSpawner")
	NLD0 E 10
	TNT1 A 0 A_SpawnItemEx("NewLegDoomguySmokeSpawner")
	TNT1 A 0 ACS_NamedExecuteAlways("LegDoomguyPowerShard",0)
	TNT1 A 0 A_PlaySound("legendary/defense",6,1.0,0,0.4)
	TNT1 A 0 A_PlaySound("LDoomguy/Taunt",2,1.0,0,0.4)
	Goto See
  ResistanceBuff:
	TNT1 A 0 A_JumpIf(user_resistancebufflimit >= 4,"See")
	TNT1 A 0 A_SetUserVar(user_resistancebufflimit,user_resistancebufflimit+1)
	TNT1 A 0 A_JumpIf(user_resistancebuff == 1,"See")
	TNT1 A 0 A_PlaySound("Saber/Pickup",7,1.0,0,0.5)
	NLD2 E 10
	TNT1 A 0 A_PlaySound("Saber/Buff",1,1.0,0,0.5)
	TNT1 A 0 A_PlaySound("Saber/Resistance",6,1.0,0,0.5)
	TNT1 A 0 A_PlaySound("LDoomguy/Taunt",2,1.0,0,0.4)
	TNT1 A 0 A_GiveInventory("LegDoomguySaberResistance")
	TNT1 A 0 ACS_NamedExecuteAlways("LegDoomguyResistanceBuff",0)
	NLD2 F 20
	Goto See
  

  Mine:
	NLD0 C 4 Fast
	NLD0 E 15 Fast A_CustomMissile("LACThrownMine",32,0,0,2,15)
	NLD0 C 4 Fast
	Goto See
	
  Grenade:
	"####" A 0 A_PlaySound("weapons/hgrenadepin",0,1.0,0)
	"####" E 4 Fast A_FaceTarget
	"####" A 0 A_PlaySound("weapons/hgrenadethrow",0,1.0,0)
	"####" E 1 A_CustomMissile("LegThrownGrenade",32,0,0,2,4)
	"####" A 0 A_GiveInventory("MonsterAvoid",1)
	Goto See
	
  Pause:
	"####" EE 5 A_SpawnItemEx("NewLegDoomguySmokeSpawner")
	TNT1 A 0 A_PlaySound("weapons/LMGReload3",7,1.0,0,0.5)
	Goto See
	
	
  ASG:
	TNT1 A 0 A_PlaySound("LShotgun/Cock",7,1.0,0,0.5)
	NLD7 E 10 A_FaceTarget
  ASGLoop:
	TNT1 A 0 A_JumpIfInventory("MarineKilled",1,"Taunt")
	
	TNT1 A 0 A_JumpIfInventory("ASGZAmmo",16,"ReloadASG")
	NLD7 E 5 Fast A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_JumpIf(user_infammo == 1,2)
	TNT1 A 0 A_GiveInventory("ASGZAmmo",1)
	TNT1 AAAA 0 A_CustomMissile("LegendaryBlueTracer",Random(28,34),0,frandom(-6,6),CMF_OFFSETPITCH,frandom(-3,3))
	TNT1 A 0 A_SpawnItemEx("BlueShellCasing",-8,7,30,4,0,(0.1)*Random(30,40),Random(-80,-90),128)
	TNT1 A 0 A_CustomBulletAttack(18.3,18.3,4,Random(5,15)*6,"LegModdedBulletPuff")
	TNT1 A 0 A_PlaySound("Weapons/LegAutoShotgun",1)
	NLD7 F 5 Fast A_GiveInventory("LegZombieStrafing",1)
	NLD7 A 0 A_Jump(60,"Pause","TryCoachgun")
	NLD7 A 0 A_Jump(15,"Grenade")
	Loop
  ReloadASG:
	TNT1 A 0 A_Jump(128,2)
	TNT1 A 0 A_JumpIfCloser(350,"Coachgun")
    TNT1 A 0 A_ChangeFlag("NOPAIN",1)
	NLD7 E 7 Fast A_SpawnItemEx("NewLegDoomguySmokeSpawner")
	TNT1 A 0 A_SpawnItemEx("NewLegDoomguySmokeSpawner")
	NLD7 E 5 Fast A_PlaySound("lasgguy/asgout")
	TNT1 A 0 A_SpawnItemEx("LegendaryEmptyDrumSpawner", -8, 7, 30, 4, 0, (0.1)*Random(30, 40), Random(-80, -90), 128)
	TNT1 A 0 A_TakeInventory("ASGZAmmo",16)
    NLD7 EEEEEEEE 6 Fast A_SpawnItemEx("NewLegDoomguySmokeSpawner")
	TNT1 A 0 A_SpawnItemEx("NewLegDoomguySmokeSpawner")
    NLD7 E 11 Fast A_PlaySound("lasgguy/asgin") 
    TNT1 A 0 A_ChangeFlag("NOPAIN",0)
    Goto See
	
	
  TryCoachgun:
	TNT1 A 0 A_JumpIfCloser(350,"Coachgun")
	Goto Pause
  Coachgun:
	TNT1 A 0 A_PlaySound("Coachgun/Pickup",7,1.0,0,0.5)
	NLD8 E 10 Fast
	NLD8 EE 5 Fast A_GiveInventory("LegZombieStrafing",1)
	TNT1 AAAAAAAA 0 A_CustomMissile("LegendaryBlueTracer",Random(28,34),0,frandom(-6,6),CMF_OFFSETPITCH,frandom(-3,3))
	TNT1 A 0 A_CustomBulletAttack(24.5,19,10,Random(5,15)*6,"LegModdedBulletPuff")
	TNT1 A 0 A_PlaySound("Coachgun/Fire1",1)
	NLD8 F 5 Fast A_GiveInventory("LegZombieStrafing",1)
	NLD8 EEE 5 Fast A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_GiveInventory("LegZombieStrafing",1)
	NLD8 E 6 Fast A_PlaySound("Coachgun/Open")
	TNT1 A 0 A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_SpawnItemEx("BlueShellCasing",-8,6,36,Random(2,6),0,random(1,3),random(-80,-90),128)
	NLD8 E 1 A_SpawnItemEx("BlueShellCasing",-10,6,36,Random(2,6),0,random(1,3),random(-80,-90),128)
	NLD8 E 6 Fast A_PlaySound("Coachgun/Load")
	TNT1 A 0 A_GiveInventory("LegZombieStrafing",1)
	NLD8 E 6 Fast A_PlaySound("Coachgun/Close")
	TNT1 A 0 A_GiveInventory("LegZombieStrafing",1)
	NLD8 E 6 Fast
	NLD8 A 0 A_Jump(64,"Grenade")
	Goto See
	
	
  LMG:
	NLD0 E 10 A_FaceTarget
  LMGLoop:
	TNT1 A 0 A_JumpIfInventory("MarineKilled",1,"Taunt")
	
	TNT1 A 0 A_JumpIfInventory("LegAK47Ammo",76,"ReloadLMG")
	NLD0 E 3 Fast A_GiveInventory("LegZombieStrafing",1)	
	TNT1 A 0 A_JumpIf(user_infammo == 1,2)
	TNT1 A 0 A_GiveInventory("LegAK47Ammo",1)
	TNT1 A 0 A_CustomMissile("LegendaryBlueTracer",Random(28,34),0,frandom(-6,6),CMF_OFFSETPITCH,frandom(-3,3))
	TNT1 A 0 A_SpawnItemEx("LegRifleCasing", 12, -6, 36, Random(2, 6), 0, Random(1, 3), Random(-80, -90), 128)
	TNT1 A 0 A_CustomBulletAttack(12,9,1,Random(10,20)*3,"LegModdedBulletPuff")
	TNT1 A 0 A_PlaySound("weapons/LMGFire",1)
	NLD0 F 3 Fast A_GiveInventory("LegZombieStrafing",1)	
	TNT1 A 0 A_JumpIfCloser(350,"ASG")
	TNT1 A 0 A_MonsterRefire(128,"See")
	TNT1 A 0 A_Jump(20,"PauseLMG")
	NLD0 A 0 A_Jump(15,"Grenade")
	Loop
  ReloadLMG:
    TNT1 A 0 A_ChangeFlag("NOPAIN",1)
    TNT1 A 0 A_PlaySound("weapons/LMGReload2")
	TNT1 A 0 A_SpawnItemEx("LegendaryEmptyDrumSpawner", -8, 7, 30, 4, 0, (0.1)*Random(30, 40), Random(-80, -90), 128)
	TNT1 A 0 A_TakeInventory("LegAK47Ammo",76)
    NLD0 EE 25 Fast A_SpawnItemEx("NewLegDoomguySmokeSpawner")
	TNT1 A 0 A_SpawnItemEx("NewLegDoomguySmokeSpawner")
    NLD0 E 20 Fast A_PlaySound("weapons/LMGReload1") 
	TNT1 A 0 A_SpawnItemEx("NewLegDoomguySmokeSpawner")
	NLD0 E 40 Fast A_PlaySound("weapons/LMGReload3")
    TNT1 A 0 A_ChangeFlag("NOPAIN",0)
    Goto See
  PauseLMG:
	NLD0 EE 5 A_SpawnItemEx("NewLegDoomguySmokeSpawner")
	Goto See
	
	
  PlasmaticRifle:
	TNT1 A 0 A_PlaySound("weapons/legup",7,1.0,0,0.5)
	NLD9 E 10 A_FaceTarget
  PlasmaticRifleLoop:
	TNT1 A 0 A_JumpIfInventory("MarineKilled",1,"Taunt")
	
	TNT1 A 0 A_JumpIfInventory("LegZombieRifleAmmo",25,"ReloadPlasmaticRifle")
	TNT1 A 0 A_JumpIf(user_infammo == 1,2)
	TNT1 A 0 A_GiveInventory("LegZombieRifleAmmo",1)
	TNT1 A 0 A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_PlaySound("BlueDTRFire",1)
	NLD9 F 4 Fast A_CustomMissile("LegendaryProjectile",32,0,random(-2,2),CMF_TRACKOWNER)
	TNT1 A 0 A_JumpIf(user_infammo == 1,2)
	TNT1 A 0 A_GiveInventory("LegZombieRifleAmmo",1)
	TNT1 A 0 A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_PlaySound("BlueDTRFire",1)
	NLD9 E 4 Fast A_CustomMissile("LegendaryProjectile",32,0,random(-2,2),CMF_TRACKOWNER)
	NLD9 A 0 A_MonsterRefire(128,"Pause")
	TNT1 A 0 A_Jump(24,"PausePlasmaticRifle")
	NLD9 A 0 A_Jump(10,"Grenade")
	Loop
  ReloadPlasmaticRifle:
    TNT1 A 0 A_ChangeFlag("NOPAIN",1)
	NLD9 E 4 Fast A_PlaySound("weapons/demontecheject")
	NLD9 E 10 Fast A_PlaySound("weapons/demontechsteam")
	TNT1 A 0 A_SpawnItemEx("LDemonTechEmptyMag", -8, 7, 30, 4, 0, (0.1)*Random(30, 40), Random(-80, -90), 128)
	TNT1 A 0 A_TakeInventory("LegZombieRifleAmmo",25)
    NLD9 EEEEE 5 Fast A_SpawnItemEx("NewLegDoomguySmokeSpawner")
	TNT1 A 0 A_SpawnItemEx("NewLegDoomguySmokeSpawner")
    NLD9 E 6 Fast A_PlaySound("weapons/demontechload") 
	TNT1 A 0 A_SpawnItemEx("NewLegDoomguySmokeSpawner")
	NLD9 E 12 Fast A_PlaySound("weapons/demontechclick3")
    TNT1 A 0 A_ChangeFlag("NOPAIN",0)
    Goto See
  PausePlasmaticRifle:
	NLD9 A 0 A_PlaySound("weapons/demontechsteam",6)
	Goto Pause
	
	
  SaberAlt:
	TNT1 A 0 A_PlaySound("Saber/Pickup",7,1.0,0,0.5)
	NLD2 E 10
	TNT1 A 0 A_PlaySound("Saber/Swing",1)
	TNT1 A 0 A_PlaySound("Saber/AltSwing",6,1.0,0,0.5)
	NLD2 FF 6 Fast A_GiveInventory("LegZombieStrafing",1)
	NLD2 F 8 Fast A_CustomMissile("CrusaderRazorWind",32)
	TNT1 A 0 A_PlaySound("Saber/Swing",1)
	TNT1 A 0 A_PlaySound("Saber/AltSwing",6,1.0,0,0.5)
	NLD2 FF 6 Fast A_GiveInventory("LegZombieStrafing",1)
	NLD2 F 8 Fast A_CustomMissile("CrusaderRazorWind",32)
	TNT1 A 0 A_PlaySound("Saber/Swing",1)
	TNT1 A 0 A_PlaySound("Saber/AltSwing",6,1.0,0,0.5)
	NLD2 FF 6 Fast A_GiveInventory("LegZombieStrafing",1)
	NLD2 F 12 Fast A_CustomMissile("CrusaderRazorWind",32)
	TNT1 A 0 A_PlaySound("weapons/LMGReload3",7,1.0,0,0.5)
	Goto See
	
	
  Cannon:
	TNT1 A 0 A_PlaySound("legendarycannon/up",7,1.0,0,0.5)
	NLD6 E 15 A_FaceTarget
	TNT1 A 0 A_SetUserVar(user_missile,random(0,5))
  CannonLoop:
	NLD6 A 0 A_JumpIf(user_missile >= 10,"Pause")
	TNT1 A 0 A_SetUserVar(user_missile,user_missile+1)
	NLD6 EE 5 Fast A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_PlaySound("LegCannon/Fire",1)
	TNT1 A 0 A_CustomMissile("LegDoomguyCannonBall",32)
	NLD6 FF 5 Fast A_GiveInventory("LegZombieStrafing",1)
	NLD6 A 0 A_MonsterRefire(128,"Pause")
	Loop
	
	
  CannonAlt:
	TNT1 A 0 A_PlaySound("legendarycannon/up",7,1.0,0,0.5)
	NLD6 E 15 A_FaceTarget
	TNT1 A 0 A_PlaySound("legendarycannon/charge",6,1.0,0,0.5)
	NLD6 E 10 A_FaceTarget
	TNT1 A 0 A_SetUserVar(user_missile,random(0,4))
  CannonAltLoop:
	NLD6 A 0 A_JumpIf(user_missile >= 8,"Pause")
	TNT1 A 0 A_SetUserVar(user_missile,user_missile+1)
	NLD6 EEE 6 Fast A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_PlaySound("LegCannon/Fire2",1)
	TNT1 AAA 0 A_CustomMissile("LegCommanderProj",32,0,random(-13,13),CMF_OFFSETPITCH,frandom(-5,5))
	NLD6 F 6 Fast A_GiveInventory("LegZombieStrafing",1)
	NLD6 A 0 A_MonsterRefire(128,"Pause")
	Loop
	
	
  BFG:
	TNT1 A 0 A_PlaySound("LDoomguy/BFG2",2,1.0,0,0.5)
	TNT1 A 0 A_JumpIf(user_bfg == 0,3)
	TNT1 A 0 A_SetUserVar(user_bfg,1)
	TNT1 A 0 A_PlaySound("LDoomguy/BFG",2,1.0,0,0.5)
	TNT1 A 0 A_PlaySound("Weapons/GuruUp",7,1.0,0,0.5)
	NLD3 E 15 A_FaceTarget
	TNT1 A 0 A_PlaySound("Weapons/GuruTrigger",6,1.0,0,0.5)
	NLD3 E 10 A_FaceTarget
	TNT1 A 0 A_PlaySound("Weapons/GuruCharge",1,1.0,0,0.5)
	NLD3 EEEEEEEEEEEEEEEEEEEE 5 A_GiveInventory("LegZombieStrafing",1)
    TNT1 A 0 A_PlaySound("Weapons/GuruFire",1,1.0,0,0.5)
  	TNT1 A 0 A_PlaySound("Weapons/GuruAddFire",6,1.0,0,0.5)
	NLD3 F 20 A_CustomMissile("CyberGuruball",32)
	Goto Pause
	
	
  BFGAlt:
	TNT1 A 0 A_PlaySound("Weapons/GuruUp",7,1.0,0,0.5)
	NLD3 E 15 A_FaceTarget
	TNT1 A 0 A_SetUserVar(user_missile,random(0,2))
  BFGAltLoop:
	NLD3 A 0 A_JumpIf(user_missile >= 3,"Pause")
	TNT1 A 0 A_SetUserVar(user_missile,user_missile+1)
	NLD3 EE 5 Fast A_GiveInventory("LegZombieStrafing",1)
  	TNT1 A 0 A_PlaySound("Weapons/GuruAddFire",1,1.0,0,0.5)
	NLD3 F 15 Fast A_CustomMissile("LegCyberLaserBeam")
	NLD3 EEEEE 5 Fast A_GiveInventory("LegZombieStrafing",1)
	NLD3 A 0 A_MonsterRefire(128,"Pause")
	Loop
	
	
  10k:
	TNT1 A 0 A_PlaySound("Leg10k/Draw",7,1.0,0,0.5)
    NLD5 E 15 A_FaceTarget
	TNT1 A 0 A_PlaySound("weapons/charge15k",1)
	NLD5 EEEEE 6 Fast A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_SetUserVar(user_missile,random(0,10))
  10kLoop:
	TNT1 A 0 A_JumpIf(user_missile >= 20,"10kPause")
	TNT1 A 0 A_SetUserVar(user_missile,user_missile+1)
	NLD5 E 2 A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_PlaySound("weapons/bfg15kfire",1)
	NLD5 F 2 A_CustomMissile("Legendary10KProjectile",32,0,frandom(-6,6),CMF_OFFSETPITCH,frandom(-2,2))
	Loop
  10kPause:
	NLD5 A 0 A_PlaySound("weapons/bfg15kcooldown",6)
	Goto Pause


  10kAlt:
	TNT1 A 0 A_PlaySound("Leg10k/Draw",7,1.0,0,0.5)
    NLD5 E 15 A_FaceTarget
	TNT1 A 0 A_PlaySound("EnragedDTech/Charge",1)
	NLD5 EEEEE 8 Fast A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_SetUserVar(user_missile,random(0,2))
  10kAltLoop:
	TNT1 A 0 A_JumpIf(user_missile >= 6,"10kPause")
	TNT1 A 0 A_SetUserVar(user_missile,user_missile+1)
	NLD5 E 4 Fast A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_GiveInventory("LegZombieStrafing",1)
	TNT1 A 0 A_PlaySound("LesserCardinal/BFGFire",1)
	NLD4 F 6 Fast A_CustomMissile("LegCyberNobleMiniDTBFG",32,0,frandom(-6,6),CMF_OFFSETPITCH,frandom(-2,2))
	Loop
	
	
  Pain:
	TNT1 A 0 A_JumpIfHealthLower(800,"TryShard")
	TNT1 A 0 A_Jump(32,"PowerShard","ResistanceBuff")
  PainContinue:
	NLD0 G 3
	NLD0 G 3 A_Pain
	TNT1 A 0 A_Jump(192,"Missile")
	Goto See
  TryShard:
	TNT1 A 0 A_Jump(128,"TryResistance")
	TNT1 A 0 A_JumpIf(user_powershardlimit >= 3,"TryResistance")
	TNT1 A 0 A_JumpIf(user_powershard == 1,"TryResistance")
	Goto PowerShard
  TryResistance:
	TNT1 A 0 A_JumpIf(user_resistancebufflimit >= 4,"PainContinue")
	TNT1 A 0 A_JumpIf(user_resistancebuff == 1,"PainContinue")
	Goto ResistanceBuff
	
	
  Death:
	TNT1 A 0 A_ChangeFlag("Bright",0)
	TNT1 A 0 A_SpawnItemEx("RingOfRegenerationHalf",0,0,12,random(0,8),random(0,8),2,random(0,360),0,0)
	TNT1 A 0 A_SpawnItemEx("LegendaryCoachgun",0,0,12,random(0,8),random(0,8),2,random(0,360),0,32)
	TNT1 A 0 A_SpawnItemEx("Legendary Assault Shotgun",0,0,12,random(0,8),random(0,8),2,random(0,360),0,32)
	TNT1 A 0 A_SpawnItemEx("Legendary Plasmatic Rifle",0,0,12,random(0,8),random(0,8),2,random(0,360),0,32)
	TNT1 A 0 A_SpawnItemEx("Legendary Plasmatic Cannon",0,0,12,random(0,8),random(0,8),2,random(0,360),0,128)
	TNT1 A 0 A_SpawnItemEx("LegendaryBFG10k",0,0,12,random(0,8),random(0,8),2,random(0,360),0,200)
	TNT1 A 0 A_SpawnItemEx("Legendary BFG",0,0,12,random(0,8),random(0,8),2,random(0,360),0,200)
	TNT1 A 0 A_SpawnItemEx("LegendaryLifeEssence",0,0,12,random(0,8),random(0,8),2,random(0,360),0,200)
	TNT1 A 0 A_SpawnItemEx("LegendaryLifeEssence",0,0,12,random(0,8),random(0,8),2,random(0,360),0,200)
	TNT1 A 0 A_SpawnItemEx("LegendaryLifeEssence",0,0,12,random(0,8),random(0,8),2,random(0,360),0,200)
	TNT1 A 0 A_SpawnItemEx("LegendaryBossLifeEssence",0,0,12,random(0,8),random(0,8),2,random(0,360),0,200)
	TNT1 A 0 A_SpawnItemEx("LegendaryArmorBonusMax",0,0,12,random(0,8),random(0,8),2,random(0,360),0,200)
	TNT1 A 0 A_SpawnItemEx("LegendaryArmorBonusMax",0,0,12,random(0,8),random(0,8),2,random(0,360),0,200)
	TNT1 A 0 A_SpawnItemEx("LegendaryArmorBonusMax",0,0,12,random(0,8),random(0,8),2,random(0,360),0,200)
	TNT1 A 0 A_SpawnItemEx("LegendaryBossArmorBonusMax",0,0,12,random(0,8),random(0,8),2,random(0,360),0,200)
	NLD0 H 5 A_Scream
	NLD0 I 5 A_NoBlocking
	NLD0 JK 5
	NLD0 L 5 A_SpawnItem("BodyCrash",0,0,0,0)
	NLD0 M 5
	TNT1 A 0 A_SpawnItemEx("LegDoomguySoulEffect",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
	NLD0 N 5 ACS_NamedExecuteAlways("DropDoll",0,75)
	NLD0 N 20
	TNT1 A 0 A_PlaySoundEx("brain/spit","Voice",0,2)
	NLD0 N 1 A_SpawnItemEx("LegendaryHeroSoul",0,0,16,0,0,0,0,SXF_NOCHECKPOSITION|SXF_TELEFRAG)
	NLD0 N -1
	Stop
	}
}

ACTOR LegDoomguySkullOfPower : PowerupGiver
{
  Inventory.MaxAmount 1
  Powerup.Duration -30
  Powerup.Type "Power4xDamage"
  +INVENTORY.AUTOACTIVATE
  +INVENTORY.ALWAYSPICKUP
}

Actor EnemySaberResistance : PowerProtection
{
  DamageFactor "Normal", 0.25
}

Actor LegDoomguySaberResistance : PowerupGiver
{
  Inventory.MaxAmount 1
  Powerup.Duration -30
  Powerup.Type "EnemySaberResistance"
  +INVENTORY.ALWAYSPICKUP
  +INVENTORY.AUTOACTIVATE
}

Actor LegDoomguyCannonBall : LegendaryCannonBallCF
{
  Damage 40
  Species "LegendaryDoomguy"
}

Actor LegendaryDoomguyGhostA
{
  Renderstyle Translucent
  Alpha 0.7
  +NOTIMEFREEZE
  +NOINTERACTION
  +CLIENTSIDEONLY
  States
  {
  Spawn:
	TNT1 A 0 NoDelay A_JumpIf(ACS_ExecuteWithResult(304) == 1,"Null")
	TNT1 A 0 A_CheckSight("Null")
	TNT1 A 1
	Goto Fade
  Fade:
	NLD0 A 2 A_FadeOut(0.1)
	Loop
	}
}

Actor LegendaryDoomguyGhostB : LegendaryDoomguyGhostA
{
  States
  {
  Fade:
	NLD0 B 2 A_FadeOut(0.1)
	Loop
	}
}

Actor LegendaryDoomguyGhostC : LegendaryDoomguyGhostA
{
  States
  {
  Fade:
	NLD0 C 2 A_FadeOut(0.1)
	Loop
	}
}

Actor LegendaryDoomguyGhostD : LegendaryDoomguyGhostA
{
  States
  {
  Fade:
	NLD0 D 2 A_FadeOut(0.1)
	Loop
	}
}

Actor NewLegDoomguySmokeSpawner
{
  +NOTIMEFREEZE
  +NOINTERACTION
  +CLIENTSIDEONLY
  States
  {
  Spawn:
	TNT1 A 0 NoDelay A_JumpIf(CallAcs("LCAEffectCheck"),"Toaster")
	TNT1 AAA 0 A_SpawnItemEx("AHellionSmoke",random(12,-12),random(12,-12),random(12,64),0,0,random(1,3),0,128,0)
	TNT1 A 1 A_SpawnItemEx("LegDoomguySmoke",random(20,-20),random(20,-20),random(20,40))
	Stop
  Toaster:
	TNT1 A 1 A_SpawnItemEx("LegDoomguySmoke",random(20,-20),random(20,-20),random(20,40),0,0,0,0,0,160)
	Stop	
	}
}

Actor NewLegDoomguySmokeSpawner2 : NewLegDoomguySmokeSpawner
{
  +NOTIMEFREEZE
  +NOINTERACTION
  +CLIENTSIDEONLY
  States
  {
  Spawn:
	TNT1 A 0 NoDelay A_JumpIf(CallAcs("LCAEffectCheck"),"Toaster")
	TNT1 AAA 0 A_SpawnItemEx("AHellionSmoke",random(12,-12),random(12,-12),random(12,64),0,0,random(1,3),0,128,0)
	TNT1 A 1 A_SpawnItemEx("LegDoomguySmoke",random(40,-40),random(40,-40),random(60,100))
	Stop
  Toaster:
	TNT1 A 1 A_SpawnItemEx("LegDoomguySmoke",random(40,-40),random(40,-40),random(60,100),0,0,0,0,0,160)
	Stop	
	}
}

Actor NewLegendaryDoomguySummoner : LegendaryDoomguySummoner replaces LegendaryDoomguySummoner
{
  Alpha 0
  Renderstyle Translucent
  States
  {
  Spawn:
	TNT1 A 175 Bright
  Death:
	TNT1 A 0 Bright
	TNT1 A 0 A_SpawnItemEx("CircleSpawnFX",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION)
	TNT1 A 0 A_SpawnItemEx("LegDoomguyThunderSpawner",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION)
	NLD0 WWWWWWWWWWVVVVVVVVVV 1 A_FadeIn(0.05)
	TNT1 A 0 A_SpawnItemEx ("LegDoomguySummonEffect",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
	NLD0 UUUUUUUUU 5 A_SpawnItemEx("LDoomguySmokeSpawner2",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION|SXF_CLIENTSIDE)
	TNT1 A 0 A_SpawnItemEx("LDoomguySmokeSpawner",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION|SXF_CLIENTSIDE)
	TNT1 A 0 A_SpawnItemEx ("LegDoomguySummonEffect",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
	NLD0 TTTTTTTTT 5 A_SpawnItemEx("LDoomguySmokeSpawner2",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION|SXF_CLIENTSIDE)
	TNT1 A 0 A_SpawnItemEx("LDoomguySmokeSpawner",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION|SXF_CLIENTSIDE)
	TNT1 A 0 A_SpawnItemEx("LegDoomguySummonEffect",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
	NLD0 SSSSSSSSS 5 A_SpawnItemEx("LDoomguySmokeSpawner2",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION|SXF_CLIENTSIDE)
	TNT1 A 0 A_SpawnItemEx("LDoomguySmokeSpawner",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION|SXF_CLIENTSIDE)
	TNT1 A 0 A_SpawnItemEx("LegDoomguySummonEffect",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
	NLD0 RRRRRRRRR 5 A_SpawnItemEx("LDoomguySmokeSpawner2",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION|SXF_CLIENTSIDE)
	TNT1 A 0 A_SpawnItemEx("LDoomguySmokeSpawner",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION|SXF_CLIENTSIDE)
	TNT1 A 0 A_SpawnItemEx("LegDoomguySummonEffect",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
	NLD0 QQQQQQQQQ 5 A_SpawnItemEx("LDoomguySmokeSpawner2",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION|SXF_CLIENTSIDE)
	TNT1 A 0 A_SpawnItemEx("LDoomguySmokeSpawner",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION|SXF_CLIENTSIDE)
	TNT1 A 0 A_SpawnItemEx("LegDoomguySummonEffect",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
	NLD0 PPPPPPPPP 5 A_SpawnItemEx("LDoomguySmokeSpawner2",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION|SXF_CLIENTSIDE)
	TNT1 A 0 A_SpawnItemEx("LDoomguySmokeSpawner",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION|SXF_CLIENTSIDE)
	TNT1 A 0 A_SpawnItemEx("LegDoomguySummonEffect",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
	NLD0 OOOOOOOOO 5 A_SpawnItemEx("LDoomguySmokeSpawner2",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION|SXF_CLIENTSIDE)
	TNT1 A 0 A_SpawnItemEx("LDoomguySmokeSpawner",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION|SXF_CLIENTSIDE)
	NLD0 AAAAAAAAA 5 A_SpawnItemEx("LDoomguySmokeSpawner2",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION|SXF_CLIENTSIDE)
	TNT1 A 0 A_SpawnItemEx("LDoomguySmokeSpawner",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION|SXF_CLIENTSIDE)
	TNT1 A 0
	TNT1 A 2 A_SpawnItemEx("LDoomguySmokeSpawner2",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION|SXF_CLIENTSIDE)
	TNT1 A 1 A_Explode(1000,40,0)
	TNT1 A 1 A_SpawnItemEx("LegendaryDoomguy",0,0,1,0,0,0,0,SXF_NOCHECKPOSITION|SXF_TELEFRAG)
	Stop
	}
}