//////////////////////
// WEAPONS ARCHIVE  //             Behold the power... of CTRL+C!!!
//////////////////////

actor WeaponArchiveCloud
{
scale 4.5
+MISSILE
height 2
radius 2
states
{
Spawn:
TNT1 A 0
TNT1 A 0 A_ChangeVelocity(0, 0, -80, 0)
W_RC O -1 A_Jump(128, "Other")
Other:
W_RC P -1
stop
}
}

/*
attack timers (how long each dude takes when theyre out)

doc - 6s
metdad - 6s
dark4 - 9s
duo - 8s
king - varies, 9s-11s
brg - 9s
mm? -
proto -
bass -
*/


actor WeaponArchiveBoss
{
//$Category MM8BDM-Bosses
Height 58
Radius 28
Scale 2.5
Obituary "%o had their data expunged by \caWeapon Archive\c-."

Health 1000
mass 99999999
speed 20
damagefactor "Misc", 0.0
damagefactor "Quick", 0.0
damagefactor "Buster", 2.5
damagefactor "ThunderBeam", 2.5
damagefactor "QuickBoomerang", 1.9
damagefactor "HardKnuckle", 3.2 //3.0
damagefactor "DrillBomb", 3.3 //2.5 
//damagefactor "GyroAttack", 2.2
damagefactor "PowerStone", 4.5 //3.9
damagefactor "YamatoSpear", 1.0
damagefactor "ScorchWheel", 3.2
damagefactor "WaterBalloon", 3.0
damagefactor "MagmaBazooka1", 2.4
damagefactor "MagmaBazooka2", 2.9

MONSTER
floatspeed 0
bouncefactor 2.0
WallBounceFactor 2.0
-COUNTKILL
-SOLID
-CANPASS
+NOBLOOD
+LOOKALLAROUND
+SLIDESONWALLS
+NOTARGETSWITCH
+NOPAIN
-DROPOFF
+BRIGHT
painchance 256
var int user_shotangle;

+INVULNERABLE
+NOCLIP
+THRUSPECIES //duometeor dies upon touching an archive when not present, dont remove
+NOGRAVITY

	states
	{
	Spawn:
	W_RC A 0	
	W_RC A -1
	stop
	
	ActivateMove:
	W_RC D 0 A_PlaySoundEX("misc/archiveawake","SoundSlot7",0,1)
	TNT1 A 0 Thing_Remove(501)
	W_RC ABC 2
	W_RC D -1
	stop
	
	Activate:
	W_RC A 0 A_ChangeFlag("NOGRAVITY", 0)
	W_RC A 0 A_ChangeFlag("NOCLIP", 0)
	W_RC A 0 A_ChangeFlag("INVULNERABLE", 0)
	W_RC D 1 A_FaceTarget
	Goto Look
		
	DeactivateMove:
	W_RC A 0 A_ChangeFlag("NOGRAVITY", 1)
	W_RC A 0 A_ChangeFlag("NOCLIP", 1)
	W_RC DB 5
	W_RC A -1
	stop
	
	Deactivate:
	W_RC A -1
	stop
	
	
	Look:
	W_RC D 1 A_LookEx(0, 0, 0, 0, 360, "See")
	loop
	See:
	W_RC D 0 A_ChangeFlag("INVULNERABLE", 0)
	W_RC D 0 A_JumpIfInventory("BossHealth2" , 9, "Start.BRG")
	W_RC D 0 A_JumpIfInventory("BossHealth2" , 8, "Start.King")
	W_RC D 0 A_JumpIfInventory("BossHealth2" , 7, "Start.Duo")
	W_RC D 0 A_JumpIfInventory("BossHealth2" , 6, "Start.Bass")
	W_RC D 0 A_JumpIfInventory("BossHealth2" , 5, "Start.Protoman")
	W_RC D 0 A_JumpIfInventory("BossHealth2" , 4, "Start.Megaman")
	W_RC D 0 A_JumpIfInventory("BossHealth2" , 3, "Start.Dark4")
	W_RC D 0 A_JumpIfInventory("BossHealth2" , 2, "Start.MetDad")
	W_RC D 0 A_JumpIfInventory("BossHealth2" , 1, "Start.Doc")
	W_RC D -1
	stop
	
	End:
	W_RC D 0 A_ChangeFlag("INVULNERABLE", 1)
	W_RC D -1 A_GiveInventory("AstroCrushAmmo", 1)
	stop
	
		
	////////////////////////////////////////////////////////////////////////////
	
	

	//Phase 1

	
	
	////////////////////////////////////////////////////////////////////////////
	
	
	Start.Doc:
	W_RC DDDDDDDDDDD 1 A_FaceTarget
	LeafStart:
	W_RC F 3 A_FaceTarget
	W_RC D 0 A_ChangeFlag("INVULNERABLE",1)
	W_RC D 0 A_GiveToTarget("EvilRobotShield", 1)
	W_RC D 0 A_PlaySoundEx("weapon/leafshield", "SoundSlot5", 1, 1)
	W_RC D 35 A_SpawnItemEx("DocLeafShield")
	W_RC D 0 A_FaceTarget
	HotLeaf:
	W_RC D 0 A_FaceTarget
	W_RC DDDDDD 2 A_SpawnItemEx("DocHeatRadius", -8, 0, 0)
	W_RC D 0 A_GiveInventory("CutterFlag",1)
	W_RC D 0 A_StopSoundEx("SoundSlot5")
	HEAM A 0 A_PlaySoundEx("weapon/atomicfire","Voice",0,1)
	W_RC D 0 A_FaceTarget
	W_RC D 0 A_SpawnItemEx("DocHotLeafDropped", 0, 48, 48, 24,0,0,random(-8,8))
	W_RC D 0 A_SpawnItemEx("DocHotLeafDropped", 0, -48, 48, 24,0,0,random(-8,8))
	W_RC D 0 A_SpawnItemEx("DocHotLeafDropped", 0, 0, 96, 24,0,0,random(-8,8))
	W_RC D 0 A_SpawnItemEx("DocHotLeafDropped", 0, 0, 0, 24,0,0,random(-8,8))
	W_RC D 0 A_SpawnItemEx("DocHotLeafStart", 0, 0, 63, 0, 0, 18)
	W_RC D 0 A_ChangeFlag("INVULNERABLE",0)
	W_RC DDDDDD 2 A_SpawnItemEx("DocHeatRadius", -8, 0, 0)
	W_RC D 0 A_SpawnItemEx("DocHotLeafStart", 0, 0, 63, 0, 0, 18)
	W_RC DDDFFF 2 A_SpawnItemEx("DocHeatRadius", -8, 0, 0)
	W_RC D 0 A_SpawnItemEx("DocHotLeafStart", 0, 0, 63, 0, 0, 18)
	W_RC DDDFFF 2 A_SpawnItemEx("DocHeatRadius", -8, 0, 0)
	W_RC D 0 A_SpawnItemEx("DocHotLeafStart", 0, 0, 63, 0, 0, 18)
	W_RC D 0 A_SpawnItemEx("Archive_DocHotLeafDropper", 0, 0, 256 , 10, 0, 0 , 0)
	W_RC D 0 A_SpawnItemEx("Archive_DocHotLeafDropper", 0, 0, 256 , 10, 0, 0 , 36)
	W_RC D 0 A_SpawnItemEx("Archive_DocHotLeafDropper", 0, 0, 256 , 10, 0, 0 , 72)
	W_RC D 0 A_SpawnItemEx("Archive_DocHotLeafDropper", 0, 0, 256 , 10, 0, 0 , 108)
	W_RC D 0 A_SpawnItemEx("Archive_DocHotLeafDropper", 0, 0, 256 , 10, 0, 0 , 144)
	W_RC D 0 A_SpawnItemEx("Archive_DocHotLeafDropper", 0, 0, 256 , 10, 0, 0 , 180)
	W_RC D 0 A_SpawnItemEx("Archive_DocHotLeafDropper", 0, 0, 256 , 10, 0, 0 , 216)
	W_RC D 0 A_SpawnItemEx("Archive_DocHotLeafDropper", 0, 0, 256 , 10, 0, 0 , 252)
	W_RC D 0 A_SpawnItemEx("Archive_DocHotLeafDropper", 0, 0, 256 , 10, 0, 0 , 288)
	W_RC D 0 A_SpawnItemEx("Archive_DocHotLeafDropper", 0, 0, 256 , 10, 0, 0 , 324)
	W_RC D 0 A_FaceTarget
	HeatUp:
	W_RC D 0 A_TakeFromTarget("EvilRobotShield", 1)
	W_RC D 0 A_SpawnItemEx("DocHeatRadius", -8, 0, 0)
	W_RC D 0 A_GiveInventory("CutterFlag",1)
	W_RC D 0 A_JumpIfInventory("CutterFlag", 10, "DashStart")
	W_RC FD 1 A_FaceTarget
	loop
	HeatUp2:
	W_RC D 0 A_TakeFromTarget("EvilRobotShield", 1)
	W_RC D 0 ThrustThingZ(0,2,0,1)
	W_RC D 0 A_ChangeFlag("NOGRAVITY",1)
	W_RC D 0 A_SpawnItemEx("DocHeatRadius", -8, 0, 0)
	W_RC D 0 A_GiveInventory("CutterFlag",1)
	W_RC D 0 A_JumpIfInventory("CutterFlag", 12, "DashStart")
	W_RC FD 1 A_FaceTarget
	loop

	DashStart:
	HEAM A 0 A_FaceTarget
	HEAM A 0 A_SpawnItemEx("DocDashFX",0,0,0)
	HEAM A 0 A_SpawnItemEx("DocDashFX",0,32,32)
	HEAM A 0 A_SpawnItemEx("DocDashFX",0,-32,-32)
	HEAM A 0 A_SpawnItemEx("DocDashFX",0,32,-32)
	HEAM A 0 A_SpawnItemEx("DocDashFX",0,-32,32)
	HEAM A 0 A_SpawnItemEx("DocDashFX",0,0,64)
	HEAM A 0 A_SpawnItemEx("DocDashFX",0,64,0)
	HEAM A 0 A_SpawnItemEx("DocDashFX",0,-64,0)
	TNT1 A 3 A_SpawnItemEx("DocDashFX",0,0,-64)
	HEAM A 0 A_FaceTarget
	HEAM A 0 A_SpawnItemEx("DocDashFX",32,0,0)
	HEAM A 0 A_SpawnItemEx("DocDashFX",32,-32,0)
	HEAM A 0 A_SpawnItemEx("DocDashFX",32,32,-0)
	HEAM A 0 A_SpawnItemEx("DocDashFX",32,0,32)
	TNT1 A 6 A_SpawnItemEx("DocDashFX",32,0,-32)
	HEAM A 0 A_FaceTarget
	HEAM A 0 A_PlaySoundEx("weapon/atomicfire","Voice",0,1)
	TNT1 A 1 A_TakeInventory("CutterFlag",9999)
	Goto Dash.Doc
	Dash.Doc:
	HEAM P 0 A_LookEx(LOF_NOSOUNDCHECK,0,80,0,360,"DashEnd")
	HEAM A 0 A_FaceTarget
	HEAM A 0 A_Stop
	HEAM A 0 A_SpawnItemEx("DocDashDamager",0,0,0,50)
	HEAM A 0 A_GiveInventory("CutterFlag",1)
	HEAM A 0 A_JumpIfInventory("CutterFlag",18,"DashEnd")
	TNT1 A 1 A_Recoil(-45)
	loop
	DashEnd:
	HEAM A 0 A_Stop
	HEAM A 0 A_SpawnItemEx("DocDashDamager",0,0,0,50)
	TNT1 A 1 A_Recoil(-45)
	HEAM A 0 A_Stop
	HEAM A 0 A_SpawnItemEx("DocDashDamager",0,0,0,50)
	TNT1 A 1 A_Recoil(-45)
	HEAM A 0 A_Stop
	HEAM A 0 A_SpawnItemEx("DocDashDamager",0,0,0,50)
	TNT1 A 1 A_Recoil(-45)
	HEAM A 0 A_Stop
	HEAM A 0 A_SpawnItemEx("DocDashDamager",0,0,0,50)
	TNT1 A 1 A_Recoil(-45)
	HEAM A 0 A_Stop
	HEAM A 0 A_SpawnItemEx("DocDashDamager",0,0,0,50)
	TNT1 A 1 A_Recoil(-45)
	HEAM A 0 A_Stop
	HEAM A 0 A_SpawnItemEx("DocDashDamager",0,0,0,50)
	TNT1 A 1 A_Recoil(-45)
	HEAM A 0 A_Stop
	HEAM A 0 A_SpawnItemEx("DocDashDamager",0,0,0,50)
	TNT1 A 1 A_Recoil(-45)
	HEAM A 0 A_Stop
	HEAM A 0 A_SpawnItemEx("DocDashDamager",0,0,0,50)
	TNT1 A 1 A_Recoil(-45)
	HEAM P 0 A_Stop
	W_RC D 0 A_ChangeFlag("NOGRAVITY",0)
	W_RC D 8 A_TakeInventory("CutterFlag",9999)
	W_RC D 8 A_FaceTarget
	W_RC D 0 A_JumpIfInventory("FlameBlastAmmo",1,"Land.Doc")
	W_RC D 0 A_GiveInventory("FlameBlastAmmo",1)
	Goto HeatUp2

	Land.Doc:
	W_RC D 0 A_Stop
	W_RC D 0 A_TakeInventory("FlameBlastAmmo",999)
	W_RC D 0 //A_SpawnItemEx("EnkerMelee")
	W_RC DDDDDDDDDDDDDDD 4 A_FaceTarget
	goto End
	
	////////////////////////////////////////////////////////////////////////////
	
	
	////////////////////////////////////////////////////////////////////////////
	
	Start.MetDad:
	W_RC DDDDDDDDDD 1 A_FaceTarget
	W_RC F 3
	W_RC D 0 A_JumpIfInventory("CutterFlag",2,"HyperJump")
	W_RC D 0 A_GiveInventory("CutterFlag",1)
	W_RC D 0 A_StopSoundEx("SoundSlot7")
	W_RC D 0 A_SpawnItemEx("MetDaddyJumpFog")
	W_RC D 0 A_JumpIfCloser(384,"JumpSmall")
	W_RC D 0 ThrustThingZ(0,60,0,0)
	W_RC E 5 A_Recoil(-25)
	Falling.MetDad:
	W_RC E 1 A_JumpIf(floorz-z==0,"Land.MetDad")
	W_RC E 0 ThrustThingZ(1,2,0,0)
	loop
	JumpSmall:
	W_RC D 0 ThrustThingZ(0,70,0,0)
	W_RC E 10 A_Recoil(random(-5,-15))
	goto Falling.MetDad
	Land.metDad:
	W_RC D 0 A_SpawnItemEx("Archive_MetDaddyRiseFX")
	W_RC D 0 A_PlaySoundEx("misc/hugequake", "SoundSlot7")
	W_RC D 0 A_Stop
	W_RC D 0 A_Quake(3,32,0,0,0)
	W_RC D 0 A_Explode(25, 300, XF_NOTMISSILE, 0, 35)
	W_RC D 0 ACS_ExecuteAlways(5,0,10)
	//W_RC D 0 A_SpawnItemEx("Archive_MetSpawner",-128,0,0)
	//W_RC D 0 A_SpawnItemEx("Archive_MetSpawner",128,-64,0)
	//W_RC D 0 A_SpawnItemEx("Archive_MetSpawner",64,128,0) //goodbye sweet prince(s)
	//W_RC D 0 A_SpawnItemEx("Archive_MetSpawner",64,-128,0)
	W_RC EDFDFDFDFDDDD 2
	goto Start.MetDad
	
	HyperJump:
	W_RC D 0 A_PlaySoundEx("weapon/watershieldburst", "SoundSlot7", 0, 1)
	W_RC D 0 A_SpawnItemEx("MetDaddyJumpFog")
	W_RC D 0 ThrustThingZ(0,100,0,0)
	W_RC D 0 A_FaceTarget
	W_RC EEEEEEEEEEE 2 A_SpawnItemEx("Archive_MetDaddyAfterImage",-1)
	W_RC D 0 A_Setgravity(0.0)
	W_RC E 15 A_Stop
	W_RC D 0 ThrustThingZ(0, 300, 1, 1)
	HyperFall:
	W_RC D 0 A_FaceTarget
	W_RC D 0 A_SetGravity(1.0)
	W_RC D 0 A_SpawnItemEx("Archive_MetDaddyAfterImage",-1)
	W_RC E 1 A_JumpIf(floorz==z, "HyperLand")
	loop
	HyperLand:
	W_RC D 0 A_SpawnItemEx("Archive_MetDaddyRiseFX")
	W_RC D 0 A_PlaySoundEx("misc/hugequake", "SoundSlot7",0,1)
	W_RC D 0 A_Explode(90, 300, XF_NOTMISSILE, 0, 90)
	//W_RC D 0 ACS_ExecuteAlways(5,0,10)
	//W_RC D 0 ACS_ExecuteAlways(5,0,48)
	W_RC D 0 A_FaceTarget
	W_RC D 0 A_SpawnItemEx("Archive_MetDaddyJunkWaveProjectile",0,0,0,12)
	W_RC D 0 A_SpawnItemEx("Archive_MetDaddyJunkWave",0,0,0,0,50)
	W_RC D 0 A_SpawnItemEx("Archive_MetDaddyJunkWave",0,0,0,0,-50)
	W_RC EDFDFDFDFDDDD 3 
	W_RC D 30
	W_RC D 0 A_TakeInventory("CutterFlag",999)
	W_RC DDDDDD 8 A_FaceTarget
	goto End
	
	////////////////////////////////////////////////////////////////////////////
	
	
	////////////////////////////////////////////////////////////////////////////
	
	Start.Dark4:
	W_RC DDDDDDDDDDD 1 A_FaceTarget
	LeapBack:
	W_RC D 5 A_ChangeVelocity(-30, 0, 5, CVF_RELATIVE)
	Falling2.Dark4:
	W_RC D 1 A_JumpIf(floorz==z, 1)
	loop
	W_RC D 0 A_Stop
	Shoot.Dark4:
	W_RC D 0 A_TakeInventory("CutterFlag", 999)
	W_RC D 10 ACS_Execute(10,0)
	W_RC D 0 A_PlaySoundEx("misc/darkthrow", "SoundSlot2", 0, 1)
	W_RC D 4 A_FaceTarget
	W_RC D 0 A_SpawnItemEx("DarkMelee")
	W_RC D 0 A_FaceTarget
	W_RC D 0 A_PlaySoundEx("weapon/coilexplode", "Voice", 0, 1)
	W_RC F 4 A_CustomMissile("DarkProjectile", 40, 0, random(-1,1))
	W_RC E 4 A_GiveInventory("CutterFlag",1)
	W_RC D 8
	
	W_RC D 0 A_JumpIfInventory("CutterFlag",4,1)
	goto Shoot.Dark4+4
 
 	W_RC D 0 A_TakeInventory("CutterFlag", 999)
	W_RC D 0 A_JumpIfInventory("WildCoilAmmo",1,"End.Dark4")
	W_RC D 0 A_GiveInventory("WildCoilAmmo",1)

	W_RC D 5 A_FaceTarget
	W_RC D 0 A_PlaySoundEx("misc/darkthrow", "SoundSlot2", 0, 1)
	W_RC D 5 A_FaceTarget
	W_RC D 5 A_FaceTarget
	W_RC D 0 A_SpawnItemEx("DarkShieldFire", 40, 0, 0, 30, 0, 0 , 0)
	W_RC D 0 A_SpawnItemEx("DarkShieldFire", 40, 0, 0, 30, 0, 0 , 180) 
	W_RC D 5 ACS_Terminate(10,0)
	W_RC D 5
	W_RC F 2
	W_RC D 0 A_Jump(256, "LeapLeft", "LeapRight", "LeapFront")
	LeapLeft:
	W_RC D 0 A_FaceTarget
	W_RC D 5 A_ChangeVelocity(20, 8, 15, CVF_RELATIVE)
	Goto Falling.Dark4
	LeapRight:
	W_RC D 0 A_FaceTarget
	W_RC D 5 A_ChangeVelocity(20, -8, 15, CVF_RELATIVE)
	Goto Falling.Dark4
	LeapFront:
	W_RC D 0 A_FaceTarget
	W_RC D 5 A_ChangeVelocity(30, 0, 15, CVF_RELATIVE)
	Goto Falling.Dark4
	Falling.Dark4:
	W_RC D 1 A_JumpIf(floorz==z, "Land.Dark4")
	loop
	Land.Dark4:
	W_RC D 0 A_TakeInventory("LeafShieldAmmo", 999)
	W_RC D 0 A_SpawnItemEx("DarkMelee")
	W_RC F 5 A_Stop
	LandWait:
	W_RC D 1 A_FaceTarget
	W_RC D 0 A_JumpIfInventory("CutterFlag", 2, "Shoot.Dark4")
	loop
	End.Dark4:
	W_RC D 5 A_FaceTarget
	W_RC D 0 A_PlaySoundEx("misc/darkthrow", "SoundSlot2", 0, 1)
	W_RC D 5 A_FaceTarget
	W_RC D 5 A_FaceTarget
	W_RC D 0 A_SpawnItemEx("Archive_DarkShieldFire2", 40, 0, 0, 40, 0, 0 , 0)
	W_RC D 0 A_SpawnItemEx("Archive_DarkShieldFire2", 40, 0, 0, 40, 0, 0 , 180) 
	W_RC D 5 ACS_Terminate(10,0)
	W_RC D 0 A_TakeInventory("CutterFlag", 999)
	W_RC D 0 A_TakeInventory("WildCoilAmmo", 999)
	W_RC D 10
	W_RC D 0 
	goto End
	
		
	////////////////////////////////////////////////////////////////////////////
	
	

	//Phase 2

	
	
	////////////////////////////////////////////////////////////////////////////
	
	
	Start.Duo:
	W_RC DDDDDDDDDDD 1 A_FaceTarget
	W_RC D 0 A_Stop
	W_RC D 0 A_ChangeFlag("CANPASS",1)
	W_RC D 0 A_Chase
	W_RC D 0 A_JumpIfInventory("FlashBombAmmo",2,"Rise")
	W_RC D 0 A_JumpIfInventory("FlashBombAmmo",1,"Charge")
	Ranged:
	W_RC D 6 A_FaceTarget
	W_RC D 0 A_PlaySound("weapon/cfire")
	W_RC E 4 A_CustomMissile("Archive_DuoFist",35,-12,random(-5,5),0)
	W_RC F 4
	W_RC D 6 A_FaceTarget
	W_RC D 0 A_PlaySound("weapon/cfire")
	W_RC E 4 A_CustomMissile("Archive_DuoFist",35,-12,random(-5,5),0)
	W_RC F 4
	W_RC D 6 A_FaceTarget
	W_RC D 0 A_PlaySound("weapon/cfire")
	W_RC E 4 A_CustomMissile("Archive_DuoFist",35,-12,random(-5,5),0)
	W_RC F 4
	W_RC D 0 A_GiveInventory("FlashBombAmmo",1)
	Goto Start.Duo
	Charge:
	W_RC F 5 A_PlaySound("weapon/superboost")
	W_RC D 0 A_FaceTarget
	W_RC E 4 A_Recoil(-90)
	Rush:
	W_RC D 0 A_JumpIfCloser(128,"GroundSlam")
	W_RC D 0 A_JumpIfInventory("CutterFlag",9,"GroundSlam")
	W_RC E 1 A_GiveInventory("CutterFlag",1)
	loop
	GroundSlam:
	W_RC D 0 A_GiveInventory("FlashBombAmmo",1)
	W_RC D 0 A_Stop
	W_RC D 0 A_TakeInventory("CutterFlag",999)
	W_RC EEE 3
	W_RC D 0 A_FaceTarget
	W_RC D 0 A_PlaySound("misc/hugequake2")
	W_RC F 20 A_SpawnItemEx("Archive_DuoShockWave")
	W_RC DD 2 A_FaceTarget
	Goto Start.Duo
	
	Rise:
	W_RC D 0 A_ChangeFlag("NOGRAVITY",1)
	W_RC D 0 A_FaceTarget
	W_RC D 0 ThrustThingZ(0,10,0,1)
	W_RC D 0 A_PlaySound("weapon/pcharge")
	W_RC D 0 A_SpawnItemEX("Archive_DuoMeteorFadein",0,-2,10,0,0,momz)
	W_RC D 0 A_SpawnItemEX("Archive_DuoMeteorFadein",0,2,10,0,0,momz)
	W_RC GGG 1 A_SpawnItemEX("Archive_DuoAfterImage1",-5,0,-2,0,0,momz)
	W_RC HHH 1 A_SpawnItemEX("Archive_DuoAfterImage2",-5,0,-2,0,0,momz)
	W_RC III 1 A_SpawnItemEX("Archive_DuoAfterImage3",-5,0,-2,0,0,momz)
	W_RC DDD 1 A_SpawnItemEX("Archive_DuoAfterImage4",-5,0,-2,0,0,momz)
	W_RC GG 1 A_SpawnItemEX("Archive_DuoAfterImage1",-5,0,-2,0,0,momz)
	W_RC HH 1 A_SpawnItemEX("Archive_DuoAfterImage2",-5,0,-2,0,0,momz)
	W_RC II 1 A_SpawnItemEX("Archive_DuoAfterImage3",-5,0,-2,0,0,momz)
	W_RC DD 1 A_SpawnItemEX("Archive_DuoAfterImage4",-5,0,-2,0,0,momz)
	W_RC GG 1 A_SpawnItemEX("Archive_DuoAfterImage1",-5,0,-2,0,0,momz)
	W_RC HH 1 A_SpawnItemEX("Archive_DuoAfterImage2",-5,0,-2,0,0,momz)
	W_RC II 1 A_SpawnItemEX("Archive_DuoAfterImage3",-5,0,-2,0,0,momz)
	W_RC DD 1 A_SpawnItemEX("Archive_DuoAfterImage4",-5,0,-2,0,0,momz)
	W_RC G 1 A_SpawnItemEX("Archive_DuoAfterImage1",-5,0,-2,0,0,momz)
	W_RC H 1 A_SpawnItemEX("Archive_DuoAfterImage2",-5,0,-2,0,0,momz)
	W_RC I 1 A_SpawnItemEX("Archive_DuoAfterImage3",-5,0,-2,0,0,momz)
	W_RC D 1 A_SpawnItemEX("Archive_DuoAfterImage4",-5,0,-2,0,0,momz)
	W_RC D 0 A_ChangeFlag("NOBLOCKMAP",1)
	W_RC D 0 A_ChangeFlag("MISSILE",1)
	W_RC D 0 A_ChangeFlag("RIPPER",1)
	W_RC D 0 A_ChangeFlag("SHOOTABLE",0)
	W_RC D 0 A_ChangeFlag("DOOMBOUNCE",1)
	W_RC D 0 A_Stop
	W_RC D 0 ThrustThingZ(0,40,1,0)
	W_RC D 0 A_FaceTarget
	W_RC D 0 A_Recoil(-40)
	Goto Ball
	Ball:
	DUOR L 0 A_GiveInventory("CutterFlag",1)
	DUOR L 0 Radius_Quake(5, 10, 0, 100, 0)
	DUOR L 0 A_SpawnItemEx("GigaFistFX",0,0,12)
	DUOR LLMM 1 A_Explode(10,80,XF_NOTMISSILE)
	DUOR N 0 A_JumpIfInventory("CutterFlag",30,"Fall")
	loop
	Fall:
	W_RC D 0 A_FaceTarget
	W_RC D 0 //A_ChangeVelocity(20,0,0,CVF_RELATIVE|CVF_REPLACE)
	W_RC D 0 A_ChangeFlag("SOLID",0)
	W_RC D 0 A_TakeInventory("CutterFlag",999)
	W_RC D 0 A_ChangeFlag("MISSILE",0)
	W_RC D 0 A_ChangeFlag("SHOOTABLE",1)
	W_RC D 0 A_ChangeFlag("RIPPER",0)
	W_RC D 0 A_ChangeFlag("DOOMBOUNCE",0)
	W_RC D 0 A_ChangeFlag("NOBLOCKMAP",0)
	W_RC D 10
	W_RC D 0 A_ChangeFlag("NOGRAVITY",0)
	Goto Falling
	Falling:
	W_RC D 1 A_JumpIf(z==floorz,"End.Duo")
	loop
	End.Duo:
	W_RC D 0 A_TakeInventory("FlashBombAmmo",9999)
	W_RC D 0 A_ChangeFlag("CANPASS",1)
	W_RC D 0 A_ChangeFlag("SOLID",1)
	W_RC D 32
	W_RC DD 4 A_FaceTarget
	goto End
	
	////////////////////////////////////////////////////////////////////////////
	
	
	////////////////////////////////////////////////////////////////////////////
	
	Start.King:
	W_RC D 0 A_Chase
	W_RC DDDDDDDDDDD 1 A_FaceTarget
	Dash.King:
	W_RC D 0 A_GiveInventory("FlameSwordAmmo",1)
	W_RC D 0 A_GiveInventory("CutterFlag",1)
	W_RC D 0 A_SpawnItemEx("Archive_KingAxeDash",40)
	W_RC D 0 A_SpawnItemEx("Archive_KingAxeDashFX",0)
	W_RC D 0 A_SpawnItemEx("Archive_KingAxeDashFX2")
	W_RC D 0 A_PlaySoundEx("misc/kingswing","Voice")
	W_RC GGHHIIDD 1 A_ChangeVelocity(15,0,0,CVF_RELATIVE|CVF_REPLACE)
	W_RC G 0 A_JumpIfInventory("CutterFlag",15,"Chance")
	W_RC G 0 A_JumpIfInventory("FlameSwordAmmo",3,"Reset")
	loop
	Reset:
	W_RC A 0 A_FaceTarget
	W_RC G 0 A_TakeInventory("FlameSwordAmmo",999)
	Goto Dash.King
	Chance:
	W_RC D 0 A_Stop
	W_RC D 0 A_Jump(128,"Dash.King")
	W_RC A 0 A_TakeInventory("CutterFlag",999)
	W_RC D 20 A_FaceTarget
	Blast:
	W_RC DFDFDFDFDFDFDF 1 A_FaceTarget
	Blast2:
	W_RC D 0 A_Stop
	W_RC DFDF 1 A_FaceTarget
	W_RC D 0 A_GiveInventory("CutterFlag",1)
	W_RC D 0 A_PlaySoundEx("misc/kingblast","Voice")
	W_RC D 0 A_SpawnItemEx("KingXProjectile",0,0,4,35,0,0,0,SXF_NOCHECKPOSITION)
	W_RC E 10 A_FaceTarget
	W_RC DF 5
	W_RC D 0 A_JumpIfInventory("CutterFlag",3,"End.King")
	W_RC D 6 A_ChangeVelocity(25,10,random(5,15),CVF_RELATIVE|CVF_REPLACE)
	Goto Falling.King
	Falling.King:
	W_RC D 1 A_JumpIf(z==floorz, "Blast2")
	loop
	End.King:
	W_RC A 0 A_TakeInventory("CutterFlag",999)
	W_RC D 10
	goto End
	
	////////////////////////////////////////////////////////////////////////////
	
	
	////////////////////////////////////////////////////////////////////////////
	
	Start.BRG:
	W_RC DDDDDDDDDDD 1 A_FaceTarget
	W_RC D 0 A_JumpIfInventory("CutterFlag",2,"Illusion")
	W_RC D 0 A_JumpIfInventory("YamatoSpearAmmo",1,1)
	Goto LeapStrike
	W_RC A 0 A_Jump(256,"Strike", "LeapStrike")
	Strike:
	W_RC D 0 A_GiveInventory("CutterFlag",1)
	W_RC D 0 A_GiveInventory("YamatoSpearAmmo",1)
	W_RC F 2 A_FaceTarget
	W_RC D 0 A_CustomMissile("Archive_BusterRodRod",32,0,0,2,0)
	W_RC E 20 
	W_RC D 5
	W_RC D 0 A_JumpIfInventory("CopyVisionAmmo",1,"End.BRG")
	Goto Start.BRG
	LeapStrike:
	W_RC D 0 A_GiveInventory("CutterFlag",1)
	W_RC D 0 A_GiveInventory("YamatoSpearAmmo",1)
	W_RC D 12 A_ChangeVelocity(25,random(-15,15),15,CVF_RELATIVE|CVF_REPLACE)
	LeapStrikeOut:
	W_RC D 0 A_Stop
	W_RC D 0 A_ChangeFlag("NOGRAVITY",1)
	W_RC F 2 A_FaceTarget
	W_RC D 0 A_CustomMissile("Archive_BusterRodRod",32,0,0,0,0)
	W_RC E 20 
	W_RC D 5
	W_RC D 0 A_ChangeFlag("NOGRAVITY",0)
	Goto Falling.BRG
	Falling.BRG:
	W_RC D 1 A_Jumpif(floorz==z, "Start.BRG")
	loop
	Illusion:
	W_RC D 0 ACS_Execute(11,0,0)
	W_RC F 4 A_FaceTarget
	W_RC D 0 A_ChangeVelocity(30,0,25,CVF_RELATIVE|CVF_REPLACE)
	LeapMiddle:
	W_RC D 1 //A_JumpIf(x,"IllusionScatter")
	loop
	IllusionScatter:
	W_RC D 0 A_Stop
	W_RC D 0 A_PlaySoundEx("misc/brgillusion","Voice",0,1)
	W_RC D 0 A_SetAngle(random(0,360))
	W_RC D 0 A_ChangeVelocity(25,0,0,CVF_RELATIVE|CVF_REPLACE)
	W_RC D 0 A_SpawnItemEx("Archive_BusterRodIllusion",0,0,0,25,0,0,45)
	W_RC D 0 A_SpawnItemEx("Archive_BusterRodIllusion",0,0,0,25,0,0,90)
	W_RC D 0 A_SpawnItemEx("Archive_BusterRodIllusion",0,0,0,25,0,0,135)
	W_RC D 0 A_SpawnItemEx("Archive_BusterRodIllusion",0,0,0,25,0,0,180)
	W_RC D 0 A_SpawnItemEx("Archive_BusterRodIllusion",0,0,0,25,0,0,-90)
	W_RC D 0 A_SpawnItemEx("Archive_BusterRodIllusion",0,0,0,25,0,0,-45)
	W_RC D 0 A_SpawnItemEx("Archive_BusterRodIllusion",0,0,0,25,0,0,-135)
	IllusionFall:
	W_RC D 0 ThrustThingZ(0,2,1,1)
	W_RC D 1 A_Jumpif(floorz==z, "IllusionLand")
	loop
	IllusionLand:
	W_RC D 0 A_Stop
	W_RC D 0 A_SetAngle(180+angle)
	W_RC D 130
	W_RC D 0 A_GiveInventory("CopyVisionAmmo",1)
	Leap:
	W_RC F 2
	W_RC D 8 A_ChangeVelocity(20,0,10,CVF_RELATIVE|CVF_REPLACE)
	Falling2.BRG:
	W_RC D 1 A_Jumpif(floorz==z, 1)
	loop
	W_RC D 0 A_Stop
	Goto Strike
	End.BRG:
	W_RC D 0 A_TakeInventory("CutterFlag",999)
	W_RC D 0 A_TakeInventory("CopyVisionAmmo",999)
	W_RC D 0 A_TakeInventory("YamatoSpearAmmo",999)
	W_RC D 10
	goto End
	
		
	////////////////////////////////////////////////////////////////////////////
	
	

	//Phase 3

	
	
	////////////////////////////////////////////////////////////////////////////
	
	
	Start.Megaman:
	W_RC DDDDDDDDDDD 1 A_FaceTarget
	W_RC D 0 A_JumpIfInventory("FlameSwordAmmo",1,"Falling.Megaman")
	W_RC D 0 A_JumpIfInventory("CentaurFlashAmmo",1,"CentaurFlash")
	W_RC D 0 A_GiveInventory("FlameSwordAmmo",1)
	FireWire:
	W_RC D 0 A_FaceTarget
	W_RC D 0 A_SetAngle(angle+random(-12.4, 12.4))
	W_RC D 0 A_Stop
	W_RC D 0 A_PlaySoundEx("weapon/WireAdp", "voice", 0, 1)
	W_RC D 0 A_SpawnItemEx("BossWireAdaptorHook",-2,0,32,1)
	Goto WireLoop
	WireLoop:
	W_RC D 1 A_GiveInventory("QuickBoomerangAmmo",1)
	W_RC D 0 A_JumpIfInventory("QuickBoomerangAmmo",40,"PharaohSlide")
	W_RC D 1 A_JumpIf(momx + momy == 0, "WireLoop")
	W_RC D 0 A_TakeInventory("QuickBoomerangAmmo",9999)
	WireFlyLoop:
	W_RC D 1 A_FaceTarget
	W_RC D 0 A_JumpIfCloser(128, "FlameSword")
	W_RC D 0 A_JumpIfInventory("WireAdaptorDelay", 1, "WireFlyLoop")
	Goto Start.Megaman
	FlameSword:
	W_RC F 2 A_FaceTarget
	W_RC D 0 A_FaceTarget
	W_RC D 0 A_PlaySoundEx("weapon/flamesword", "Voice", 0, 1)
	W_RC E 1 A_CustomMissile("FlameSword2?",32,16,-50,2,20)
	W_RC E 1 A_CustomMissile("FlameSword2?",32,8,-25,2,10)
	W_RC E 1 A_CustomMissile("FlameSword2?",32,0,0,2,0)
	W_RC E 1 A_CustomMissile("FlameSword2?",32,-8,25,2,-5)
	W_RC E 1 A_CustomMissile("FlameSword2?",32,-16,50,2,-10)
	FlameSwordEnd:
	W_RC D 1 A_FaceTarget
	W_RC D 0 A_JumpIfInventory("CentaurFlashAmmo", 1, "End.Megaman")
	W_RC D 0 A_JumpIfInventory("WireAdaptorDelay", 1, "FlameSwordEnd")
	Goto Start.Megaman
	Falling.Megaman:
	W_RC D 0 A_TakeInventory("FlameSwordAmmo",9999)
	W_RC D 1 A_CheckFloor("PharaohSlide")
	loop
	PharaohSlide:
	W_RC D 0 A_TakeInventory("FlameSwordAmmo",9999)
	W_RC D 0 A_GiveInventory("CentaurFlashAmmo",1)
	W_RC D 0 A_SpawnItemEx("Archive_PharaohShot?Warper", 0, 0, 32)
	W_RC D 0 A_Stop
	W_RC D 0 A_FaceTarget
	W_RC MMMMMMMMMMMMMMMMMMMMM 1 A_ChangeVelocity(20.0,0,0,CVF_REPLACE|CVF_RELATIVE)
	W_RC D 0 A_Stop
	W_RC D 0 A_FaceTarget
	W_RC D 0 A_ChangeVelocity(0.0, random(-8.0, 8.0), 15.0, CVF_REPLACE|CVF_RELATIVE)
	W_RC DDDDF 2
	W_RC D 0 A_PlaySoundEx("weapon/pharaoh2","Voice",0,1)
	W_RC F 4 A_CustomMissile("Archive_PharaohShot3", 42, 0, 0)
	PharaohFall:
	W_RC D 1 A_CheckFloor("Start.Megaman")
	loop
	CentaurFlash:
	W_RC D 0 A_Stop
	W_RC DDDDDDDDD 5 A_FaceTarget
	W_RC D 0 A_PlaySoundEx("weapon/centaurflash","Voice",0,1)
	W_RC DDDDDDDDDD 0 A_SpawnItemEx("CentaurFlashFX", 0, 0, 28, 256/12, 0, random2(256/12), random(0, 359))
	W_RC DDDDDDDDDD 0 A_SpawnItemEx("CentaurFlashFX", 0, 0, 28, 256/12, 0, random2(256/12), random(0, 359))
	W_RC D 0 A_FaceTarget
	W_RC D 0 A_ChangeFlag("SHOOTABLE", 0)
	W_RC D 0 A_ChangeFlag("INVULNERABLE", 1)
	W_RC DDDDD 1 A_FadeOut(0.2, 0)
	W_RC D 80
	W_RC DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD 0 A_Chase("", "")
	W_RC D 0 A_PlaySoundEx("weapons/mm6/centaurflashexplode","Body",0,1)
	W_RC DDDDDDDDDD 0 A_SpawnItemEx("CentaurFlashFX", 0, 0, 28, 256/12, 0, random2(256/12), random(0, 359))
	W_RC DDDDDDDDDD 0 A_SpawnItemEx("CentaurFlashFX", 0, 0, 28, 256/12, 0, random2(256/12), random(0, 359))
	W_RC D 1 A_JumpIfCloser(256,"FadeSword")
	goto FadePharaoh
	FadeSword:
	W_RC D 0 A_FaceTarget
	W_RC DDDDD 1 A_FadeIn(0.2)
	W_RC D 0 A_FaceTarget
	W_RC D 0 A_ChangeFlag("SHOOTABLE", 1)
	W_RC D 0 A_ChangeFlag("INVULNERABLE", 0)
	W_RC D 1 A_FaceTarget
	Goto FlameSword
	FadePharaoh:
	W_RC D 0 A_FaceTarget
	W_RC D 0 A_SpawnItemEX("Archive_PharaohShot?Warper2",0,0,32)
	W_RC DDDDD 1 A_FadeIn(0.2)
	W_RC D 0 A_FaceTarget
	W_RC D 0 A_ChangeFlag("SHOOTABLE", 1)
	W_RC D 0 A_ChangeFlag("INVULNERABLE", 0)
	W_RC DDDFF 1 A_FaceTarget
	W_RC D 0 A_PlaySoundEx("weapon/pharaoh2","Voice",0,1)
	W_RC E 4 A_CustomMissile("Archive_PharaohShot3", 42, 0, 0)
	W_RC D 0 A_JumpIfInventory("CentaurFlashAmmo", 1, "End.Megaman")
	End.MegaMan:
	W_RC D 0 A_TakeInventory("CentaurFlashAmmo",9999)
	W_RC D 0 A_TakeInventory("QuickBoomerangAmmo",9999)
	W_RC D 28
	Goto End
	
	////////////////////////////////////////////////////////////////////////////
	
	
	////////////////////////////////////////////////////////////////////////////
	
	Start.Protoman:
	W_RC DDDDDDDDDDD 1 A_FaceTarget
	W_RC D 0 A_TakeInventory("CutterFlag", 9999)
	W_RC D 0 A_JumpIfInventory("MagmaBazookaAmmo",3,"End.Protoman")
	W_RC D 0 A_JumpIfInventory("MagmaBazookaAmmo",1,"ShieldToss")
	Hop:
	W_RC F 2 A_FaceTarget 
	W_RC D 3 A_ChangeVelocity(3,0,15,CVF_RELATIVE|CVF_REPLACE)
	W_RC D 1 
	W_RC D 0 A_FaceTarget
	W_RC D 0 A_PlaySoundEx("misc/devilfire", "Voice", 0, 1)
	W_RC E 5 A_CustomMissile("ProtoBossBuster", 48, 0, 0)
	W_RC D 0 A_FaceTarget
	W_RC D 0 A_PlaySoundEx("misc/devilfire", "Voice", 0, 1)
	W_RC E 5 A_CustomMissile("ProtoBossBuster", 48, 0, 0)
	Falling.Protoman:
	W_RC D 1 A_Jumpif(floorz==z, "HopLand")
	loop
	HopLand:
	W_RC D 0 A_PlaySoundEx("misc/protoland", "Voice", 0, 1)
	W_RC F 2 A_Stop
	W_RC D 0 A_GiveInventory("CutterFlag",1)
	W_RC D 0 A_JumpIfInventory("CutterFlag", 4, "HopEnd")
	W_RC D 0 A_JumpIfInventory("CutterFlag", 3, "Jump.Protoman")
	Goto Hop
	HopEnd:
	W_RC FD 5
	Goto Dash.Protoman
	Jump.Protoman:
	W_RC F 3 A_FaceTarget 
	W_RC D 3 A_ChangeVelocity(10,0,18,CVF_RELATIVE|CVF_REPLACE)
	W_RC D 1 
	W_RC D 0 A_FaceTarget
	W_RC D 0 A_PlaySoundEx("misc/devilfire", "Voice", 0, 1)
	W_RC E 2 A_CustomMissile("ProtoBossBuster", 48, 0, -32)
	W_RC D 0 A_PlaySoundEx("misc/devilfire", "Voice", 0, 1)
	W_RC E 2 A_CustomMissile("ProtoBossBuster", 48, 0, -16)
	W_RC D 0 A_PlaySoundEx("misc/devilfire", "Voice", 0, 1)
	W_RC E 2 A_CustomMissile("ProtoBossBuster", 48, 0, -8)
	W_RC D 0 A_PlaySoundEx("misc/devilfire", "Voice", 0, 1)
	W_RC E 2 A_CustomMissile("ProtoBossBuster", 48, 0, 0)
	W_RC D 0 A_PlaySoundEx("misc/devilfire", "Voice", 0, 1)
	W_RC E 2 A_CustomMissile("ProtoBossBuster", 48, 0, 8)
	W_RC D 0 A_PlaySoundEx("misc/devilfire", "Voice", 0, 1)
	W_RC E 2 A_CustomMissile("ProtoBossBuster", 48, 0, 16)
	W_RC D 0 A_PlaySoundEx("misc/devilfire", "Voice", 0, 1)
	W_RC E 2 A_CustomMissile("ProtoBossBuster", 48, 0, 32)
	Goto Falling.Protoman
	
	Dash.Protoman:
	W_RC D 0 A_TakeInventory("CutterFlag", 9999)
	W_RC D 15 A_FaceTarget
	W_RC D 0 A_PlaySoundEx("weapon/tengudash", "Voice", 0, 1)
	W_RC D 0 A_FaceTarget
	DashLoop:
	W_RC D 0 A_ChangeVelocity(27,0,0,CVF_RELATIVE|CVF_REPLACE)
	W_RC D 0 A_FaceTarget
	W_RC J 1 A_JumpIfCloser(64, "DashPass")
	W_RC D 0 A_ChangeVelocity(27,0,0,CVF_RELATIVE|CVF_REPLACE)
	W_RC D 0 A_FaceTarget
	W_RC J 1 A_JumpIfCloser(64, "DashPass")
	W_RC D 0 A_SpawnItemEx("ProtoDust", -32, 0, 0)
	loop
	DashPass:
	W_RC D 0 ACS_Execute(12,0,0)
	W_RC DDDDDDDDDDDDDDD 1 A_ChangeVelocity(30,0,0,CVF_RELATIVE|CVF_REPLACE)
	DashHit:
	W_RC D 15 A_Stop
	W_RC D 0 A_GiveInventory("MagmaBazookaAmmo",1)
	Goto Start.ProtoMan
	
	ShieldToss:
	W_RC D 0 A_TakeInventory("MagmaBazookaAmmo",9999)
	W_RC D 0 A_FaceTarget
	W_RC E 5 A_SpawnItemEx("Archive_ProtoShieldAttack", 0, 0, 32, 23, 0, 5, random(-30,30))
	W_RC FDD 4
	W_RC D 0 ACS_Execute(12,0,1)
	ShieldCharge:
	W_RC D 0 A_PlaySoundEx("weapon/pcharge", "Voice", 0, 1)
	W_RC FFFFFDDDDDFFFFDDDDFFFDDDFFDDFDFDFDFDFDFD 1 
	ShieldShot2:
	W_RC D 1 ACS_Execute(12,0,2)
	ShieldShot:
	W_RC D 0 A_GiveInventory("MagmaBazookaAmmo",1)
	W_RC D 0 A_PlaySoundEx("weapon/pshot", "Voice", 0, 1)
	W_RC E 6 A_SpawnItemEx("ProtoShotBoss", 0, 0, 32, 50, 0, 0, 0)
	W_RC FDD 4 
	Goto BluffChance
	BluffCharge:
	W_RC D 1 A_FaceTarget
	goto ShieldShot
	BluffChance:
	W_RC D 0 A_JumpIfInventory("MagmaBazookaAmmo",3,"ChaseShield")
	W_RC D 0 A_Jump(128,"BluffCharge")
	Goto ShieldShot2
	ChaseShield:
	W_RC D 1 ACS_Execute(12,0,2)
	W_RC D 0 A_PlaySoundEx("weapon/tengudash", "Voice", 0, 1)
	W_RC D 0 ACS_Execute(12,0,3)
	Chasing:
	W_RC JJ 1 A_ChangeVelocity(30,0,0,CVF_RELATIVE|CVF_REPLACE)
	W_RC D 0 A_SpawnItemEx("ProtoDust", -32, 0, 0)
	W_RC D 0 A_SpawnItemEx("ProtoDamager")
	loop
	End.Protoman:
	W_RC D 20 A_Stop
	W_RC D 0 A_TakeInventory("MagmaBazookaAmmo",9999)
	goto End
	
	////////////////////////////////////////////////////////////////////////////
	
	
	////////////////////////////////////////////////////////////////////////////
	
	Start.Bass: 
	W_RC DDDDDDDDDDD 1 A_FaceTarget
	W_RC D 0 A_TakeInventory("CutterFlag", 9999)
	W_RC D 0 A_JumpIfInventory("WaveBurnerAmmo",1,"ChargeDash")
	Shoot.Bass:
	W_RC D 0 A_PlaySoundEx("weapon/adapterreturn", "auto", 0, 1)
	W_RC D 0 A_FaceTarget
	W_RC D 8 A_Stop
	W_RC D 0 A_FaceTarget
	W_RC D 0 A_PlaySoundEx("weapon/mbuster", "voice", 0, 1)
	W_RC D 0 A_CustomMissile("BassBossShot", 32, 8, random(-5, 5))
	W_RC EF 2 A_FaceTarget
	W_RC D 0 A_GiveInventory("CutterFlag",1)
	W_RC D 0 A_JumpIfInventory("CutterFlag",5,1)
	Goto Shoot.Bass+3
	BusterWave:
	W_RC D 0 A_GiveInventory("WaveBurnerAmmo",1)
	W_RC F 0 A_FaceTarget
	W_RC D 0 A_ChangeVelocity(-25, 0, 5, CVF_RELATIVE|CVF_REPLACE)
	W_RC D 3
	W_RC D 1 A_CheckFloor(1)
	wait
	W_RC D 0 A_PlaySoundEx("weapon/adapterreturn", "auto", 0, 1)
	W_RC D 0 A_FaceTarget
	W_RC D 0 A_SetAngle(angle + 60)
	W_RC F 8 A_Stop
	W_RC D 0 A_SetUserVar(user_shotangle, 120)
	BusterWaveLoop:
	W_RC D 0 A_PlaySoundEx("weapon/mbuster", "voice", 0, 1)
	W_RC E 1 A_SpawnItemEx("BassBossShot", 6, 0, 32, 50)
	W_RC D 0 A_SetAngle(angle - 5)
	W_RC D 0 A_SetUserVar(user_shotangle, user_shotangle-5)
	W_RC D 0 A_JumpIf(user_shotangle > 0, "BusterWaveLoop")
	goto BusterWave2
	BusterWave2:
	W_RC D 0 A_PlaySoundEx("weapon/adapterreturn", "auto", 0, 1)
	W_RC D 0 A_FaceTarget
	W_RC D 0 A_SetAngle(angle - 60)
	W_RC F 8 A_Stop
	W_RC D 0 A_SetUserVar(user_shotangle, 120)
	BusterWaveLoop2:
	W_RC D 0 A_PlaySoundEx("weapon/mbuster", "voice", 0, 1)
	W_RC E 1 A_SpawnItemEx("BassBossShot", 6, 0, 32, 50)
	W_RC D 0 A_SetAngle(angle + 5)
	W_RC D 0 A_SetUserVar(user_shotangle, user_shotangle-5)
	W_RC D 0 A_JumpIf(user_shotangle > 0, "BusterWaveLoop2")
	W_RC D 0
	W_RC F 4
	Goto Start.Bass
	
	ChargeDash:
	W_RC D 0 A_PlaySoundEx("weapon/chargeup", "voice", 0, 1)
	W_RC DDDDDFJ 5 A_FaceTarget
	W_RC M 4 A_FaceTarget
	DashContinue:
	W_RC D 0 A_PlaySoundEx("weapon/adapterchargeloop", "voice", 0, 1)
	W_RC D 0 A_ChangeVelocity(35, 0, 0, CVF_RELATIVE|CVF_REPLACE)
	W_RC MMMMMM 1 A_JumpIfCloser(120, "DashKick")
	goto ChargeDash+8
	
	DashKick:
	W_RC D 0 A_Stop
	W_RC D 0 A_FaceTarget
	W_RC M 2
	W_RC JK 2
	W_RC D 0 A_PlaySoundEx("weapon/chargekick", "voice", 0, 1)
	W_RC D 0 A_SpawnItemEx("BassBossKick", 0, 0, 32, 40)
	W_RC D 0 A_TakeInventory("WeaponCharge", 10)
	W_RC LMJKLMJ 2
	W_RC D 0 A_FaceTarget
	W_RC D 0 A_Stop
	W_RC D 0 A_TakeInventory("CutterFlag", 9999)
	W_RC D 0 A_TakeInventory("WaveBurnerAmmo", 9999)
	W_RC D 15
	Goto End
	
	Death:
	TNT1 A 0 
	TNT1 A 0 ACS_Terminate(10,0)
	TNT1 A 0 Thing_Remove(501)
	TNT1 A 0 Thing_Remove(502)
	TNT1 A 0 A_PlaySoundEx("misc/mm3explosion", "voice",0,1)
	TNT1 A 0 A_SpawnItemEX("Archive_DeathFX",0,0,48)
	stop
	}
}
	
		
	////////////////////////////////////////////////////////////////////////////
	
	

	//Actors

	
	
	////////////////////////////////////////////////////////////////////////////
	
	

