////////////////////
// COPY MEGAMAN 1 //						?
////////////////////

actor BossWireAdaptorHook : WireAdaptorHook
{
states
{
Spawn:
WADP B 0
WADP B 0 A_SetUserVar("user_CountDown",reactiontime)
WADP B 0 A_SetUserVar(user_PTID, ACS_NamedExecuteWithResult("core_gettarget"))
WADP B 0 A_GiveInventory("WeaponCharge",1)
WADP B 0 A_ScaleVelocity(44)//Speed of projectile.
goto Spawn2

Spawn2:
WADP B 0 ACS_NamedExecuteAlways("core_drawhookshot", 0, user_PTID, 18)
WADP B 0 A_GiveToTarget("WireHookShotDelay",1)
WAD1 ABABAB 1 //A_JumpIf(ACS_NamedExecuteWithResult("core_targetexists")==0,"SuperDeath")
WADP B 0 A_GiveToTarget("WireHookShotDelay",1)
WAD1 ABABAB 1 //A_JumpIf(ACS_NamedExecuteWithResult("core_targetexists")==0,"SuperDeath")
WireLoop:
WADP B 0 A_GiveToTarget("WireHookShotDelay",1)
WAD1 ABABAB 1 //A_JumpIf(ACS_NamedExecuteWithResult("core_targetexists")==0,"SuperDeath")
WADP B 0 A_SetUserVar("user_CountDown",user_CountDown - 1)
WAD1 A 0 A_CountDown
loop

Death:
WADP B 0 A_JumpIfCloser(64, "SuperDeath")
XDeath:
Crash:
WADP B 0 A_JumpIf(user_CountDown == 0, "SuperDeath")
WADP B 0 A_JumpIfInventory("WeaponCharge",2,"SuperDeath")
WADP B 0 A_JumpIfInventory("WeaponCharge",1,1)
goto SuperDeathPoof//Kill hook early if it never got through the Spawn state.
WADP B 0 A_PlaySoundEx("weapon/crashland","Weapon")
WADP B 0 A_JumpIfInventory("NoHookshot",1,"Death1",AAPTR_TRACER)
WADP B 0 A_CheckFlag("SHOOTABLE","Death2",AAPTR_TRACER)
goto Death1
Death1://Tracer isn't shootable (probably can't move)
WADP B 0 ACS_NamedExecuteAlways("core_hookshot",0,user_PTID,30,0)
WAD1 B 3
goto DeathLoop1
Death2://Tracer IS shootable (probably CAN move)
WADP B 0 ACS_NamedExecuteAlways("core_hookshot",0,user_PTID,30,1)
WAD1 B 3//Needs at least 3 tics of delay.
goto DeathLoop2
DeathLoop1:
WADP B 0 A_JumpIfCloser(64,"SuperDeathPoof")
WADP B 0 A_GiveToTarget("WireHookShotDelay",1)
WAD1 B 1 //A_JumpIf(ACS_NamedExecuteWithResult("core_targetexists")==0,"SuperDeath")
loop
DeathLoop2:
WADP B 0 A_JumpIfCloser(64,"SuperDeathPoof")
WADP B 0 A_Warp(AAPTR_TRACER,-4,0,28)
WADP B 0 A_GiveToTarget("WireHookShotDelay",1)
WAD1 B 0 //A_JumpIf(ACS_NamedExecuteWithResult("core_targetexists")==0,"SuperDeath")
WAD1 B 1 //A_JumpIf(ACS_NamedExecuteWithResult("core_targetexists",1)==0,"DeathLoop1")
loop
SuperDeathPoof:
WADP B 0 A_PlaySoundEx("weapon/adapterreturn","Weapon")
WADP B 0 A_TakeFromTarget("WireAdaptorDelay",1)
WADP B 0 A_ChangeFlag("NOINTERACTION",1)
WAD1 B 6 A_Stop
stop
SuperDeath:
WAD1 B 0
stop
}
}

actor BossWireAdaptorHookFX : WireAdaptorHookFX {}

