////////////////////////////////////
//   LIGHTNING LORD (CACODEMON)   //
////////////////////////////////////

Actor LightningLord 30608
{
//$Category MM8BDM-Monsters (Doom)
//$Title Lightning Lord (Cacodemon)
//$Sprite D013B8B2
Tag "Lightning Lord"
Translation "4:4=4:4", "192:192=216:216", "198:198=227:227", "196:196=215:215", "215:215=215:215", "216:216=216:216", "227:227=227:227"
MONSTER
Species "LightningLordMonster"
BloodType "MonsterRipperProtect_Helper"
//+NOBLOOD
-NOINFIGHTING
+DONTHARMSPECIES
+FLOAT
+FLOATBOB
+NOGRAVITY
Health 400
Radius 31
Height 56
Speed 1 // 8
PainChance 128
PainChance "WindStorm", 128
PainChance "GravityHold", 128
PainChance "ConcreteShot", 128
PainChance "TornadoBlow", 128
PainChance "BlackHoleBomb", 128
PainChance "TimeStopper", 256
DamageFactor "Dummy", 0.0
SeeSound "item/rushdetect"
PainSound "monster/mm2pain"
DeathSound "monster/death"
ActiveSound "misc/repairing"
Obituary "$OB_CACO"
HitObituary "$OB_CACOHIT"
Mass 9999
Scale 2.5
States
{
Spawn:
LLOR A 0 NoDelay A_Stop
LLOR A 0 A_TakeInventory("CutterFlag",1)
LLOR A 0 ACS_NamedExecuteAlways("Monster_PassivePain",0)
LLOR A 0 A_SpawnItemEx("MonsterHitbox31_56")
// Alphabet soup in order to match the idle animation of ThunderLord with the A_Look loop delay of Cacodemon (10 tics)
LLOR A 1 A_Look
LLOR AAIIIJJJK 1
LLOR K 1 A_Look
LLOR KAAAIIIJJ 1
LLOR J 1 A_Look
LLOR KKKAAAIII 1
LLOR J 1 A_Look
LLOR JJKKKAAAI 1
LLOR I 1 A_Look
LLOR IJJJKKKAA 1
LLOR A 1 A_Look
LLOR IIIJJJKKK 1
Goto Spawn+4

FirstSee:
LLOR A 0 A_TakeInventory("CutterFlag",1)
LLOR A 0 ACS_NamedExecuteAlways("Monster_PassivePain",0)
LLOR A 0 Thing_SetTranslation(0,30501) //ALLRED
LLOR A 0 A_ChangeFlag("FLOATBOB",false)
LLOR A 2 Bright
LLOR A 0 Thing_SetTranslation(0,30608) //LIGHTNINGLORDMONSTER
LLOR A 0 A_GiveInventory("CutterFlag",1)
Goto See

See:
LLOR A 0 A_JumpIfInventory("CutterFlag",1,1)
Goto FirstSee
LLOR A 1 A_Chase
LLOR AA 1 A_ChangeVelocity(2,0,momz,3)
LLOR I 1 A_Chase
LLOR II 1 A_ChangeVelocity(2,0,momz,3)
LLOR J 1 A_Chase
LLOR JJ 1 A_ChangeVelocity(2,0,momz,3)
LLOR K 1 A_Chase
LLOR KK 1 A_ChangeVelocity(2,0,momz,3)
Loop

Missile:
LLOR A 0 A_Stop
LLOR A 0 A_FaceTarget
LLOR BBBCC 1
LLOR C 0 A_FaceTarget
LLOR CDDDG 1
LLOR G 0 A_PlaySoundEx("weapon/coilfire1","Weapon")
LLOR G 0 A_CustomComboAttack("LightningLordShot",48,30,"weapon/slashclawhit","Buster")
LLOR G 0 Thing_SetTranslation(0,30504) //MISSILEFLASH
LLOR G 2 Bright
LLOR G 0 Thing_SetTranslation(0,30608) //LIGHTNINGLORDMONSTER
LLOR F 3
Goto See

Pain:
LLOR H 0 A_Stop
Pain.WindStorm:
Pain.GravityHold:
Pain.ConcreteShot:
Pain.TornadoBlow:
Pain.BlackHoleBomb:
LLOR H 0 Thing_SetTranslation(0,30608) //LIGHTNINGLORDMONSTER
LLOR H 12 A_Pain
Goto See

Pain.TimeStopper:
LLOR H 0 A_Stop
LLOR H 0 Thing_SetTranslation(0,30608) //LIGHTNINGLORDMONSTER
LLOR H 0 A_ChangeFlag("NOPAIN",true)
LLOR "##############################################################################################################################################################################################################################################################################################################################################################" 1 A_SpawnItemEx("TimeStopGFX",random(8,56),0,random(0,96),0,0,0,random(0,359),0,80)
LLOR H 0 A_ChangeFlag("NOPAIN",false)
Goto See

Death.WindStorm:
Death.GravityHold:
Death.TornadoBlow:
BlowDeath:
LLOR H 0 A_Stop
LLOR H 0 Thing_SetTranslation(0,30608) //LIGHTNINGLORDMONSTER
LLOR H 0 A_ChangeFlag("SHOOTABLE",false)
LLOR H 0 A_ChangeFlag("NODAMAGE",false)
LLOR H 0 A_ChangeFlag("SOLID",false)
LLOR H 1 ThrustThingZ(0,10,0,1)
LLOR H 0 A_JumpIf(ceilingz-z<64,"Death")
LLOR H 0 A_GiveInventory("BlowDeathTimer",1)
LLOR H 0 A_JumpIfInventory("BlowDeathTimer",35,"Death")
Goto BlowDeath+5

Death:
XDeath:
LLOR H 0 A_Stop
LLOR H 0 A_FaceTarget
LLOR H 0 Thing_SetTranslation(0,30608) //LIGHTNINGLORDMONSTER
LLOR H 2 A_NoBlocking
LLOR H 0 A_Scream
LLOR H 0 A_SpawnItemEx("ExplosionEffect1",0,0,90)
LLOR H 0 A_SpawnItemEx("MonsterFakeDeathFX",0,0,90,0,0,0,0,1)
LLOR H 0 A_SpawnItemEx("LightningLord_DeathMarker",0,0,20,0,0,4,0,1)
TNT1 H 0 A_JumpIf(CallACS("Monster_CanDropWeapon"),4)
TNT1 H 0 A_Jump(45,2)
TNT1 H 0 A_JumpIf(True,2)
TNT1 H 0 ACS_NamedExecuteWithResult("Monster_WeaponDrop",5) //Assault Beam
TNT1 A 38
TNT1 A -1 A_SetFloorClip
Stop

Raise:
TNT1 A 0 A_SpawnItemEx("MonsterReviveHelper")
TNT1 A 8 A_UnSetFloorClip
TNT1 A 12
TNT1 A 0 A_GiveInventory("DrillFlag",1)
LLOR IAIAIAIAI 3
LLOR A 0 A_ChangeFlag("FLOATBOB",true)
TNT1 A 0 A_TakeInventory("DrillFlag",1)
Goto See
}
}