actor Archive_DeathFX //because archive offsets and napalm offsets dont match
{
//+CLIENTSIDEONLY
+NOINTERACTION
+NOGRAVITY
-SOLID
radius 2
height 2
scale 2.5
States
{
Spawn:
TNT1 A 0
NAPA EFGHIJKLMNOPQRS 1
stop
}
}

actor Archive_TeleFog
{
//+CLIENTSIDEONLY
+NOINTERACTION
+NOGRAVITY
-SOLID
radius 2
height 2
scale 2.5
States
{
Spawn:
TNT1 A 2
TFOG I 0 A_PlaySound("misc/itemspawn")
TFOG GIH 2
stop
}
}

actor Archive_DocHotLeafDropper
{
PROJECTILE
renderstyle none
states
{
	Spawn:
	LEAF X 0 A_ChangeVelocity(10,random(-10,10),0, CVF_RELATIVE|CVF_REPLACE)
	PLAY A 12 A_SpawnItemEx("Archive_DocHotLeafDropped", 0, 0, 0, 0, 0, 0)
	loop
}
}


actor Archive_DocHotLeafDropped : DocHotLeafDropped
{
Damage (3)
states
{
	Spawn:
	LEAF UVWXYXWV 2
	loop
	Death:
	LEAF WZWZWZW 8 A_Explode(4, 32, 0)
	stop
}
}

