actor KingBoss
{
//$Category MM8BDM-Bosses
Height 80
Radius 40
speed 0
Scale 2.5
Obituary "%o bent the knee to \ckking\c-."
Translation "192:192=215:215", "198:198=220:220"
Health 1000
mass 99999999
damagefactor "King", 0.0
damagefactor "Buster", 1.0
damagefactor "ThunderBolt", 4.0
damagefactor "CopyVision", 2.0
damagefactor "BubbleLead", 2.0
//painchance 256
Speed 0
Damage 0
MONSTER
//-ISMONSTER
//+NOaRADIUSDMG
-COUNTKILL
+NOBLOOD
States
{
Spawn:
KING W 1 //A_Look
loop
Seek:
KING J 1 A_Look
loop
SeekWithShield:
KING J 1 A_LookEx(0, 0, 0,  0, 360, "ShieldStand")
loop
See:
PLAY A 0// A_SpawnItemEx("TeleportFog", 28, -28, 0,0,0,0,0,SXF_NOCHECKPOSITION)
KING J 0 A_SpawnItemEx("KingShieldGiver")
ShieldStand:
KING J 0 A_GiveInventory("CutterFlag",1)
KING J 0 // A_Chase
KING J 1 A_FaceTarget
KING J 0 A_JumpIfInventory("CutterFlag",200,"JumpChance")
loop
JumpChance:
KING I 0 A_Jump(8,"Jump")
KING J 0 A_JumpIfInventory("CutterFlag",300,"XAttack")
Goto SeekWithShield 
Jump:
KING V 8
KING I 0 A_ChangeVelocity(15,0,10,CVF_RELATIVE|CVF_REPLACE)
KING K 23
KING K 0 A_Stop
KING JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ 1 A_FaceTarget
Goto SeekWithShield
XAttack:
KING I 8 A_TakeInventory("CutterFlag",999)
KING I 12 A_GiveInventory("BusterAmmo",1)
KING I 0 A_GiveInventory("KingProtection",1)//A_ChangeFlag("INVULNERABLE",1)
KING I 0// A_GiveToTarget("EvilRobotShield",health)
KING I 0 //A_GiveToTarget("BossHealth1",health)
KING LMLMLMLMLMLMLMLMLMLMLMLMLMLMLMLMLMLMLMLMLMLM 1
KINP A 0 A_PlaySoundEx("misc/kingblast","Voice")
KING L 0 A_SpawnItemEx("KingXProjectile",0,0,4,35,0,0,0,SXF_NOCHECKPOSITION)
KING LMLMLMLMLMLMLMLMLMLMLMLMLMLMLMLMLMLMLMLMLMLM 1
KINP A 0 A_PlaySoundEx("misc/kingblast","Voice")
KING L 0 A_SpawnItemEx("KingXProjectile",0,0,4,35,0,0,0,SXF_NOCHECKPOSITION)
KING LMLMLMLMLMLMLMLMLMLMLMLMLMLMLMLMLMLMLMLMLMLM 1
KINP A 0 A_PlaySoundEx("misc/kingblast","Voice")
KING L 0 A_SpawnItemEx("KingXProjectile",0,0,4,35,0,0,0,SXF_NOCHECKPOSITION)
KING LMLMLMLMLMLMLMLMLMLMLMLMLMLMLMLMLMLMLMLMLMLM 1
KINP A 0 A_PlaySoundEx("misc/kingblast","Voice")
KING L 0 A_SpawnItemEx("KingXProjectile",0,0,4,35,0,0,0,SXF_NOCHECKPOSITION)
KING LMLMLMLMLMLMLMLMLMLMLMLMLMLMLMLMLMLMLMLMLMLM 1
KINP A 0 A_PlaySoundEx("misc/kingblast","Voice")
KING L 0 A_SpawnItemEx("KingXProjectile",0,0,4,35,0,0,0,SXF_NOCHECKPOSITION)
KING LMLMLMLMLMLMLMLMLMLMLMLMLMLMLMLMLMLMLMLMLMLM 1
KING I 0 A_TakeInventory("BusterAmmo",999)
KING I 0 A_TakeInventory("KingProtection",999)//A_ChangeFlag("INVULNERABLE",0)
KING I 0 //A_TakeFromTarget("BossHealth1",999999)
KING I 0 //A_TakeFromTarget("EvilRobotShield",999999)
Goto SeekWithShield
Death:
KING J 1 A_FaceTarget
KING JJJJJJ 2 A_SpawnItemEx("KingExplode", 28 + random(-15,15), -28 + random(-15,15), 40 + random(-15,15),0,0,0,0,SXF_NOCHECKPOSITION)
KING J 0 A_SpawnItemEx("KingBoss2")
stop
}
}

