////////////////////////////////////////////
//         WILY CLONE (BOSSBRAIN)         //
////////////////////////////////////////////

Actor WilyClone 30623
{
//$Category MM8BDM-Monsters (Doom)
//$Title Wily Clone (BossBrain)
//$Sprite WCLNA0
//$NotAngled
//$Arg0 Music on Death
//$Arg0Type 11
//$Arg0Enum { 0 = "On"; 1 = "Off"; }
//$Arg1 CutmanMike Head
//$Arg1Type 11
//$Arg1Enum { 0 = "Off"; 1 = "On"; }
Translation "192:192=93:93", "198:198=0:0"
Tag "Wily Clone"
Species "WilyCloneMonster"
BloodType "MonsterRipperProtect_Helper"
//+NOBLOOD
+SOLID
+SHOOTABLE
+NOICEDEATH
+OLDRADIUSDMG
+FLOORCLIP
+NOBLOOD
Health 250
PainChance 255
DamageFactor "Dummy", 0.0
Mass 9999
Scale 2.5
States
{
Spawn:
WCLN A 0 NoDelay
WCLN A 0 A_TakeInventory("CutterFlag",1)
WCLN A 0 ACS_NamedExecuteAlways("Monster_PassivePain",0)
WCLN A 0 A_JumpIf(args[1] == 1, "SpawnCMM")
SpawnWily:
WCLN AB 6
Loop

SpawnCMM:
WCLN G 1
Loop

Pain:
WCLN F 0 A_PlaySound("monster/flinch",CHAN_BODY,1.0,0,0.0)
WCLN F 0 A_PlaySound("monster/flinch",CHAN_VOICE,1.0,0,0.0)
WCLN F 0 A_PlaySound("monster/flinch",CHAN_ITEM,1.0,0,0.0)
WCLN F 0 A_PlaySound("monster/flinch",CHAN_AUTO,1.0,0,0.0)
WCLN F 0 A_JumpIf(args[1] == 1, "PainCMM")
PainWily:
WCLN C 36 A_Pain
Goto SpawnWily

PainCMM:
WCLN H 36 A_Pain
Goto SpawnCMM

Death:
XDeath:
WCLN F 0 A_FaceTarget
WCLN F 0 A_PlaySound("misc/devildeath",CHAN_BODY,1.0,0,0.0)
WCLN F 0 A_PlaySound("misc/devildeath",CHAN_VOICE,1.0,0,0.0)
WCLN F 0 A_PlaySound("misc/devildeath",CHAN_ITEM,1.0,0,0.0)
WCLN F 0 A_PlaySound("misc/devildeath",CHAN_AUTO,1.0,0,0.0)
WCLN F 0 A_JumpIf(args[1] == 1, "DeathCMM")
DeathWily:
WCLN F 0 A_SpawnItemEx("FakeDeathFX",0,0,32)
WCLN DEDFDEDF 4
WCLN F 0 A_JumpIf(args[0] == 1, "TrueDeathWily")
WCLN F 0 A_PlaySound("monster/braindeath",CHAN_WEAPON,1.0,0,0.0)
// A little extension in order to let the victory music play properly
WCLN DEDFDEDFDEDFDEDFDEDFDEDFDEDFDEDF 4
Goto TrueDeathWily

DeathCMM:
WCLN I 0 A_SpawnItemEx("FakeDeathFX",0,0,36)
WCLN I 0 A_SpawnItemEx("WilyCloneCMM_DeathMarker",0,0,35,0,0,0,0,1)
WCLN I 32
WCLN I 0 A_JumpIf(args[0] == 1, "TrueDeathCMM")
WCLN I 0 A_PlaySound("monster/braindeath",CHAN_WEAPON,1.0,0,0.0)
WCLN I 128
Goto TrueDeathCMM

TrueDeathWily:
WCLN DEDFDEDFDEDFDEDFDEDFDEDFDEDFDEDF 4
WCLN D -1 A_BrainDie
Stop

TrueDeathCMM:
WCLN I 128
WCLN I -1 A_BrainDie
Stop
}
}

Actor WilyCloneCMM_DeathMarker : Monster_DeathMarker
{
Gravity 0.025
States
{
Spawn:
WCLN J 0 A_SetPitch(Pitch+0.005)
WCLN J 0 A_SetGravity(Pitch)
WCLN J 1 A_CheckFloor("SpawnFloor")
loop

SpawnFloor:
WCLN JJJJJJKKKKKKJJJJJJJJKKKKKLKLKKKKKKM 4
WCLN M 6 A_FadeOut
wait
}
}

Actor WilyClone_Replaced : WilyClone replaces BossBrain {}

//////////////////////////////////////////////
//         WILY CLONE EYE (BOSSEYE)         //
//////////////////////////////////////////////