/*actor Archive_MetSpawner : MetSpawner
{
translation "60:60=195:195", "58:58=94:94"
states
{
	SpawnMet:
	TNT1 A 0 A_SetAngle(random(0,360))
	TNT1 AAAAAAAAAA 0 A_SpawnItemEx("CatcherJunkSmallFX", random(0,28), 0, 0, random(1,8), 0, random(3,10), random(0,360),1)
	METT B 2 ThrustThingZ(0, random(50,100),0,0)
	Falling:
	METT ABCB 2 A_JumpIf(z==0, "Land")
	loop
	Land:
	TNT1 A 0 A_SpawnItemEx("Archive_MetCatcherMet")
	stop
}
}*/

actor Archive_MetDaddyRiseFX : MetDaddyRiseFX //transfertranslation
{
translation "60:60=195:195", "58:58=94:94"
states
{
Spawn:
TNT1 A 1
TNT1 A 0 A_JumpIf(z!=floorz, "Spawn")
MCAT IIIIIIIIIIIIIIIIIIIIIIIIIII 0 A_SpawnItemEx("Archive_CatcherJunkBigFX", random(32,300), 0, 0, random(5,20), 0, random(5,15), random(0,360),1)
stop
}
}

actor Archive_CatcherJunkBigFX : CatcherJunkBigFX //transfertranslation
{
translation "60:60=195:195", "58:58=94:94"
states
{
	Death:
	TNT1 A 0 A_SpawnITemEx("CatcherJunkSmallFX", 0,0,0,random(2,5), 0,random(1,8), random(0,360),1) 
	TNT1 A 0 A_SpawnITemEx("CatcherJunkSmallFX", 0,0,0,random(2,5), 0,random(1,8), random(0,360),1)
	stop
}
}

