ACTOR Juggernaut : TheSpiderMastermind 2545
{
	//$Category BD Bosses
	//$Icon "monster"
	//$Colour rgb(200, 0, 0)
	//$Sprite BS1WA1
	Radius 94//112SpriteW(168%=188)
	Height 134//80SpriteH(168%=134)
	Scale 1.68
	Speed 8
	PainSound "juggernaut/pain"
	DeathSound "juggernaut/death"
	ActiveSound "juggernaut/roam"
	SeeSound "juggernaut/see"
	Obituary "%o was destroyed by the Juggernaut"
	Tag "Juggernaut"
	Species "SpiderMastermind"
	DropItem "64UnmakerUpgradeSpawner", 16
	States
	{
	/////////////////////
	Spawn:
		BS1W A 1
		TNT1 A 0 A_GiveInventory("TargetIsAMastermind")
	    TNT1 A 0 A_SpawnItemEx ("KillTreads",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
		Goto Standby

	Standby:
	Idle:
	    BS1W A 1
	    BS1W AC 10 A_Look
	    Loop

	//////////////////

	See:
	    BS1W A 1 A_FaceTarget
		Goto Rolling

	Rolling:
		TNT1 A 0
		TNT1 A 0 A_PlaySound("juggernaut/engine")
	    BS1W AAABBBCCCDDD 2 A_Chase
		TNT1 A 0 A_SpawnItem("TreadsDamage", 94)
		TNT1 A 0 A_SpawnItemEx("TnkStep", 0, 0, 8, 0, 0, 0, angle, SXF_ABSOLUTEANGLE)
		TNT1 A 0 A_PlaySound("juggernaut/engine")
	    BS1W AAABBBCCCDDD 2 A_Chase
		TNT1 A 0 A_SpawnItem("TreadsDamage", 94)
		TNT1 A 0 A_SpawnItemEx("TnkStep", 0, 0, 8, 0, 0, 0, angle, SXF_ABSOLUTEANGLE)
		TNT1 A 0 A_Jump (128, "Rolling2")
		TNT1 A 0 A_CheckSight("See")
		Loop

	Rolling2:
		TNT1 A 0
		TNT1 A 0 A_PlaySound("juggernaut/engine")
		TNT1 A 0 A_CustomMissile ("JuggernautBody1", 0)//Torso not shooting
		BS1B A 2 A_Chase//Tracks
		TNT1 A 0 A_CustomMissile ("JuggernautBody1", 0)
		BS1B A 2 A_Chase
		TNT1 A 0 A_CustomMissile ("JuggernautBody1", 0)
		BS1B A 2 A_Chase
		TNT1 A 0 A_CustomMissile ("JuggernautBody1", 0)
		BS1B A 2 A_Chase
		TNT1 A 0 A_CustomMissile ("JuggernautBody1", 0)
		BS1B A 2 A_Chase
		TNT1 A 0 A_CustomMissile ("JuggernautBody1", 0)
		BS1B A 2 A_Chase

		TNT1 A 0 A_CustomMissile ("JuggernautBody1", 0)
		BS1B A 2 A_Chase
		TNT1 A 0 A_CustomMissile ("JuggernautBody1", 0)
		BS1B A 2 A_Chase
		TNT1 A 0 A_CustomMissile ("JuggernautBody1", 0)
		BS1B A 2 A_Chase
		TNT1 A 0 A_CustomMissile ("JuggernautBody1", 0)
		BS1B A 2 A_Chase
		TNT1 A 0 A_CustomMissile ("JuggernautBody1", 0)
		BS1B A 2 A_Chase
		TNT1 A 0 A_CustomMissile ("JuggernautBody1", 0)
		BS1B A 2 A_Chase
		TNT1 A 0 A_SpawnItem("TreadsDamage", 94)
		TNT1 A 0 A_SpawnItemEx("TnkStep", 0, 0, 8, 0, 0, 0, angle, SXF_ABSOLUTEANGLE)

		TNT1 A 0 A_CheckSight("Rolling")
		Goto Missile

	///////////////////

	Missile:
		TNT1 A 0 A_JumpIfCloser(256, "FireMachinegun")
		TNT1 A 0 A_Jump(64, "FireRockets")
		TNT1 A 0 A_PlaySound("juggernaut/engine")
		TNT1 A 0 A_CustomMissile ("JuggernautBody1", 0)
		BS1B A 2 A_FaceTarget
		TNT1 A 0 A_CustomMissile ("JuggernautBody1", 0)
		BS1B A 2 A_FaceTarget
		TNT1 A 0 A_CustomMissile ("JuggernautBody1", 0)
		BS1B A 2 A_FaceTarget
		TNT1 A 0 A_CheckSight("Rolling")
		Goto FireMachinegun

    FireMachinegun:
		TNT1 A 0
		TNT1 A 0 A_CheckSight("Rolling")
		TNT1 A 0 A_CustomMissile ("JuggernautBody2", 0)//Torso shooting
		BS1B A 2 A_Chase//Tracks
		TNT1 A 0 A_CustomMissile("MastermindTracer", 91, 52, random(-3, 3), CMF_OFFSETPITCH, random(-2,2))
		TNT1 A 0 A_CustomMissile("DistantFireSoundSSG", 91, 0, 0, 1, 0)
		TNT1 A 0 A_CustomMissile("Alerter",91,52)
		TNT1 A 0 A_CustomMissile("MasterMindCaseSpawn", 91, 52, angle-90, CMF_ABSOLUTEANGLE)
		TNT1 A 0 A_GiveInventory("JuggernautMachinegunAmmo", 1)
		TNT1 A 0 A_JumpIfInventory("JuggernautMachinegunAmmo", 100, "StopFiring")

		TNT1 A 0 A_CustomMissile ("JuggernautBody1", 0)//Torso not shooting
		BS1B A 2 A_Chase//Tracks

		TNT1 A 0 A_CustomMissile ("JuggernautBody2", 0)//Torso shooting
		BS1B A 2 A_Chase//Tracks
		TNT1 A 0 A_CustomMissile("MastermindTracer", 91, -52, random(-3, 3), CMF_OFFSETPITCH, random(-2,2))
		TNT1 A 0 A_CustomMissile("DistantFireSoundSSG", 91, 0, 0, 1, 0)
		TNT1 A 0 A_CustomMissile("Alerter",91,-52)
		TNT1 A 0 A_CustomMissile("MasterMindCaseSpawn", 91, -52, angle-270, CMF_ABSOLUTEANGLE)
		TNT1 A 0 A_GiveInventory("JuggernautMachinegunAmmo", 1)
		TNT1 A 0 A_JumpIfInventory("JuggernautMachinegunAmmo", 100, "StopFiring")
		Goto FireMachinegun

	FireRockets:
	    TNT1 A 0
		TNT1 A 0 A_JumpIfCloser(256, "FireMachinegun")//avoid it's own splash damage

		TNT1 A 0 A_CustomMissile ("JuggernautBody1", 0)
		BS1B A 2 A_FaceTarget
		TNT1 A 0 A_CustomMissile ("JuggernautBody1", 0)
		BS1B A 2 A_FaceTarget
		TNT1 A 0 A_CustomMissile ("JuggernautBody1", 0)
		BS1B A 2 A_FaceTarget
		TNT1 A 0 A_CustomMissile("JuggernautRocket", 121, 79, random(-2,2), CMF_OFFSETPITCH, random(-1,1))
		TNT1 A 0 A_CustomMissile("DistantFireSoundRocket", 106, 0, 0, 1, 0)
		TNT1 A 0 A_CustomMissile ("JuggernautBody1", 0)
		BS1B A 2 A_FaceTarget
		TNT1 A 0 A_CustomMissile ("JuggernautBody1", 0)
		BS1B A 2 A_FaceTarget
		TNT1 A 0 A_CustomMissile ("JuggernautBody1", 0)
		BS1B A 2 A_FaceTarget

		TNT1 A 0 A_CustomMissile ("JuggernautBody1", 0)
		BS1B A 2 A_FaceTarget
		TNT1 A 0 A_CustomMissile ("JuggernautBody1", 0)
		BS1B A 2 A_FaceTarget
		TNT1 A 0 A_CustomMissile ("JuggernautBody1", 0)
		BS1B A 2 A_FaceTarget
		TNT1 A 0 A_CustomMissile("JuggernautRocket", 121, -79, random(-2,2), CMF_OFFSETPITCH, random(-1,1))
		TNT1 A 0 A_CustomMissile("DistantFireSoundRocket", 106, 0, 0, 1, 0)
		TNT1 A 0 A_CustomMissile ("JuggernautBody1", 0)
		BS1B A 2 A_FaceTarget
		TNT1 A 0 A_CustomMissile ("JuggernautBody1", 0)
		BS1B A 2 A_FaceTarget
		TNT1 A 0 A_CustomMissile ("JuggernautBody1", 0)
		BS1B A 2 A_FaceTarget

		TNT1 A 0 A_CheckSight("Rolling")
		TNT1 A 0 A_PlaySound("juggernaut/engine")
		TNT1 A 0 A_JumpIfCloser(256, "FireMachinegun")//avoid it's own splash damage
		TNT1 A 0 A_CustomMissile ("JuggernautBody1", 0)
		BS1B A 2 A_FaceTarget
		TNT1 A 0 A_CustomMissile ("JuggernautBody1", 0)
		BS1B A 2 A_FaceTarget
		TNT1 A 0 A_CustomMissile ("JuggernautBody1", 0)
		BS1B A 2 A_FaceTarget
		TNT1 A 0 A_CustomMissile("JuggernautRocket", 106, 79, random(-2,2), CMF_OFFSETPITCH, random(-1,1))
		TNT1 A 0 A_CustomMissile("DistantFireSoundRocket", 106, 0, 0, 1, 0)
		TNT1 A 0 A_CustomMissile ("JuggernautBody1", 0)
		BS1B A 2 A_FaceTarget
		TNT1 A 0 A_CustomMissile ("JuggernautBody1", 0)
		BS1B A 2 A_FaceTarget
		TNT1 A 0 A_CustomMissile ("JuggernautBody1", 0)
		BS1B A 2 A_FaceTarget

		TNT1 A 0 A_CustomMissile ("JuggernautBody1", 0)
		BS1B A 2 A_FaceTarget
		TNT1 A 0 A_CustomMissile ("JuggernautBody1", 0)
		BS1B A 2 A_FaceTarget
		TNT1 A 0 A_CustomMissile ("JuggernautBody1", 0)
		BS1B A 2 A_FaceTarget
		TNT1 A 0 A_CustomMissile("JuggernautRocket", 106, -79, random(-2,2), CMF_OFFSETPITCH, random(-1,1))
		TNT1 A 0 A_CustomMissile("DistantFireSoundRocket", 106, 0, 0, 1, 0)
		TNT1 A 0 A_CustomMissile ("JuggernautBody1", 0)
		BS1B A 2 A_FaceTarget
		TNT1 A 0 A_CustomMissile ("JuggernautBody1", 0)
		BS1B A 2 A_FaceTarget
		TNT1 A 0 A_CustomMissile ("JuggernautBody1", 0)
		BS1B A 2 A_FaceTarget

		TNT1 A 0 A_CheckSight("Rolling")
		TNT1 A 0 A_PlaySound("juggernaut/engine")
		TNT1 A 0 A_JumpIfCloser(256, "FireMachinegun")//avoid it's own splash damage
		TNT1 A 0 A_CustomMissile ("JuggernautBody1", 0)
		BS1B A 2 A_FaceTarget
		TNT1 A 0 A_CustomMissile ("JuggernautBody1", 0)
		BS1B A 2 A_FaceTarget
		TNT1 A 0 A_CustomMissile ("JuggernautBody1", 0)
		BS1B A 2 A_FaceTarget
		TNT1 A 0 A_CustomMissile("JuggernautRocket", 91, 79, random(-2,2), CMF_OFFSETPITCH, random(-1,1))
		TNT1 A 0 A_CustomMissile("DistantFireSoundRocket", 106, 0, 0, 1, 0)
		TNT1 A 0 A_CustomMissile ("JuggernautBody1", 0)
		BS1B A 2 A_FaceTarget
		TNT1 A 0 A_CustomMissile ("JuggernautBody1", 0)
		BS1B A 2 A_FaceTarget
		TNT1 A 0 A_CustomMissile ("JuggernautBody1", 0)
		BS1B A 2 A_FaceTarget

		TNT1 A 0 A_CustomMissile ("JuggernautBody1", 0)
		BS1B A 2 A_FaceTarget
		TNT1 A 0 A_CustomMissile ("JuggernautBody1", 0)
		BS1B A 2 A_FaceTarget
		TNT1 A 0 A_CustomMissile ("JuggernautBody1", 0)
		BS1B A 2 A_FaceTarget
		TNT1 A 0 A_CustomMissile("JuggernautRocket", 91, -79, random(-2,2), CMF_OFFSETPITCH, random(-1,1))
		TNT1 A 0 A_CustomMissile("DistantFireSoundRocket", 106, 0, 0, 1, 0)
		TNT1 A 0 A_CustomMissile ("JuggernautBody1", 0)
		BS1B A 2 A_FaceTarget
		TNT1 A 0 A_CustomMissile ("JuggernautBody1", 0)
		BS1B A 2 A_FaceTarget
		TNT1 A 0 A_CustomMissile ("JuggernautBody1", 0)
		BS1B A 2 A_FaceTarget
		Goto Rolling

	StopFiring:
		TNT1 A 0
		BS1W A 1 A_FaceTarget
		TNT1 A 0 A_TakeInventory("JuggernautMachinegunAmmo", 100)
		Goto Rolling

	////////////////////
	Pain:
	Pain.Stomp:
	Pain.Explosive:
	    TNT1 A 0
	    BS1W A 2
		BS1W A 2 A_Pain
		Goto Rolling

	Pain.Killme:
	Pain.Taunt:
		TNT1 A 0
		TNT1 A 0 HealThing(2)
		Goto Missile

	///////////////////////
	Crush:
	Death:
	Death.Stomp:
	Death.Telefrag:
	Death.Massacre:
	Death.Cut:
	Death.Saw:
	Death.decaptate:
	Death.Fatality:
	    TNT1 A 0
		TNT1 A 0 A_Scream
		TNT1 A 0 A_NoBlocking
		TNT1 A 0 A_SpawnItem("KillTreads")
		EXPL A 0 Radius_Quake (4, 35, 0, 10, 0)
        TNT1 AAAA 0 A_CustomMissile ("ExplosionSpawner", 90, 0, random (0, 360), 2, random (0, 180))
        TNT1 AAAAAA 0 A_CustomMissile ("ExplosionSpawner", 90, 0, random (0, 180), 2, random (0, 180))
        TNT1 AAAA 0 A_CustomMissile ("UltraGoreSPawner", 90, 0, random (0, 360), 2, random (0, 180))
        TNT1 AAAAAA 0 A_CustomMissile ("UltraGoreSpawner", 90, 0, random (0, 180), 2, random (0, 180))
        TNT1 A 0 A_CustomMissile ("CyberXDeath", 0, 0, random (0, 360), 2, random (0, 160))
		BS1B B 5 A_CustomMissile ("ExplosionSmoke", 60, 0, random (0, 360), 2, random (70, 110))
		BS1B B 5 A_CustomMissile ("FlameTrails", 60, 0, random (0, 360), 2, random (0, 160))
		BS1B B 5 A_CustomMissile ("ExplosionSmoke", 60, 0, random (0, 360), 2, random (70, 110))
		BS1B B 5 A_CustomMissile ("FlameTrails", 60, 0, random (0, 360), 2, random (0, 160))
		BS1B B 5 A_CustomMissile ("ExplosionSmoke", 60, 0, random (0, 360), 2, random (70, 110))
		BS1B B 5 A_CustomMissile ("FlameTrails", 60, 0, random (0, 360), 2, random (0, 160))
		BS1B B 5 A_CustomMissile ("ExplosionSmoke", 60, 0, random (0, 360), 2, random (70, 110))
		BS1B B 5 A_CustomMissile ("FlameTrails", 60, 0, random (0, 360), 2, random (0, 160))
		BS1B B 5 A_CustomMissile ("ExplosionSmoke", 60, 0, random (0, 360), 2, random (70, 110))
		BS1B B 5 A_CustomMissile ("FlameTrails", 60, 0, random (0, 360), 2, random (0, 160))
		BS1B B 5 A_CustomMissile ("ExplosionSmoke", 60, 0, random (0, 360), 2, random (70, 110))
		BS1B B 5 A_CustomMissile ("FlameTrails", 60, 0, random (0, 360), 2, random (0, 160))
		BS1B B 5 A_CustomMissile ("ExplosionSmoke", 60, 0, random (0, 360), 2, random (70, 110))
		BS1B B 5 A_CustomMissile ("FlameTrails", 60, 0, random (0, 360), 2, random (0, 160))
		BS1B B 5 A_CustomMissile ("ExplosionSmoke", 60, 0, random (0, 360), 2, random (70, 110))
		BS1B B 5 A_CustomMissile ("FlameTrails", 60, 0, random (0, 360), 2, random (0, 160))
		BS1B B 5 A_CustomMissile ("ExplosionSmoke", 60, 0, random (0, 360), 2, random (70, 110))
		BS1B B 5 A_CustomMissile ("FlameTrails", 60, 0, random (0, 360), 2, random (0, 160))
		BS1B B 5 A_CustomMissile ("ExplosionSmoke", 60, 0, random (0, 360), 2, random (70, 110))
		BS1B B 5 A_CustomMissile ("FlameTrails", 60, 0, random (0, 360), 2, random (0, 160))
		BS1B B 5 A_CustomMissile ("ExplosionSmoke", 60, 0, random (0, 360), 2, random (70, 110))
		BS1B B 5 A_CustomMissile ("FlameTrails", 60, 0, random (0, 360), 2, random (0, 160))
		BS1B B -1 A_BossDeath
		Stop
	}
}

actor JuggernautBase : CurbstompedMarine
{
	Health 10000
	damagefactor "Killme", 9999.0
	Radius 64
	Height 2
	Scale 1.68
	Monster
	+NOBLOOD
	+SOLID
	-NOBLOCKMAP
	-COUNTKILL
	Mass 99999
	States
	{
	Spawn:
	BS1B A 5
	Loop

	Death:
	TNT1 A 0
	TNT1 A 0 A_NoBlocking
	Stop
	}
}


actor KillTreads
{
+NOTARGET
Radius 1
Height 1
DamageType Killme
+NOGRAVITY
+NOTELEPORT
+NODAMAGETHRUST
+THRUGHOST
+NORADIUSDMG
+NOEXTREMEDEATH
+FORCERADIUSDMG
PROJECTILE
	+DEHEXPLOSION
	+ACTIVATEMCROSS
States
{
Spawn:
TNT1 A 0
        TNT1 A 0 A_Explode(20,80,0)
Stop
 }
}


actor TreadsDamage
{
+NOTARGET
Radius 1
Height 1
DamageType Stomp
+NOGRAVITY
+NOTELEPORT
+NODAMAGETHRUST
+THRUGHOST
+NORADIUSDMG
+NOEXTREMEDEATH
+FORCERADIUSDMG
PROJECTILE
	+DEHEXPLOSION
	+ACTIVATEMCROSS
	+EXPLODEONWATER
States
{
Spawn:
	TNT1 A 0
	TNT1 A 0 A_Explode(200,50,0)
	TNT1 A 1 A_Noblocking
Stop
 }
}

Actor JuggernautBody1
{
+RANDOMIZE
+FORCEXYBILLBOARD
+DONTSPLASH
+NOEXTREMEDEATH
+THRUACTORS
+NOGRAVITY
+NOCLIP
Projectile
damage 0
radius 2
height 0
speed 1
Scale 1.68
states
	{
	Spawn:
		BS1T AAAA 1
	    Stop
	}
}

Actor JuggernautBody2: JuggernautBody1
{
states
	{
	Spawn:
		BS1T BBBB 1
	    Stop
	}
}