actor Megaman?Boss1
{
	//$Category MM8BDM-Bosses
	Obituary "%o was scrapped by \cnMegaman\ct?\c-."
	MONSTER
	-COUNTKILL
	+NOBLOOD
	+MISSILEMORE
	+LOOKALLAROUND
	+SLIDESONWALLS
	Health 250
	damagefactor "Normal", 0.32
	mass 999999
	Radius 16
	Height 56
	Scale 2.5
	Speed 10
	States
	{
	Spawn:
		TFOG A 1 A_JumpIf(momz ==0,"StandingStart")
	loop
	StandingStart:
		TFOG A 0 A_SpawnItemEx("MM?1DamageGiver")
		TFOG CCAAABBBBB 1
	goto Standing
	Standing:
		EMEG A 1 
	loop
	Emote:
		EMEG AJKLLLLKKKKKKK 5
        EMEG J -1
	wait
	
	
	Seek:
		EMEG A 1 A_Look
		loop
	See:
		EMEG BBBBBCCCCC 1 A_ChangeVelocity(6.0,0.0,0.0,CVF_REPLACE|CVF_RELATIVE)
		EMEG A 0 A_FaceTarget
		EMEG A 0 A_SetAngle(angle - random(-45,45))
		EMEG DDDDDEEEEE 1 A_ChangeVelocity(6.0,0.0,0.0,CVF_REPLACE|CVF_RELATIVE)
		EMEG A 0 A_FaceTarget
		EMEG A 0 A_SetAngle(angle - random(-45,45))
		EMEG BBBBBCCCCC 1 A_ChangeVelocity(6.0,0.0,0.0,CVF_REPLACE|CVF_RELATIVE)
		EMEG A 0 A_FaceTarget
		EMEG A 0 A_SetAngle(angle - random(-45,45))
		EMEG DDDDDEEEEE 1 A_ChangeVelocity(6.0,0.0,0.0,CVF_REPLACE|CVF_RELATIVE)
		EMEG A 0 A_FaceTarget
		EMEG A 0 A_SetAngle(angle - random(-45,45))
		EMEG A 0 A_JumpIfInventory("CutterFlag",2,"Attack")
		EMEG A 0 A_Jump(100, "Attack")
		EMEG A 0 A_GiveInventory("CutterFlag",1)
		loop
	Attack:
		EMEG A 0 A_JumpIfHealthLower(175,"ChargeCheck")
		EMEG A 0 A_Jump(256, "Shoot","Slide")
		goto Shoot
	ChargeCheck:
		EMEG A 0 A_Jump(256, "Charge","Slide","Shoot")
		goto Attack+1
	Charge:
		EMEG F 0 A_FaceTarget
		EMEG F 0 A_Stop
		EMEG F 0 A_PlaySoundEx("weapon/coilstart", "voice", 0, 1)
		EMEG F 1 Thing_SetTranslation(10,92)
		EMEG F 0 A_FaceTarget
		EMEG F 1 Thing_SetTranslation(10,0)
		EMEG F 0 A_FaceTarget
		EMEG F 0 A_GiveInventory("WeaponCharge",1)
		EMEG F 0 A_JumpIfInventory("WeaponCharge",17,"Charge2")
		goto Charge+3
	Charge2:
		EMEG F 0 A_PlaySoundEx("weapon/coilcharge", "voice", 0, 1)
		EMEG F 1 Thing_SetTranslation(10,93)
		EMEG F 0 A_FaceTarget
		EMEG F 1 Thing_SetTranslation(10,94)
		EMEG F 0 A_FaceTarget
		EMEG F 1 Thing_SetTranslation(10,0)
		EMEG F 0 A_FaceTarget
		EMEG F 1 Thing_SetTranslation(10,93)
		EMEG F 0 A_FaceTarget
		EMEG F 1 Thing_SetTranslation(10,94)
		EMEG F 0 A_FaceTarget
		EMEG F 1 Thing_SetTranslation(10,0)
		EMEG F 0 A_FaceTarget
		EMEG F 0 A_GiveInventory("WeaponCharge",1)
		EMEG F 0 A_JumpIfInventory("WeaponCharge",24,"ChargeShot")
		loop
	ChargeShot:
		EMEG F 0 A_TakeInventory("WeaponCharge",999)
		EMEG F 0 A_PlaySoundEx("weapon/cfire", "voice", 0, 1)
		EMEG F 0 A_CustomMissile("Mega?ChargeShot",32,8,0,2)
		EMEG FA 6
		goto Seek
	Shoot:
		EMEG F 0 A_FaceTarget
		EMEG F 0 A_Stop
		EMEG AF 3
		EMEG B 0 A_PlaySoundEx("weapon/mbuster", "voice", 0, 1)
		EMEG F 8 A_CustomMissile("Mega?Shot",32,8,0,2)
		EMEG F 0 A_FaceTarget
		EMEG F 3
		EMEG B 0 A_PlaySoundEx("weapon/mbuster", "voice", 0, 1)
		EMEG F 8 A_CustomMissile("Mega?Shot",32,8,0,2)
		EMEG F 0 A_FaceTarget
		EMEG F 3
		EMEG B 0 A_PlaySoundEx("weapon/mbuster", "voice", 0, 1)
		EMEG F 8 A_CustomMissile("Mega?Shot",32,8,0,2)
		EMEG A 5
		goto Seek
	Slide:
		EMEG F 1 A_Stop
		EMEG F 0 A_FaceTarget
		EMEG A 3
		EMEG IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII 1 A_ChangeVelocity(15.0,0,0,CVF_REPLACE|CVF_RELATIVE)
		EMEG A 5 A_Stop
		goto Seek
		
	Death:
		EMEH H 0 A_FaceTarget
		EMEG H 0 A_GiveInventory("IsDead",1)
		EMEG H 0 A_Recoil(20)
		EMEG H 0 SetPlayerProperty(1, 2, 5)
		EMEG HHHHHHHHH 4 A_SpawnItemEx("BassExplode", random(-48,48), random(-8,48), random(0,48)) 
		EMEG H 0 Thing_SetTranslation(10,0)
		EMEG MNMN 15
		EMEG H 0 A_Stop
		EMEG H 0 ACS_Execute(8,0)
		DeathWait:
		EMEG MN 20
		loop
	TeleportOut:
		TFOG B 0 A_PlaySoundEx("misc/teleportout", "voice", 0, 1)
		TFOG BAC 3
		TFOG A 0 A_ChangeFlag("NOGRAVITY",1)
	TeleportLoop:
		TFOG A 1 ThrustThingZ(0,50,0,0)
		goto TeleportLoop
	
}
}

actor MM?1DamageGiver
{
	PROJECTILE
	Damagetype "Bass"
	Height 1
	Radius 1
	Speed 0
	Damage (0)
	renderstyle none
	States
	{
	Spawn:
		PLAY AAAAAAAAAAA 1
		TNT1 A 0 A_Warp(AAPTR_TARGET, 0, 0, 0, 0)
		TNT1 A 0 A_Explode(15,80,0)
		loop
	}
}

actor Mega?Shot
{
PROJECTILE
damagetype "Buster"
Obituary "$OB_MEGABUSTER"
Speed 35
Damage (10)
radius 5
height 5
scale 2.5
States
{
Spawn:
TNT1 A 2
BUST A 1 
wait
}
}

actor Mega?ChargeShot
{
PROJECTILE
damagetype "Buster"
Obituary "$OB_MEGABUSTER"
Speed 40
Damage (30)
radius 10
height 5
scale 2.5
States
{
Spawn:
ARRS A 0
ARRS BCDC 1 
loop
}
}

////////////////////
// COPY MEGAMAN 2 //
////////////////////

