////////////////
//  DARK MAN  //						Well... "Men" now.
////////////////

actor Darkman4Boss
{
//$Category MM8BDM-Bosses
stencilcolor "white"
Height 62
Radius 34
Scale 2.5
Obituary "%o was blown to bits by \cgDarkMan4\c-."
Translation "192:192=87:87", "198:198=227:227"
//+INVULNERABLE
Health 1000
mass 99999999
damagefactor "Misc", 0.0
damagefactor "Buster", 0.7
damagefactor "ProtoBuster", 0.7
damagefactor "ProtoBuster2", 0.9
damagefactor "ProtoBuster3", 1.4
damagefactor "DarkMan", 0.0
damagefactor "SparkShock", 0.0
Speed 11
Damage 0
MONSTER
+THRUSPECIES
species "Darkman"
floatspeed 0
gravity 1.0
meleerange 80
-COUNTKILL
-SOLID
-CANPASS
+NOBLOOD
+LOOKALLAROUND
+SLIDESONWALLS
//+NOTARGETSWITCH
+NOPAIN
-DROPOFF
maxstepheight 40
Meleerange 9999
painchance 256
states
{
	Spawn:
	TNT1 A 0
	TNT1 A 0 A_SpawnItemEx("ProtoUpgrade", 0, 0, 40, 9, -9, 10, 0)
	TNT1 A 0 A_PlaySoundEx("weapon/coilexplode", "Voice", 0, 1)
	DAR4 AAAA 1 A_SpawnItemEx("DrillExplode", random(0,23), 0, random(0,64), 0,0,0,random(0,360))
	SpawnWait:
	DAR4 A -1
	Goto Spawn2
	Intro:
	DAR4 AF 6
	DAR4 G 50 ACS_Execute(8,0)
	DAR4 F 6 A_GiveInventory("LeafShieldAmmo", 1)
	DAR4 A -1
	Spawn2:
	DAR4 A 1 A_Look
	loop
	Seek:
	DAR4 A 1 A_LookEx(0,0,0,0,360, "See")
	loop
	Round2Look:
	DAR4 A 1 A_LookEx(0,0,0,0,360,"Round2")
	loop
	Round2:
	DAR4 A 5 //A_GiveInventory("DrillBombAmmo", 1)
	See:
	DAR4 A 0 A_TakeInventory("CutterFlag", 999)
	DAR4 A 0 ACS_Execute(8,0)
	DAR4 AAA 2 A_FaceTarget
	DAR4 G 0 A_SpawnItemEx("DarkMelee")
	DAR4 A 0 A_JumpIfInventory("DrillBombAmmo", 1, "SlowThrow")
	DAR4 A 0 A_Jump(150, "Missile")
	Goto ShieldThrow
	Missile:
	DAR4 A 0 A_Jump(100, "DarkBlaster")
	DAR4 A 0 A_JumpIfInventory("CrashBombAmmo", 1, "DarkBlaster")
	RegularBlaster:
	DAR4 F 4 A_FaceTarget
	DAR4 G 0 A_SpawnItemEx("DarkMelee")
	DAR4 G 0 A_FaceTarget
	DAR4 G 0 A_PlaySoundEx("weapon/coilexplode", "Voice", 0, 1)
	DAR4 G 4 A_CustomMissile("DarkProjectile", 40, -32, random(-12,12))
	DAR4 A 10
	DAR4 F 4 A_FaceTarget
	DAR4 G 0 A_SpawnItemEx("DarkMelee")
	DAR4 G 0 A_FaceTarget
	DAR4 G 0 A_PlaySoundEx("weapon/coilexplode", "Voice", 0, 1)
	DAR4 G 4 A_CustomMissile("DarkProjectile", 40, -32, random(-12,12))
	DAR4 A 10
	DAR4 F 4 A_FaceTarget
	DAR4 G 0 A_SpawnItemEx("DarkMelee")
	DAR4 G 0 A_FaceTarget
	DAR4 G 0 A_PlaySoundEx("weapon/coilexplode", "Voice", 0, 1)
	DAR4 G 4 A_CustomMissile("DarkProjectile", 40, -32, 0)
	DAR4 A 10
	DAR4 F 4 A_FaceTarget
	DAR4 G 0 A_SpawnItemEx("DarkMelee")
	DAR4 G 0 A_FaceTarget
	DAR4 G 0 A_PlaySoundEx("weapon/coilexplode", "Voice", 0, 1)
	DAR4 G 4 A_CustomMissile("DarkProjectile", 40, -32, random(-12,12))
	DAR4 A 25
	Goto Seek
	SlowThrow:
	DAR4 A 60
	ShieldThrow:
	DAR4 A 5 A_FaceTarget
	DAR4 A 0 A_PlaySoundEx("misc/darkthrow", "SoundSlot2", 0, 1)
	DAR4 A 5 A_FaceTarget
	DAR4 A 5 A_FaceTarget
	DAR4 A 0 A_SpawnItemEx("DarkShieldFire", 40, 0, 0, 20, 0, 0 , 0)
	DAR4 A 0 A_SpawnItemEx("DarkShieldFire", 40, 0, 0, 20, 0, 0 , 180) 
	DAR4 A 5 ACS_Terminate(8,0)
	DAR4 F 5
	DAR4 A 0 A_ChangeFlag("NOPAIN", 0)
	DAR4 A 0 A_Jump(256, "LeapLeft", "LeapRight")
	LeapLeft:
	DAR4 Y 0 A_FaceTarget
	DAR4 Y 5 A_ChangeVelocity(20, 10, 15, CVF_RELATIVE)
	Goto Falling
	LeapRight:
	DAR4 Y 0 A_FaceTarget
	DAR4 Y 5 A_ChangeVelocity(20, -10, 15, CVF_RELATIVE)
	Goto Falling
	Falling:
	DAR4 Y 1 A_JumpIf(floorz==z, "Land")
	loop
	Land:
	DAR4 A 0 A_ChangeFlag("NOPAIN", 1)
	DAR4 A 0 A_PlaySoundEx("misc/fatland", "Voice", 0, 1)
	DAR4 A 0 A_TakeInventory("LeafShieldAmmo", 999)
	DAR4 G 0 A_SpawnItemEx("DarkMelee")
	DAR4 A 5 A_Stop
	LandWait:
	DAR4 A 1 A_FaceTarget
	DAR4 A 0 A_JumpIfInventory("CutterFlag", 2, "Seek")
	loop
	DarkBlaster:
	DAR4 A 0 A_JumpIfInventory("LeafShieldAmmo", 1, "RegularBlaster")
	DarkBlasterStart:
	DAR4 I 0 A_PlaySoundEx("weapon/adaptercharge","Item",0,1)
	DAR4 A 0 A_FaceTarget
	DAR4 G 0 A_SpawnItemEx("DarkMelee")
	DarkBlasterCharging:
	DAR4 A 0 A_FaceTarget
	DAR4 F 0 Thing_SetTranslation(0, 2005)
	DAR4 FF 1 A_GiveInventory("WeaponCharge", 1)
	DAR4 F 0 Thing_SetTranslation(0, 0)
	DAR4 FF 1 A_GiveInventory("WeaponCharge", 1)//A_SpawnItemEx("EvilRoboFistCharger",random(256,-256),random(256,-256),random(256,-256))
	DAR4 F 0 A_JumpIfInventory("DrillBombAmmo", 1, "DarkBlasterCharging")
	DAR4 F 0 A_JumpIfInventory("WeaponCharge", 45, "DarkBlasterFire")
	loop
	DarkBlasterFire:
	DAR4 F 0 Thing_SetTranslation(0, 0)
	BUST B 0 A_PlaySoundEx("weapon/coilfire1", "Body", 1, 1)
	BUST B 0 A_GiveInventory("WeaponCharge", 17)
	DarkBlasterFiring:
	DAR4 A 0 A_FaceTarget
	DAR4 G 0 A_SpawnItemEx("DarkMelee")
	DAR4 G 1 A_CustomMissile("DarkProjectile3", 40, -32, random(-13,13),2,0)
	DAR4 F 0 A_TakeInventory("WeaponCharge", 1)
	DAR4 F 0 A_JumpIfInventory("WeaponCharge", 1, "DarkBlasterFiring")
	BUST B 0 A_StopSoundEx("Body")
	DAR4 A 55 A_FaceTarget
	Goto Seek
	DamagedFalling:
	DAR4 A 0 A_ChangeFlag("NOPAIN", 1)
	BUST B 0 A_StopSoundEx("Body")
	DAR4 F 0 A_TakeInventory("WeaponCharge", 9999)
	DAR4 F 0 Thing_SetTranslation(0, 0)
	DAR4 H 1 A_ChangeFlag("INVULNERABLE", 1)
	DAR4 H 1 A_JumpIf(floorz==z, "DamagedLand")
	loop
	DamagedLand:
	DAR4 A 0 A_ChangeFlag("NOPAIN", 1)
	DAR4 A 0 A_PlaySoundEx("misc/fatland", "Voice", 0, 1)
	DAR4 A 0 A_TakeInventory("LeafShieldAmmo", 999)
	DAR4 I -5 A_Stop
	stop
	Order:
	DAR4 F 0 A_GiveInventory("DrillBombAmmo", 1)
	DAR4 J -1 A_ChangeFlag("INVULNERABLE", 0)
	stop
	Death:
	DAR4 F 0 Thing_SetTranslation(0, 0)
	BUST B 0 A_StopSoundEx("Body")
	ENKR H 0 ACS_Execute(5,0,37)
	ENKR H 0 A_Stop
	ENKR H 0 A_SpawnItemEx("BigHealth", 0, 0, 50, 0, 0, 18)
	ENKR H 0 A_FaceTarget
	ENKR H 0 A_SpawnItemEx("FakeDeathFX", 0, 0, 50)
	ENKR A 0 A_PlaySoundEx("misc/devildeath", "SoundSlot5", 0, 1)
	stop
	Spawn3:
	DAR4 A -1
	stop
	loop
	FakeBlaster:
	BUST B 0 A_StopSoundEx("Body")
	DAR4 F 0 A_TakeInventory("WeaponCharge", 9999)
	DAR4 F 0 Thing_SetTranslation(0, 0)
	BUST B 0 A_PlaySoundEx("weapon/coilfire1", "Voice", 0, 1)
	DAR4 GGGGGGGGGGGGGGGGGGGG 1 A_CustomMissile("DarkProjectile", 40, -32, random(-5,5),2,0)
	DAR4 A -1
	stop
	Pain.ProtoBuster3:
	DAR4 A 0 ACS_Terminate(8,0)
	BUST B 0 A_StopSoundEx("Body")
	DAR4 F 0 Thing_SetTranslation(0, 0)
	DAR4 F 0 A_TakeInventory("WeaponCharge", 9999)
	DAR4 H 0 A_FaceTarget
	DAR4 H 0 A_ChangeFlag("NORADIUSDMG", 1)
	DAR4 H 0 A_ChangeFlag("NOPAIN", 1)
	DAR4 A 0 A_TakeInventory("CutterFlag", 9999)
	DAR4 H 70 A_ChangeVelocity(-10, random(-10,10), 4, CVF_REPLACE|CVF_RELATIVE) 
	DAR4 H 0 A_ChangeFlag("NORADIUSDMG", 0)
	Goto See
}
}