actor Archive_MetDaddyJunkWave : MetDaddyJunkWave
{
translation "60:60=195:195", "58:58=94:94"
states
{
Spawn:
PLAY A 0 A_CountDown
TNT1 A 2 A_SpawnItemEx("Archive_MetDaddyJunkWaveProjectile", 0,0,0,12,0,0,0,1)
loop
}
}


actor Archive_MetDaddyJunkWaveProjectile : MetDaddyJunkWaveProjectile
{
+DONTSPLASH
translation "60:60=195:195", "58:58=94:94"
States
{
	Spawn:
	TNT1 A 0 A_Explode(18, 62, 0, 0, 18)
	TNT1 A 0 A_JumpIf(z!=0, "Death")
	W_RC D 0 A_PlaySoundEx("misc/junkmix", "SoundSlot7", 1)//, 1)
	PLAY A 0 A_CountDown
	TNT1 AAAAAAAAA 2 A_SpawnItemEx("Archive_CatcherJunkBigFX", random(-28,28), random(-28,28), 0, random(1,8), 0, random(5,10), random(-45,45),1)
	loop
	Death:
	TNT1 A 0
	stop
}
}

actor Archive_MetDaddyAfterImage : MetDaddyAfterImage
{
scale 2.5
states
{
	Spawn:
	W_RC E 1 A_FadeOut(0.05)
loop
}
}