actor Megaman?Boss2
{
	//$Category MM8BDM-Bosses
	Obituary "%o was scrapped by \cnMegaman\ct?\c-."
	MONSTER
	-COUNTKILL
	+NOBLOOD
	+MISSILEMORE
	+LOOKALLAROUND
	+SLIDESONWALLS
	-NOGRAVITY
	Health 250
	//translation "192:192=205:205", "198:198=74:74"
	damagefactor "Normal", 0.30
	damagefactor "Wanaan", 0.0
	damagefactor "BubbleLead", 0.2
	mass 999999
	Radius 16
	Height 56
	Scale 2.5
	Speed 10
	States
	{
	Spawn:
		TFOG A 1 A_JumpIf(momz ==0,"StandingStart")
	loop
	StandingStart:
		TFOG A 0 A_GiveInventory("NeedleCannonAmmo",1)
		TFOG A 0 A_SpawnItemEx("MM?1DamageGiver")
		TFOG CCAAABBBBB 1
	goto Standing
	Standing:
		EMEG A 1 A_Stop
	loop
	Emote:
		EMEG AJOP 4
		EMEG Q -1
	wait
	Emote2:
		EMEG AJKLLLLKKKKKKK 5
        EMEG J 55
		EMEG A -1
	wait
	Scare:
		EMEG H 0 A_Recoil(10)
		EMEG H 0 A_SpawnItemEX("WanaanPretend",0,0,0,0,0,0,0,0)
		EMEG H 1 ThrustThingZ(0,30,0,0)
		EMEG H 1 A_CheckFloor("Standing")
	wait
	
	SeekS:
		EMEG A 0 A_TakeInventory("AstroCrushAmmo",999)
	Seek:
		EMEG A 1 A_Look
		loop
	BubbleLeadStart:
		EMEG A 0 A_GiveInventory("BubbleLeadAmmo")
	See:
		EMEG BBBBBCCCCC 1 A_ChangeVelocity(9.0,0.0,velz,CVF_REPLACE|CVF_RELATIVE)
		EMEG A 0 A_FaceTarget
		EMEG A 0 A_SetAngle(angle - random(-25,25))
		EMEG DDDDDEEEEE 1 A_ChangeVelocity(9.0,0.0,velz,CVF_REPLACE|CVF_RELATIVE)
		EMEG A 0 A_FaceTarget
		EMEG A 0 A_SetAngle(angle - random(-25,25))
		EMEG BBBBBCCCCC 1 A_ChangeVelocity(9.0,0.0,velz,CVF_REPLACE|CVF_RELATIVE)
		EMEG A 0 A_FaceTarget
		EMEG A 0 A_SetAngle(angle - random(-25,25))
		EMEG DDDDDEEEEE 1 A_ChangeVelocity(9.0,0.0,velz,CVF_REPLACE|CVF_RELATIVE)
		EMEG A 0 A_FaceTarget
		EMEG A 0 A_SetAngle(angle - random(-25,25))
		EMEG A 0 A_JumpIfInventory("CutterFlag",2,"Attack")
		EMEG A 0 A_Jump(100, "Attack")
		EMEG A 0 A_GiveInventory("CutterFlag",1)
		loop
	Attack:
		EMEG A 0 A_JumpIfInventory("PowerStoneAmmo",2,"PowerStone")
		EMEG A 0 A_JumpIfInventory("PowerStoneAmmo",1,"PowerStoneStart")
		EMEG A 0 A_JumpIfInventory("BubbleLeadAmmo",2,"BubbleLead")
		EMEG A 0 A_JumpIfInventory("BubbleLeadAmmo",1,"BubbleLeadStart")
		EMEG A 0 A_JumpIfInventory("PhaseFlag",8,"StoneAttack")
		EMEG A 0 A_JumpIfInventory("PhaseFlag",7,"StoneGet")
		EMEG A 0 A_JumpIfInventory("PhaseFlag",4,"BubAttack")
		EMEG A 0 A_JumpIfInventory("PhaseFlag",3,"BubGet")
	AttackCheck:
		EMEG A 0 A_JumpIfHealthLower(175,"ChargeCheck")
		EMEG A 0 A_Jump(70,"Slide","Jump"/*,"JumpShoot"*/)
		EMEG A 0 A_Jump(256, "ShootSwitch")
		goto Shoot
		
	BubGet:
		EMEG F 0 A_GiveInventory("PhaseFlag",1)
		EMEG A 0 A_Stop
		EMEG M 5
		EMEG A 0 ACS_ExecuteAlways(15,0,18)
		EMEG A 10 A_GiveInventory("BubbleLeadAmmo",1)
		BSB1 A 1
		wait
		
	StoneGet:
		EMEG F 0 A_GiveInventory("PhaseFlag",1)
		EMEG A 0 A_Stop
		EMEG M 5
		EMEG A 0 ACS_ExecuteAlways(15,0,21)
		EMEG A 10 A_GiveInventory("PowerStoneAmmo",1)
		BSB1 A 1
		wait
		
	BubAttack:
		EMEG A 0 A_JumpIfHealthLower(175,"ChargeCheck")
		EMEG A 0 A_Jump(70,"Slide","Jump"/*,"JumpShoot"*/)
		EMEG A 0 A_Jump(256, "ShootSwitch","BubbleLeadSwitch")
		goto Shoot
	StoneAttack:
		EMEG A 0 A_Jump(70,"Slide","Jump"/*,"JumpShoot"*/)
		EMEG A 0 A_Jump(256,"ChargeSwitch","BubbleLeadSwitch","PowerStoneSwitch")
		goto Shoot
	ChargeCheck:
		EMEG A 0 A_Jump(90,"ChargeSwitch"/*,"JumpShoot"*/)
		goto AttackCheck+1
	ChargeSwitch:
		EMEG A 0 A_JumpIfInventory("NeedleCannonAmmo",1,"Charge")
		EMEG A 0 A_GiveInventory("NeedleCannonAmmo",1)
		EMEG A 0 A_SpawnItemEX("SwitchSpawn")
		EMEG A 0 A_TakeInventory("SuperArmAmmo",999)
		EMEG A 0 A_TakeInventory("DangerWrapAmmo",999)
		EMEG A 0 A_PlaySoundEx("menu/cursor","voice",0,1)
		EMEG A 0 Thing_SetTranslation(10,1)
	Charge:
		EMEG F 0 A_FaceTarget
		EMEG F 0 A_Stop
		EMEG F 0 A_PlaySoundEx("weapon/coilstart", "weapon", 0, 1)
		EMEG F 1 Thing_SetTranslation(10,92)
		EMEG F 0 A_FaceTarget
		EMEG F 1 Thing_SetTranslation(10,0)
		EMEG F 0 A_FaceTarget
		EMEG F 0 A_GiveInventory("WeaponCharge",1)
		EMEG F 0 A_JumpIfInventory("WeaponCharge",17,"Charge2")
		goto Charge+3
	Charge2:
		EMEG F 0 A_PlaySoundEx("weapon/coilcharge", "weapon", 0, 1)
		EMEG F 1 Thing_SetTranslation(10,93)
		EMEG F 0 A_FaceTarget
		EMEG F 1 Thing_SetTranslation(10,94)
		EMEG F 0 A_FaceTarget
		EMEG F 1 Thing_SetTranslation(10,0)
		EMEG F 0 A_FaceTarget
		EMEG F 0 A_GiveInventory("WeaponCharge",1)
		EMEG F 1 Thing_SetTranslation(10,93)
		EMEG F 0 A_FaceTarget
		EMEG F 1 Thing_SetTranslation(10,94)
		EMEG F 0 A_FaceTarget
		EMEG F 1 Thing_SetTranslation(10,0)
		EMEG F 0 A_FaceTarget
		EMEG F 0 A_GiveInventory("WeaponCharge",1)
		EMEG F 0 A_JumpIfInventory("WeaponCharge",18,"ChargeShot")
		loop
	ChargeShot:
		EMEG F 0 A_TakeInventory("WeaponCharge",999)
		EMEG F 0 A_PlaySoundEx("weapon/cfire", "weapon", 0, 1)
		EMEG F 0 A_CustomMissile("Mega?ChargeShot",32,8,0)
		EMEG FA 6
		EMEG F 0 A_GiveInventory("PhaseFlag",1)
		goto Seek
	ShootSwitch:
		EMEG A 0 A_JumpIfInventory("NeedleCannonAmmo",1,"Shoot")
		EMEG A 0 A_GiveInventory("NeedleCannonAmmo",1)
		EMEG A 0 A_SpawnItemEX("SwitchSpawn")
		EMEG A 0 A_TakeInventory("SuperArmAmmo",999)
		EMEG A 0 A_TakeInventory("DangerWrapAmmo",999)
		EMEG A 0 A_PlaySoundEx("menu/cursor","voice",0,1)
		EMEG A 0 Thing_SetTranslation(10,1)
		TFOG ACB 2 A_Stop
	Shoot:
		EMEG A 0 Thing_SetTranslation(10,0)
		EMEG F 0 A_FaceTarget
		EMEG F 0 A_Stop
		EMEG F 1
		EMEG B 0 A_PlaySoundEx("weapon/mbuster", "weapon", 0, 1)
		EMEG F 8 A_CustomMissile("Mega?Shot",32,8,0)
		EMEG F 0 A_FaceTarget
		EMEG F 1
		EMEG B 0 A_PlaySoundEx("weapon/mbuster", "weapon", 0, 1)
		EMEG F 8 A_CustomMissile("Mega?Shot",32,8,0)
		EMEG F 0 A_FaceTarget
		EMEG F 1
		EMEG B 0 A_PlaySoundEx("weapon/mbuster", "weapon", 0, 1)
		EMEG F 8 A_CustomMissile("Mega?Shot",32,8,0)
		EMEG A 6
		EMEG F 0 A_GiveInventory("PhaseFlag",1)
		goto Seek
	PowerStoneSwitch:
		EMEG A 0 A_JumpIfInventory("SuperArmAmmo",1,"PowerStone")
		EMEG A 0 A_GiveInventory("SuperArmAmmo",1)
		EMEG A 0 A_SpawnItemEX("SwitchSpawn")
		EMEG A 0 A_TakeInventory("DangerWrapAmmo",999)
		EMEG A 0 A_TakeInventory("NeedleCannonAmmo",999)
		EMEG A 0 A_PlaySoundEx("menu/cursor","voice",0,1)
		EMEG A 0 Thing_SetTranslation(10,29)
		TFOG ACB 2 A_Stop
	PowerStone:
		EMEG F 0 A_Stop
		EMEG F 0 A_FaceTarget
		EMEG A 2
		EMEG IIIIIIIIIIIIIIII 1 A_ChangeVelocity(20.0,0,0,CVF_REPLACE|CVF_RELATIVE)
		EMEG A 5 A_Stop
		EMEG F 0 A_TakeInventory("PowerStoneAmmo",999)
		EMEG F 0 A_Stop
		EMEG F 0 A_FaceTarget
		EMEG F 2
		POWS E 0 A_PlaySoundEx("weapon/powerstone","weapon",0,1)
		EMEG F 0 A_CustomMissile("PowerStoneSpawner?",32,8,0)
		EMEG F 5
		EMEG M 5
		EMEG A 0 A_ChangeVelocity(0, 0, 15, CVF_RELATIVE|CVF_REPLACE)
		EMEG R 5
		POWS E 0 A_PlaySoundEx("weapon/powerstone","weapon",0,1)
		EMEG F 0 A_CustomMissile("PowerStoneSpawner?",32,8,0)
		EMEG F 0 A_GiveInventory("PhaseFlag",1)
		EMEG R 1 A_CheckFloor("See")
		wait
	BubbleLeadSwitch:
		EMEG A 0 A_JumpIfInventory("DangerWrapAmmo",1,"BubbleLead")
		EMEG A 0 A_GiveInventory("DangerWrapAmmo",1)
		EMEG A 0 A_SpawnItemEX("SwitchSpawn")
		EMEG A 0 A_TakeInventory("SuperArmAmmo",999)
		EMEG A 0 A_TakeInventory("NeedleCannonAmmo",999)
		EMEG A 0 A_PlaySoundEx("menu/cursor","voice",0,1)
		EMEG A 0 Thing_SetTranslation(10,1)
		TFOG ACB 2 A_Stop
	BubbleLead:
		EMEG A 0 A_Stop
		EMEG M 5
		EMEG F 0 A_TakeInventory("CutterFlag",999)
		EMEG F 0 A_TakeInventory("BubbleLeadAmmo",999)
		EMEG F 0 A_GiveInventory("CutterFlag",15)
		EMEG A 0 ACS_ExecuteAlways(15,0,20)
		EMEG F 0 A_FaceTarget
		EMEG F 0 A_Stop
	BubbleLeadShoot:
		EMEG F 1 A_FaceTarget
		EMEG B 0 A_PlaySoundEx("weapon/mbuster", "weapon", 0, 1)
		EMEG F 0 A_CustomMissile("BubbleLead?",32,8,random(-16,16))
		EMEG F 5
		EMEG F 0 A_FaceTarget
		EMEG F 0 A_TakeInventory("CutterFlag",1)
		EMEG F 0 A_JumpIfInventory("CutterFlag",1,"BubbleLeadShoot")
		EMEG F 0 A_GiveInventory("PhaseFlag",1)
		EMEG F 0 A_GiveInventory("AstroCrushAmmo",1)
		EMEG A 0 ACS_ExecuteAlways(15,0,23)
		EMEG A 10
		goto Seek
	Jump:
		EMEG A 0 A_Stop
		EMEG A 0 A_FaceTarget
		EMEG M 5
		BSB1 A 0 A_ChangeVelocity(random(-10,10), random(-10,10), 15, CVF_RELATIVE|CVF_REPLACE)
		EMEG R 10
		EMEG R 1 A_CheckFloor("See")
		wait
	JumpPos:
		EMEG A 0 A_ChangeFlag("INVULNERABLE", 1)
		EMEG A 0 A_Stop
		EMEG A 0 A_ChangeFlag("NOCLIP", 1)
		EMEG A 0 A_ChangeFlag("NOGRAVITY", 1)
		EMEG R 1
		wait
	JumpPosAir:
		EMEG A 0 A_ChangeVelocity(0,0,velz, CVF_REPLACE)
		EMEG A 0 A_ChangeFlag("NOGRAVITY", 0)
		EMEG A 0 A_ChangeFlag("NOCLIP", 0)
		EMEG A 0 ThrustThingZ(0,5,1,1)
		EMEG R 1 A_CheckFloor("Detect")
		goto JumpPosAir+3
	PowerStoneStart:
		EMEG A 0 A_GiveInventory("PowerStoneAmmo",1)
	Slide:
		EMEG F 0 A_Stop
		EMEG F 0 A_FaceTarget
		EMEG A 2
		EMEG IIIIIIIIIIIIIIII 1 A_ChangeVelocity(20.0,0,0,CVF_REPLACE|CVF_RELATIVE)
		EMEG A 3 A_Stop
		EMEG A 0 A_FaceTarget
		EMEG A 2
		EMEG IIIIIIIIIIIIIIII 1 A_ChangeVelocity(20.0,0,0,CVF_REPLACE|CVF_RELATIVE)
		EMEG A 3 A_Stop
		EMEG F 0 A_GiveInventory("PhaseFlag",1)
		goto Seek
		
	Detect:
		EMEG A 0 A_ChangeFlag("INVULNERABLE", 0)
		EMEG F 0 A_JumpIfInventory("PhaseFlag",9,2)
		EMEG F 0 A_JumpIfInventory("PhaseFlag",8,"StonePickup")
		EMEG F 0 A_JumpIfInventory("AstroCrushAmmo",1,"SeekS")
		EMEG F 0 A_JumpIfInventory("DangerWrapAmmo",1,"BubbleLeadShoot")
		EMEG F 0 A_JumpIfInventory("PhaseFlag",4,"BubPickup")
		EMEG A 1
		goto Seek
	BubPickup:
		EMEG A 0 A_GiveInventory("DangerWrapAmmo",1)
		EMEG A 0 A_TakeInventory("NeedleCannonAmmo",999)
		EMEG A 0 A_SpawnItemEX("SwitchSpawn")
		EMEG A 0 A_PlaySoundEx("menu/cursor","voice",0,1)
		EMEG A 0 Thing_SetTranslation(10,1)
		EMEG A 0 ACS_ExecuteAlways(8,0,1)
		goto Seek
	StonePickup:
		EMEG A 0 A_GiveInventory("SuperArmAmmo",1)
		EMEG A 0 A_TakeInventory("DangerWrapAmmo",999)
		EMEG A 0 A_TakeInventory("NeedleCannonAmmo",999)
		EMEG A 0 A_SpawnItemEX("SwitchSpawn")
		EMEG A 0 A_PlaySoundEx("menu/cursor","voice",0,1)
		EMEG A 0 Thing_SetTranslation(10,29)
		EMEG A 0 ACS_ExecuteAlways(8,0,2)
		goto Seek
		
	Death:
		EMEG H 0 ACS_ExecuteAlways(17,0,0)
		EMEH H 0 A_FaceTarget
		EMEG H 0 A_GiveInventory("IsDead",1)
		EMEG H 0 A_Recoil(20)
		EMEG H 0 SetPlayerProperty(1, 2, 5)
		EMEG HHHHHHHHH 4 A_SpawnItemEx("BassExplode", random(-48,48), random(-8,48), random(0,48)) 
		EMEG H 0 Thing_SetTranslation(10,0)
		EMEG MNMN 15
		EMEG H 0 A_Stop
		EMEG H 0 ACS_Execute(8,0,3)
		DeathWait:
		EMEG MN 20
		loop
	TeleportOut:
		TFOG B 0 A_PlaySoundEx("misc/teleportout", "voice", 0, 1)
		TFOG BAC 3
		TFOG A 0 A_ChangeFlag("NOGRAVITY",1)
	TeleportLoop:
		TFOG A 1 ThrustThingZ(0,50,0,0)
		goto TeleportLoop
	
}
}

