/////////////////////
// WILY IRON GOLEM //
/////////////////////

actor WilyGolemArmAnchor
{
Obituary "%o was torn apart by the Wily Iron Golem."
radius 5
-SOLID
+NOGRAVITY
+BRIGHT
scale 2.5
renderstyle none
states
{
Spawn:
WGOL C 0 
WGOL C 0 A_CustomMissile("WilyGolemArmAnchor2", 0, 0, 0, CMF_AIMDIRECTION, pitch)
WGOA A 1
loop
}
}


actor WilyGolemArmAnchorLeft : WilyGolemArmAnchor
{
states
{
Spawn:
WGOL C 0 
WGOL C 0 A_CustomMissile("WilyGolemArmAnchor2Left", 0, 0, 0, CMF_AIMDIRECTION, pitch)
WGOA A 1
loop
}
}

actor WilyGolemArmSegment1
{
Obituary "%o was torn apart by the Wily Iron Golem."
-SOLID
+NOGRAVITY
+NOINTERACTION
+MISSILE
scale 2.5
speed 0
radius 1
height 1
gravity 0.03
states
{
Spawn:
TNT1 A 0
WGOA C 2 A_SpawnItemEx("WilyGolemArmBlocker")// A_CustomMissile("WilyGolemArmAnchor3", 0, 0, 0, 2, 0)
Goto End
End:
"####" # 0 A_JumpIf(tid==700, "Chopped")
stop
Chopped:
"####" # 0 A_ChangeFlag("NOINTERACTION", 0)
"####" # -1 A_ChangeFlag("NOGRAVITY", 0)
stop
Death:
//TNT1 A 0 A_PlaySoundEx("weapon/coilexplode", "Weapon", 0, 1) 
TNT1 A 0 Radius_Quake(5, 10, 0, 256, 400)
TNT1 AAA 1 A_SpawnItemEx("DrillExplode", random(-64, 64), 0, random(0, 64), 0, 0, 0, random(0,360)) 
stop
}
}

actor WilyGolemArmSegment2 : WilyGolemArmSegment1
{
states
{
Spawn:
TNT1 A 0
WGOA B 2 A_SpawnItemEx("WilyGolemArmBlocker")// A_CustomMissile("WilyGolemArmAnchor3", 0, 0, 0, 2, 0)
Goto End
}
}

actor WilyGolemArmSegment3 : WilyGolemArmSegment1
{
states
{
Spawn:
TNT1 A 0
WGOA H 2 A_SpawnItemEx("WilyGolemArmBlocker")// A_CustomMissile("WilyGolemArmAnchor3", 0, 0, 0, 2, 0)
Goto End
}
}

actor WilyGolemArmSegment4 : WilyGolemArmSegment1
{
states
{
Spawn:
TNT1 A 0
WGOA H 2 A_SpawnItemEx("WilyGolemArmBlocker")// A_CustomMissile("WilyGolemArmAnchor3", 0, 0, 0, 2, 0)
Goto End
}
}


actor WilyGolemArmSegmentDeath
{
Obituary "%o was torn apart by the Wily Iron Golem."
+MISSILE
+NOINTERACTION
-SOLID
states
{
Spawn:
TNT1 A 0
TNT1 A 1 A_Jump(200, "Spawn")
TNT1 AAA 1 A_SpawnItemEx("DrillExplode", random(-80, 80), 0, random(0, 80), 0, 0, 0, random(0,360)) 
stop
}
}

actor WilyGolemArmAnchor2
{
Obituary "%o was torn apart by the Wily Iron Golem."
-SOLID
+NOGRAVITY
+NOINTERACTION
+MISSILE
scale 2.5
speed 220
+NOCLIP
states
{
Spawn:
TNT1 A 0
TNT1 A 0 Thing_ChangeTID(0, 101)
Goto Arm
Arm:
TNT1 A 1 A_Stop
TNT1 A 0 ACS_NamedExecuteAlways("armangle", 0)
WGOA A 0 ACS_NamedExecuteAlways("drawgolemarm", 0, 19, 20, 0)
WGOA A 1 //A_SpawnITemEx("AtomicFire3", 0, 0, 0, 10)
WGOA A 0 A_JumpIf(CallACS("GetGolemCutscenePart")>1, "No")
WGOA A 0 A_JumpIF(CallACS("GetHandState", 0) == 1, "Fist")
WGOA A 1 A_CustomMissile("WilyGolemArmAnchor3", 0, 0, 0, CMF_AIMDIRECTION, 0)
stop
Fist:
WGOA A 1 A_CustomMissile("WilyGolemArmAnchor3_Fist", 0, 0, 0, CMF_AIMDIRECTION, 0)
stop
No:
WGOA A 1
stop
Death:
TNT1 A 0 ACS_Terminate(4, 0)
stop
}
}


actor WilyGolemArmAnchor2Left : WilyGolemArmAnchor2
{
states
{
Spawn:
TNT1 A 0
TNT1 A 0 Thing_ChangeTID(0, 201)
Goto Arm
Arm:
TNT1 A 1 A_Stop
TNT1 A 0 ACS_NamedExecuteAlways("armangle", 0, 1)
WGOA A 0 A_JumpIf(CallACS("GetGolemCutscenePart")>4, "No")
WGOA A 0 ACS_NamedExecuteAlways("drawgolemarm", 0, 21, 20, 0)
WGOA A 1 //A_SpawnITemEx("AtomicFire3", 0, 0, 0, 10)
WGOA A 0 A_JumpIF(CallACS("GetHandState", 1) == 1, "Fist")
WGOA A 1 A_CustomMissile("WilyGolemArmAnchor3Left", 0, 0, 0, CMF_AIMDIRECTION, 0)
stop
Fist:
WGOA A 1 A_CustomMissile("WilyGolemArmAnchor3Left_Fist", 0, 0, 0, CMF_AIMDIRECTION, 0)
stop
}
}

actor WilyGolemArmBlocker
{
Obituary "%o was torn apart by the Wily Iron Golem."
Radius 32
Height 62
-SOLID
-CANPASS
damagetype "Misc"
renderstyle none
species "Golem"
+SHOOTABLE
states
{
Spawn:
PLAY A 0
PLAY A 0 Thing_ChangeTID(0, 75)
PLAY A 2
stop
}
}

actor WilyGolemArmDamager
{
Obituary "%o was torn apart by the Wily Iron Golem."
//+RIPPER
PROJECTILE
+THRUSPECIES
species "Golem"
Radius 42
Height 40
//scale 5.0
renderstyle none
damage (5)
states
{
Spawn:
BASS A 4
stop
}
}

actor WilyGolemArmDamager2 : WilyGolemArmDamager
{
Obituary "%o was torn apart by the Wily Iron Golem."
damage (10)
radius 52
}

actor WilyGolemArmAnchor3 : WilyGolemArmAnchor2
{
speed 255
gravity 0.03
states
{
Spawn:
TNT1 A 0
TNT1 A 0 Thing_ChangeTID(0, 102)
TNT1 A 1 A_Stop
WGOA A 0 A_JumpIf(CallACS("GetGolemCutscenePart")>1, "Chopped")
TNT1 A 0 ACS_NamedExecuteAlways("drawgolemarm", 0, 101, 45, 1)
WGOA D 1 //A_CustomMissile("WilyGolemArmAnchor3", 0, 0, 0, 2, 0)
stop
Chopped:
WGOA F 0 A_ChangeFlag("MISSILE", 1)
WGOA F 0 A_ChangeFlag("NOINTERACTION", 0)
"####" # 0 A_ChangeFlag("NOGRAVITY", 0)
"####" # 1 A_JumpIf(z-floorz==0, "Death")
wait
Fist:
WGOA F 1
stop
Grind:
WGOA F 1
stop
Death:
TNT1 A 0 A_PlaySoundEx("weapon/coilexplode", "Weapon", 0, 1) 
TNT1 AAA 0 A_SpawnItemEx("DrillExplode", random(-64, 64), 0, random(0, 64), 0, 0, 0, random(0,360)) 
stop
}
}

actor WilyGolemArmAnchor3_Fist : WilyGolemArmAnchor2
{
speed 255
gravity 0.03
states
{
Spawn:
TNT1 A 0
TNT1 A 0 Thing_ChangeTID(0, 102)
TNT1 A 1 A_Stop
WGOA A 0 A_JumpIf(CallACS("GetGolemCutscenePart")>1, "Chopped")
TNT1 A 0 ACS_NamedExecuteAlways("drawgolemarm", 0, 101, 45, 1)
WGOA F 1 //A_CustomMissile("WilyGolemArmAnchor3", 0, 0, 0, 2, 0)
stop
Chopped:
WGOA F 0 A_ChangeFlag("MISSILE", 1)
WGOA F 0 A_ChangeFlag("NOINTERACTION", 0)
"####" # 0 A_ChangeFlag("NOGRAVITY", 0)
"####" # 1 A_JumpIf(z-floorz==0, "Death")
wait
Fist:
WGOA F 1
stop
Grind:
WGOA F 1
stop
Death:
TNT1 A 0 A_PlaySoundEx("weapon/coilexplode", "Weapon", 0, 1) 
TNT1 AAA 0 A_SpawnItemEx("DrillExplode", random(-64, 64), 0, random(0, 64), 0, 0, 0, random(0,360)) 
stop
}
}