/*actor Archive_MetCatcherMet : MetCatcherMet 
{
dropitem none
states
{
Spawn:
METT D 1
METT D 0 Thing_ChangeTID(0,1016)
METT D 1 A_JumpIf(floorz!=z, "Spawn")
METT D 0 A_Stop
METT D 0 A_ChangeFlag("INVULNERABLE",0)
METT D 0 A_GiveInventory("MetCatcherMetInvul",1)
Looking:
METT D 35
METT D 1 A_Jump(128, "Looking")
METT D 1 A_LookEx(0,0,0,0,360,"See")
loop
See:
METT D 45 A_FaceTarget
METT F 0 A_FaceTarget
METT E 5 A_TakeInventory("MetCatcherMetInvul",1)
METT F 0 A_FaceTarget
METT F 5 A_CustomMissile("MetShot",0,0,0,0)
METT B 5
METT AAABBBCCCBBB 1 A_Chase
METT AAABBBCCCBBB 1 A_Chase
METT AAABBBCCCBBB 1 A_Chase
METT AAABBBCCCBBB 1 A_Chase
METT BE 5
METT D 5 A_GiveInventory("MetCatcherMetInvul",1)
loop
}
}*/

actor Archive_DarkShieldFire2 : DarkShieldFire
{
reactiontime 50
States
{
Spawn:
DARS ABC 1 A_Explode(8, 40, 0)
TNT1 A 0 A_CountDown
loop
Death:
DARS A 0 
stop
}
}