actor WanaanPretend : GeminiTrail
{
+FLOORHUGGER
-NOINTERACTION
States
{
Spawn:
WANN A 0
WANN ABDDD 2
WANN C 10 A_PlaySoundEX("misc/wanaan","voice",0,1)
WANN CBA 2
stop
}
}

actor Wanaan
{
+FLOORHUGGER
damagetype "Wanaan"
scale 2.0
States
{
Spawn:
WANN A 0
WANN ABDDD 2
WANN C 0 A_Explode(5,32,0,0,32)
WANN C 10 A_PlaySoundEX("misc/wanaan","voice",0,1)
WANN CBA 2
stop
}
}

actor SwitchSpawn : GeminiTrail
{
States
{
Spawn:
	EMEG A 1
	TNT1 A 0 A_JumpIfInTargetInventory("SuperArmAmmo",1,"PowerStone")
	TNT1 A 0 A_JumpIfInTargetInventory("DangerWrapAmmo",1,"BubbleLead")
	TNT1 A 0 A_JumpIfInTargetInventory("NeedleCannonAmmo",1,"MegaBuster")
stop
BubbleLead:
	TNT1 AAAAAAAAAA 0 A_SpawnItemEX("BubbleLead?FX",0,0,0,random(5,10),0,random(-10,10),random(0,360),0)
	stop
MegaBuster:
	TNT1 AAAAAAAAAA 0 A_SpawnItemEX("MegaBuster?FX",0,0,0,random(5,10),0,random(-10,10),random(0,360),0)
	stop
PowerStone:
	TNT1 AAAAAAAAAA 0 A_SpawnItemEX("PowerStone?FX",0,0,0,random(5,10),0,random(-10,10),random(0,360),0)
	stop
}
}

