ACTOR NoMusicEnragedLegendaryCommando 
{
Monster
Health 875 //Nerf Health For Balance
Radius 20
Height 56
Speed 14
Mass 200
PainChance 15
BloodColor "Red"
DropItem "LegendaryBossLifeEssence" 256
DropItem "LegendaryBossArmorBonusMax" 256
DropItem "LegendaryBossLifeEssence" 128
DropItem "LegendaryBossArmorBonusMax" 128
DamageFactor "PDTBFG", 0.20
DamageFactor "PDTBFGTracer", 0.20
DamageFactor "PlayerDevBall", 0.120
DamageFactor "PlayerDevBall2", 0.120
DamageFactor "PlayerDTBFGRailgunSlug", 0.120
DamageFactor "PlayerDevTracer", 0.120
DamageFactor "Legendary", 0.0
DamageFactor "LegendaryPlayer", 0.3
DamageFactor "LegendaryGuru", 0.0
DamageFactor "LegendaryGuruPlayer", 0.3
DamageFactor "LACGrenade", 0.0
DamageFactor "LegendaryZombie", 0.0
DamageFactor "GeneralTracer", 0.0
DamageFactor "DBFG10K2", 0.65
DamageFactor "PlayerDBFG10K2", 0.65
DamageFactor "DBFG2", 0.65
DamageFactor "PlayerDBFG2", 0.65
DamageFactor "PlayerDTRG", 0.5
DamageFactor "CerChainguns", 0.0
DamageFactor 0.65
DamageFactor "Legendary", 0.0
DamageFactor "LegendaryPlayer", 0.0
DamageFactor "LACGrenade", 0.0
SeeSound "ELEGCommando/See"
PainSound "ELEGCommando/pain"
DeathSound "ELEGCommando/death"
ActiveSound "ELEGCommando/active"
Obituary "%o was dishonorably discharged by an Enraged Legendary Commando."
Tag "\c[m6]Enraged\c- \c[z3]Legendary Commando Summoning\c-"
+NOTIMEFREEZE
+BOSS
+BOSSDEATH
+FLOORCLIP
+MISSILEMORE
+MISSILEEVENMORE
+QUICKTORETALIATE
+NOICEDEATH
+NODROPOFF
+DONTGIB
+NOTARGET
+NORADIUSDMG
+NOFEAR
+NOKILLSCRIPTS
+BRIGHT
var int user_protection;
var int user_protected;
var int user_ProxLoad;
var int user_missile;
States
{
  Spawn:
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner")
    ECOS A 10 A_Look
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner")
	ECOI A 10 A_Look
    Loop
  See:
    ECOS A 0 A_JumpIfTargetInLOS("Strafing")
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner")
    ECOS AABB 3 A_Chase
	TNT1 A 0 A_SpawnItem("LegendaryFootStep")
	ECOS A 0 A_JumpIfTargetInLOS("Strafing")
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner")
	ECOS CCDD 3 A_Chase
	ECOS A 0 A_Jump(80,"Rush")
	TNT1 A 0 A_SpawnItem("LegendaryFootStep")
    Loop
  Rush:
    ECOS A 0 A_JumpIfTargetInLOS("Strafing")
	TNT1 A 0 A_SpawnItem("LegendaryFootStep")
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner")
	TNT1 A 0 A_SpawnItemEx("EnragedLegCommandoGhostA")
	ECOS A 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("EnragedLegCommandoGhostA")
	ECOS A 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("EnragedLegCommandoGhostB")
	ECOS B 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("EnragedLegCommandoGhostB")
	ECOS B 1 A_Chase
	TNT1 A 0 A_SpawnItem("LegendaryFootStep")
    TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner")
	TNT1 A 0 A_SpawnItemEx("EnragedLegCommandoGhostC")
	ECOS C 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("EnragedLegCommandoGhostC")
	ECOS C 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("EnragedLegCommandoGhostD")
	ECOS D 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("EnragedLegCommandoGhostD")
	ECOS D 1 A_Chase
	TNT1 A 0 A_SpawnItem("LegendaryFootStep")
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner")
	TNT1 A 0 A_Jump(84,"See")
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner")
	Loop
  Strafing:
	TNT1 A 0 A_SpawnItem("LegendaryFootStep")
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	ECOS AA 3 A_GiveInventory("LegZombieStrafingg2",1)
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	ECOS BB 3 A_GiveInventory("LegZombieStrafingg2",1)
	TNT1 A 0 A_SpawnItem("LegendaryFootStep")
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
    ECOS CC 3 A_GiveInventory("LegZombieStrafingg2",1)	
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	ECOS DD 3 A_GiveInventory("LegZombieStrafingg2",1)
	Goto See
  Pause:
	ECOS EEEEE 3 A_GiveInventory("LegZombieStrafingg2",1)
	Goto See	
  Missile:
    TNT1 A 0 A_SetShootable
    TNT1 A 0 A_UnsetInvulnerable
    TNT1 A 0 A_SetTranslucent(1)
    TNT1 A 0 A_Jump(88,"Combo","Grenades","ProxMines","LegendaryStar","ClusterBomb")
  Normal:
	ECOS EEEE 3 A_GiveInventory("LegZombieStrafingg2",1)
	ECOS E 3 A_GiveInventory("LegZombieStrafingg2",1)
	TNT1 A 0 A_GiveInventory("LegZombieStrafingg2",1)
	TNT1 A 0 A_CustomMissile("EnragedLegCommanderProj",32)
	ECOS F 3 A_PlaySoundEx("legendarycannon/fire","Weapon")
	TNT1 A 0 A_Jump(24,"Pause")
	TNT1 A 0 A_SpidRefire
	Goto Normal+3
  Combo:
	ECOS E 0 A_SetInvulnerable
	ECOS E 0 A_PlaySound("superzombie/sight")
	ECOS E 1 A_FaceTarget
	ECOS EEEE 3 A_GiveInventory("LegZombieStrafingg3",1)
	LEGW A 0 A_PlayWeaponSound("legendarycannon/charge")
	ECOS EEEEE 3 A_GiveInventory("LegZombieStrafingg3",1)
	ECOS E 0 A_UnSetInvulnerable
  ComboLoop:
    TNT1 A 0 A_JumpIf (user_missile >= 10,"ComboEnd")
	TNT1 A 0 A_CustomMissile("ELegRevBall",32,0,random(-2,2))
	ECOS FE 3 A_GiveInventory("LegZombieStrafingg2",1)
	TNT1 A 0 A_SetUserVar(user_missile,user_missile+1)
	Loop
  ComboEnd:
    TNT1 A 0 A_SetUserVar(user_missile,0)
	ECOS EEEE 3 A_GiveInventory("LegZombieStrafingg2",1)
	TNT1 A 0 A_Jump(80,"Grenades")
	Goto See
  Grenades:
	ECOS EEEEEEEE 3 A_GiveInventory("LegZombieStrafingg2",1)
  GrenadesLoop:
    TNT1 A 0 A_JumpIf (user_missile >= 6,"ComboEnd")
	ECOS EEE 3 A_GiveInventory("LegZombieStrafingg2",1)
	TNT1 A 0 A_GiveInventory("LegZombieStrafingg2",1)
	ECOS F 3 A_CustomMissile("EnragedCommandoRocket",32)	
	TNT1 A 0 A_SetUserVar(user_missile,user_missile+1)
	Loop
  LegendaryStar:
	ECOS E 0 A_SetInvulnerable
	ECOS E 0 A_PlaySound("superzombie/sight")
	ECOS E 1 A_FaceTarget
	ECOS EEEE 3 A_GiveInventory("LegZombieStrafingg3",1)
	LEGW A 0 A_PlayWeaponSound("star/load3")
	ECOS EEEEE 3 A_GiveInventory("LegZombieStrafingg3",1)
	ECOS E 0 A_UnSetInvulnerable
	ECOS F 0 A_PlayWeaponSound("star/fire")
	ECOS F 7 A_CustomMissile("LegCommandoRedStar",32)
	ECOS E 8 A_FaceTarget
	Goto See
  Clusterbomb:
    TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner")
	ECOS E 0 A_PlaySound("ELegCommando/Star",0,1,0,ATTN_NONE)
	ECOS E 0 A_PlaySound("cydes/mischrg",7,1,0,0.5)
	ECOS E 1 A_FaceTarget
	ECOS EEEEEEEEEEEEEE 3 A_GiveInventory("LegZombieStrafingg3",1)
	TNT1 A 0 A_PlaySound("lrball3/shot")
	ECOS F 7 A_CustomMissile("ELegRevBall3",32)
	ECOS E 10 A_FaceTarget
	TNT1 A 0 A_Jump(196,"See")
	TNT1 A 0 A_PlaySound("lrball3/shot")
	ECOS F 7 A_CustomMissile("ELegRevBall3",32)
	ECOS E 10 A_FaceTarget
	Goto See
  ProxMines:
    TNT1 A 0 A_JumpIf(user_ProxLoad == 1,"ProxDetonate")
	TNT1 A 0 A_SetUserVar(user_ProxLoad,1)
    ECOS E 0 A_PlaySound("ELegCommando/Star",0,1,0,ATTN_NONE)
	ECOS EEEEE 3 A_GiveInventory("LegZombieStrafingg3",1)
  ProxMineLoop:
    TNT1 A 0 A_JumpIf (user_missile >= 8,"ComboEnd")
	ECOS F 5 A_CustomMissile("ELegCommandoProxMine",32)
	ECOS EEEE 3 A_GiveInventory("LegZombieStrafingg2",1)
	TNT1 A 0 A_SetUserVar(user_missile,user_missile+1)
	Loop
  ProxDetonate:
    ECOS E 0 A_PlaySound("ELegCommando/Star",0,1,0,ATTN_NONE)
	ECOS EEEEE 3 A_GiveInventory("LegZombieStrafingg3",1)
	TNT1 AAAAAAAAAAAA 0 A_CustomMissile("MakeThoseEnragedMinesExplodeNicely",32,0,random(0,360))
	ECOS E 3 A_GiveInventory("LegZombieStrafingg3",1)
	ECOS E 3 A_GiveInventory("LegZombieStrafingg3",1)
	TNT1 A 0 A_SetUserVar(user_ProxLoad,0)
	Goto Missile
  Pain:
	TNT1 A 0 A_Jump(20,"Protection")
	ECOS G 3
	ECOS G 3 A_Pain
	TNT1 A 0 A_Jump(192,"Missile")
	Goto See	
  Protection:
	TNT1 A 0 A_JumpIf(user_protection >= 3,"Pain")
	TNT1 A 0 A_JumpIf(user_protected == 1,"Pain")
	TNT1 A 0 A_PlaySound("legendary/defense")
	TNT1 A 0 A_FaceTarget
	ECOS E 2 ACS_NamedExecuteAlways("EnragedLegendaryProtection")
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner")
	Goto See	
  Death:
    TNT1 A 0 A_ChangeFlag("BRIGHT",0)
    TNT1 A 0 A_Jump(36,"LegendarySoul")
    TNT1 A 0 A_StopSound(6)
	ECOS H 5 A_Scream
    ECOS I 5 A_Fall
	TNT1 AAAAAAAAAAAA 0 A_CustomMissile("MakeThoseEnragedMinesExplodeNicely",32,0,random(0,360))
    ECOS J 5 A_SpawnItem("BodyCrash")
    ECOS KLM 5 
    ECOS N -1
	Stop
  LegendarySoul:
    TNT1 A 0 A_StopSound(6)
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner")
	ECOS H 5 A_Scream
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner")
    ECOS I 5 A_Fall
	TNT1 A 0 A_SpawnItem("EnragedHellionSmokeSpawner")
    ECOS J 5 A_SpawnItem("BodyCrash")
    ECOS K 5 A_SpawnItem("EnragedHellionSmokeSpawner")
    ECOS L 5 A_SpawnItem("EnragedHellionSmokeSpawner")
    ECOS M 5 A_SpawnItem("EnragedHellionSmokeSpawner")
	ECOS N 140 A_SpawnItem("EnragedHellionSmokeSpawner")
	ECOS N 0 A_PlaySoundEx("brain/spit","Voice",0,2)
	ECOS NNNNNNNNNNNNNNNNN 2 Bright A_SpawnItem("ELegSoulEventSmokeSpawner",1)
	ECOS NNNNNNNNNNNNNNNNN 2 Bright A_SpawnItem("ELegSoulEventSmokeSpawner",1)
	ECOS NNNNNNNNNNNNNNNNN 2 Bright A_SpawnItem("ELegSoulEventSmokeSpawner",1)
	TNT1 A 0 A_SpawnItemEx("EnragedLegendarySoul",0,0,16,0,0,0,0,32)
	TNT1 A 0 A_SpawnItemEx("TeleportFog",0,0,16,0,0,0,0,32)
	ECOS N -1
	Stop	
  XDeath:
    TNT1 A 0 A_StopSound(6)
	ECOS O 3 A_SpawnItemEx("EnragedGibbedGenerator")
    ECOS P 3 A_XScream
    ECOS R 3 A_Fall
	TNT1 AAAAAAAAAAAA 0 A_CustomMissile("MakeThoseEnragedMinesExplodeNicely",32,0,random(0,360))
    ECOS S 3 
    ECOS T -1 
    Stop
    }
}