//these afterimages are so hacky, is there a way i can do them nicer?
actor Archive_DuoAfterImage1
{
+NOINTERACTION
-SOLID
scale 2.5
renderstyle stencil
stencilcolor "Cyan"
alpha 0.2
states
{
	Spawn:
	W_RC GGGGGG 1 A_FadeIn(0.1)
	stop
}
}

actor Archive_DuoAfterImage2 : Archive_DuoAfterImage1
{
states
{
	Spawn:
	W_RC HHHHHH 1 A_FadeIn(0.1)
	stop
}
}

actor Archive_DuoAfterImage3 : Archive_DuoAfterImage1
{
states
{
	Spawn:
	W_RC IIIIII 1 A_FadeIn(0.1)
	stop
}
}

actor Archive_DuoAfterImage4 : Archive_DuoAfterImage1
{
states
{
	Spawn:
	W_RC DDDDDD 1 A_FadeIn(0.1)
	stop
}
}

actor Archive_DuoMeteorFadeIn
{
+NOINTERACTION
-SOLID
scale 3.0
reactiontime 9
alpha 0.2
states
{
	Spawn:
	DUOR LLMM 1 A_FadeIn(0.02)
	DUOR L 0 A_CountDown
	loop
}
}

actor Archive_DuoShockWave
{
PROJECTILE
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_Explode(20,64,0)
TNT1 A 0 A_SpawnItemEx("Archive_DuoShockwavePart",0,0,0,18,0,0,0)
TNT1 A 0 A_SpawnItemEx("Archive_DuoShockwavePart",0,0,0,18,0,0,15)
TNT1 A 0 A_SpawnItemEx("Archive_DuoShockwavePart",0,0,0,18,0,0,30)
TNT1 A 0 A_SpawnItemEx("Archive_DuoShockwavePart",0,0,0,18,0,0,45)
TNT1 A 0 A_SpawnItemEx("Archive_DuoShockwavePart",0,0,0,18,0,0,60)
TNT1 A 0 A_SpawnItemEx("Archive_DuoShockwavePart",0,0,0,18,0,0,75)
TNT1 A 0 A_SpawnItemEx("Archive_DuoShockwavePart",0,0,0,18,0,0,90)
TNT1 A 0 A_SpawnItemEx("Archive_DuoShockwavePart",0,0,0,18,0,0,105)
TNT1 A 0 A_SpawnItemEx("Archive_DuoShockwavePart",0,0,0,18,0,0,120)
TNT1 A 0 A_SpawnItemEx("Archive_DuoShockwavePart",0,0,0,18,0,0,135)
TNT1 A 0 A_SpawnItemEx("Archive_DuoShockwavePart",0,0,0,18,0,0,150)
TNT1 A 0 A_SpawnItemEx("Archive_DuoShockwavePart",0,0,0,18,0,0,165)
TNT1 A 0 A_SpawnItemEx("Archive_DuoShockwavePart",0,0,0,18,0,0,180)
TNT1 A 0 A_SpawnItemEx("Archive_DuoShockwavePart",0,0,0,18,0,0,195)
TNT1 A 0 A_SpawnItemEx("Archive_DuoShockwavePart",0,0,0,18,0,0,210)
TNT1 A 0 A_SpawnItemEx("Archive_DuoShockwavePart",0,0,0,18,0,0,225)
TNT1 A 0 A_SpawnItemEx("Archive_DuoShockwavePart",0,0,0,18,0,0,240)
TNT1 A 0 A_SpawnItemEx("Archive_DuoShockwavePart",0,0,0,18,0,0,255)
TNT1 A 0 A_SpawnItemEx("Archive_DuoShockwavePart",0,0,0,18,0,0,270)
TNT1 A 0 A_SpawnItemEx("Archive_DuoShockwavePart",0,0,0,18,0,0,285)
TNT1 A 0 A_SpawnItemEx("Archive_DuoShockwavePart",0,0,0,18,0,0,300)
TNT1 A 0 A_SpawnItemEx("Archive_DuoShockwavePart",0,0,0,18,0,0,315)
TNT1 A 0 A_SpawnItemEx("Archive_DuoShockwavePart",0,0,0,18,0,0,330)
TNT1 A 0 A_SpawnItemEx("Archive_DuoShockwavePart",0,0,0,18,0,0,345)
stop
}
}