actor KingBoss2
{
//$Category MM8BDM-Bosses
Height 80
Radius 40
Scale 2.5
Translation "192:192=215:215", "198:198=220:220"
Health 1000
mass 99999999
Obituary "%o bent the knee to \ckking\cl."
damagefactor "King", 0.0
damagefactor "Buster", 2.0
damagefactor "ThunderBolt", 1.0
damagefactor "CopyVision", 1.0
damagefactor "BubbleLead", 1.0
//painchance 256
Speed 0
Damage 0
MONSTER
//-ISMONSTER
//+NOaRADIUSDMG
+LOOKALLAROUND
+INVULNERABLE
-CANPASS
-COUNTKILL
+NOBLOOD
-SOLID
meleerange 100
speed 0
States
{
Spawn:
KING R 1 A_Jump(256,"Seek")
KING R -1 ACS_Execute(45,0)
loop
Regen:
KING S -1
loop
Spawn2:
PLAY A 0// A_SpawnItemEx("TeleportFog", 28, 0, 0,0,0,0,0,SXF_NOCHECKPOSITION)
KING A 35
KING I 0 A_ChangeFlag("INVULNERABLE",0)
Seek:
KING A 1 A_Look
loop
See:
KING A 0 A_TakeInventory("CutterFlag",999)
KING A 0 A_Chase
KING A 4 A_FaceTarget
KING A 0 A_Jump(210,"Jump","Dash")
Goto Laser
Jump:
KING I 0 A_ChangeVelocity(25,0,random(5,15),CVF_RELATIVE|CVF_REPLACE)
KING I 0 A_Jump(128,"Jump3")
Jump2:
KING N 5 A_ChangeVelocity(0,10,0,CVF_RELATIVE)
Goto Falling
Jump3:
KING N 5 A_ChangeVelocity(0,-10,0,CVF_RELATIVE)
Goto Falling
Falling:
KING N 1 A_JumpIf(z==floorz, "Land")
loop
Land:
KING A 1 A_Stop
Goto Seek
Melee:
KING B 5 A_FaceTarget
KIFU F 5 A_FaceTarget
KING G 0 A_GiveToTarget("KingAxeSwing",1)
KING G 0 A_PlaySoundEx("misc/kingchop","Voice")
KING G 0 ACS_Execute(5,0,20)
KIFU G 4 A_FaceTarget
KING A 8
Goto Seek
Laser:
KING A 3 A_FaceTarget
KING G 0 A_PlaySoundEx("weapon/gemini","Voice")
KING Q 0 A_SpawnItemEx("KingLaser",3,0,45,15)
KING Q 12 A_FaceTarget
KING A 8 A_FaceTarget
KING A 0 A_Jump(128,"Jump","Dash")
Goto Jump
Dash:
KING G 0 A_GiveInventory("FlameSwordAmmo",1)
KING G 0 A_GiveInventory("CutterFlag",1)
KING G 0 A_SpawnItemEx("KingAxeDash",40)
KING G 0 A_SpawnItemEx("KingAxeDashFX",0)
KING G 0 A_PlaySoundEx("misc/kingswing","Voice")
KING OOOPPP 1 A_ChangeVelocity(15,0,0,CVF_RELATIVE|CVF_REPLACE)
KING G 0 A_JumpIfInventory("CutterFlag",10,"Chance")
KING G 0 A_JumpIfInventory("CutterFlag",20,"Chance")
KING G 0 A_JumpIfInventory("FlameSwordAmmo",5,"Reset")
loop
Reset:
KING A 0 A_FaceTarget
KING G 0 A_TakeInventory("FlameSwordAmmo",999)
Goto Dash
Chance:
KING A 0 A_Stop
KING G 0 A_Jump(128,"Dash")
KING A 20 A_FaceTarget
Goto Seek
Death:
KING H 0 A_GiveToTarget("NoDamage",1)
KING H 0 SetPlayerProperty(1,1,0)
KING H 12 A_FaceTarget
KING HHHH 12 A_SpawnItemEx("KingExplode", random(-48,48), random(-48,48), random(0,48))
KING HHHHHHHH 5 A_SpawnItemEx("KingExplode", random(-48,48), random(-48,48), random(0,48))
KING HHHHHHHHHHHHHHHH 2 A_SpawnItemEx("KingExplode", random(-48,48), random(-48,48), random(0,48))
KINP A 0 A_PlaySoundEx("misc/devildeath", "Auto", 0, 1)
KINP A 0 ACS_Execute(46,0)
KING H 800 A_SpawnItemEx("FakeDeathFX", 0, 0, 32)
stop
}
}