Actor DetonateProx : Inventory{Inventory.MaxAmount 1}

Actor LegZombieStrafingg2 : LegZombieStrafing
{
  States
  {
  Pickup:
    NULL A 1 
	NULL A 1 A_SpawnItem("EnragedHellionSmokeSpawner")
	NULL A 1 A_Jump(188,2)
	NULL A 1 A_GiveInventory("LegZombieJumping",1)
	NULL A 1 A_JumpIf(velx != 0 || vely != 0,2)
	NULL A 1 A_Jump(256,2)
	NULL A 1 A_Jump(235,5)
	NULL A 1 A_JumpIfInventory("LegCommandoStrafeSens",1,3)
	NULL A 1 A_GiveInventory("LegCommandoStrafeSens",1)
	NULL A 1 A_Jump(256,2)	
	NULL A 1 A_TakeInventory("LegCommandoStrafeSens",1)
	NULL A 1 A_JumpIfInventory("LegCommandoStrafeSens",1,3)
	NULL A 1 ThrustThing(angle*256/360+38.7,3,0,0)
	NULL A 1 A_Jump(256,2)	
	NULL A 1 ThrustThing(angle*256/360+38.7,-3,0,0)
    NULL A 1 A_FaceTarget
	NULL A 1 A_Jump(24,2)
	NULL A 1 A_JumpIfCloser(300,2)
	NULL A 1 A_Recoil(-1)
    Stop
	NULL A 1 A_Recoil(1)
    Stop	
  }
}