Actor LightningLord_DeathMarker : Monster_DeathMarker
{
Gravity 0.4
States
{
Spawn:
TNT1 A 0 NoDelay A_Jump(128,2)
TNT1 A 0 A_SetScale(-ScaleX,ScaleY)
SpawnLoop:
LLOR M 1 A_CheckFloor("SpawnFloor")
loop

SpawnFloor:
LLOR "#" 1 A_JumpIfInTargetInventory("DrillFlag",1,"Death")
wait
}
}

Actor LightningLordShot
{
Translation "192:192=216:216"
+BRIGHT
PROJECTILE
Radius 6
Height 8
Speed 10
FastSpeed 20
Damage (20)
DamageType "Buster"
SeeSound "misc/sunstargroundflame"
DeathSound "monster/firecrash"
Scale 2.5
States
{
Spawn:
LLOR LL 4 NoDelay
loop

Death:
MMFX CDE 3
stop
}
}

Actor LightningLord_Replaced : LightningLord replaces Cacodemon {}

//////////////////////////////////////////
//   LIGHTNING OVERLORD (CACOLANTERN)   //
//////////////////////////////////////////

Actor LightningOverlord : LightningLord 30626
{
//$Category MM8BDM-Monsters (Skulltag)
//$Title Lightning Overlord (Cacolantern)
//$Sprite D014B8B2
Tag "Lightning Overlord"
Translation "4:4=4:4", "192:192=85:85", "198:198=95:95", "196:196=215:215", "215:215=215:215", "216:216=85:85", "227:227=95:95"
Health 800
Obituary "$OB_CACOLANTERN"
HitObituary "$OB_CACOLANTERN_MELEE"
States
{
FirstSee:
LLOR A 0 A_TakeInventory("CutterFlag",1)
LLOR A 0 ACS_NamedExecuteAlways("Monster_PassivePain",0)
LLOR A 0 Thing_SetTranslation(0,30501) //ALLRED
LLOR A 0 A_ChangeFlag("FLOATBOB",false)
LLOR A 2 Bright
LLOR A 0 Thing_SetTranslation(0,30626) //LIGHTNINGOVERLORDMONSTER
LLOR A 0 A_GiveInventory("CutterFlag",1)
Goto See

See:
LLOR A 0 A_JumpIfInventory("CutterFlag",1,1)
Goto FirstSee
LLOR A 1 A_Chase
LLOR AA 1 A_ChangeVelocity(2,0,momz,3)
LLOR I 1 A_Chase
LLOR II 1 A_ChangeVelocity(2,0,momz,3)
LLOR J 1 A_Chase
LLOR JJ 1 A_ChangeVelocity(2,0,momz,3)
LLOR K 1 A_Chase
LLOR KK 1 A_ChangeVelocity(2,0,momz,3)
Loop

Missile:
LLOR A 0 A_Stop
LLOR A 0 A_FaceTarget
LLOR BBBCC 1
LLOR C 0 A_FaceTarget
LLOR CDDDG 1
LLOR G 0 A_PlaySoundEx("weapon/coilfire1","Weapon")
LLOR G 0 A_CustomComboAttack("LightningOverlordShot",48,30,"weapon/slashclawhit","Buster")
LLOR G 0 Thing_SetTranslation(0,30504) //MISSILEFLASH
LLOR G 2 Bright
LLOR G 0 Thing_SetTranslation(0,30626) //LIGHTNINGOVERLORDMONSTER
LLOR F 3
Goto See

Pain:
LLOR H 0 A_Stop
Pain.WindStorm:
Pain.GravityHold:
Pain.ConcreteShot:
Pain.TornadoBlow:
Pain.BlackHoleBomb:
LLOR H 0 Thing_SetTranslation(0,30626) //LIGHTNINGOVERLORDMONSTER
LLOR H 12 A_Pain
Goto See

Pain.TimeStopper:
LLOR H 0 A_Stop
LLOR H 0 Thing_SetTranslation(0,30626) //LIGHTNINGOVERLORDMONSTER
LLOR H 0 A_ChangeFlag("NOPAIN",true)
LLOR "##############################################################################################################################################################################################################################################################################################################################################################" 1 A_SpawnItemEx("TimeStopGFX",random(8,56),0,random(0,96),0,0,0,random(0,359),0,80)
LLOR H 0 A_ChangeFlag("NOPAIN",false)
Goto See

Death.WindStorm:
Death.GravityHold:
Death.TornadoBlow:
BlowDeath:
LLOR H 0 A_Stop
LLOR H 0 Thing_SetTranslation(0,30626) //LIGHTNINGOVERLORDMONSTER
LLOR H 0 A_ChangeFlag("SHOOTABLE",false)
LLOR H 0 A_ChangeFlag("NODAMAGE",false)
LLOR H 0 A_ChangeFlag("SOLID",false)
LLOR H 1 ThrustThingZ(0,10,0,1)
LLOR H 0 A_JumpIf(ceilingz-z<64,"Death")
LLOR H 0 A_GiveInventory("BlowDeathTimer",1)
LLOR H 0 A_JumpIfInventory("BlowDeathTimer",35,"Death")
Goto BlowDeath+5

Death:
XDeath:
LLOR H 0 A_Stop
LLOR H 0 A_FaceTarget
LLOR H 0 Thing_SetTranslation(0,30626) //LIGHTNINGOVERLORDMONSTER
LLOR H 2 A_NoBlocking
LLOR H 0 A_Scream
LLOR H 0 A_SpawnItemEx("ExplosionEffect1",0,0,90)
LLOR H 0 A_SpawnItemEx("MonsterFakeDeathFX",0,0,90,0,0,0,0,1)
LLOR H 0 A_SpawnItemEx("LightningOverlord_DeathMarker",0,0,20,0,0,4,0,1)
TNT1 H 0 A_JumpIf(CallACS("Monster_CanDropWeapon"),4)
TNT1 H 0 A_Jump(85,2)
TNT1 H 0 A_JumpIf(True,2)
TNT1 H 0 ACS_NamedExecuteWithResult("Monster_WeaponDrop",5) //Assault Beam
TNT1 A 38
TNT1 A -1 A_SetFloorClip
Stop
}
}