actor PowerStone?FX : GeminiTrail
{
alpha 0.4
renderstyle translucent
States
{
Spawn:
	MQFX B 10
stop
}
}

actor BubbleLead?FX : PowerStone?FX
{
States
{
Spawn:
	MQFX A 10
	stop
}
}

actor MegaBuster?FX : PowerStone?FX
{
States
{
Spawn:
	MQFX C 10
	stop
}
}

actor PhaseFlag : CutterFlag
{
}

actor PowerStoneSpawner? : PowerStoneSpawner
{
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_SpawnItemEx("PowerStone?", 46,0,-8,0,0,0,0)
TNT1 A 0 A_SpawnItemEx("PowerStone?", 46,0,-8,0,0,0,-120)
TNT1 A 0 A_SpawnItemEx("PowerStone?", 46,0,-8,0,0,0,120)
stop
}
}

actor PowerStone? : PowerStone
{
damage (40)
}

actor BubbleLeadSpawner? : BubbleLeadSpawner
{
States
{
Spawn:
TNT1 A 1
TNT1 A 0 A_SpawnItemEx("BubbleLeadStart?",8,0,-16,8,0,5,0,0,0)
stop
}
}

actor BubbleLeadStart? : BubbleLeadStart
{
Damage (20)
Obituary "$OB_BUBBLELEAD"
States
{
Death2:
TNT1 A 1 A_SpawnItemEx("BubbleLead?",0,0,0,18,0,0,0,0,0)
stop
}
}

actor BubbleLead? : BubbleLead
{
Damage (20)
Obituary "$OB_BUBBLELEAD"
States
{
Continue:
TNT1 A 0 A_CustomMissile("BubbleLead?",0,0,0,2,0)
TNT1 A 1
stop
}
}

////////////////////
// COPY MEGAMAN 3 //
////////////////////