Actor LegZombieStrafingg3 : LegZombieStrafing
{
States
{
  Pickup:
    NULL A 1 
	NULL A 1 A_SpawnItem("EnragedHellionSmokeSpawner")
	NULL A 1 A_Jump(188,2)
	NULL A 1 A_GiveInventory("LegZombieJumping",1)
	NULL A 1 A_JumpIf(velx != 0 || vely != 0,2)
	NULL A 1 A_Jump(256,2)
	NULL A 1 A_Jump(235,5)
	NULL A 1 A_JumpIfInventory("LegCommandoStrafeSens",1,3)
	NULL A 1 A_GiveInventory("LegCommandoStrafeSens",1)
	NULL A 1 A_Jump(256,2)	
	NULL A 1 A_TakeInventory("LegCommandoStrafeSens",1)
	NULL A 1 A_JumpIfInventory("LegCommandoStrafeSens",1,3)
	NULL A 1 ThrustThing(angle*256/360+38.7,5,0,0)
	NULL A 1 A_Jump(256,2)	
	NULL A 1 ThrustThing(angle*256/360+38.7,-5,0,0)
    NULL A 1 A_FaceTarget
	NULL A 1 A_Jump(24,2)
	NULL A 1 A_JumpIfCloser(300,2)
	NULL A 1 A_Recoil(-1)
    Stop
	NULL A 1 A_Recoil(1)
    Stop	
  }
}