Actor LightningOverlord_DeathMarker : LightningLord_DeathMarker {}

Actor LightningOverlordShot : LightningLordShot
{
Translation "192:192=85:85"
+BRIGHT
PROJECTILE
Speed 20
SeeSound "misc/sunstargroundflame"
DeathSound "monster/firecrash"
States
{
Spawn:
LLOR LL 4 NoDelay
loop

Death:
MMFX CDE 3
stop
}
}

//////////////////////////////////////////
//      LIGHTNING DEITY (ABADDON)       //
//////////////////////////////////////////

Actor LightningDeity : LightningLord 30627
{
//$Category MM8BDM-Monsters (Skulltag)
//$Title Lightning Deity (Abaddon)
//$Sprite D015B8B2
Tag "Lightning Deity"
Translation "4:4=4:4", "192:192=202:202", "198:198=240:240", "196:196=215:215", "215:215=215:215", "216:216=202:202", "227:227=240:240"
Health 1200
Speed 1 // 12
PainChance 40
Obituary "$OB_ABADDON"
HitObituary "$OB_ABADDON_MELEE"
States
{
FirstSee:
LLOR A 0 A_TakeInventory("CutterFlag",1)
LLOR A 0 ACS_NamedExecuteAlways("Monster_PassivePain",0)
LLOR A 0 Thing_SetTranslation(0,30501) //ALLRED
LLOR A 0 A_ChangeFlag("FLOATBOB",false)
LLOR A 2 Bright
LLOR A 0 Thing_SetTranslation(0,30627) //LIGHTNINGDEITYMONSTER
LLOR A 0 A_GiveInventory("CutterFlag",1)
Goto See

See:
LLOR A 0 A_JumpIfInventory("CutterFlag",1,1)
Goto FirstSee
LLOR A 1 A_Chase
LLOR AA 1 A_ChangeVelocity(4.125,0,momz,3)
LLOR I 1 A_Chase
LLOR II 1 A_ChangeVelocity(4.125,0,momz,3)
LLOR J 1 A_Chase
LLOR JJ 1 A_ChangeVelocity(4.125,0,momz,3)
LLOR K 1 A_Chase
LLOR KK 1 A_ChangeVelocity(4.125,0,momz,3)
Loop

Missile:
LLOR A 0 A_Stop
LLOR A 0 A_FaceTarget
LLOR BBBCC 1
LLOR C 0 A_FaceTarget
LLOR CDDDG 1
LLOR G 0 A_PlaySoundEx("weapon/coilfire1","Weapon")
LLOR G 0 A_CustomComboAttack("LightningDeityShot",48,40,"weapon/slashclawhit","Buster")
LLOR G 0 Thing_SetTranslation(0,30504) //MISSILEFLASH
LLOR G 2 Bright
LLOR G 0 Thing_SetTranslation(0,30627) //LIGHTNINGDEITYMONSTER
LLOR F 3
LLOR A 0 A_FaceTarget
LLOR BBBCC 1
LLOR C 0 A_FaceTarget
LLOR CDDDG 1
LLOR G 0 A_PlaySoundEx("weapon/coilfire1","Weapon")
LLOR G 0 A_CustomComboAttack("LightningDeityShot",48,40,"weapon/slashclawhit","Buster")
LLOR G 0 Thing_SetTranslation(0,30504) //MISSILEFLASH
LLOR G 2 Bright
LLOR G 0 Thing_SetTranslation(0,30627) //LIGHTNINGDEITYMONSTER
LLOR F 3
Goto See

Pain:
LLOR H 0 A_Stop
Pain.WindStorm:
Pain.GravityHold:
Pain.ConcreteShot:
Pain.TornadoBlow:
Pain.BlackHoleBomb:
LLOR H 0 Thing_SetTranslation(0,30627) //LIGHTNINGDEITYMONSTER
LLOR H 12 A_Pain
Goto See

Pain.TimeStopper:
LLOR H 0 A_Stop
LLOR H 0 Thing_SetTranslation(0,30627) //LIGHTNINGDEITYMONSTER
LLOR H 0 A_ChangeFlag("NOPAIN",true)
LLOR "##############################################################################################################################################################################################################################################################################################################################################################" 1 A_SpawnItemEx("TimeStopGFX",random(8,56),0,random(0,96),0,0,0,random(0,359),0,80)
LLOR H 0 A_ChangeFlag("NOPAIN",false)
Goto See

Death.WindStorm:
Death.GravityHold:
Death.TornadoBlow:
BlowDeath:
LLOR H 0 A_Stop
LLOR H 0 Thing_SetTranslation(0,30627) //LIGHTNINGDEITYMONSTER
LLOR H 0 A_ChangeFlag("SHOOTABLE",false)
LLOR H 0 A_ChangeFlag("NODAMAGE",false)
LLOR H 0 A_ChangeFlag("SOLID",false)
LLOR H 1 ThrustThingZ(0,10,0,1)
LLOR H 0 A_JumpIf(ceilingz-z<64,"Death")
LLOR H 0 A_GiveInventory("BlowDeathTimer",1)
LLOR H 0 A_JumpIfInventory("BlowDeathTimer",35,"Death")
Goto BlowDeath+5

Death:
XDeath:
LLOR H 0 A_Stop
LLOR H 0 A_FaceTarget
LLOR H 0 Thing_SetTranslation(0,30627) //LIGHTNINGDEITYMONSTER
LLOR H 2 A_NoBlocking
LLOR H 0 A_Scream
LLOR H 0 A_SpawnItemEx("ExplosionEffect1",0,0,90)
LLOR H 0 A_SpawnItemEx("MonsterFakeDeathFX",0,0,90,0,0,0,0,1)
LLOR H 0 A_SpawnItemEx("LightningDeity_DeathMarker",0,0,20,0,0,4,0,1)
TNT1 H 0 A_JumpIf(CallACS("Monster_CanDropWeapon"),4)
TNT1 H 0 A_Jump(105,2)
TNT1 H 0 A_JumpIf(True,2)
TNT1 H 0 ACS_NamedExecuteWithResult("Monster_WeaponDrop",5) //Assault Beam
TNT1 A 38
TNT1 A -1 A_SetFloorClip
Stop
}
}

Actor LightningDeity_DeathMarker : LightningLord_DeathMarker {}

Actor LightningDeityShot : LightningLordShot
{
Translation "192:192=202:202"
+BRIGHT
PROJECTILE
Speed 20
Damage (30)
SeeSound "misc/sunstargroundflame"
DeathSound "monster/firecrash"
States
{
Spawn:
LLOR LL 4 NoDelay
loop

Death:
MMFX CDE 3
stop
}
}