Actor WilyCloneEye 30624
{
//$Category MM8BDM-Monsters (Doom)
//$Title Wily Clone Eye (BossEye)
//$Sprite YEYEA0
//$NotAngled
//$Arg0 Music on Sight
//$Arg0Type 11
//$Arg0Enum { 0 = "On"; 1 = "Off"; }
Tag "Wily Clone Eye"
+NOBLOCKMAP
+NOSECTOR
AttackSound "Silence"
Height 32
Scale 2.5
States
{
Spawn:
TNT1 A 10 NoDelay A_Look
Loop

See:
TNT1 A 0 A_JumpIf(args[0] == 1, "Spit")
TNT1 A 0 A_PlaySound("monster/brainactive",CHAN_VOICE,1.0,0,0.0)
Spit:
TNT1 A 181
TNT1 A 0 A_PlaySound("misc/eclipsegravitywelldeath",CHAN_WEAPON,1.0,0,0.0)
TNT1 A 0 A_PlaySound("misc/eclipsegravitywelldeath",CHAN_6,1.0,0,0.0)
TNT1 A 0 A_PlaySound("misc/eclipsegravitywelldeath",CHAN_7,1.0,0,0.0)
TNT1 A 150 A_BrainSpit
Goto Spit+1
}
}

Actor WilyCloneEye_Replaced : WilyCloneEye replaces BossEye {}

/////////////////////////////////////////////////
//         WILY CLONE SHOT (SPAWNSHOT)         //
/////////////////////////////////////////////////

Actor WilyCloneShot replaces SpawnShot
{
Translation "216:216=104:104", "220:220=110:110"
+BRIGHT
PROJECTILE
+NOCLIP
-ACTIVATEPCROSS
Radius 6
Height 32
Speed 10
Damage (5)
Scale 3

// The Spawn List, big monsters and boss monsters are best left unspawned
// The '255' does nothing, second field is their spawn chance

DropItem "SniperJoePistol" 					255 60
DropItem "SniperJoeShotgun" 				255 55
DropItem "SniperJoeChaingun" 				255 30
DropItem "SniperJoeSSG" 					255 40
DropItem "HotHeadMonster" 					255 50
DropItem "ColdHeadMonster" 					255 40
DropItem "MonoRoader"						255 40
DropItem "MonoRoaderElite"					255 20
DropItem "ShadowMonoRoader"					255 30
DropItem "ShadowMonoRoaderElite"			255 15
DropItem "BrutalMonoRoader"					255 10
DropItem "SubeeMonster"						255 10
DropItem "LightningLord"					255 30
DropItem "LightningOverlord"				255 20
DropItem "LightningDeity"					255 15
DropItem "CopyMachine"						255  2
DropItem "SkeletonJoeMonster"				255 10
DropItem "GiantSpringerSpitter"				255 20
DropItem "BigEyeArtilleryMonster"			255 30
DropItem "BigEyeBarragerMonster"			255 15
DropItem "HammerJoeMonster"					255 24
DropItem "HammerJoeEliteMonster"			255 10
DropItem "HammerJoeCaptainMonster"			255  8
DropItem "TabanMonsterActive"				255 40
DropItem "DarspiderMonster"					255 20
DropItem "WalkingBomb"						255 10
DropItem "ChronicBomb"						255 10
DropItem "WarpedJoeTan"						255 30
DropItem "WarpedJoeRed"						255 20
DropItem "WarpedJoeRust"					255 20
DropItem "WarpedJoeGray"					255 20
DropItem "WarpedJoeDGreen"					255 10
DropItem "WarpedJoeGold"					255 15
DropItem "WarpedJoeLGreen"					255 10
DropItem "WarpedJoeBlue"					255 10
DropItem "TellyHunter"						255 35

States
{
Spawn:
YBIT A 0 NoDelay A_SetScale(ScaleX,ScaleY+1.0)
YBIT CDEF 3 A_SpawnFly("WilyCloneFog")
Goto Spawn+1
}
}

/////////////////////////////////////////////////
//          WILY CLONE FOG (SPAWNFIRE)         //
/////////////////////////////////////////////////

actor WilyCloneFog replaces SpawnFire
{
Translation "192:192=104:104", "198:198=110:110"
+BRIGHT
+MISSILE
-SOLID
+NOGRAVITY
+NOINTERACTION
+NOBLOCKMAP
+NOTELEPORT
height 0
radius 0
Scale 2
states
{
Spawn:
TNT1 A 0 NoDelay A_PlaySoundEx("monster/spawnin","Body")
TNT1 A 0 A_PlaySoundEx("monster/spawnin","Voice")
TNT1 A 0 A_PlaySoundEx("monster/spawnin","Item")
TNT1 A 0 A_PlaySoundEx("monster/spawnin","Auto")
WFOG ABCDEFGHIJ 5
stop
}
}