Actor EnragedLegCommanderProj : LegRevSmallBall3
{
Speed 70
Damage 36
BounceCount 3
DeathSound "lrball3/exp"
  States
  {
  Spawn:
    TNT1 A 0
	RRB3 A 0 A_CountDown
    RRB3 A 0 A_SeekerMissile(15,8,SMF_LOOK)
	RRB3 AA 1 bright A_SpawnItemEx("ELegRevBall3Trail2")
	RRB3 A 0 A_SeekerMissile(1,8,SMF_LOOK)
	RRB3 BB 1 bright A_SpawnItemEx("ELegRevBall3Trail2")
	RRB3 A 0 A_SeekerMissile(15,8,SMF_LOOK)
	RRB3 CC 1 bright A_SpawnItemEx("ELegRevBall3Trail2")
	RRB3 A 0 A_SeekerMissile(15,8,SMF_LOOK)
	RRB3 DD 1 bright A_SpawnItemEx("ELegRevBall3Trail2")
    loop
  Death:
	TNT1 A 0 A_SpawnItemEx("EnragedParticleSpawner")
	TNT1 A 0 A_SpawnItemEx("EKaboomLNMute")
    TNT1 I 8 bright A_Explode(8,80,0)
    Stop
  }
}

ACTOR EnragedLegCommandoGhostA
{
Scale 1.1
Radius 20
Height 56
Speed 0
Alpha 0.7
PROJECTILE
RENDERSTYLE Translucent
+CLIENTSIDEONLY
+NOINTERACTION
+NOTIMEFREEZE
States
{
  Spawn:
    TNT1 A 0
    TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(304) == 1, "NULL")
  Fade:
    TNT1 A 1
    ECOS A 2 A_FadeOut(0.10)
    Goto Fade+1
  Toaster:
    TNT1 A 0
    Stop
    }
}