actor Darkman3Boss
{
//$Category MM8BDM-Bosses
stencilcolor "white"
Height 52
Radius 34
Scale 2.5
Obituary "%o was sniped by \ctDarkMan3\c-."
Translation "192:192=65:65", "198:198=60:60", "202:202=216:216"
//+INVULNERABLE
Health 1000
mass 99999999
damagefactor "Misc", 0.0
damagefactor "Buster", 0.5
damagefactor "ProtoBuster", 2.2
damagefactor "ProtoBuster2", 2.4
damagefactor "ProtoBuster3", 2.9
damagefactor "DarkMan", 0.0
damagefactor "SparkShock", 0.0
Speed 11
Damage 0
MONSTER
+THRUSPECIES
floatspeed 0
gravity 1.0
meleerange 80
-COUNTKILL
-SOLID
-CANPASS
+NOBLOOD
+LOOKALLAROUND
+SLIDESONWALLS
//+NOPAIN
+QUICKTORETALIATE
-DROPOFF
species "Darkman"
maxstepheight 40
Meleerange 9999
painchance 256
states
{
	Spawn:
	DAR3 A 1 A_LookEx(0,0,0,0,360,"SpawnSee")
	loop
	SpawnSee:
	DAR3 A 1 A_FaceTarget
	loop
	//Goto See
	Assault:
	DAR3 F 0 A_PlaySoundEx("misc/fakeshot", 0, 0, 1)
	DAR3 F 0 A_CustomMissile("DarkSniperShot", 50, 30, 0)
	DAR3 FG 4 
	loop
	Start:
	DAR1 A 0 A_ClearTarget
	DAR3 A 1 A_LookEx(0,0,0,0,360,"See")
	loop
	See:
	DAR3 A 0 A_Stop
	DAR3 AAAAAA 4 A_FaceTarget
	Leap:
	DAR3 A 0 A_FaceTarget
	DAR3 A 0 A_PlaySoundEx("misc/darkleap", 0, 0, 1)
	DAR3 I 15 A_ChangeVelocity(15, random(-10,10), 15, CVF_REPLACE|CVF_RELATIVE) 
	DAR3 A 0 A_ChangeFlag("NOGRAVITY",1)
	DAR3 I 5 A_Stop
	Missile:
	DAR3 A 0 A_ChangeFlag("QUICKTORETALIATE", 0)
	DAR3 A 0 A_FaceTarget
	DAR3 F 0 A_PlaySoundEx("misc/fakeshot", 0, 0, 1)
	DAR3 F 0 A_CustomMissile("DarkSniperShot", 50, 30, 0)
	DAR3 IJ 4
	DAR3 A 0 A_GiveInventory("CutterFlag",1)
	DAR3 F 0 A_JumpIfInventory("CutterFlag", 8, "Falling")
	loop
	Falling:
	DAR3 A 0 A_ChangeFlag("NOGRAVITY",0)
	DAR3 I 1 A_JumpIf(floorz==z, "StunStart")
	loop
	Stun:
	DAR3 A 2 A_LookEx(0,0,0,0,360,"StunStart")
	Goto StunStart
	StunStart:
	DAR3 A 0 A_ChangeFlag("QUICKTORETALIATE", 0)
	DAR3 A 0 A_TakeInventory("CutterFlag", 9999)
	DAR3 A 0 A_Stop
	DAR3 A 4 A_FaceTarget
	DAR3 GGGGGGGGGGGG 4 A_FaceTarget
	DAR3 A 0 A_PlaySoundEx("misc/sparkzap", "Voice", 0, 1)
	DAR3 A 0 A_CustomMissile("DarkStunner", 40, 0, 0)
	DAR3 A 0 A_CustomMissile("DarkStunner", 40, 0, -15) 
	DAR3 F 6 A_CustomMissile("DarkStunner", 40, 0, 15) 
	DAR3 A 4 A_FaceTarget
	DAR3 A 0 A_ChangeFlag("QUICKTORETALIATE", 1)
	Goto Start
	Pain.ProtoMan:
	DAR3 A 0 A_ChangeFlag("NOGRAVITY",0)
	DAR3 H 0 A_FaceTarget
	DAR3 A 0 A_TakeInventory("CutterFlag", 9999)
	DAR3 H 35 A_ChangeVelocity(-10, random(-10,10), 10, CVF_REPLACE|CVF_RELATIVE) 
	Goto Start
	Death:
	ENKR H 0 A_Stop
	ENKR H 0 A_FaceTarget
	ENKR H 0 A_SpawnItemEx("BigHealth", 0, 0, 50, 0, 0, 18)
	ENKR H 0 A_SpawnItemEx("FakeDeathFX", 0, 0, 50)
	ENKR A 0 A_PlaySoundEx("misc/devildeath", "SoundSlot5", 0, 1)
	stop
}
}