actor Megaman?Boss3
{
	//$Category MM8BDM-Bosses
	Obituary "%o was scrapped by \cnMegaman\ct?\c-."
	MONSTER
	-COUNTKILL
	+NOBLOOD
	+MISSILEMORE
	+LOOKALLAROUND
	+SLIDESONWALLS
	Health 250
	damagefactor "Normal", 0.4
	mass 999999
	Radius 16
	Height 56
	Scale 2.5
	Speed 10
	var int user_cflashtimer;
	States
	{
	Spawn:
		TFOG A 1 A_JumpIf(momz ==0,"StandingStart")
	loop
	StandingStart:
		//TFOG A 0 A_SpawnItemEx("MM?1DamageGiver")
		TFOG CCAAABBBBB 1
	goto Standing
	Standing:
		EMEG A 1 
	loop
	Emote:
		EMEG AJKLLLLKKKKKKK 5
        EMEG J -1
	wait
	EmoteWeapon:
		TFOG ACB 2
        EMEG K -1
	wait
	EmoteWeaponEnd:
		TFOG ACB 2
        EMEG J -1
	wait
	
	Start:
		EMEG A 0 A_GiveInventory("FlameSwordAmmo", 1)
	Seek:
		EMEG A 1 A_Look
		loop
	See:
		EMEG F 0 A_TakeInventory("YamatoSpearAmmo",9999)
		EMEG F 0 A_TakeInventory("QuickBoomerangAmmo",9999)
		EMEG B 0 A_JumpIfInventory("FlameSwordAmmo",1,"FireWire")
		EMEG BBBBBCCCCC 1 A_ChangeVelocity(12.0,0.0,velz,CVF_REPLACE|CVF_RELATIVE)
		EMEG A 0 A_FaceTarget
		EMEG A 0 A_SetAngle(angle - random(-45,45))
		EMEG DDDDDEEEEE 1 A_ChangeVelocity(12.0,0.0,velz,CVF_REPLACE|CVF_RELATIVE)
		EMEG A 0 A_FaceTarget
		EMEG A 0 A_SetAngle(angle - random(-45,45))
		EMEG BBBBBCCCCC 1 A_ChangeVelocity(12.0,0.0,velz,CVF_REPLACE|CVF_RELATIVE)
		EMEG A 0 A_FaceTarget
		EMEG A 0 A_SetAngle(angle - random(-45,45))
		EMEG DDDDDEEEEE 1 A_ChangeVelocity(12.0,0.0,velz,CVF_REPLACE|CVF_RELATIVE)
		EMEG A 0 A_FaceTarget
		EMEG A 0 A_SetAngle(angle - random(-45,45))
		EMEG A 1 A_JumpIfTargetInLOS("ShootJump", 360)
		loop
	Aim:
		EMEG F -1
		stop
	FireWire:
		EMEG F 0 A_FaceTarget
		EMEG F 0 A_SetAngle(angle+random(-12.4, 12.4))
		EMEG F 1 A_Stop
		EMEG F 0 A_PlaySoundEx("weapon/WireAdp", "voice", 0, 1)
		EMEG F 0 A_SpawnItemEx("BossWireAdaptorHook",-2,0,32,1)
		EMEG F 0 A_TakeInventory("FlameSwordAmmo",9999)
		Goto WireLoop
	WireLoop:
		EMEG F 1 A_GiveInventory("QuickBoomerangAmmo",1)
		EMEG F 0 A_JumpIfInventory("QuickBoomerangAmmo",40,"CentaurFlash")
		EMEG F 1 A_JumpIf(momx + momy == 0, "WireLoop")
		EMEG F 0 A_TakeInventory("QuickBoomerangAmmo",9999)
		EMEG F 0 Thing_SetTranslation(0, 81)
		TFOG ACB 2
	WireFlyLoop:
		EMEG R 1 A_FaceTarget
		EMEG R 0 A_JumpIfCloser(128, "FlameSword")
		EMEG R 0 A_JumpIfInventory("WireAdaptorDelay", 1, "WireFlyLoop")
		Goto Seek
	FlameSwordSelect:
		EMEG F 1 A_Stop
		EMEG F 0 Thing_SetTranslation(0, 81)
		TFOG ACB 2 A_FaceTarget
	FlameSword:
		EMEG F 2 A_FaceTarget
		EMEG F 0 A_FaceTarget
		EMEG F 0 A_PlaySoundEx("weapon/flamesword", "Voice", 0, 1)
		EMEG F 1 A_CustomMissile("FlameSword2?",32,16,-50,2,20)
		EMEG F 1 A_CustomMissile("FlameSword2?",32,8,-25,2,10)
		EMEG F 1 A_CustomMissile("FlameSword2?",32,0,0,2,0)
		EMEG F 1 A_CustomMissile("FlameSword2?",32,-8,25,2,-5)
		EMEG F 1 A_CustomMissile("FlameSword2?",32,-16,50,2,-10)
	FlameSwordEnd:
		EMEG R 1 A_FaceTarget
		EMEG R 0 A_JumpIfInventory("WireAdaptorDelay", 1, "FlameSwordEnd")
		Goto Seek
	ShootJump:
		EMEG R 1 A_Stop
		EMEG R 0 A_FaceTarget
		EMEG R 5 A_ChangeVelocity(14.0, random(-20.0, 20.0), 10.0, CVF_RELATIVE|CVF_REPLACE)
		EMEG R 5 A_ChangeVelocity(0, 0, -5.0, CVF_RELATIVE)
	Fall:
		EMEG R 1 A_CheckFloor("Shoot")
		loop
	Attack:
		EMEG A 1 A_Jump(256, "PharoahSlide", "CentaurFlash", "YamatoSpear")
		goto Attack
	Charge:
		EMEG F 0 A_FaceTarget
		EMEG F 1 A_Stop
		EMEG F 0 A_PlaySoundEx("weapon/coilstart", "voice", 0, 1)
		EMEG F 1 Thing_SetTranslation(10,92)
		EMEG F 0 A_FaceTarget
		EMEG F 1 Thing_SetTranslation(10,0)
		EMEG F 0 A_FaceTarget
		EMEG F 0 A_GiveInventory("WeaponCharge",1)
		EMEG F 0 A_JumpIfInventory("WeaponCharge",17,"Charge2")
		goto Charge+3
	Charge2:
		EMEG F 0 A_PlaySoundEx("weapon/coilcharge", "voice", 0, 1)
		EMEG F 1 Thing_SetTranslation(10,93)
		EMEG F 0 A_FaceTarget
		EMEG F 1 Thing_SetTranslation(10,94)
		EMEG F 0 A_FaceTarget
		EMEG F 1 Thing_SetTranslation(10,0)
		EMEG F 0 A_FaceTarget
		EMEG F 1 Thing_SetTranslation(10,93)
		EMEG F 0 A_FaceTarget
		EMEG F 1 Thing_SetTranslation(10,94)
		EMEG F 0 A_FaceTarget
		EMEG F 1 Thing_SetTranslation(10,0)
		EMEG F 0 A_FaceTarget
		EMEG F 0 A_GiveInventory("WeaponCharge",1)
		EMEG F 0 A_JumpIfInventory("WeaponCharge",24,"ChargeShot")
		loop
	ChargeShot:
		EMEG F 0 A_TakeInventory("WeaponCharge",999)
		EMEG F 0 A_PlaySoundEx("weapon/cfire", "voice", 0, 1)
		EMEG F 0 A_CustomMissile("Mega?ChargeShot",32,8,0,2)
		EMEG FA 6
		goto Seek
	Shoot:
		EMEG A 0 A_JumpIFCloser(100, "FlameSwordSelect")
		EMEG A 0 A_JumpIFCloser(200, "FireWire")
		EMEG F 0 A_FaceTarget
		EMEG A 1 A_Stop
		EMEG F 0 Thing_SetTranslation(0,0)
		EMEG AF 3
		EMEG B 0 A_PlaySoundEx("weapon/mbuster", "voice", 0, 1)
		EMEG F 4 A_CustomMissile("Mega?Shot",32,8,8,2)
		EMEG F 0 A_FaceTarget
		EMEG F 3
		EMEG B 0 A_PlaySoundEx("weapon/mbuster", "voice", 0, 1)
		EMEG F 4 A_CustomMissile("Mega?Shot",32,8,0,2)
		EMEG F 0 A_FaceTarget
		EMEG F 3
		EMEG B 0 A_PlaySoundEx("weapon/mbuster", "voice", 0, 1)
		EMEG F 4 A_CustomMissile("Mega?Shot",32,8,-8,2)
		EMEG F 0 A_FaceTarget
		EMEG F 3
		EMEG B 0 A_PlaySoundEx("weapon/mbuster", "voice", 0, 1)
		EMEG F 4 A_CustomMissile("Mega?Shot",32,8,0,2)
		EMEG F 0 A_FaceTarget
		EMEG F 3
		EMEG B 0 A_PlaySoundEx("weapon/mbuster", "voice", 0, 1)
		EMEG F 4 A_CustomMissile("Mega?Shot",32,8,8,2)
		EMEG A 2 //A_JumpIfTargetInLOS("Attack", 360)
		goto Attack
	Slide:
		EMEG F 1 A_Stop
		EMEG F 0 A_FaceTarget
		EMEG A 3
		EMEG IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII 1 A_ChangeVelocity(15.0,0,0,CVF_REPLACE|CVF_RELATIVE)
		EMEG A 5 A_Stop
		goto Seek
	PharoahSlide:
		EMEG F 0 A_SpawnItemEx("PharaohShot?Warper", 0, 0, 32)
		EMEG F 1 A_Stop
		EMEG F 0 A_FaceTarget
		EMEG F 0 Thing_SetTranslation(0, 31)
		TFOG ACB 2
		EMEG A 0 A_FaceTarget
		EMEG IIIIIIIIIIIIIIIIIIIII 1 A_ChangeVelocity(20.0,0,0,CVF_REPLACE|CVF_RELATIVE)
		EMEG A 1 A_Stop
		EMEG A 0 A_FaceTarget
		EMEG A 0 A_ChangeVelocity(0.0, random(-8.0, 8.0), 15.0, CVF_REPLACE|CVF_RELATIVE)
		EMEG R 10
		EMEG A 0 A_PlaySoundEx("weapon/pharaoh2","Voice",0,1)
		EMEG F 4 A_CustomMissile("PharaohShot3", 42, 0, 0)
	PharoahFall:
		EMEG R 1 A_CheckFloor("Seek")
		loop
	YamatoSpear:
		EMEG A 0 Thing_SetTranslation(0, 37)
		TFOG ACB 2
		EMEG F 1 A_Stop
		EMEG FFFFFF 1 A_FaceTarget
	YamatoSpearFire:
		EMEG F 0 A_JumpIFInventory("YamatoSpearAmmo", 28, "Seek")
		EMEG F 0 A_FaceTarget
		EMEG F 0 A_PlaySoundEx("weapon/mbuster","Voice",0,1)
		EMEG F 4 A_CustomMissile("YamatoSpear?",32,0,random(-14, 14),0)
		EMEG F 0 A_FaceTarget
		EMEG F 0 A_PlaySoundEx("weapon/mbuster","Voice",0,1)
		EMEG F 4 A_CustomMissile("YamatoSpear?",32,0,random(-14, 14),0)
		EMEG F 0 A_FaceTarget
		EMEG F 0 A_PlaySoundEx("weapon/mbuster","Voice",0,1)
		EMEG F 4 A_CustomMissile("YamatoSpear?",32,0,random(-14, 14),0)
		EMEG F 0 A_GiveInventory("YamatoSpearAmmo",3)
		EMEG F 0 A_JumpIfTargetInLOS("YamatoSpearFire",360)
		Goto Seek
	CentaurFlash:
		EMEG F 1 A_Stop
		EMEG F 0 A_FaceTarget
		EMEG F 1 Thing_SetTranslation(0, 51)
		TFOG ACB 2
		EMEG F 5 A_FaceTarget
		EMEG A 0 A_PlaySoundEx("weapon/centaurflash","Voice",0,1)
		EMEG AAAAAAAAAA 0 A_SpawnItemEx("CentaurFlashFX", 0, 0, 28, 256/12, 0, random2(256/12), random(0, 359))
		EMEG AAAAAAAAAA 0 A_SpawnItemEx("CentaurFlashFX", 0, 0, 28, 256/12, 0, random2(256/12), random(0, 359))
		EMEG F 0 A_FaceTarget
		EMEG F 0 A_ChangeFlag("SHOOTABLE", 0)
		EMEG F 0 A_ChangeFlag("INVULNERABLE", 1)
		EMEG FFFFF 1 A_FadeOut(0.2, 0)
		EMEG F 80 A_ChangeFlag("SOLID", false)
	CentaurFlashWait:
		EMEG FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF 0 //A_Chase("", "")
		EMEG F -1 ACS_NamedExecuteWithResult("TC_CentaurFlashTeleport")
		stop
	CentaurFlashEnd:
		EMEG A 0 A_ChangeFlag("SOLID", true)
		EMEG A 0 A_PlaySoundEx("weapons/mm6/centaurflashexplode","Body",0,1)
		EMEG AAAAAAAAAA 0 A_SpawnItemEx("CentaurFlashFX", 0, 0, 28, 256/12, 0, random2(256/12), random(0, 359))
		EMEG AAAAAAAAAA 0 A_SpawnItemEx("CentaurFlashFX", 0, 0, 28, 256/12, 0, random2(256/12), random(0, 359))
		EMEG F 1 A_JumpifCloser(64, "FadeSword")
		EMEG F 1 A_Jump(256, "FadeCharge", "FadeYamato")
		stop
	FadeSword:
		EMEG F 1 Thing_SetTranslation(0, 81)
		EMEG F 0 A_FaceTarget
		EMEG FFFFF 1 A_FadeIn(0.2)
		EMEG F 0 A_FaceTarget
		EMEG F 0 A_ChangeFlag("SHOOTABLE", 1)
		EMEG F 0 A_ChangeFlag("INVULNERABLE", 0)
		EMEG FFFFF 1 A_FaceTarget
		Goto FlameSword
	FadeYamato:
		EMEG F 1 Thing_SetTranslation(0, 37)
		EMEG F 0 A_FaceTarget
		EMEG FFFFF 1 A_FadeIn(0.2)
		EMEG F 0 A_FaceTarget
		EMEG F 0 A_ChangeFlag("SHOOTABLE", 1)
		EMEG F 0 A_ChangeFlag("INVULNERABLE", 0)
		EMEG FFFFFFFFFFFFFFFFFF 1 A_FaceTarget
		Goto YamatoSpearFire
	FadeCharge:
		EMEG F 10 A_PlaySoundEx("weapon/coilstart", "voice", 0, 1)
		EMEG F 1 Thing_SetTranslation(0, 81)
		EMEG F 0 A_FaceTarget
		EMEG F 0 A_FadeIn(0.2)
		EMEG F 1 Thing_SetTranslation(10,93)
		EMEG F 0 A_FaceTarget
		EMEG F 0 A_FadeIn(0.2)
		EMEG F 1 Thing_SetTranslation(10,94)
		EMEG F 0 A_FaceTarget
		EMEG F 0 A_FadeIn(0.2)
		EMEG F 1 Thing_SetTranslation(10,0)
		EMEG F 0 A_FaceTarget
		EMEG F 0 A_FadeIn(0.2)
		EMEG F 1 Thing_SetTranslation(10,93)
		EMEG F 0 A_FaceTarget
		EMEG F 0 A_FadeIn(0.2)
		EMEG F 0 A_ChangeFlag("SHOOTABLE", 1)
		EMEG F 0 A_ChangeFlag("INVULNERABLE", 0)
		EMEG F 1 Thing_SetTranslation(10,94)
		EMEG F 0 A_FaceTarget
		EMEG F 1 Thing_SetTranslation(10,0)
		EMEG F 0 A_FaceTarget
		EMEG F 1 Thing_SetTranslation(10,93)
		EMEG F 0 A_FaceTarget
		EMEG F 1 Thing_SetTranslation(10,94)
		EMEG F 0 A_FaceTarget
		EMEG F 1 Thing_SetTranslation(10,0)
		EMEG F 0 A_FaceTarget
		EMEG F 1 Thing_SetTranslation(10,93)
		EMEG F 0 A_FaceTarget
		EMEG F 1 Thing_SetTranslation(10,94)
		EMEG F 0 A_FaceTarget
		EMEG F 1 Thing_SetTranslation(10,0)
		EMEG F 0 A_FaceTarget
		EMEG F 1 Thing_SetTranslation(10,93)
		EMEG F 0 A_FaceTarget
		EMEG F 1 Thing_SetTranslation(10,94)
		EMEG F 0 A_FaceTarget
		EMEG F 1 Thing_SetTranslation(10,0)
		EMEG F 0 A_FaceTarget
		EMEG F 1 Thing_SetTranslation(10,93)
		EMEG F 0 A_FaceTarget
		EMEG F 1 Thing_SetTranslation(10,94)
		EMEG F 0 A_FaceTarget
		EMEG F 1 Thing_SetTranslation(10,0)
		EMEG F 0 A_FaceTarget
		EMEG F 1 Thing_SetTranslation(10,93)
		EMEG F 0 A_FaceTarget
		EMEG F 1 Thing_SetTranslation(10,94)
		EMEG F 0 A_FaceTarget
		EMEG F 1 Thing_SetTranslation(10,0)
		EMEG F 0 A_FaceTarget
		EMEG F 1 Thing_SetTranslation(10,93)
		EMEG F 0 A_FaceTarget
		EMEG F 1 Thing_SetTranslation(10,94)
		EMEG F 0 A_FaceTarget
		EMEG F 1 Thing_SetTranslation(10,0)
		EMEG F 0 A_FaceTarget
		Goto ChargeShot
	Death:
		EMEH H 0 A_FaceTarget
		EMEG H 0 A_GiveInventory("IsDead",1)
		EMEG H 0 A_Recoil(20)
		EMEG H 0 SetPlayerProperty(1, 2, 5)
		EMEG HHHHHHHHH 4 A_SpawnItemEx("BassExplode", random(-48,48), random(-8,48), random(0,48)) 
		EMEG H 0 Thing_SetTranslation(10,0)
		EMEG MNMN 15 Thing_ChangeTID(0,10)
		EMEG H 0 A_Stop
		EMEG H 0 ACS_Execute(8,0,4)
		DeathWait:
		EMEG N 0 A_SpawnItemEx("ShockFX", random(-12,12), random(-12,12),random(0,32))  
		EMEG MN 20
		loop
	TeleportOut:
		TFOG B 0 A_PlaySoundEx("misc/teleportout", "voice", 0, 1)
		TFOG BAC 3
		TFOG A 0 A_ChangeFlag("NOGRAVITY",1)
	TeleportLoop:
		TFOG A 1 ThrustThingZ(0,50,0,0)
		goto TeleportLoop
	Leave:
		EMEG B 0 A_ChangeFlag("NOCLIP",1)
		EMEG BBBBBCCCCC 1 A_ChangeVelocity(8.0,0.0,velz,CVF_REPLACE|CVF_RELATIVE)
		EMEG DDDDDEEEEE 1 A_ChangeVelocity(8.0,0.0,velz,CVF_REPLACE|CVF_RELATIVE)
		EMEG BBBBBCCCCC 1 A_ChangeVelocity(8.0,0.0,velz,CVF_REPLACE|CVF_RELATIVE)
		EMEG DDDDDEEEEE 1 A_ChangeVelocity(8.0,0.0,velz,CVF_REPLACE|CVF_RELATIVE)
		EMEG R 10 A_ChangeVelocity(6.0, 0.0, 18.0, CVF_REPLACE|CVF_RELATIVE)
	LeaveLeap:
		EMEG R 50//1 A_CheckFloor("LeaveLeap")
		EMEG R -1 A_PlaySoundEx("", "Voice", 0, 1)
		stop
}
}


actor PharaohShot?Warper
{
height 1
radius 1
+MISSILE
+NOINTERACTION
-SOLID
scale 2.5
states
{
Spawn:
PHAS BBCCDDEEFFGGHHIIJJKKJJKKJJKKJJKKJJKKJJ 1 A_Warp(AAPTR_TARGET, 0, 0, 80, 0, WARPF_COPYINTERPOLATION)
stop
}
}

actor FlameSword2? : FlameSword2
{
States
{
Spawn:
TNT1 A 0
TNT1 AAAAA 1 A_SpawnItemEx("FlameSwordTrail2?")
Goto Death
}
}

actor FlameSwordTrail2? : FlameSwordTrail2
{
damage (8)
}

actor YamatoSpear? : YamatoSpear
{
Damage (4)
}