ACTOR EnragedLegCommandoGhostB : EnragedLegCommandoGhostA
{
States
{
  Spawn:
    TNT1 A 0
    TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(304) == 1, "NULL")
  Fade:
    TNT1 A 1
    ECOS B 2 A_FadeOut(0.10)
    Goto Fade+1
    }
}

ACTOR EnragedLegCommandoGhostC : EnragedLegCommandoGhostA
{
States
{
  Spawn:
    TNT1 A 0
    TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(304) == 1, "NULL")
  Fade:
    TNT1 A 1
    ECOS C 2 A_FadeOut(0.10)
    Goto Fade+1
    }
}

ACTOR EnragedLegCommandoGhostD : EnragedLegCommandoGhostA
{
States
{
  Spawn:
    TNT1 A 0
    TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(304) == 1, "NULL")
  Fade:
    TNT1 A 1
    ECOS D 2 A_FadeOut(0.10)
    Goto Fade+1
    }
}

Actor LegCommandoRedStar : LegCyberKnightBlueStar
{
Decal Scorch
DamageType "Legendary"
Obituary "%o was dishonorably discharged by an Enraged Legendary Commando."
States
{
  Spawn:
	TNT1 A 0 A_SeekerMissile(15,5)
	ERB1 ABCD 2 Bright A_CustomMissile("ELegRevBallFX",0)
	TNT1 A 0 A_SeekerMissile(15,5)
	Loop
  Death:
	TNT1 A 0 A_PlaySound("Redstar/Explode",0,1,0,ATTN_NONE)
	TNT1 A 0 A_Explode(192,384,0)
	TNT1 A 0 Radius_Quake(15,20,0,20,0)
	TNT1 A 0 A_SpawnItemEx("EnragedCommandoStarShock", 0, 0, 15, 0, 0, 0, 0, 128)
	TNT1 A 20 A_SpawnItem("EnragedDTBFGEx",0,-10)
	ERB1 EFGHIJKLMNO 3 Bright
	Stop
    }
}

ACTOR EnragedCommandoStarShock : DTech10KShockwave2 {+NOTIMEFREEZE}

ACTOR EnragedCommandoRocket : LegRevRocket
{
Speed 40
DECAL EnragedRocketScorch
DamageType ""
States
{
  Spawn:
	TNT1 A 0 A_CustomMissile("MissileTrail",Random(4,6),Random(-2,2))
	EROC A 2 Bright A_CustomMissile("EnragedMissileTrailParticle",Random(4,6),Random(-2,2))
	TNT1 A 0 A_CustomMissile("MissileTrail",Random(4,6),Random(-2,2))	
	EROC B 2 Bright A_CustomMissile("EnragedMissileTrailParticle",Random(4,6),Random(-2,2))
	Loop
  Death:
	TNT1 A 0 A_SpawnItemEx("EnragedParticleSpawner") 
	EROC B 6 Bright A_Explode
	EROC CD 5 Bright A_SetTranslucent(0.75,1)
	Stop
	}
}