actor Darkman2Boss : Darkman3Boss
{
Obituary "%o was electrocuted by \cuDarkMan2\c-."
Translation "192:192=4:4", "198:198=93:93", "202:202=216:216"
speed 6
damagefactor "ProtoBuster3", 3.2
+QUICKTORETALIATE
states
{
	Spawn:
	DAR2 A 1 A_LookEx(0,0,0,0,360,"SpawnSee")
	loop
	SpawnSee:
	DAR2 A 1 A_FaceTarget
	loop
	Assault:
	DAR2 F 0 A_PlaySoundEx("misc/sparkzap", 0, 0, 1)
	DAR2 F 0 A_CustomMissile("DarkStunnerFake", 40, 0, 0)
	DAR2 FGAAA 3 
	loop
	Start:
	DAR2 A 8 ACS_ExecuteAlways(8,0)
	Goto See
	Pain.ProtoMan:
	DAR4 H 0 A_ChangeFlag("NORADIUSDMG", 1)
	DAR2 H 0 A_FaceTarget
	DAR2 A 0 A_TakeInventory("CutterFlag", 9999)
	DAR2 H 35 A_ChangeVelocity(-10, random(-10,10), 10, CVF_REPLACE|CVF_RELATIVE) 
	DAR4 H 0 A_ChangeFlag("NORADIUSDMG", 0)
	Goto See
	See:
	DAR2 BBBBCCCCDDDDEEEE 1 A_Wander
	DAR2 BBBBCCCCDDDDEEEE 1 A_Wander
	Goto Chase
	Chase:
	DAR2 BBBBCCCCDDDDEEEE 1 A_Chase("","")
	loop
}
}