actor Archive_DuoShockwavePart : DuoShockWavePart {Damage (5)}

actor Archive_DuoFist : MidFist
{
Damage (20)
speed 35
}

actor Archive_KingAxeDash : KingAxeDash
{
-NOBLOCKMAP
-SHOOTABLE
Obituary "%o had %p data removed by \caWeapon Archive\c-."
States
{
Death:
TNT1 A 1 A_Explode(12,128,0)
stop
}
}

 
actor Archive_KingAxeDashFX : KingAxeDashFX
{
States
{
Spawn:
W_RC GHID 1 A_FadeOut(0.08)
loop
}
}

actor Archive_KingAxeDashFX2
{
Translation "192:192=215:215", "198:198=220:220"
+NOGRAVITY
+NOINTERACTION
alpha 1.0
scale 2.5
States
{
Spawn:
RC_K AABBAABBA 1 A_Warp(AAPTR_TARGET, 40, 0, 0, 0, WARPF_INTERPOLATE|WARPF_NOCHECKPOSITION)
stop
}
}

actor Archive_BusterRodIllusion : BusterRodIllusion
{
alpha 0.95
States
{
Spawn:
W_RC D 0 Thing_ChangeTID(0,502)
W_RC D 1 A_Jumpif(floorz==z, "IllusionLand")
loop
IllusionLand:
W_RC D 0 A_SpawnItemEx("BusterRodBarrier")
W_RC D 0 A_Stop
W_RC D 0 A_SetAngle(180+angle)
W_RC D 130
Death:
W_RC D 1 A_FadeOut(0.06)
loop
}
}