actor WilyGolemArmAnchor3Left : WilyGolemArmAnchor3
{
states
{
Spawn:
TNT1 A 0
TNT1 A 0 Thing_ChangeTID(0, 202)
Goto Death
Death:
TNT1 A 1 A_Stop
WGOA A 0 A_JumpIf(CallACS("GetGolemCutscenePart")>4, "No")
WGOA C 0 ACS_NamedExecuteAlways("drawgolemarm", 0, 201, 45, 1)
WGOA E 1 //A_CustomMissile("WilyGolemArmAnchor3", 0, 0, 0, 2, 0)
stop
Fist:
WGOA G 1
stop
Grind:
WGOA G 1
stop
}
}

actor WilyGolemArmAnchor3Left_Fist : WilyGolemArmAnchor3
{
states
{
Spawn:
TNT1 A 0
TNT1 A 0 Thing_ChangeTID(0, 202)
Goto Death
Death:
TNT1 A 1 A_Stop
WGOA A 0 A_JumpIf(CallACS("GetGolemCutscenePart")>4, "No")
WGOA C 0 ACS_NamedExecuteAlways("drawgolemarm", 0, 201, 45, 1)
WGOA G 1 //A_CustomMissile("WilyGolemArmAnchor3", 0, 0, 0, 2, 0)
stop
Fist:
WGOA G 1
stop
Grind:
WGOA G 1
stop
}
}