actor Darkman1Boss : Darkman3Boss
{
Obituary "%o was ran down by \cqDarkMan1\c-."
Translation "192:192=4:4", "198:198=110:110", "199:199=219:219", "202:202=216:216"
speed 4
meleerange 50
DamageType "DarkMan"
damagefactor "ProtoBuster3", 2.4
+QUICKTORETALIATE
states
{
	Spawn:
	DAR1 A 1 A_LookEx(0,0,0,0,360,"SpawnSee")
	loop
	SpawnSee:
	DAR1 A 1 A_FaceTarget
	loop//Goto Start
	Assault:
	DAR1 F 0 A_PlaySoundEx("weapon/napalm", 0, 0, 1)
	DAR1 F 0 A_CustomMissile("DarkProjectile", 40, 8, 0)
	DAR1 FGAA 3 
	loop
	Start:
	DAR1 A 0 A_ClearTarget
	DAR1 A 1 A_LookEx(0,0,0,0,360,"See")
	loop
	See:
	DAR1 B 0 A_PlaySoundEx("misc/sharkjoeraise", "SoundSlot5", 1, 0)
	DAR1 BBBBBCCCCCDDDDDEEEEE 1 A_Chase("Melee","")
	DAR1 BBBBBCCCCCDDDDDEEEEE 1 A_Chase("Melee","")
	DAR1 BBBBBCCCCCDDDDDEEEEE 1 A_Chase("Melee","")
	DAR1 BBBBBCCCCCDDDDDEEEEE 1 A_Chase("Melee","")
	Goto Charge
	Charge:
	DAR3 A 0 A_ChangeFlag("QUICKTORETALIATE", 0)
	DAR3 A 0 A_PlaySoundEx("misc/gutsgboost", 0, 0, 1)
	DAR1 BCBCBC 4 A_FaceTarget
	Charging:
	DAR1 B 0 A_PlaySoundEx("misc/sharkjoeraise", "SoundSlot5", 0, 0)
	DAR1 B 0 A_SpawnItemEx("DarkMelee")
	DAR1 B 2 A_Recoil(-4)
	DAR1 B 0// A_PlaySoundEx("misc/sharkjoeraise", "SoundSlot5", 0, 0)
	DAR1 B 0 A_SpawnItemEx("DarkMelee")
	DAR1 C 2 A_Recoil(-4)
	DAR1 A 0 A_GiveInventory("CutterFlag",1)
	DAR1 F 0 A_JumpIfInventory("CutterFlag", 15, "ChargeEnd")
	loop
	ChargeEnd:
	DAR1 B 0 A_StopSoundEx("SoundSlot5")
	DAR1 A 0 A_TakeInventory("CutterFlag", 9999)
	DAR1 A 8 A_Stop
	Melee:
	DAR3 A 0 A_ChangeFlag("QUICKTORETALIATE", 1)
	DAR1 B 0 A_StopSoundEx("SoundSlot5")
	DAR1 A 0 A_FaceTarget
	DAR1 F 0 A_PlaySoundEx("weapon/napalm", 0, 0, 1)
	DAR1 F 0 A_CustomMissile("DarkProjectileTank", 40, 8, 0)
	DAR1 FGAAAA 3 
	DAR1 A 0 A_FaceTarget
	DAR1 F 0 A_PlaySoundEx("weapon/napalm", 0, 0, 1)
	DAR1 F 0 A_CustomMissile("DarkProjectileTank", 40, 8, 0)
	DAR1 FGAAAA 3 
	DAR1 A 10
	Goto Start
	Pain.ProtoMan:
	DAR4 H 0 A_ChangeFlag("NORADIUSDMG", 1)
	DAR1 H 0 A_FaceTarget
	DAR1 H 0 A_TakeInventory("CutterFlag", 9999)
	DAR1 H 35 A_ChangeVelocity(-10, random(-10,10), 10, CVF_REPLACE|CVF_RELATIVE) 
	DAR4 H 0 A_ChangeFlag("NORADIUSDMG", 0)
	Goto Start
	Death:
	DAR1 B 0 A_StopSoundEx("SoundSlot5")
	ENKR H 0 A_Stop
	ENKR H 0 A_FaceTarget
	ENKR H 0 A_SpawnItemEx("BigHealth", 0, 0, 50, 0, 0, 18)
	ENKR H 0 A_SpawnItemEx("FakeDeathFX", 0, 0, 50)
	ENKR A 0 A_PlaySoundEx("misc/devildeath", "SoundSlot5", 0, 1)
	stop
}
}

actor DarkMelee
{
+MISSILE
+NOINTERACTION
height 0
radius 0
damagetype "DarkMan"
States
{
	Spawn:
	TNT1 A 0
	TNT1 A 0 A_Explode(5, 80, 0)
	stop
}
}

actor DarkStunner
{
PROJECTILE
scale 2.5
Height 32
Radius 32
Damage (1)
Speed 22
damagetype "SparkShock"
species "Darkman"
+THRUSPECIES
states
{
	Spawn:
	DARS DE 3
	DARS F 10
	stop
}
}

actor DarkStunnerFake : DarkStunner
{
damagetype "Misc"
Speed 20
}

actor DarkProjectile : FastProjectile
{
damagetype "DarkMan"
PROJECTILE
//+RIPPER
+DONTREFLECT
//+THRUGHOST
//-MISSILE
Speed 60
damage (18)
+THRUSPECIES
species "Darkman"
Height 6
Radius 6
Scale 2.5
States
{
Spawn:
DARS D 0 
DARS D 3 
DARS D -1//A_ChangeFlag("MISSILE",1)
loop
}
}