actor Archive_BusterRodRod : BusterRodRod
{
Damage (10)
States
{
Spawn:
BRGZ P 0
BRGZ P 0 A_PlaySoundEx("misc/brgstaff",0)
BRGZ P 1 Thing_ChangeTID(0, 8174)
BRGZ POOPPOOPPOO 1 A_SpawnItemEx("Archive_BusterRodPart",0,0,0,-momx/4,-momy/4,-momz/4,0,SXF_ABSOLUTEMOMENTUM|SXF_NOCHECKPOSITION)//A_CustomMissile("BusterRodPart",0,0,0,0,0)
BRGZ A 1 A_ScaleVelocity(-1.0)
Back:
BRGZ PP 1 //A_SpawnItemEx("Archive_BusterRodPart",0,0,0,momx/4,momy/4,momz/4,0,SXF_ABSOLUTEMOMENTUM|SXF_NOCHECKPOSITION)
BackLoop:
BRGZ P 0 A_SetUserVar("user_count", user_count + 1)//A_GiveInventory("CutterFlag", 1)
BRGZ PP 1 //A_SpawnItemEx("Archive_BusterRodPart",0,0,0,momx/4,momy/4,momz/4,0,SXF_ABSOLUTEMOMENTUM|SXF_NOCHECKPOSITION)
BRGZ P 0 A_JumpIfCloser(32, "Death")
BRGZ OO 1 //A_SpawnItemEx("Archive_BusterRodPart",0,0,0,momx/4,momy/4,momz/4,0,SXF_ABSOLUTEMOMENTUM|SXF_NOCHECKPOSITION)
BRGZ O 0 A_JumpIfCloser(32, "Death")
BRGZ O 0 A_JumpIf(user_count==6, "Death")//A_JumpIfInventory("CutterFlag", 6, "Death")
loop
Death:
TNT1 A 0
stop
}
}

actor Archive_BusterRodPart : BusterRodPart
{
States
{
Ok:
TNT1 A 0 A_SpawnItemEx("BusterRodPart",0,0,0,momx,momy,momz,0,SXF_ABSOLUTEMOMENTUM|SXF_NOCHECKPOSITION)
TNT1 A 0 A_SpawnItemEx("Archive_BusterRodPartDamager")
BRGZ N 1 A_Stop
Animate:
BRGZ N 1 A_JumpIf(CallACS("BusterRodCheck")==1, "Death")
loop
}
}

actor Archive_BusterRodPartDamager : BusterRodPartDamager
{
PROJECTILE
damage (15)
}


actor Archive_PharaohShot?Warper : PharaohShot?Warper
{
states
{
Spawn:
PHAS BBCCDDEEFFGGHHIIJJKKJJKKJJKKJJKKJJ 1 A_Warp(AAPTR_TARGET, 0, 0, 80, 0, WARPF_COPYINTERPOLATION)
stop
}
}

actor Archive_PharaohShot?Warper2 : PharaohShot?Warper
{
alpha 0
states
{
Spawn:
PHAS B 1 A_Warp(AAPTR_TARGET, 0, 0, 80, 0, WARPF_COPYINTERPOLATION)
PHAS B 0 A_FadeIn(0.2)
PHAS C 1 A_Warp(AAPTR_TARGET, 0, 0, 80, 0, WARPF_COPYINTERPOLATION)
PHAS B 0 A_FadeIn(0.2)
PHAS D 1 A_Warp(AAPTR_TARGET, 0, 0, 80, 0, WARPF_COPYINTERPOLATION)
PHAS B 0 A_FadeIn(0.2)
PHAS E 1 A_Warp(AAPTR_TARGET, 0, 0, 80, 0, WARPF_COPYINTERPOLATION)
PHAS B 0 A_FadeIn(0.2)
PHAS F 1 A_Warp(AAPTR_TARGET, 0, 0, 80, 0, WARPF_COPYINTERPOLATION)
PHAS B 0 A_FadeIn(0.2)
PHAS GHIJK 1 A_Warp(AAPTR_TARGET, 0, 0, 80, 0, WARPF_COPYINTERPOLATION)
stop
}
}

actor Archive_PharaohShot3 : PharaohShot3
{
Obituary "%o had %p data removed by \caWeapon Archive\c-."
speed 35
States
{
Spawn:
PHAS JK 4
loop
Death:
TNT1 A 0
TNT1 A 0 A_Explode(30,96,0,0,16)
TNT1 A 0 A_SpawnItemEx("OilPitIgnite",0,0,8)
PHAS LMNO 2
stop
}
}

actor Archive_ProtoShieldAttack : ProtoShieldAttack
{
-MISSILE
Obituary "%o had %p data removed by \caWeapon Archive\c-."
}