actor KingExplode
{
-SOLID
+NOGRAVITY
States
{
Spawn:
TNT1 A 0
KINP A 0 A_PlaySoundEx("weapon/cfire","Auto",0,1)
TNT1 A 0 A_SpawnItemEx("DrillExplode")
stop
}
}

actor KingLaser : GeminiLaser
{
Translation "192:207=72:72"
PROJECTILE
+HEXENBOUNCE
+CANBOUNCEWATER
WALLBOUNCEFACTOR 0.91
+RIPPER
BOUNCEFACTOR 0.91
Obituary "%o was slain by \ciking\cl's laser."
speed 15
Radius 32
Height 32
damagetype "Misc"
scale 2.5
damage (1)
+FORCEXYBILLBOARD
reactiontime 100
States
{
Spawn:
GEMI A 0
GEMI A 0 A_SpawnItemEx("KingLaserTrail",0,0,0,0,0,0,0)
GEMI A 1 A_CountDown
loop
}
}

actor KingLaserTrail
{
Translation "192:207=72:72"
+NOINTERACTION
+NOGRAVITY
+FORCEXYBILLBOARD
-SOLID
scale 2.5
height 0
radius 0
States
{
Spawn:
GEMI A 8
stop
}
}

actor KingAxeDash
{
PROJECTILE
height 64
radius 64
-NOBLOCKMAP
+SHOOTABLE
health 999
painchance 999
Damagetype "Misc"
Obituary "%o was slain by \ciking\cl's mighty axe."
States
{
Spawn:
TNT1 A 1
Goto Death
Pain.Buster:
Pain.CopyVision:
Pain.ThunderBolt:
Pain.BubbleLead:
KING G 0 A_PlaySoundEx("item/protoreflect","Item")
Death:
TNT1 A 1 A_Explode(8,128,0)
stop
}
}


actor KingAxeSwing : CustomInventory
{
Obituary "%o was slain by \ciking\cl's mighty axe."
States
{
Spawn:
TNT1 A 0
stop
Pickup:
TNT1 A 0 DamageThing(25)
stop
}
}

actor KingAxeDashFX
{
Translation "192:192=215:215", "198:198=220:220"
+NOGRAVITY
+NOINTERACTION
renderstyle translucent
alpha 1.0
+BRIGHT
scale 2.5
States
{
Spawn:
KING O 1 A_FadeOut(0.08)
loop
}
}