actor DarkProjectile2 : DarkProjectile
{
Speed 75
States
{
Spawn:
DARS D 0 
DARS D 3 //A_PlaySoundEx("weapon/coilexplode", "Voice", 0, 0)// ThrustThingZ(0,0,0,0)
DARS D 1 A_ChangeFlag("MISSILE",1)
loop
}
}

actor DarkProjectile3 : DarkProjectile
{
Damage (4)
}

actor DarkProjectileTank : DarkProjectile
{
-RIPPER
Damage (10)
Speed 35
}

actor DarkSniperShot : DarkProjectile
{
-RIPPER
Speed 20
Damage (10)
}

actor FakeProtomanProp
{
Translation "192:192=87:87", "198:198=42:42"
scale 2.5
height 0
radius 0
-SOLID
+NOGRAVITY
states
{
	Spawn:
	TFOG A 0 A_ChangeVelocity(0,0,-13,CVF_RELATIVE|CVF_REPLACE)
	TFOG A 1 A_Jumpif(floorz==z, "Land")
	loop
	Land:
	TFOG A 0 A_PlaySoundEx("misc/teleportin", "Voice", 0, 1)
	TFOG CCAAABBBBB 1
	Spawn2:
	PROM AK 10
	loop
	Turn:
	PROM AAAA 2 A_SetAngle(angle+45)
	PROM F -1 A_PlaySoundEx("misc/fakereloadshort", "Voice", 0,1)
	stop
}
}

actor DarkShieldFire
{
PROJECTILE
+NOINTERACTION
Height 56
Radius 10
Damage (0)
Speed 28
+RIPPER
+THRUSPECIES
species "Darkman"
damagetype "Darkman"
scale 2.5
States
{
Spawn:
DARS ABCABCABCABCABCABCABCABCABCABCABCABC 1 A_Explode(8, 40, 0)
DARS A 0 A_Stop
Return:
DARS A 0 A_FaceTarget
DARS A 0 A_Recoil(-1)
DARS A 0 A_Explode(8, 40, 0)
DARS A 1 A_JumpIfCloser(64, "Death")
DARS A 0 A_FaceTarget
DARS A 0 A_Recoil(-1)
DARS A 0 A_Explode(8, 40, 0)
DARS B 1 A_JumpIfCloser(64, "Death")
DARS A 0 A_FaceTarget
DARS A 0 A_Recoil(-1)
DARS A 0 A_Explode(8, 40, 0)
DARS C 1 A_JumpIfCloser(64, "Death")
DARS A 0 A_GiveInventory("CutterFlag",1)
DARS A 0 A_JumpIfInventory("CutterFlag", 20, "Death")
loop
Death:
DARS A 0 A_GiveToTarget("CutterFlag",1)
stop
}
}

actor DarkShield1
{
PROJECTILE
Height 56
health 1
+NOBLOOD
Radius 5
Damage (0)
+SHOOTABLE
-NOBLOCKMAP
+REFLECTIVE
+DEFLECT
+DONTREFLECT
+GHOST
+THRUSPECIES
species "Darkman"
Speed 5
scale 2.5
+DONTRIP
States
{
Spawn:
TNT1 A 1
DARS A 2 A_Stop
stop
}
}

actor DarkShield2 : DarkShield1
{
States
{
Spawn:
TNT1 A 1
DARS B 2 A_Stop
stop
}
}

actor DarkShield3 : DarkShield1
{
States
{
Spawn:
TNT1 A 1
DARS C 2 A_Stop
stop
}
}

actor DarkShieldFire1
{
PROJECTILE
Height 56
Radius 10
Damage (2)
Speed 28
+RIPPER
damagetype "DarkMan"
+NOINTERACTION
scale 2.5
States
{
Spawn:
DARS ABCABCABCABCABCABCABCABC 1 A_Explode(5,64,0)
DARS A 0 A_Stop
goto Follow
Follow:
DARS A 0 Thing_ChangeTid(0,600)
DARS A 1 A_Explode(2,64,0)
DARS A 0 A_FaceTarget
DARS A 0 A_Recoil(-1)
DARS B 1 A_Explode(2,64,0)
DARS A 0 A_FaceTarget
DARS A 0 A_Recoil(-1)
DARS C 1 A_Explode(2,64,0)
DARS A 0 A_FaceTarget
DARS A 0 A_Recoil(-1)
loop
}
}