actor WilyGolemHead
{
-SOLID
+THRUSPECIES
+SHOOTABLE
+INVULNERABLE
+THRUACTORS
Obituary "%o was torn apart by the Wily Iron Golem."
health 9999
species "Wily"
//+NOGRAVITY
Scale 2.5
gravity 50.0
states
{
Spawn:
TNT1 A 0
TNT1 A 0 ACS_NamedExecuteAlways("TargetTeam", 0)
Static:
WGOL A -1 //A_PlaySoundEx("misc/hugequake", "Voice", 0, 1)
stop
Land:
TNT1 A 0 A_PlaySoundEx("misc/hugequake", "Voice", 0, 1)
goto Static
Explodey:
WGOL A 0 A_PlaySoundEx("misc/mm3explosion", "Voice", 1, 1)
WGOL AAAAAAAA 4 A_SpawnItemEx("DrillExplode", 112, random(-200, 200), -64 + random(-64, 32)) 
loop
Dying2:
WGOL A 0 A_PlaySoundEx("misc/mm3explosion", "Voice", 1, 1)
WGOL CC 0 A_SpawnItemEx("DrillExplode", 112, random(-250, 250), -80 + random(0, 358)) 
WGOL CCCCCCCC 2 A_SpawnItemEx("SharkDeathFx", 112, random(-250, 250), -80 + random(0, 358)) 
loop
Waiting:
WGOL A -1
stop
Dying:
WGOL B 4 A_SpawnItemEx("DrillExplode", 20, random(-64, 64), random(64, 256))
loop
BombLaunch:
WGOL B 8 A_SetAngle(angle + 45)
WGOL BBB 1 A_SpawnItemEx("WilyGolemAlabell", 40, 0, 90, 15, frandom(-1, 1), frandom(5, 10), frandom(-30, 0))
WGOL B 6 A_PlaySoundEx("misc/sharktorpedo", "Voice", 0, 1)
WGOL B 8 A_SetAngle(angle - 45)
WGOL BBB 1 A_SpawnItemEx("WilyGolemAlabell", 40, 0, 90, 18, frandom(-1, 1), frandom(5, 10), frandom(-30, 30))
WGOL B 6 A_PlaySoundEx("misc/sharktorpedo", "Voice", 0, 1)
WGOL B 8 A_SetAngle(angle - 45)
WGOL BBB 1 A_SpawnItemEx("WilyGolemAlabell", 40, 0, 90, 15, frandom(-1, 1), frandom(5, 10), frandom(0, 30))
WGOL B 6 A_PlaySoundEx("misc/sharktorpedo", "Voice", 0, 1)
WGOL B 18 A_SetAngle(angle + 45)
WGOL A 8 
Goto Waiting
Sucking:
WGOL B 0 A_SpawnItemEX("WilyGolemSuckFX", 256, 0, 92, -20)
WGOL BBBB 2 A_SpawnItemEX("WilyGolemVacuumFX", random(200, 700), random(-400, 400), -32, -5)
loop
Damaged:
WGOL CCCCCDDDDDCCCCCEEEEE 1 A_FaceTarget
loop
EyebrowLasers:
WGOL A 0 A_PlaySoundEx("weapon/mirrorabsorb", "Voice", 0, 1)
WGOL A 3 Thing_SetTranslation(0, 1001)
WGOL A 3 Thing_SetTranslation(0, 0)
WGOL A 3 Thing_SetTranslation(0, 1001)
WGOL A 3 Thing_SetTranslation(0, 0)
WGOL A 3 Thing_SetTranslation(0, 1001)
WGOL A 3 Thing_SetTranslation(0, 0)
WGOL A 3 Thing_SetTranslation(0, 1001)
WGOL A 3 Thing_SetTranslation(0, 0)
WGOL A 3 Thing_SetTranslation(0, 1001)
WGOL A 3 Thing_SetTranslation(0, 0)
WGOL A 3 Thing_SetTranslation(0, 1001)
WGOL A 3 Thing_SetTranslation(0, 0)
WGOL AAAAAAAAAAAAAAAAAAAAA 1 A_FaceTarget
WGOL C 0 A_SpawnItemEx("EyebrowLaserSpawner")
FacePlayer:
WGOL A 1 A_FaceTarget
loop
Stashe:
WGOL AA 2 A_FaceTarget
WGOL A 0 A_PlaySoundEx("misc/wilygolemstashe", "Voice", 0, 1)
WGOL [ 3 A_FaceTarget
WGOL A 3 A_FaceTarget
WGOL A 0 A_PlaySoundEx("misc/wilygolemstashe", "Voice", 0, 1)
WGOL [ 3 A_FaceTarget
WGOL A 3 A_FaceTarget
WGOL A 0 A_PlaySoundEx("misc/wilygolemstashe", "Voice", 0, 1)
WGOL [ 3 A_FaceTarget
WGOL A 3 A_FaceTarget
WGOL A 0 A_PlaySoundEx("misc/wilygolemstashe", "Voice", 0, 1)
WGOL [ 3 A_FaceTarget
WGOL AAAAAAAAA 2 A_FaceTarget
WGOL ] -1 A_CustomMissile("StasheARang", 128, 0, 0, 0, 0)
stop
Electro:
WGOL A 0 
WGOL A 10
WGOL A 0 A_PlaySoundEx("misc/wilygolemboltcharge", "Voice", 0, 1)
WGOL A 0 A_SpawnItemEx("WilyGolemElectroFX", 0, -128 - 96, 188)
WGOL A 1 A_SpawnItemEx("WilyGolemElectroFX", 0, 128 + 96, 188)
WGOL A 0 A_SpawnItemEx("WilyGolemElectroFX", 0, -128 - 64, 188)
WGOL A 1 A_SpawnItemEx("WilyGolemElectroFX", 0, 128 + 64, 188)
WGOL A 0 A_SpawnItemEx("WilyGolemElectroFX", 0, -128 - 32, 188)
WGOL A 1 A_SpawnItemEx("WilyGolemElectroFX", 0, 128 + 32, 188)
WGOL A 0 A_SpawnItemEx("WilyGolemElectroFX", 0, -128, 188)
WGOL A 5 A_SpawnItemEx("WilyGolemElectroFX", 0, 128, 188)
WGOL A 2 Thing_SetTranslation(0, 64)
WGOL A 2 Thing_SetTranslation(0, 0)
WGOL A 2 Thing_SetTranslation(0, 64)
WGOL A 2 Thing_SetTranslation(0, 0)
WGOL A 0 A_PlaySoundEx("misc/wilyball", "Voice", 0, 1)
WGOL B 25 A_SpawnITemEx("WilyGolemElectroballSpawner", 32, 0, 116)
WGOL A 0 A_PlaySoundEx("misc/wilyball", "Voice", 0, 1)
WGOL B 25 A_SpawnITemEx("WilyGolemElectroballSpawner2", 32, 0, 116)
WGOL A 0 A_PlaySoundEx("misc/wilyball", "Voice", 0, 1)
WGOL B 25 A_SpawnITemEx("WilyGolemElectroballSpawner3", 32, 0, 116)
Goto Spawn
Dead:
WGOL A 0 A_PlaySoundEx("misc/devildeath", "Voice", 0, 1)
WGOL A 0 A_SpawnItemEx("FakeDeathFX", 10, 0, 256)
WGOA U -1 A_SpawnItemEx("WilyGolemWilyEjected", 10, 0, 256, 0, 0, 20)
stop
}
}

actor WilyGolemWilyEjected
{
scale 2.5
PROJECTILE
states
{
Spawn:
WILG A 3 A_SpawnItemEx("SharkTorpedoDeath", 0, 0, 0)
loop
}
}


actor WilyGolemWily
{
scale 2.5
gravity 0.3
states
{
Spawn:
WILG A 0 A_SpawnItemEx("SharkTorpedoDeath", -2, 0, 24)
WILG AAA 1 A_JumpIf(floorz-z==0, "Bounce")
loop
Bounce:
WILG A 0 A_PlaySoundEx("weapon/crackermine", "Voice", 0, 1)
WILG A 1 ThrustThingZ(0, 20, 0, 1)
Bounced:
WILG A 1 A_JumpIf(floorz-z==0, "Grovel")
loop
Grovel:
WILG BC 7
loop
TerraJump:
WILG A 1 A_ChangeVelocity(-5, 0, 5) 
Goto TerraBounced
TerraBounced:
WILG A 1 A_JumpIf(floorz-z==0, "TerraSit")
loop
TerraSit:
WILG W -1
stop
ScaredJump:
WILG A 0 A_Recoil(6)
WILG A 0 A_SetGravity(1.0)
WILG A 2 ThrustThingZ(0, 30, 0, 1)
ScaredFly:
WILG [ 1 A_JumpIf(floorz-z==0, "Scared")
loop
Scared:
WILG ] 1 A_Stop
Sweaty:
WILG ] 2 A_SpawnItemEx("WilyGolemWilySweat", -8, 0, 40, random(0, 10), 0, random(5, 10), random(0,360)) 
loop
Sit:
WILG ] -1
stop
Stand:
WILG D -1
stop
}
}

actor WilyGolemWilySweat
{
PROJECTILE
scale 1.0
translation "0:255=4:4"
-NOGRAVITY
states
{
Spawn:
PIXL A 1 A_FadeOut(0.1)
loop
}
}

actor WilyGolemVacuumFX
{
speed 10
renderstyle translucent
alpha 1.0
scale 1.5
translation "8:253=4:4"
+NOINTERACTION
+MISSILE
states
{
Spawn:
MMFX E 0 A_FadeOut(0.08)
MMFX E 1
loop
}
}

actor WilyGolemElectroFX
{
Obituary "%o was torn apart by the Wily Iron Golem."
scale 2.5
+NOINTERACTION
states
{
Spawn:
WGOA STST 1
stop
}
}

actor WilyGolemElectroball
{
PROJECTILE
scale 2.2
Obituary "%o was torn apart by the Wily Iron Golem."
Damage (2)
Height 32
Radius 32
damagetype "LaserTrident"
translation "228:232=248:248"
+RIPPER
speed 18
var int user_dir;

states
{
Spawn:
WGOA MMNNOO 1 A_JumpIf(z<16, "CorrectDeath")
loop
CorrectDeath:
WGOA M 1 ThrustThingZ(0, 50, 0, 1)
Death:
//WGOA M 0 A_SpawnItemEX("WilyGolemElectroRingBall", 0, 0, 0, 8, 0, 0, user_dir)
//WGOA M 0 A_SetUserVar("user_dir", user_dir + 4)
//WGOA M 0 A_Jumpif(user_dir>359, "End")
//loop
WGOA M -1 ACS_NamedExecuteWithResult("TC_SpawnElectroRingBalls")
stop
End:
ESPA A 0 A_PlaySoundEx("misc/wilybeam", "SoundSlot6", 0, 1)
ESPA ZYXW 4 A_Stop
stop
}
}

actor WilyGolemElectroRingBall
{
Obituary "%o was torn apart by the Wily Iron Golem."
PROJECTILE
height 16
radius 16
scale 2.5
damage (8)
Damagetype "LaserTrident"
+RIPPER
states
{
Spawn:
WGOA PQR 4
loop
}
}

actor WilyGolemElectroballSpawner
{
Obituary "%o was torn apart by the Wily Iron Golem."
+MISSILE
+NOINTERACTION
renderstyle none
states
{
Spawn:
TNT1 A 0
WGOA M -1 ACS_NamedExecuteAlways("GolemElectroBall", 0)
loop
Death:
WGOA M 0 A_FaceTarget
WGOA M 35 A_CustomMissile("WilyGolemElectroball", 0, 0, 0, 0, 0)
stop
}
}

actor WilyGolemElectroballSpawner2 : WilyGolemElectroballSpawner
{
Obituary "%o was torn apart by the Wily Iron Golem."
states
{
Spawn:
TNT1 A 0
WGOA M -1 ACS_NamedExecuteAlways("GolemElectroBall", 0, 1)
loop
}
}

actor WilyGolemElectroballSpawner3 : WilyGolemElectroballSpawner
{
Obituary "%o was torn apart by the Wily Iron Golem."
states
{
Spawn:
TNT1 A 0
WGOA M -1 ACS_NamedExecuteAlways("GolemElectroBall", 0, 2)
loop
}
}
actor StasheARang
{
PROJECTILE
+THRUACTORS
damagetype "Misc"
+SEEKERMISSILE
+NOINTERACTION
scale 2.5
Obituary "%o was torn apart by the Wily Iron Golem."
height 16
radius 16
speed 14
states
{
Spawn:
WGOA A 0
WGOA A 0 ACS_NamedExecuteAlwayS("Stashe", 0)
Flying:
WGOA A 0 A_PlaySoundEx("weapon/slashclaw", "Voice", 0, 1)//ACS_NamedExecuteAlways("StasheArang", 0)
WGOA A 0 A_Explode(5, 60, 0, 0, 60)
WGOA IIJJ 1 A_SeekerMissile(1, 5, SMF_PRECISE)
WGOA A 0 A_PlaySoundEx("weapon/slashclaw", "Voice", 0, 1)//ACS_NamedExecuteAlways("StasheArang", 0)
WGOA A 0 A_Explode(5, 60, 0, 0, 60)
WGOA KKLL 1 A_SeekerMissile(1, 5, SMF_PRECISE)
loop
Death:
TNT1 A 35
stop
}
}


actor EyebrowLaserSpawner
{
height 1
radius 1
+NOGRAVITY
+LOOKALLAROUND
+THRUSPECIES
Obituary "%o was torn apart by the Wily Iron Golem."
species "Wily"
renderstyle none
states
{
Spawn:
TNT1 A 0
TNT1 A 1 ACS_NamedExecuteAlways("TargetTeam", 0)
TNT1 A 0 Thing_ChangeTID(0, 1102)
BASS A 1 //A_LookEx(0, 0, 0, 0, 360, "See")
See:
TNT1 A 0 A_FaceTarget
PLAY A 4 A_CustomMissile("EyebrowLaserStart", 260, 112, 0)
PLAY A 0 A_PlaySoundEx("misc/wilygolemeyebrow", "Voice", 0, 1)
PLAY A 0 A_CustomMissile("EyebrowLaser", 260, 112, random(-4, 4))//A_SpawnItemEx("EyebrowLaser", 0, 100, 0, 0)
PLAY A 4 A_CustomMissile("EyebrowLaserStart", 260, -112, 0)
PLAY A 0 A_PlaySoundEx("misc/wilygolemeyebrow", "Voice", 0, 1)
PLAY A 0 A_CustomMissile("EyebrowLaser", 260, -112, random(-4, 4))
PLAY A 0 A_GiveInventory("CutterFlag", 1)
PLAY A 0 A_JumpIfInventory("CutterFlag", 7, "Delay")
loop
Delay:
TNT1 A 55 A_TakeInventory("CutterFlag", 999)
Goto See
}
}

actor EyebrowLaser
{
PROJECTILE
height 16
radius 16
damage (7)
Obituary "%o was torn apart by the Wily Iron Golem."
damagetype "Misc"
+THRUSPECIES
species "Wily"
scale 2.5
Speed 65
states
{
Spawn:
WGOL Q 0
WGOL QQQQRRRR 1 A_JumpIf(CallACS("LaserShieldDist", 0), "Death2")
loop
Death:
WGOL PO 4
stop
Death2:
TNT1 A 0 A_Stop
TNT1 A 0 A_PlaySoundEx("item/protoreflect", 0)
TNT1 A 0 A_SpawnItemEx("ProtoShieldDeathFX", 0, 0, -20)
Goto Death
}
}

actor EyebrowLaserStart : EyebrowLaser
{
speed 0 
states
{
Spawn:
WGOL OP 4
stop
}
}

actor WilyGolemSuckFX
{
PROJECTILE
+THRUACTORS
scale 5.0
states
{
Spawn:
WGOL N 0 A_FadeOut(0.1)
WGOL N 1 A_SetScale(scalex - 0.45, scaley - 0.45) 
loop
}
}

actor WilyGolemGrind
{
Obituary "%o was torn apart by the Wily Iron Golem."
PROJECTILE
height 0
radius 0
+NOINTERACTION
states
{
Spawn:
TNT1 A 5
TNT1 A 0 A_SpawnItemEx("WilyGolemGrindFX", 64, random(-64, 64), -28)
TNT1 AAA 0 A_SpawnITemEx("WilyGolemGrindDebris", random(0, 48), 0, random(0, 48), random(5, 25), 0, frandom(2, 10), frandom(-8,8))
stop
}
}

actor WilyGolemGrindFX
{
Obituary "%o was torn apart by the Wily Iron Golem."
+MISSILE
+NOINTERACTION
scale 3.5
states
{
Spawn:
LBFX EFGHIJ 2
stop
}
}

actor WilyGolemDebrisShadow
{
Obituary "%o was torn apart by the Wily Iron Golem."
+FLOORHUGGER
PROJECTILE
+NOINTERACTION
scale 1.0
reactiontime 45
states
{
Spawn:
TNT1 A 1
TNT1 A 0 A_Jump(256, "Block", "Girder", "Blocks")
Block:
TNT1 A 0 A_SpawnItemEx("WilyGolemDebris1", 0, 0, 532, 0, 0, -10)
Goto Shadow
Girder:
TNT1 A 0 A_SpawnItemEx("WilyGolemDebris2", 0, 0, 532, 0, 0, -10)
Goto Shadow
Blocks:
TNT1 A 0 A_SpawnItemEx("WilyGolemDebris3FX", 0, 0, 532, 0, 0, -10, random(0,360))
TNT1 A 0 A_SpawnItemEx("WilyGolemDebris3FX", 8, 0, 532 + 10, 0, 0, -10, random(0,360))
TNT1 A 0 A_SpawnItemEx("WilyGolemDebris3FX", 16, 0, 532 + 20, 0, 0, -10, random(0,360))
TNT1 A 0 A_SpawnItemEx("WilyGolemDebris3", 0, 0, 532, 0, 0, -10)
Goto Shadow
Shadow:
WGOL M 0 A_CountDown
WGOL M 1 A_SetScale(scalex + 0.04, scaley + 0.04)
loop
}
}

actor WilyGolemDebris1
{
PROJECTILE
Gravity 0.1
-NOGRAVITY
//+THRUSPECIES
species "Golem"
Damage (19)
Obituary "%o was torn apart by the Wily Iron Golem."
damagetype "Boss"
scale 2.8
radius 40

states
{
Spawn:
WGOL F -1
loop
Death:
TNT1 A 0 A_SpawnItemEx("SharkTorpedoDeath", 0, 0, 16)
stop
}
}

actor WilyGolemDebris2 : WilyGolemDebris1
{
states
{
Spawn:
WGOL G -1
loop
}
}


actor WilyGolemDebris3 : WilyGolemDebris1
{
states
{
Spawn:
TNT1 A -1
loop
}
}

actor WilyGolemDebris3FX : WilyGolemDebris3
{
+THRUACTORS
states
{
Spawn:
WGOL H -1
loop
Death:
TNT1 A 1
stop
}
}

actor WilyGolemGrindDebris : WilyGolemDebris2
{
Obituary "%o was torn apart by the Wily Iron Golem."
damage (5)
gravity 0.7
damagetype "Boss"
states
{
Spawn:
WGOL H -1
loop
}
}

actor WilyGolemShockwaveSpawner
{
Obituary "%o was torn apart by the Wily Iron Golem."
PROJECTILE
+THRUSPECIES
species "Golem"
+FLOORHUGGER
reactiontime 12
renderstyle none
speed 25
states
{
Spawn:
TNT1 A 0
TNT1 A 1 A_SpawnItemEx("WilyGolemShockwaveFX")
stop
Wave:
CRAS B 0 A_Explode(12, 80, 0, 0, 80)
CRAS B 0 A_SpawnItemEx("DrillExplode", 0, 0, 8, 0, 0, 0)
//CRAS B 0 A_SpawnItemEx("DrillExplode", 0, 0, 8, 0, 0, 0)
CRAS B 5
TNT1 A 0 A_JumpIf(z<-52, "Death")
loop
Death:
TNT1 A 0 
stop
}
}

actor WilyGolemShockwaveBit : PunkRock2
{
Obituary "%o was torn apart by the Wily Iron Golem."
PROJECTILE
+DOOMBOUNCE
bouncecount 3
-NOGRAVITY
+RIPPER
+THRUACTORS
damage 0
scale 2.0
translation "80:95=69:69"
bouncefactor 0.5
States
{
Spawn:
DUST D 0
TNT1 A 0 A_JumpIf(z<-52, "Death")
DUST D -1
stop
Death:
TNT1 A 0
stop
}
}

actor WilyGolemShockwaveFX
{
Obituary "%o was torn apart by the Wily Iron Golem."
+NOINTERACTION
-SOLID
states
{
	Spawn:
	TNT1 A 0
	TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx("WilyGolemShockwaveBit", random(30,512), 0, 0, random(-3,3), random(-3,3), random(5,8), random(0,360))
	stop
}
}

actor WilyGolemFireSpew
{
Obituary "%o was torn apart by the Wily Iron Golem."
PROJECTILE
+NOCLIP
states
{
Spawn:
TNT1 A 0
TNT1 A 0 A_SpawnItemEx("WilyGolemDamager", 64, 0, -8, 15, 0, 0, 0)
TNT1 A 0 A_SpawnITemEX("WilyGolemFire", 8, 0, 26, random(10, 30), 0, random(-12, 1), random(-11, 11))
Stop
}
}

actor WilyGolemDamager
{
Obituary "%o was torn apart by the Wily Iron Golem."
PROJECTILE
damage (1)
radius 64
height 64
Damagetype "Gamma"
states
{
Spawn:
TNT1 A 45
stop
}
}

actor WilyGolemFire
{
Obituary "%o was torn apart by the Wily Iron Golem."
PROJECTILE
+NOINTERACTION
damagetype "Boss"
scale 3.5
states
{
Spawn:
WGOL SSSSTTTTUUUUVVVVWWWWXXXXYYYY 1 A_SetScale(scalex + 0.001, scaley + 0.001) 
stop
}
}

actor WilyGolemCore
{
+NOGRAVITY
+SHOOTABLE
+INVULNERABLE
Obituary "%o was torn apart by the Wily Iron Golem."
+BRIGHT

Health 1000
mass 99999999
radius 15
height 32
renderstyle none
var int user_count;
var int user_maxcount;

damagefactor "Buster", 0.45
damagefactor "ReboundStriker", 0.75
damagefactor "PharaohShot1", 0.35
damagefactor "PharaohShot2", 0.35
damagefactor "PharaohShot3", 0.95

damagefactor "Misc", 0.0
damagefactor "Boss", 0.0

states
{
Spawn:
PLAY A -1
Spawn2:
PLAY A 0 A_SetUserVar("user_maxcount", 3)
PLAY A 1 A_LookEx(0, 0, 0, 0, 360, "See")
loop
Seek:
PLAY A 1 A_LookEx(0, 0, 0, 0, 360, "See")
loop
See:
PLAY A 0 ACS_NamedExecute("EvilShieldToggle", 0, 1) //A_GiveToTarget("EvilRobotShield", 1)
PLAY A 140
PLAY A 0 ACS_NamedExecute("EvilShieldToggle", 0, 0) //A_TakeFromTarget("EvilRobotShield", 1)
PLAY A 0 A_ChangeFlag("INVULNERABLE", 0)
PLAY A 20 A_GiveInventory("CutterFlag", 1)
Missile:
PLAY A 0 A_FaceTarget
PLAY A 0 A_JumpIfHealthLower(550, "MissilePlus")
PLAY A 40 A_CustomMissile("WilyGolemCoreShot", 16, 0, 0, 0) 
PLAY A 0 A_SetUserVar("user_count", user_count + 1)
PLAY A 0 A_JumpIf(user_count == user_maxcount, "EndMissile")
loop
MissilePlus:
PLAY A 20 A_CustomMissile("WilyGolemCoreShot", 16, 0,frandom(-20,20), 0) 
PLAY A 0 A_SetUserVar("user_count", user_count + 1)
PLAY A 0 A_JumpIf(user_count == user_maxcount, "EndMissile")
loop
EndMissile:
PLAY A 0 A_JUmpIf(user_maxcount > 4, 2)
PLAY A 0 A_SetUserVar("user_maxcount", user_maxcount + 1)
PLAY A 0 
PLAY A 0 A_SetUserVar("user_count", 0)
PLAY A 20 A_TakeInventory("CutterFlag", 999)
PLAY A 0 ACS_NamedExecute("EvilShieldToggle", 0, 1) //A_GiveToTarget("EvilRobotShield", 1)
PLAY A 0 A_ChangeFlag("INVULNERABLE", 1)
PLAY A 35
Goto Seek
Death:
PLAY A 0 SetPlayerPropertY(1, 2, 5)
PLAY A 0 A_SetAngle(0.75)
PLAY A 0 A_ChangeFlag("NOGRAVITY", 1)
PLAY A 0 A_Quake(3, 32, 0, 1000)
PLAY AAAAA 4 A_SpawnItemEx("DrillExplode", random(-256, 256), 4, random(-64, 32)) 
PLAY A 0 A_PlaySoundEx("misc/mm3explosion", "Voice", 0, 1)
loop
}
}

actor WilyGolemHeadHitbox : WilyGolemCore
{
+THRUSPECIES
+SHOOTABLE
species "Wily"
Obituary "%o was torn apart by the Wily Iron Golem."
renderstyle normal
Health 1000
renderstyle none
scale 4.0
mass 9999999999

height 64
radius 64

damagefactor "Buster", 1.0
damagefactor "ReboundStriker", 1.80
damagefactor "PharaohShot1", 1.35
damagefactor "PharaohShot2", 1.35
damagefactor "PharaohShot3", 1.55
states
{
Spawn:
PLAY H 0 A_ChangeFlag("INVULNERABLE", 1)
PLAY A -1
stop
Damaged:
PLAY H 0 A_ChangeFlag("INVULNERABLE", 0) 
PLAY H 0 A_SpawnItemEx("WilyGolemLid", 0, 5, 0, 0, 0, 20)
PLAY H -1
loop 
Death:
PLAY H -1
stop
}
}

actor WilyGolemLid
{
Obituary "%o was torn apart by the Wily Iron Golem."
Scale 2.5
+THRUACTORS
+MISSILE
+NOGRAVITY
states
{
Spawn:
WGOL Z 0
WGOL Z 0 Thing_ChangeTID(0, 1)
WGOL Z 10
WGOL Z 80 A_Stop
WGOL Z 0 A_ChangeVelocity(0, 0, -1.25, 0)
Falling:
WGOL Z 1 A_JumpIf(z<298.0, "Death")
loop
Death:
TNT1 A 0 A_GiveToTarget("CutterFlag", 1)
stop
End:
TNT1 A 1 A_SpawnITemEx("DrillExplode")
stop
}
}

actor WilyGolemCoreShot
{
PROJECTILE
Obituary "%o was torn apart by the Wily Iron Golem."
scale 2.5
radius 16
height 16
damage (8)
speed 3
states
{
Spawn:
WGOL I 0
WGOL I 0 A_PlaySoundEx("misc/wilygolemblast", 0, 0, 1)
WGOL IIIJJJKKKLLL 1 
WGOL IIIJJJKKKLLL 1 A_ScaleVelocity(1.2)
Looping:
WGOL IJKL 3 //A_ScaleVelocity(1.1)
loop
}
}


actor WilyGolemKingProp
{
Translation "192:192=215:215", "198:198=220:220"
scale 2.5
gravity 1.5
states
{
Spawn:
KING N 0
KING N 0 A_Recoil(-16)
Fall:
KING N 1 A_JumpIf(z < 128, "Slice")
loop
Slice:
KINP I 5 A_Stop
KINP J 5 A_PlaySoundEx("misc/kingchop","Voice")
KINP K 4 
Falling:
KING N 1 A_JumpIf(floorz-z == 0, "Land")
loop
Land:
KING A 8
KING N -1 A_ChangeVelocity(-20, 0, 20, CVF_REPLACE|CVF_RELATIVE) 
loop
AxeTalking:
KINP U 4
KING A 4
KINP U 4
KING A 4
KINP U 4
KING A 4
KINP U 4
KING A 4
KINP U 4
KING A 4
KINP U 4
KING A 4
KINP U 4
KING A 4
KINP U 4
KING A 4
KINP U 4
KING A 4
Goto Stand
}
}

actor WilyGolemDuoProp
{
Translation "192:192=220:220", "198:198=195:195"
scale 2.5
+NOGRAVITY
states
{
Spawn:
TNT1 A 0
TNT1 A 1 A_ChangeVelocity(15.0, 0, -14.5, CVF_REPLACE|CVF_RELATIVE)
Ball:
DUOR L 0 A_SpawnItemEx("GigaFistFX",0,0,12)
DUOR LLMM 1 A_JumpIf(z < 128, "Explode")
loop
Explode:
TNT1 A 0 Radius_Quake(5, 10, 0, 256, 400)
DUOR I 0 A_SpawnItemEx("WilyGolemDuoExplosion")
DUOR I 0 A_PlaySoundEx("misc/hugequake3", "Voice")
DUOR I 0 A_ChangeVelocity(-5, 0, 16, CVF_REPLACE|CVF_RELATIVE) 
Falling:
DUOR I -1 A_ChangeFlag("NOGRAVITY", 0)
stop

Talking:
DUOR A 4
DUO2 M 4
DUOR A 4
DUO2 M 4
DUOR A 4
DUO2 M 4
DUOR A 4
DUO2 M 4
DUOR A 4
DUO2 M 4
DUOR A 4
DUO2 M 4
DUOR A 4
DUO2 M 4
DUOR A 4
DUO2 M 4
DUOR A 4
DUO2 M 4
Goto Stand
}
}

actor WilyGolemDuoExplosion
{
PROJECTILE
reactiontime 30
states
{
Spawn:
TNT1 A 0 A_Countdown
TNT1 A 0 A_SpawnITemEx("DrillExplode", random(-128, 128), 0, random(-128, 128), 0, 0, 0, random(0,360))
TNT1 A 0 A_SpawnITemEx("WilyGolemExplosion", random(-128, 128), 0, random(-128, 128), 0, 0, 0, random(0,360))
TNT1 A 1
loop
}
}

actor WilygolemExplosion
{
scale 2.5
PROJECTILE
states
{
Spawn:
ASEX ABCDEF 2
stop
}
}

actor WilyGolemKing
{
Translation "192:192=215:215", "198:198=220:220"
scale 2.5
Health 1000
+SHOOTABLE
+NOTARGETSWITCH
+NODAMAGE
//+ISMONSTER
Height 52
Radius 40
mass 999999999
painchance 256
painsound "misc/monkeybutt"
speed 4

damagefactor "Normal", 0.0
damagefactor "Misc", 1.0
damagefactor "LaserTrident", 1.0
damagefactor "SparkChaser", 1.0

damagetype "Dummy"

+THRUSPECIES
species "Ally"
states
{
Spawn:
Stand:
KING A 0 A_JumpIfInventory("PlantBarrierAmmo", 1, "ShieldStart")
KING A 0 A_JumpIfInventory("AtomicFireAmmo", 1, "Seeking")
KING A 1 A_Stop
loop
WalkForward:
KING BBBBCCCCDDDDEEEE 1 A_ChangeVelocity(3.5,0,0,CVF_RELATIVE|CVF_REPLACE)//A_Recoil(-1)
loop
WalkSuck:
KING AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 1 A_ChangeVelocity(1.0,0,0,CVF_RELATIVE|CVF_REPLACE)
KING A 0 A_SetAngle(angle + 180)
WalkSucking:
KING BBBBCCCCDDDDEEEE 1 A_ChangeVelocity(0.5,0,0,CVF_RELATIVE|CVF_REPLACE)//A_Recoil(-1)
loop
BackStep:
KING BBBBCCCCEE 1 A_ChangeVelocity(-4.0,0,0,CVF_RELATIVE|CVF_REPLACE)
Goto Stand
Spawn2:
KING A 2 //ACS_NamedExecuteAlways("JoeDancePartner", 0, 4004, 4005)
Done:
KING A -1
stop
Pain:
KING H 0 A_GiveInventory("SkullBarrierAmmo", 1)
KING H 0 A_Pain
KING H 1 A_Recoil(1)
KING HHHHHHHHHHHHHHHHHH 2 A_SpawnItemEx("PainFX",-5,0,3,0,0,0)
Goto Spawn
Seeking:
DUOR A 0 A_ChangeFlag("SHOOTABLE",1)
DUOG B 0 A_TakeInventory("SkullBarrierAmmo", 9999)
KING B 0 ACS_NamedExecuteAlways("AllyFindTarget", 0)
KING BBBBCCCCDDDDEEEE 1 A_Wander
KING A 0 A_JumpIfInventory("AtomicFireAmmo", 1, "Seeking")
Goto Spawn
Chase:
DUOG B 0 A_TakeInventory("SkullBarrierAmmo", 9999)
KING BBBBCCCCDDDDEEEE 1 A_Chase
KING A 0 A_JumpIfInventory("AtomicFireAmmo", 1, "Chase")
goto Spawn
Melee:
KING H 0 A_GiveInventory("SkullBarrierAmmo", 1)
KIFU F 0 A_PlaySoundEx("misc/kingchop","Voice")
KIFU F 5
KIFU G 5 A_Explode(300, 40, XF_NOTMISSILE)
Goto Seeking
ShieldStart:
KING AAA 1 A_Stop
KING A 0 ACS_NamedExecuteAlways("LookAtMiddle", 0)
KING AAA 1 A_Stop
KING N 5 A_ChangeVelocity(18, 0, 10, CVF_RELATIVE)
ShieldJumping:
KING N 1 A_JumpIf(floorz-z==0, "Shield")
loop
ShieldStartOld:
KING J 0 A_ChangeFlag("INVULNERABLE", 1)
KING BBBBCCCCDDDDEEEEBBBBCCCCDDDDEEEE 1 A_ChangeVelocity(6.5,0,0,CVF_RELATIVE|CVF_REPLACE)
KING B 0 A_SetAngle(90)
KING B 0 A_Stop
Shield:
KING B 0 A_SetAngle(90)
KING J 0 A_ScaleVelocity(0.25)
DUOR A 0 A_ChangeFlag("SHOOTABLE",0)
Sheilding:
KING J 1 A_SpawnItemEx("WilyGolemKingShield", 28, -28, 0,0,0,0,0,SXF_NOCHECKPOSITION)
loop
Reset:
KING A 0 A_ChangeFlag("INVULNERABLE", 0)
Goto Spawn
Pain.LaserTrident:
KING N 0 A_ChangeFlag("INVULNERABLE", 1)
KING N 0 A_ChangeVelocity(0, 0, 14, CVF_REPLACE)
KING N 1 //ThrustThingZ(0, 50, 0, 0)
Falling:
KING N 1 A_JumpIf(floorz-z==0, "FallEnd")
loop
FallEnd:
KING N 0 A_ChangeFlag("INVULNERABLE", 0)
KING N 0 A_PlaySound("misc/fatland")
Goto Done
Leave:
TFOG C 0 A_ChangeFlag("NOINTERACTION",1)
TFOG A 0 A_PlaySoundEx("misc/teleportout", "Voice", 0, 1)
TFOG B 0 A_ChangeFlag("NOGRAVITY",1)
TFOG BBBAAACCC 1
TFOG A 65 A_ChangeVelocity(0,0,13,CVF_RELATIVE|CVF_REPLACE)
stop
NoAxe:
KING W -1
stop

Pain.SparkChaser:
KING H 0 A_Pain
KING H 0 A_ChangeFlag("INVULNERABLE", true)
KING H 0 A_SpawnItemEx("DrillExplode", 28, -28, 48)
KING H 0 A_PlaySoundEx("misc/mm3explode", "voice") 
KING H 0 A_SetAngle(angle - 50)
KING H 0 A_ChangeVelocity(-6, 0, 3, CVF_RELATIVE)
KING HHHHHHHHHHHHHHHHHH 2 A_SpawnItemEx("PainFX",-5,0,3,0,0,0)
KING H 0 A_ChangeFlag("INVULNERABLE", 1)
Damaged:
KING T 20 A_SpawnItemEx("ShockFX", random(0, 12), 0, random(8, 32), 0,0,0,random(0,360))
loop
FakeShielding:
KING J 1 A_SpawnItemEx("WilyGolemKingShieldFake", 28, -28, 0,0,0,0,0,SXF_NOCHECKPOSITION)
loop
Kneel:
KING R -1
stop 
Limp:
KING R 8 A_Stop
KINP LLLLLLLLLL 1 A_ChangeVelocity(3.0,0,0,CVF_RELATIVE|CVF_REPLACE)
KINP MMMMMMMMMM 1 A_ChangeVelocity(3.0,0,0,CVF_RELATIVE|CVF_REPLACE)
loop
Phone:
KINP S 3
KINP S 0 A_PlaySoundEx("menu/activate", "Voice", 0, 1)
PhoneWait:
KINP S -1
stop
Sad:
KINP N -1
stop
LookOn:
KING T -1
stop

AxeTalking:
KINP U 4
KING A 4
KINP U 4
KING A 4
KINP U 4
KING A 4
KINP U 4
KING A 4
KINP U 4
KING A 4
KINP U 4
KING A 4
KINP U 4
KING A 4
KINP U 4
KING A 4
KINP U 4
KING A 4
Goto Stand
Talking:
KINP P 4
KING W 4
KINP P 4
KING W 4
KINP P 4
KING W 4
KINP P 4
KING W 4
KINP P 4
KING W 4
KINP P 4
KING W 4
KINP P 4
KING W 4
KINP P 4
KING W 4
KINP P 4
KING W 4
Goto NoAxe
PhoneTalking:
KINP T 4
KINP S 4
KINP T 4
KINP S 4
KINP T 4
KINP S 4
KINP T 4
KINP S 4
KINP T 4
KINP S 4
KINP T 4
KINP S 4
KINP T 4
KINP S 4
KINP T 4
KINP S 4
KINP T 4
KINP S 4
Goto PhoneWait
KneelTalking:
KINP R 4 A_Stop
KING R 4
KINP R 4
KING R 4
KINP R 4
KING R 4
KINP R 4
KING R 4
KINP R 4
KING R 4
KINP R 4
KING R 4
KINP R 4
KING R 4
KINP R 4
KING R 4
KINP R 4
KING R 4
Goto Kneel
}
}

actor WilyGolemKingShield
{
-SOLID
-SHOOTABLE
height 5
radius 5
scale 2.5
health 1
+NOBLOOD
+NORADIUSDMG
states
{
Spawn:
KINP A 0
KINP A 0 Thing_ChangeTID(0, 800)// I dont know what this is
TNT1 A 0 A_SpawnITemEx("WilyGolemKingShieldHitbox", 0, 0 * 16)
TNT1 A 0 A_SpawnITemEx("WilyGolemKingShieldHitbox", 0, 1 * 16)
TNT1 A 0 A_SpawnITemEx("WilyGolemKingShieldHitbox", 0, 2 * 16)
TNT1 A 0 A_SpawnITemEx("WilyGolemKingShieldHitbox", 0, -1 * 16)
TNT1 A 0 A_SpawnITemEx("WilyGolemKingShieldHitbox", 0, -2 * 16)
KINP AA 1 
stop
Death:
TNT1 A 0 A_PlaySoundEx("item/protoreflect", 0)
TNT1 A 0 A_SpawnItemEx("ProtoShieldDeathFX", 12, 0, 24)
KINP AA 1 
stop
}
}

actor WilyGolemKingShieldHitbox
{
-SOLID
+SHOOTABLE
health 1
+NOBLOOD
+NORADIUSDMG
height 120
renderstyle none
radius 16
+THRUSPECIES
species "GolemAllies"
states
{
Spawn:
KINP A 0
KINP A 0 Thing_ChangeTID(0, 800)
KINP AA 1
stop
Death:
TNT1 A 0 A_PlaySoundEx("item/protoreflect", 0)
TNT1 A 0 A_SpawnItemEx("ProtoShieldDeathFX", 12, 0, 24)
KINP AA 1 
stop
}
}

actor WilyGolemKingShieldFake : WilyGolemKingShield
{
+NOINTERACTION
-SHOOTABLE
}

actor WilyGolemDuo
{
Translation "192:192=220:220", "198:198=195:195"
scale 2.5
Health 1000
+SHOOTABLE
+NOTARGETSWITCH
+NODAMAGE
Height 52
Radius 40
speed 4
mass 999999999
painchance 256
painsound "misc/monkeybutt"

damagefactor "Normal", 0.0
damagefactor "Misc", 1.0

damagefactor "LaserTrident", 1.0
damagefactor "SparkChaser", 1.0

+THRUSPECIES
species "Ally"
states
{
Spawn:
Stand:
DUOR G 0 Thing_SetTranslation(0, 0)

DUOR A 0 A_JumpIfInventory("PlantBarrierAmmo", 1, "Rise")
KING A 0 A_JumpIfInventory("AtomicFireAmmo", 1, "Seeking")
DUOR A 1 A_Stop
loop
WalkForward:
DUOR A 0 Thing_SetTranslation(0, 0)
DUOR BBBBCCCCDDDDEEEE 1 A_ChangeVelocity(3.5,0,0,CVF_RELATIVE|CVF_REPLACE)
loop
WalkSuck:
DUOR G 0 Thing_SetTranslation(0, 0)
DUOR AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 1 A_ChangeVelocity(1.0,0,0,CVF_RELATIVE|CVF_REPLACE)
DUOR A 0 A_SetAngle(angle + 180)
WalkSucking:
DUOR BBBBCCCCDDDDEEEE 1 A_ChangeVelocity(0.5,0,0,CVF_RELATIVE|CVF_REPLACE)//A_Recoil(-1)
loop
BackStep:
DUOR BBBBCCCCEE 1 A_ChangeVelocity(-4.0,0,0,CVF_RELATIVE|CVF_REPLACE)
Goto Spawn

Spawn2:
DUOR A 2 //ACS_NamedExecuteAlways("JoeDancePartner", 0, 4005, 4004)
Chase:
DUOR BBBBCCCCDDDDEEEE 1 A_Chase
loop
Pain:
DUOG B 0 A_GiveInventory("SkullBarrierAmmo", 1)
DUOR G 0 Thing_SetTranslation(0, 0)
DUOR H 0 A_Pain
DUOR H 1 A_Recoil(1)
DUOR HHHHHHHHHHHHHHHHHH 2 A_SpawnItemEx("PainFX",-5,0,3,0,0,0)
Goto Spawn



Seeking:
DUOR A 0 Thing_SetTranslation(0, 0)
DUOR A 0 A_ChangeFlag("SHOOTABLE",1)
DUOG B 0 A_TakeInventory("SkullBarrierAmmo", 9999)
DUOR B 0 ACS_NamedExecuteAlways("AllyFindTarget", 0)
DUOR BBBBCCCCDDDDEEEE 1 A_Wander
KING A 0 A_JumpIfInventory("AtomicFireAmmo", 1, "Seeking")
Goto Spawn
Chase:
DUOR A 0 Thing_SetTranslation(0, 0)
DUOG B 0 A_TakeInventory("SkullBarrierAmmo", 9999)
DUOR BBBBCCCCDDDDEEEE 1 A_Wander
DUOR BBBBCCCCDDDDEEEE 1 A_Chase
KING A 0 A_JumpIfInventory("AtomicFireAmmo", 1, "Seeking")
Goto Spawn
Missile:
DUOG B 0 A_GiveInventory("SkullBarrierAmmo", 1)
DUOF B 0 A_PlaySoundEx("weapon/coilstart","Voice")
DUOR G 0 A_FaceTarget
DUOR G 2 Thing_SetTranslation(0, 102)
DUOR G 2 Thing_SetTranslation(0, 103)
DUOR G 2 Thing_SetTranslation(0, 104)
DUOR G 2 Thing_SetTranslation(0, 102)
DUOR G 2 Thing_SetTranslation(0, 103)
DUOR G 2 Thing_SetTranslation(0, 104)
DUOR G 0 A_FaceTarget
DUOR G 2 Thing_SetTranslation(0, 104)
DUOR G 2 Thing_SetTranslation(0, 102)
DUOR G 2 Thing_SetTranslation(0, 103)
DUOR G 2 Thing_SetTranslation(0, 104)
DUOR G 2 Thing_SetTranslation(0, 102)
DUOR G 2 Thing_SetTranslation(0, 103)
DUOR G 2 Thing_SetTranslation(0, 104)
DUOR G 0 A_FaceTarget
DUOR G 2 Thing_SetTranslation(0, 102)
DUOR G 2 Thing_SetTranslation(0, 103)
DUOR G 2 Thing_SetTranslation(0, 104)
DUOR G 2 Thing_SetTranslation(0, 102)
DUOR G 2 Thing_SetTranslation(0, 103)
DUOR G 2 Thing_SetTranslation(0, 104)
DUOR G 2 Thing_SetTranslation(0, 0)
DUOR G 0 A_FaceTarget
DUOF B 0 A_PlaySoundEx("weapon/cfire","Voice")
DUOR G 9 A_CustomMissile("WilyGolemDuoGigaFist", 20, 0, 0, 2, 0)
DUOR G 3 Thing_SetTranslation(0, 0)
Goto Chase

Rise:
DUOR A 0 A_ChangeFlag("INVULNERABLE",1)
DUOR A 0 A_ChangeFlag("NOBLOCKMONST",1)
DUOR A 0 A_ChangeFlag("NOGRAVITY",1)
DUOR A 0 A_ChangeFlag("SHOOTABLE",0)
DUOR A 0 ThrustThingZ(0,5,0,0)
DUOR G 0 A_PlaySound("weapon/pcharge")
DUOR IJKIJKIJKJKIJK 2
DUOR LM 2 A_Stop
DUOR A 0 ThrustThingZ(0,50,0,0)
Goto Ball
Ball:
DUOR LLMMLLMMLLMMLLMMLLMMLLMMLLMMLLMMLLMMLLMM 1 A_SpawnItemEx("WilyGolemDuoFX", random(-48, 48), random(-48, 48), 0, 0, 0, 0) 
DUOR L 0 ACS_NamedExecute("DuoBallAttack", 0)
loop
DuoBallEnd:
DUOR A 0 A_ChangeFlag("NOGRAVITY",0)
DUOR A 0 A_SetAngle(90)
DUOR A 0 A_ChangeVelocity(-8, 0, 5, CVF_REPLACE|CVF_RELATIVE)
TNT1 A 0 Radius_Quake(5, 10, 0, 256, 400)
DUOR I 0 A_SpawnItemEx("WilyGolemDuoExplosion")
DUOR I 0 A_PlaySoundEx("misc/hugequake3", "Voice")
DuoBallFalling:
DUOR I 1 A_JumpIF(floorz-z==0, "DuoBallLand")
loop
DuoBallLand:
DUOR S 0 A_Stop
DUOR S 50 A_ChangeFlag("NOBLOCKMONST", 0)
DUOR A 0 A_ChangeFlag("INVULNERABLE",0)
DUOR A 0 A_TakeInventory("PlantBarrierAmmo", 999)
Goto WilyPotShots
Reset:
KING A 0 A_ChangeFlag("INVULNERABLE", 0)
Goto Spawn
Pain.LaserTrident:
DUOR I 0 A_ChangeFlag("INVULNERABLE", 1)
DUOR I 0 A_ChangeVelocity(0, 0, 13, CVF_REPLACE)
DUOR I 1 //ThrustThingZ(0, 50, 0, 0)
Falling:
DUOR I 1 A_JumpIf(floorz-z==0, "FallEnd")
loop
FallEnd:
DUOR I 0 A_ChangeFlag("INVULNERABLE", 0)
DUOR I 0 A_PlaySound("misc/fatland")
Goto Spawn
Leave:
TFOG C 0 A_ChangeFlag("NOINTERACTION",1)
TFOG A 0 A_PlaySoundEx("misc/teleportout", "Voice", 0, 1)
TFOG B 0 A_ChangeFlag("NOGRAVITY",1)
TFOG BBBAAACCC 1
TFOG A 65 A_ChangeVelocity(0,0,13,CVF_RELATIVE|CVF_REPLACE)
stop
WilyPotShots:
DUOR A 10 ACS_NamedExecuteAlways("DuoTargetWily", 0)
DUOR GG 6 A_FaceTarget
DUOR G 0 A_PlaySound("weapon/cfire")
DUOR G 8 A_CustomMissile("GolemDuoMidFist",35,-12,0,0)
DUOR GG 6 A_FaceTarget
DUOR G 0 A_PlaySound("weapon/cfire")
DUOR G 8 A_CustomMissile("GolemDuoMidFist",35,-12,0,0)
DUOR GG 6 A_FaceTarget
DUOR G 0 A_PlaySound("weapon/cfire")
DUOR G 8 A_CustomMissile("GolemDuoMidFist",35,-12,0,0)
DUOR GA 10
loop
Aim:
DUOR F 70 
DUOR F 0 A_PlaySoundEx("weapon/tscharge","Voice",0,1)
Aiming:
DUOR F 2 Thing_SetTranslation(0, 102)
DUOR F 2 Thing_SetTranslation(0, 103)
DUOR F 2 Thing_SetTranslation(0, 104)
loop
SafeAim:
DUOR F -1
stop
ShowPower:
DUO2 DDDEEE 8
DUO2 E 0 A_SpawnITemEx("DuoPropLightEnergy", 2, -25, 40)
ShowingPower:
DUO2 FG 4
loop
NoMoreShow:
DUO2 D 40 A_GiveInventory("CutterFlag", 1)
Goto Stand

Pain.SparkChaser:
DUOR H 0 A_Pain
DUOR H 0 A_ChangeFlag("INVULNERABLE", true)
DUOR H 0 A_ChangeVelocity(-5, 0, 0, CVF_RELATIVE)
DUOR HHHHHHHHHHHHHHHHHH 2 A_SpawnItemEx("PainFX",-5,0,3,0,0,0)
Damaged:
DUO2 L 20 A_SpawnItemEx("ShockFX", random(0, 12), 0, random(8, 32), 0,0,0,random(0,360))
loop

TerraRise:
DUOR A 0 A_ChangeFlag("INVULNERABLE",1)
DUOR A 0 A_ChangeFlag("NOBLOCKMONST",1)
DUOR A 0 A_ChangeFlag("NOGRAVITY",1)
DUOR A 0 A_ChangeFlag("SHOOTABLE",0)
DUOR A 0 ThrustThingZ(0,3,0,0)
DUOR G 0 A_PlaySound("weapon/pcharge")
DUOR IJKIJKIJKJKIJKIJKIJK 2
DUOR LM 2 A_Stop
Goto TerraBall
TerraBall:
DUOR LLMM 1 A_SpawnItemEx("WilyGolemDuoFX", random(-48, 48), random(-48, 48), 0, 0, 0, 0) 
loop

TerraBallEnd:
DUOR L 0 A_Stop
DUOR LLMMLLMM 1 
DUOR ILIL 2
Hover:
DUOR I -1
stop
DBZ:
DUOR IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII 1 A_SpawnItemEx("WilyGolemTerraDBZ", 340, 0, random(-56, 300), 0, 0, 0, random(0,360))
DUOR IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII 1 A_SpawnItemEx("WilyGolemTerraDBZ", 340, 0, random(-56, 300), 0, 0, 0, random(0,360))
goto Hover
TheEnd:
DUOR I 10
DUOR H 5
DUOR HHHHHHHHHHHHHHH 2 A_SpawnItemEx("WilyGolemBoosterFX",random(-50,50),random(-50,50),random(-10,80))
Ending:
DUOR H 1 A_SpawnItemEx("WilyGolemBoosterFX",random(-50,50),random(-50,50),random(-10,80))
loop
Explode:
ERO4 I 0 A_JumpIfInventory("CutterFlag",25,"Dead")
ERO4 I 0 A_GiveInventory("CutterFlag",1)
ERO4 I 0 A_PlaySoundEx("weapon/coilexplode","Auto",0,1)
DUOR H 1 A_SpawnItemEx("DrillExplode",random(-90,50),random(-90,90),random(-30,90))
DUOR H 1 A_SpawnItemEx("WilygolemExplosion",random(-90,90),random(-90,90),random(-30,90))
TNT1 A 1 A_SpawnItemEx("DuoCriticalDeathGib", 0, 0, 32, random(-2,2), random(-2,2), random(2,7), random(0,359), 0)
loop
Dead:
TNT1 A 0 A_PlaySoundEx("misc/gib","Auto",0,1)
TNT1 AAAAAAAAAAA 0 A_SpawnItemEx("DuoCriticalDeathGib", 0, 0, 32, random(-6,6), random(-6,6), random(4,8), random(0,359), 0)
stop

Talking:
DUOR A 4
DUO2 M 4
DUOR A 4
DUO2 M 4
DUOR A 4
DUO2 M 4
DUOR A 4
DUO2 M 4
DUOR A 4
DUO2 M 4
DUOR A 4
DUO2 M 4
DUOR A 4
DUO2 M 4
DUOR A 4
DUO2 M 4
DUOR A 4
DUO2 M 4
Goto Stand
}
}

actor DuoCriticalDeathGib : CriticalDeathGib
{
Translation "192:192=220:220", "198:198=195:195"
gravity 0.2
States
{
Spawn:
TNT1 A 0
TNT1 A 0 //ACS_NamedExecuteWithResult("core_copytranslation")
TNT1 A 0 A_Jump(256,"B","C","D","E","F","G")
wait
}
}

actor GolemDuoMidFist : MidFist
{
+THRUSPECIES
species "GolemAllies"
damage (5)
}

actor DuoPropLightEnergy
{
scale 2.0
+MISSILE
+NOGRAVITY

states
{
Spawn:
TNT1 A 0 A_JumpIfInTargetInventory("CutterFlag", 1, "Death")
DUO2 HHHIIIJJJKKK 1 A_Weave(0, 1, 0, 0.12)
loop
Death:
TNT1 A 0
stop
}
}

actor WilyGolemDuoFX 
{
reactiontime 3
scale 3.0
+NOGRAVITY
-SOLID
states
{
Spawn:
RBFX TU 6 A_CountDown
loop
}
}


actor WilyGolemDuoGigaFist : GigaFist
{
//+RIPPER
damage 256
damagetype "Dummy"
radius 32
Damage (0)
+THRUSPECIES
species "Ally"
states
{
Spawn:
GIGF F 2
GIGF F 1 A_SpawnItemEx("GigaFistFX",64,0,0,momx/7,momy/7,momz/7,0,SXF_ABSOLUTEMOMENTUM)
GIGF G 2
loop
Death:
GIGF F 0
GIGF F 0 A_Explode(256, 64, 0)
GIGF F 0 A_Recoil(5)
GIGF F 1 A_FadeOut
Goto Death+2
}
}

actor WilyGolemAlabell
{
+SHOOTABLE
+DROPOFF
+NOBLOCKMONST
+INVULNERABLE
Obituary "%o was torn apart by the Wily Iron Golem."
painchance 256
mass 40
painsound "misc/scorebounce"
speed 1
Health 10000000
//+NODAMAGE
scale 2.0
Height 30
Radius 20
-SOLID
var int user_speed;

damagetype "Misc"
damagefactor "Misc", 0.0
damagefactor "Buster", 2.0
damagefactor "ReboundStriker", 3.0
damagefactor "PharaohShot1", 3.0
damagefactor "PharaohShot2", 3.0
damagefactor "PharaohShot3", 5.0

states
{
Spawn:
ALAB A 0 
ALAB A 6 A_SetUservar("user_speed", 2.0)
ALAB A 0 ACS_NamedExecuteAlways("WilyGolemBomb", 0, 0)
Goto Falling
Start:
ALAB A 0 A_ChangeFlag("INVULNERABLE", 0)
ALAB A 0 A_JumpIf(y>3500, "Death2")
ALAB A 0 A_JumpIfInventory("CutterFlag", 7, "Death")
ALAB A 0 A_JumpIfInventory("CutterFlag", 6, "Timer7")
ALAB A 0 A_JumpIfInventory("CutterFlag", 5, "Timer6")
ALAB A 0 A_JumpIfInventory("CutterFlag", 4, "Timer5")
ALAB A 0 A_JumpIfInventory("CutterFlag", 3, "Timer4")
ALAB A 0 A_JumpIfInventory("CutterFlag", 2, "Timer3")
ALAB A 0 A_JumpIfInventory("CutterFlag", 1, "Timer2")
Timer1:
ALAB AAAABBBBCCCCBBBB 1 A_ChangeVelocity(user_speed, 0, 0, CVF_RELATIVE|CVF_REPLACE)//A_Wander
Goto Start
Timer2:
ALAB DDDDEEEEFFFFEEEE 1 A_ChangeVelocity(user_speed, 0, 0, CVF_RELATIVE|CVF_REPLACE)
Goto Start
Timer3:
ALAB GGGGHHHHIIIIHHHH 1 A_ChangeVelocity(user_speed, 0, 0, CVF_RELATIVE|CVF_REPLACE)
Goto Start
Timer4:
ALAB JJJJKKKKLLLLKKKK 1 A_ChangeVelocity(user_speed, 0, 0, CVF_RELATIVE|CVF_REPLACE)
Goto Start
Timer5:
ALAB MMMMNNNNOOOONNNN 1 A_ChangeVelocity(user_speed, 0, 0, CVF_RELATIVE|CVF_REPLACE)
Goto Start
Timer6:
ALAB PPPPQQQQRRRRQQQQ 1 A_ChangeVelocity(user_speed, 0, 0, CVF_RELATIVE|CVF_REPLACE)
Goto Start
Timer7:
ALAB SSSSTTTTUUUUTTTT 1 A_ChangeVelocity(user_speed, 0, 0, CVF_RELATIVE|CVF_REPLACE)
Goto Start
Pain:
ALAB A 0 A_JumpIfInventory("CutterFlag", 7, "Death")
ALAB A 0 A_JumpIfInventory("CutterFlag", 6, "Pain7")
ALAB A 0 A_JumpIfInventory("CutterFlag", 5, "Pain6")
ALAB A 0 A_JumpIfInventory("CutterFlag", 4, "Pain5")
ALAB A 0 A_JumpIfInventory("CutterFlag", 3, "Pain4")
ALAB A 0 A_JumpIfInventory("CutterFlag", 2, "Pain3")
ALAB A 0 A_JumpIfInventory("CutterFlag", 1, "Pain2")
ALAB B 0
Goto PainAnim
Pain2:
ALAB E 0
Goto PainAnim
Pain3:
ALAB H 0
Goto PainAnim
Pain4:
ALAB K 0
Goto PainAnim
Pain5:
ALAB N 0
Goto PainAnim
Pain6:
ALAB Q 0
Goto PainAnim
Pain7:
ALAB T 0
Goto PainAnim
PainAnim:
ALAB "#" 0 A_Pain
ALAB "#" 20
Falling:
ALAB "#" 1
ALAB "#" 0 A_JumpIf(z-floorz>0, "Falling")
Goto Start
Death:
TNT1 A 0 A_ClearTarget
TNT1 A 0 A_ChangeFlag("SHOOTABLE", 0)
TNT1 AAAAAAAAA 0 A_SpawnITemEx("DrillExplode", random(-256, 256), random(-256, 256), 0)
TNT1 A 0 A_SpawnItemEx("WilyGolemShockwaveFX")
TNT1 A 0 A_PlaySoundEx("misc/mm3explosion", "Voice", 0, 1)
TNT1 A 20 A_Explode(12, 2000, 0, 0, 2000)
stop
Death2:
TNT1 A 0 A_SpawnItemEx("SharkTorpedoDeath")
stop
}
}

actor EnableDamageThrust : CustomInventory
{
states
{
Pickup:
TNT1 A 0 A_ChangeFlag("NODAMAGETHRUST", 0)
stop
}
}

actor WilyGolemTerraIntro
{
PROJECTILE
+RIPPER
damage (50)
damagetype "SparkChaser"
scale 0.01
radius 32
states
{
Spawn:
WGOL QQQQRRRR 1 A_SetScale(scalex + 0.008, scaley + 0.008) 
loop
Chaser:
TNT1 A 0 A_SetScale(2.5, 2.5)
TNT1 A 0 A_PlaySoundEx("weapon/sparkchaser", "Voice", 0, 1)
TNT1 A 0 A_SpawnItemEx("WilyGolemTerraSparkFX")
Chasing:
SCHS D 0 A_SpawnItemEx("TerraSparkChaserTrail",0,0,0,-momx/4,-momy/4,-momz/4,0,SXF_ABSOLUTEMOMENTUM|SXF_NOCHECKPOSITION)
SCHS D 1 A_SpawnItemEx("TerraSparkChaserTrail", 0, 0, 0)
loop
}
}

actor WilyGolemTerraSparkFX
{
PROJECTILE
scale 4.5
states
{
Spawn:
SCHS BCBC 3
stop
}
}

actor WilyGolemDummyCamera
{
height 3
radius 3
-SOLID
states
{
Spawn:
TNT1 A -1
stop
Nograv:
TNT1 A -1 A_ChangeFlag("NOGRAVITY", 1)
stop
}
}

actor WilyGolemTerra
{
Translation "192:192=117:117", "198:198=74:74"
scale 2.5
+NOGRAVITY
+NOINTERACTION
states
{
Spawn:
TRR2 M 0
TRR2 M 0 A_ChangeVelocity(0,0,-2, CVF_REPLACE)
FXing:
TRR2 M 7 A_SpawnItemEx("TerraBossIntroFX", -1, 0, 0) 
loop
Talking:
TRR2 NMNMNMNMNMNMNMNMN 4
goto Hover
Hover:
TRR2 M -1
stop
Tele:
TRR2 IJIJ 2
TTRA A 0 A_PlaySoundEx("misc/terrateleportout", "Voice", 0, 1)
TTRA I 0 A_SpawnItemEx("TerraBossTeleportFX", 5, 0, 32)
Vanish:
TNT1 A -1
stop
Reappear:
TTRA A 0 A_PlaySoundEx("misc/terrateleportin", "Voice", 0, 1)
TNT1 A 6 A_SpawnItemEx("TerraBossTeleportFX2", 5, 0, 32)
TRR2 CDCDCDCDCDCDCD 4
Goto Talking+2
Dash:
TRR2 B 2 //A_SpawnItemEx("TerraBossDashFX", -8, 0, 0)
loop
GrabWily:
TRR2 O 0 A_PlaySoundEx("misc/hitconfirm", "Voice", 0, 1)
TRR2 O 0 A_SpawnItemEx("WilyGolemWilyWarper")
TRR2 O 60 A_ChangeVelocity(0, 0, 3.0, CVF_REPLACE)
Grabbed:
TRR2 O -1 A_Stop
stop
QuickTele:
TNT1 A 0 A_GiveInventory("CutterFlag", 1)
TTRA A 0 A_PlaySoundEx("misc/terrateleportout", "Voice", 0, 1)
TTRA I 0 A_SpawnItemEx("TerraBossTeleportFX", 5, 0, 32)
goto Vanish
GrabTalk:
TRR2 POPOPOPOPOPOPOPOP 4
Goto Grabbed
}
}

actor WilyGolemWilyWarper
{
+NOINTERACTION
+MISSILE
scale 2.5
states
{
Spawn:
WILG ZZZZZZZZZZZZZZ 1 A_Warp(AAPTR_TARGET, 8, -30, -3, 0, WARPF_NOCHECKPOSITION)
Struggle:
WILG Y 0 Thing_ChangeTID(0, 50)
WILG YYYYYYXXXXXX 1 A_Warp(AAPTR_TARGET, 8, -30, -3, 0, WARPF_NOCHECKPOSITION)
loop
}
}

actor WilyGolemTerraDBZ
{
scale 2.5
PROJECTILE
+NOINTERACTION
translation "1:255=0:0"
height 0
radius 3
Speed 0
states
{
Spawn:
TNT1 A 0 
TNT1 A 0 ACS_NamedExecute("TerraDBZSound", 0)
TNT1 A 1 ACS_NamedExecute("CutsceneSparkChaserAim", 0)
TRR2 QRSTUVWX 2
Warping:
SCHS CCBB 1 A_JumpIfInTargetInventory("MirrorBusterAmmo", 1, "Shoot")
loop
Shoot:
TNT1 A 0 A_FaceTarget(0,0)
TNT1 A 1 A_CustomMissile("WilyGolemDBZProjectile",0,0,0,2,pitch)
stop
}
}

actor WilyGolemDBZProjectile
{
PROJECTILE
+FORCEXYBILLBOARD
translation "1:255=0:0"
Radius 4
Height 4
scale 2.5
damage (5)
speed 25
//Obituary "$OB_SPARKCHASER"
damagetype "MirrorBuster"
+BRIGHT
States
{
	Spawn:
	SCHS D 1 A_SpawnItemEx("WilyGolemTerraSparkChaserTrail", 0, 0, 0)
	loop
}
}

actor WilyGolemTerraSparkChaserTrail : TerraSparkChaserTrail
{
translation "1:255=0:0"
}

actor WilyGolemBoosterFX : BoosterFX
{
translation "1:255=0:0"
}

actor WilyGolemEasyFireDamage : PowerProtection
{
damagefactor "Gamma", 3.0
powerup.duration -999999
}