actor KingProtection : PowerProtection
{
DamageFactor "Buster", 0.7
DamageFactor "CopyVision", 0.2
DamageFactor "BubbleLead", 0.2
DamageFactor "ThunderBolt", 0.2
}

actor KingShieldGiver
{
+MISSILE
+NOGRAVITY
+NOINTERACTION
renderstyle none
-SOLID
States
{
Spawn:
PLAY A 0 A_JumpIfInTargetInventory("IsDead",1,"Death")
PLAY A 0 A_JumpIfInTargetInventory("BusterAmmo",1,"Spawn2")
PLAY AAAAAAAAAA 1 A_GiveToTarget("KingShieldInventory",1)
PLAY A 0 A_GiveToTarget("KingBarrierInventory",1)
loop
Spawn2:
PLAY AAAAAAAAAA 1 A_GiveToTarget("KingShieldInventory2",1)
PLAY A 0 A_GiveToTarget("KingBarrierInventory",1)
Goto Spawn
Death:
PLAY A 0
stop
}
}

actor KingShieldInventory : CustomInventory
{
inventory.amount 1
inventory.maxamount 1
+AUTOACTIVATE
States
{
Spawn:
PLAY A 0
stop
Pickup:
PLAY A 0 A_SpawnItemEx("KingShield", 28, -28, 0,0,0,0,0,SXF_NOCHECKPOSITION)
stop
}
}

actor KingShieldInventory2 : CustomInventory
{
inventory.amount 1
inventory.maxamount 1
+AUTOACTIVATE
States
{
Spawn:
PLAY A 0
stop
Pickup:
PLAY A 0 A_FaceTarget
PLAY A 0 A_SpawnItemEx("KingShield2", 48, 0, 0,0,0,0,90)
stop
}
}


actor KingBarrierInventory : CustomInventory
{
inventory.amount 1
inventory.maxamount 1
+AUTOACTIVATE
States
{
Spawn:
PLAY A 0
stop
Pickup:
PLAY A 0 A_SpawnItemEx("KingBarrier", 0, 0, 56)
stop
}
}

actor KingShield
{
-SOLID
+SHOOTABLE
health 1
scale 2.5
height 80
radius 48
//+ISMONSTER
+DONTRIP
+NORADIUSDMG
damagefactor "CopyVision", 0.0
damagefactor "King", 0.0
States
{
Spawn:
TNT1 AA 1 A_SpawnItemEx("KingShieldFX",0,0,0)//A_SpawnItemEx("KingBarrier",0,0,56)
stop
Death:
KINP A 0 A_SpawnItemEx("KingShieldLaserStart",2,0,35,0,0,0,random(-1,1))
KINP AA 1 
stop
}
}

actor KingShield2 : KingShield
{
-SHOOTABLE
+NOINTERACTION
-SOLID
States
{
Death:
KINP A 0 //A_SpawnItemEx("KingShieldLaserFX",2,0,35,0,0,0,random(-1,1))
KINP AA 1 
stop
}
}

actor KingShieldFX
{
+CLIENTSIDEONLY
scale 2.5
height 80
radius 48
states
{
Spawn:
KINP AA 1
stop
}
}

actor KingBarrier
{
Obituary "%o stood in awe at \ciking\cl's giant shield."
PROJECTILE
DamageType "King"
Height 10
Radius 10
renderstyle none
//Scale 2.5
States
{
Spawn:
KINP EE 1 A_Explode(30,100,0)
stop
}
}