actor ProtomanAlly
{
//$Category MM8BDM-Bosses
Height 46
Radius 34
Scale 2.5
Obituary "%o was destroyed by \cgProtoMan."
Translation "192:192=87:87", "198:198=42:42"
+INVULNERABLE
Health 9999
mass 99999999
damagefactor "Misc", 0.0
damagefactor "Quick", 0.0
damagefactor "Buster", 0.0
damagefactor "ProtoBuster", 0.0
damagefactor "ProtoBuster2", 0.0
damagefactor "ProtoBuster3", 0.0
painchance 8
Speed 7
Damage 0
MONSTER
+THRUSPECIES
//-ISMONSTER
//+NORADIUSDMG
//+FLOAT
floatspeed 0
-COUNTKILL
-SOLID
-CANPASS
+NOBLOOD
+LOOKALLAROUND
+SLIDESONWALLS
//+NODAMAGE
//MaxStepHeight 0
//gravity 1.5
-DROPOFF
+FRIENDLY
-SHOOTABLE
states
{
	Spawn:
	TFOG A 0 A_ChangeVelocity(0,0,-13,CVF_RELATIVE|CVF_REPLACE)
	TFOG A 1 A_Jumpif(floorz==z, "Land")
	loop
	Land:
	TFOG A 0 A_PlaySoundEx("misc/teleportin", "Voice", 0, 1)
	TFOG CCAAABBB 1
	TFOG A 0 A_GiveInventory("HalfDamagePower", 1)
	TFOG A 0 ACS_ExecuteAlways(5,0,35)//A_SpawnItemEx("ProtoBossShieldGiver")
	Landed:
	TNT1 A 0 A_SpawnItemEx("ProtoShieldHitbox", 32, -16, 5, velx, vely, velz, 0, 8)
	TNT1 A 0 A_SpawnItemEx("ProtoShieldHitbox", 32, -8, 5, velx, vely, velz, 0, 8)
	TNT1 A 0 A_SpawnItemEx("ProtoShieldHitbox", 32, 16, 5, velx, vely, velz, 0, 8)
	TNT1 A 0 A_SpawnItemEx("ProtoShieldHitbox", 32, 8, 5, velx, vely, velz, 0, 8)
	TNT1 A 0 A_SpawnItemEx("ProtoShieldHitbox", 32, 0, 5, velx, vely, velz, 0, 8)
	PROM L 1
	loop
	Spawn2:
	PROM E 0 A_TakeInventory("StopShield",999)
	PROM LL 10 A_LookEx(LOF_NOSOUNDCHECK, 0, 0, 0, 360, "See")
	loop
	UnseePlayer:
	PROM E 1 A_ClearTarget
	Goto Spawn2
	See:
	PROM A 0 A_Stop
	PROM A 0 HealThing(9999)
	PROM A 0 A_JumpIfInTargetInventory("BusterAmmo", 1, "UnseePlayer")
	PROM A 0 A_FaceTarget
	PROM E 0 A_TakeInventory("StopShield",999)
	PROM L 10 A_TakeInventory("CutterFlag",999)
	PROM A 0 A_ChangeFlag("INVULNERABLE", 0)
	PROM A 0 A_ChangeFlag("SHOOTABLE", 1)
	PROM A 0 A_Jump(215, "Hop", "Dash")
	Goto BluffCharge
	LTank:
	PROM Q 10 A_SpawnItemEx("LTankCoop", 0, 0, 32, 13, 0, 3, 0)
	PROM L 10
	Goto Landed
	
	Hop:
	PROM N 0 A_GiveInventory("StopShield",1)
	PROM L 3 A_FaceTarget 
	PROM N 3 A_ChangeVelocity(3,0,15,CVF_RELATIVE|CVF_REPLACE)
	PROM N 1 //A_GiveInventory("StopShield",1)
	PROM E 0 A_FaceTarget
	PROM E 0 A_PlaySoundEx("misc/devilfire", "Voice", 0, 1)
	PROM O 5 A_CustomMissile("ProtoBossBuster", 48, 0, 0)
	PROM E 0 A_FaceTarget
	PROM E 0 A_PlaySoundEx("misc/devilfire", "Voice", 0, 1)
	PROM O 5 A_CustomMissile("ProtoBossBuster", 48, 0, 0)
	Falling:
	PROM E 0 A_TakeInventory("StopShield",999)
	PROM N 1 A_Jumpif(floorz==z, "HopLand")
	loop
	HopLand:
	PROM E 0 A_PlaySoundEx("misc/protoland", "Voice", 0, 1)
	PROM L 2 A_Stop
	PROM A 0 A_GiveInventory("CutterFlag",1)
	PROM A 0 A_JumpIfInventory("CutterFlag", 4, "HopEnd")
	PROM A 0 A_JumpIfInventory("CutterFlag", 3, "Jump")
	Goto Hop
	HopEnd:
	PROM L 18 A_TakeInventory("StopShield",999)
	Goto Spawn2
	Jump:
	PROM L 3 A_FaceTarget 
	PROM N 3 A_ChangeVelocity(10,0,18,CVF_RELATIVE|CVF_REPLACE)
	PROM N 1 A_GiveInventory("StopShield",1)
	PROM E 0 A_FaceTarget
	PROM E 0 A_PlaySoundEx("misc/devilfire", "Voice", 0, 1)
	PROM O 2 A_CustomMissile("ProtoBossBuster", 48, 0, -32)
	PROM E 0 A_PlaySoundEx("misc/devilfire", "Voice", 0, 1)
	PROM O 2 A_CustomMissile("ProtoBossBuster", 48, 0, -16)
	PROM E 0 A_PlaySoundEx("misc/devilfire", "Voice", 0, 1)
	PROM O 2 A_CustomMissile("ProtoBossBuster", 48, 0, -8)
	PROM E 0 A_PlaySoundEx("misc/devilfire", "Voice", 0, 1)
	PROM O 2 A_CustomMissile("ProtoBossBuster", 48, 0, 0)
	PROM E 0 A_PlaySoundEx("misc/devilfire", "Voice", 0, 1)
	PROM O 2 A_CustomMissile("ProtoBossBuster", 48, 0, 8)
	PROM E 0 A_PlaySoundEx("misc/devilfire", "Voice", 0, 1)
	PROM O 2 A_CustomMissile("ProtoBossBuster", 48, 0, 16)
	PROM E 0 A_PlaySoundEx("misc/devilfire", "Voice", 0, 1)
	PROM O 2 A_CustomMissile("ProtoBossBuster", 48, 0, 32)
	Goto Falling
	
	Dash:
	PROM L 15 A_FaceTarget
	PROM A 0 A_PlaySoundEx("weapon/tengudash", "Voice", 0, 1)
	PROM A 0 A_FaceTarget
	DashLoop:
	PROM P 0 A_SpawnItemEx("ProtoDashAssist")
	PROM P 1 A_ChangeVelocity(27,0,0,CVF_RELATIVE|CVF_REPLACE)
	PROM B 0 A_SpawnItemEx("ProtoDust", -32, 0, 0)
	PROM P 0 A_SpawnItemEx("ProtoDashAssist")
	PROM P 1 A_ChangeVelocity(27,0,0,CVF_RELATIVE|CVF_REPLACE)
	PROM B 0 A_SpawnItemEx("ProtoDust", -32, 0, 0)
	PROM P 0 A_SpawnItemEx("ProtoDashAssist")
	PROM P 1 A_ChangeVelocity(27,0,0,CVF_RELATIVE|CVF_REPLACE)
	PROM B 0 A_SpawnItemEx("ProtoDust", -32, 0, 0)
	PROM P 0 A_SpawnItemEx("ProtoDashAssist")
	PROM P 1 A_ChangeVelocity(27,0,0,CVF_RELATIVE|CVF_REPLACE)
	PROM B 0 A_SpawnItemEx("ProtoDust", -32, 0, 0)
	PROM P 0 A_SpawnItemEx("ProtoDashAssist")
	PROM P 1 A_ChangeVelocity(27,0,0,CVF_RELATIVE|CVF_REPLACE)
	PROM B 0 A_SpawnItemEx("ProtoDust", -32, 0, 0)
	PROM P 0 A_SpawnItemEx("ProtoDashAssist")
	PROM P 1 A_ChangeVelocity(27,0,0,CVF_RELATIVE|CVF_REPLACE)
	PROM B 0 A_SpawnItemEx("ProtoDust", -32, 0, 0)
	PROM P 0 A_SpawnItemEx("ProtoDashAssist")
	PROM P 1 A_ChangeVelocity(27,0,0,CVF_RELATIVE|CVF_REPLACE)
	PROM B 0 A_SpawnItemEx("ProtoDust", -32, 0, 0)
	PROM P 0 A_SpawnItemEx("ProtoDashAssist")
	PROM P 1 A_ChangeVelocity(27,0,0,CVF_RELATIVE|CVF_REPLACE)
	PROM B 0 A_SpawnItemEx("ProtoDust", -32, 0, 0)
	PROM P 0 A_SpawnItemEx("ProtoDashAssist")
	PROM P 1 A_ChangeVelocity(27,0,0,CVF_RELATIVE|CVF_REPLACE)
	PROM B 0 A_SpawnItemEx("ProtoDust", -32, 0, 0)
	PROM P 0 A_SpawnItemEx("ProtoDashAssist")
	PROM P 1 A_ChangeVelocity(27,0,0,CVF_RELATIVE|CVF_REPLACE)
	PROM B 0 A_SpawnItemEx("ProtoDust", -32, 0, 0)
	PROM P 0 A_SpawnItemEx("ProtoDashAssist")
	PROM P 1 A_ChangeVelocity(27,0,0,CVF_RELATIVE|CVF_REPLACE)
	PROM B 0 A_SpawnItemEx("ProtoDust", -32, 0, 0)
	PROM P 0 A_SpawnItemEx("ProtoDashAssist")
	PROM P 1 A_ChangeVelocity(27,0,0,CVF_RELATIVE|CVF_REPLACE)
	PROM B 0 A_SpawnItemEx("ProtoDust", -32, 0, 0)
	PROM P 0 A_SpawnItemEx("ProtoDashAssist")
	PROM P 1 A_ChangeVelocity(27,0,0,CVF_RELATIVE|CVF_REPLACE)
	PROM B 0 A_SpawnItemEx("ProtoDust", -32, 0, 0)
	PROM P 0 A_SpawnItemEx("ProtoDashAssist")
	PROM P 1 A_ChangeVelocity(27,0,0,CVF_RELATIVE|CVF_REPLACE)
	PROM B 0 A_SpawnItemEx("ProtoDust", -32, 0, 0)
	PROM P 0 A_SpawnItemEx("ProtoDashAssist")
	PROM P 1 A_ChangeVelocity(27,0,0,CVF_RELATIVE|CVF_REPLACE)
	PROM B 0 A_SpawnItemEx("ProtoDust", -32, 0, 0)
	PROM P 0 A_SpawnItemEx("ProtoDashAssist")
	PROM P 1 A_ChangeVelocity(27,0,0,CVF_RELATIVE|CVF_REPLACE)
	PROM B 0 A_SpawnItemEx("ProtoDust", -32, 0, 0)
	PROM P 0 A_SpawnItemEx("ProtoDashAssist")
	PROM L 0 A_Stop
	PROM N 4 A_ChangeVelocity(-8,0,12,CVF_RELATIVE|CVF_REPLACE)
	Goto Falling
	
	BluffCharge:
	PROM L 0 ACS_ExecuteAlways(5,0,36)
	PROM L 0 A_ChangeFlag("NOPAIN",1)
	PROM L 20 A_PlaySoundEx("weapon/pcharge", "SoundSlot1", 0, 1)
	PROM LLLLLL 5 A_FaceTarget
	PROM A 0 A_FaceTarget
	PROM A 0 A_PlaySoundEx("weapon/pshot", "Voice", 0, 1)
	PROM M 16 A_CustomMissile("ProtoShotAlly", 32,0,0)//A_SpawnItemEx("ProtoShotAlly", 0, 0, 32, 50, 0, 0, 0)
	PROM L 12 A_ChangeFlag("NOPAIN", 0)
	Goto Spawn2
	
	Death:
	PROM H 1 A_Jumpif(floorz==z, "Dying")
	loop
	Dying:
	PROM H 0 SetPlayerProperty(1,1,4)
	PROM H 0 A_FaceTarget
	PROM HHHHHHHH 1 Thing_SetTranslation(0, 0)
	PROM H 0 Thing_Remove(501)
	PROM IJ 30
	PROM J 0
	Dead:
	PROM IJ 30
	loop
	
	Pain:
	PROM N 0 A_GiveInventory("StopShield",1)
	PROM H 0 A_ChangeVelocity(-10, random(-10,10), 10, CVF_REPLACE|CVF_RELATIVE) 
	PROM H 1 A_JumpIf(floorz==z, "Fallen")
	Goto Pain+2
	Fallen:
	PROM H 10
	PROM I 35
	Goto Spawn2
	
	Leave:
	TFOG A 0 A_Stop
	PROM N 0 A_GiveInventory("StopShield",1)
	TFOG A 0 A_PlaySoundEx("misc/teleportout", "Voice", 0, 1)
	TFOG A 0 A_ChangeFlag("NOINTERACTION", 1)
	TFOG B 0 A_ChangeFlag("NOGRAVITY",1)
	TFOG BBBAAACCC 1
	TFOG A 65 A_ChangeVelocity(0,0,13,CVF_RELATIVE|CVF_REPLACE)
	stop
	
	Finish:
	PROM E 0 A_GiveInventory("StopShield",999)
	PROM N 1 A_Jumpif(floorz==z, "Finished")
	loop
	Finished:
	PROM AK 10
	loop
	}
}