Actor FELegCommandoProxMine
{
Projectile
Height 10
Radius 15
Speed 20
Scale 0.9
Mass 100
Gravity 0.7
WallBounceFactor 0.25
BounceFactor 0.36
Reactiontime 525
Damage 15 //Nerf Damage
SeeSound "Weapons/ProxFire"
Damagetype "Legendary"
Obituary "%o got too close to an Enraged Legendary Commando's proximity mine."
+DOOMBOUNCE
-NOGRAVITY
-SLIDESONWALLS
+CANBOUNCEWATER
-MOVEWITHSECTOR
+NOEXPLODEFLOOR
+NOTARGET
+THRUGHOST
+THRUSPECIES
+DONTHARMSPECIES
+DONTHARMCLASS
+NOTIMEFREEZE
States
{
  Spawn:
	EROX A 1 A_CheckFloor("Death")
	TNT1 A 0 A_Countdown
	Loop
  Death:
	TNT1 A 0 A_PlaySound("Weapons/ProxHit")
    TNT1 A 0 A_SpawnItemEX("EnragedPlantedProx")
	Stop
  Crash:
  XDeath:
	TNT1 A 0 A_Stop
	TNT1 A 0 A_PlaySound("Weapons/RockLX")
	TNT1 A 0 A_NoGravity
	TNT1 A 0 A_SetTranslucent(0.75,1)
	PRXD A 2 Bright A_Explode(80,96,1,1)
	TNT1 A 0 A_SpawnItemEx("EnragedParticleSpawner") 
    TNT1 AAAA 0 A_CustomMissile("EKaboomLN", 0, 0, random(0,360), 2, random(20,160))
	TNT1 AAAA 0 A_CustomMissile("LegendarySmokeFX2", 0, 0, random(0,360), 2, random(20,160))
	TNT1 AAAA 0 A_SpawnItemEx("LegendaryDebris",0,0,0,Random(4,-4),Random(4,-4),Random(4,8),0,128)
    TNT1 A 1 
	Stop
	}
}

Actor EnragedPlantedProx
{
Radius 10
Height 8
Damage 1
Mass 0x7FFFFFFF
Species "Legendary"
DamageType "LACGrenade"
+THRUSPECIES
+FORCERADIUSDMG
+MOVEWITHSECTOR
+NOBLOOD
+SHOOTABLE
+NOTIMEFREEZE
var int user_explodedelay;
States
{
  Spawn:
	EROX A 1 A_ChangeFlag(NOBLOCKMAP,0)
	TNT1 A 0 A_JumpIfInventory("DetonateProx",1,"Explode")
    EREV K 0 A_JumpIf(user_explodedelay >= 1500,"Explode")	 
    EREV K 0 A_SetUserVar("user_explodedelay",user_explodedelay+1)
	Loop
  Explode:
	EROX A 15 Bright A_PlaySound("weapons/minebeep")
	TNT1 A 0 A_AlertMonsters
	TNT1 A 0 A_Explode(216,180)
	TNT1 A 0 A_PlaySound("weapons/mineexplode")
	TNT1 A 0 A_SpawnItemEx("EnragedParticleSpawner") 
    TNT1 AAAA 0 A_CustomMissile("EKaboomLN", 0, 0, random(0,360), 2, random(20,160))
	TNT1 AAAA 0 A_CustomMissile("LegendarySmokeFX2", 0, 0, random(0,360), 2, random(20,160))
	TNT1 AAAA 0 A_SpawnItemEx("LegendaryDebris",0,0,0,Random(4,-4),Random(4,-4),Random(4,8),0,128)
    TNT1 A 1 
    Stop
    }
}

Actor MakeThoseEnragedMinesExplodeNicely
{
  +NOCLIP
  +NOTIMEFREEZE
  Reactiontime 100
  Speed 50
  Projectile
  States
  {
  Spawn:
	TNT1 A 0
	TNT1 A 1 A_RadiusGive("DetonateProx",500,RGF_OBJECTS)
	TNT1 A 0 A_Countdown
	Loop
  Death:
	TNT1 A 1
	Stop
  }
}