actor KingShieldLaserStart
{
PROJECTILE
+NOINTERACTION
height 0
radius 0
scale 2.5
States
{
Spawn:
KINP BB 0 A_Look
stop
See:
KINP A 0 A_PlaySoundEx("weapon/heat1","Voice")
KINP BCD 4
KINP A 0 A_PlaySoundEx("weapon/centaurflash","Voice")
KINP B 0 A_ClearTarget
KINP B 0 A_SpawnItemEx("KingShieldLaser",80,0,0,55,0,0,-2)//CustomRailgun(25,0, "purple", "white", 1, 1)
KINP B 0 A_SpawnItemEx("KingShieldLaser",80,0,0,55,0,0,-12)
KINP B 0 A_SpawnItemEx("KingShieldLaser",80,0,0,55,0,0,-22)
KINP B 0 A_SpawnItemEx("KingShieldLaser",80,0,0,55,0,0,-32)
KINP B 0 A_SpawnItemEx("KingShieldLaser",80,0,0,55,0,0,12)
KINP B 0 A_SpawnItemEx("KingShieldLaser",80,0,0,55,0,0,22)
KINP B 0 A_SpawnItemEx("KingShieldLaser",80,0,0,55,0,0,32)
stop
}
}

actor KingShieldLaser
{
Obituary "%o stood in awe at \ciking\cl's giant shield."
PROJECTILE
+RIPPER
DamageType "King"
Height 10
Radius 10
//Scale 2.5
Speed 25
damage (2)
States
{
Spawn:
KINP E 1 A_SpawnItemEx("KingShieldLaserTrail")
loop
}
}

actor KingShieldLaserTrail
{
+NOGRAVITY
+NOINTERACTION
renderstyle translucent
alpha 1.0
+BRIGHT
//scale 2.5
States
{
Spawn:
KINP E 1 A_FadeOut(0.1)
loop
}
}

actor KingXProjectile
{
Obituary "%o was vanquished by \ciking\cl's energy blasts."
PROJECTILE
DamageType "King"
Height 56
Radius 42
Scale 2.5
Speed 25
damage (25)
States
{
Spawn:
KINP F 2
Xellent:
KINP GH 1 A_SpawnItemEx("KingXTrail")
loop
}
}

actor KingXTrail
{
+NOGRAVITY
+NOINTERACTION
renderstyle add
alpha 1.0
+BRIGHT
scale 2.5
States
{
Spawn:
KINP G 1 A_FadeOut(0.1)
loop
}
}

actor KingStatue 11693
{
//$Category MM8BDM-Props
Height 58
Radius 48
+SOLID
scale 2.5
States
{
Spawn:
SKNI B -1
stop
}
}

actor KingStatueContainer 11694
{
//$Category MM8BDM-Props
Height 128
Radius 48
+SOLID
scale 2.5
States
{
Spawn:
SKNI C -1
stop
}
}

actor DefeatedKing
{
//$Category MM8BDM-Bosses
+MISSILE
+NOGRAVITY
speed 0
damage (2)
radius 32
Scale 2.5
Translation "192:192=215:215", "198:198=220:220"
States
{
Spawn:
KING R -1
stop
Call:
KING S -1
stop
Face:
KING T -1
stop
}
}

actor HeldKing
{
Scale 2.5
+NOGRAVITY
Translation "192:192=215:215", "198:198=220:220"
States
{
Spawn:
KING U 2
stop
}
}

actor ThrownKing
{
Scale 2.5
gravity 0.5
Translation "192:192=215:215", "198:198=220:220"
States
{
Spawn:
KING U -1
stop
}
}

actor WoundedMegaman 11695
{
//$Category MM8BDM-Props
scale 2.5
-SOLID
States
{
Spawn:
PLAY I 20
PLAY J 16
loop
}
}


actor WoundedBass 11696
{
//$Category MM8BDM-Props
scale 2.5
translation "192:192=217:217", "198:198=95:95"
-SOLID
States
{
Spawn:
BASS J -1
loop
}
}

actor WalkingKing
{
//$Category MM8BDM-Bosses
+MISSILE
+NOGRAVITY
speed 0
damage (2)
radius 32
Scale 2.5
Translation "192:192=215:215", "198:198=220:220"
States
{
Spawn:
KING B 4 A_ChangeVelocity(3,0,momz,CVF_RELATIVE|CVF_REPLACE)
KING CDEBCDE 4
loop
}
}