actor ProtoShotAlly : ProtoShotBoss
{
+RIPPER
damage (35)
+DONTREFLECT
+THRUGHOST
DamageType "ProtoMan"
}

actor ProtoDashAssist
{
+MISSILE
damagetype "ProtoMan"
states
{
Spawn:
TNT1 A 0
TNT1 A 0 A_Explode(30, 128, 0)
stop
}
}

actor HalfDamagePower : PowerDamage
{
powerup.duration 99999
damagefactor "normal", 0.5
}

actor DamageMiscShield : PowerProtection
{
powerup.duration 99999
damagefactor "Misc", 0.0
damagefactor "Buster", 0.0
damagefactor "ProtoMan", 0.0
damagefactor "ProtoBuster", 0.0
damagefactor "ProtoBuster1", 0.0
damagefactor "ProtoBuster2", 0.0
}


actor ProtoShotBossProp : ProtoShot3
{
Speed 60
Translation "192:192=108:108", "198:198=110:110"
Damage (0)
+RIPPER
radius 5
height 5
Damagetype "ProtoBuster"
scale 3.2
	States
	{
	Spawn:
	CHBU ABCD 3
	loop
	Death:
	NAPA EFGHIJKL 2
	NAPA MNOPQRS 2
	stop
	}
}

actor ProtomanShadowyProp
{
renderstyle Stencil
stencilcolor "Black"
scale 2.5
states
{
Spawn:
PROM A -1
loop
Walk:
PROM BBBBCCCCDDDDEEEE 1 A_Recoil(-1)
loop
}
}

// Legacy

actor DarkManBuster : MegaBuster
{
Weapon.AmmoUse 0
Weapon.AmmoGive 3
Weapon.SlotNumber 1
scale 2.5
Obituary "%o was destroyed by %k."
Inventory.Pickupmessage "You got the Dark Man Buster!"
weapon.ammotype "BusterAmmo"
+WEAPON.AMMO_OPTIONAL
+WEAPON.DONTBOB
+WEAPON.CHEATNOTWEAPON
States
{
Spawn:
WEAP X 1
stop
Ready:
BUST B 0 ACS_NamedExecuteWithResult("core_weaponcolor",CLR_MAGNETMISSILE)
BUST B 1 A_WeaponReady
Goto Ready+1
Deselect:
BUST B 0
goto DeselectSwap
Select:
BUST B 0
goto SelectSwap
Fire:
BUST B 0 A_JumpIfInventory("BubbleLeadAmmo", 1, "DarkBlaster")
BUST B 12 A_FireCustomMissile("DarkProjectile",0,0,0,10)
BUST B 10 A_GiveInventory("AtomicFireAmmo",1)
BUST B 0 A_JumpIfInventory("AtomicFireAmmo",3,"Next")
BUST B 0 A_Refire
Goto Ready
DarkBlaster:
BUST B 0 A_PlaySoundEx("weapon/coilfire1", "Voice", 0, 1)
BUST B 0 A_GiveInventory("BubbleLeadAmmo",1)
BUST BBBBBBBBBBBBBBBBB 1 A_FireCustomMissile("DarkProjectile2",0,0,0,10)
BUST B 0 A_JumpIfInventory("BubbleLeadAmmo", 6, "DarkBlasterEnd")
BUST B 0 A_Refire
Goto Ready
DarkBlasterEnd:
ERO2 I 0 A_TakeInventory("BubbleLeadAmmo",9999)
BUST B 50
Goto Leap
DarkBlasterStart:
ERO2 I 0 A_PlaySoundEx("weapon/adaptercharge","Item",0,1)
ERO2 FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF 1 A_SpawnItemEx("EvilRoboFistCharger",random(256,-256),random(256,-256),random(256,-256))
BUST B 0 A_GiveInventory("BubbleLeadAmmo",1)
Goto Ready
Next:
BUST B 0 A_GiveInventory("AirShooterAmmo",1)
BUST B 2 A_TakeInventory("AtomicFireAmmo",99)
BUST B 0 A_Jump(256,"Leap","Ready","DarkBlasterCheck")
Goto Ready
DarkBlasterCheck:
BUST B 0 A_JumpIfInventory("AirShooterAmmo", 4, "DarkBlasterStart")
Leap:
BUST B 0 ACS_Terminate(8,0)
BUST B 0 A_FireCustomMissile("DarkShieldFire1",0,0,0,-30)
BUST B 0 A_FireCustomMissile("DarkShieldFire1",180,0,0,-30)
BUST B 20 //A_GiveInventory("RocketAmmo",1)
BUST B 0 ACS_ExecuteAlways(5,0,4)
BUST B 1 ThrustThingZ(0,50,0,1)
BUST B 20 A_Recoil(random(-16,-34))
BUST B 40 //A_TakeInventory("RocketAmmo",99)
BUST B 0 ACS_Execute(8,0)
BUST B 0 Thing_Remove(600)
Goto Ready
NoAmmo:
BUST B 1
Goto Ready
}
}

actor DarkArmor : PowerProtection 
{
damagefactor "ProtoBuster", 0.0
Powerup.duration -7
}

