//////////////////////
// QUINT BOSS FIGHT // 			"To be forgotten is worse than death."
//////////////////////

actor QuintBoss
{
//$Category MM8BDM-Bosses
Height 46
Radius 34
Scale 2.5
Obituary "%o was erased from time by \cdQuint\c-."
Translation "192:192=138:138", "198:198=130:130"
Health 1000
mass 99999999
damagefactor "Misc", 0.0
damagefactor "Buster", 1.1
damagefactor "SilverTomahawk", 1.7
damagefactor "HardKnuckle", 1.3
damagefactor "SolarBlaze", 0.7
painchance 100
Speed 7
Damage 0
MONSTER
species "Quint"
+THRUSPECIES
//-ISMONSTER
//+NORADIUSDMG
//+FLOAT
floatspeed 0
-COUNTKILL
-SOLID
-CANPASS
+NOBLOOD
+LOOKALLAROUND
+SLIDESONWALLS
+NOPAIN
//+NODAMAGE
//MaxStepHeight 0
gravity 1.5
-DROPOFF
states
{
	// AtomicFireAmmo Generic Counter 1
	// CutterFlag Generic Counter 2
	// BusterAmmo Sakugarne Check

	Spawn:
	QUIN I 0
	QUIN I 0 Thing_ChangeTID(0,500)
	QUIN I 0 ACS_NamedExecute("SetQuintHealth", 0)
	QUIN I 0 A_JumpIfInventory("BusterAmmo",1,"LookAlone")
	QUIN I 8 A_Look
	loop
	LookAlone:
	QUIN A 8 A_LookEx(0,0,0,0,0,"TeamAttackChase")
	loop
	Seek:
	QUIN I 1 A_LookEx(0,0,0,0,0,"See")
	loop
	SeekBeforeAttack:
	QUIN I 1 A_LookEx(0,0,0,0,0,"ChooseAttack")
	See:
	QUIN I 0 A_TakeInventory("AtomicFireAmmo",99999)
	QUIN I 0 A_TakeInventory("CutterFlag",99999)
	QUIN I 2 //A_Jump(256,"TeamAttack")
	Bounce:
	QUIN I 2 A_FaceTarget
	QUIN I 0 A_ChangeVelocity(12,random(-10,10),20,CVF_RELATIVE|CVF_REPLACE)
	QUIN J 3
	Falling:
	QUIN J 1 A_Jumpif(floorz==z, "BasicLand")
	loop
	BasicLand:
	QUIN J 0 A_Stop
	QUIN J 0 ACS_ExecuteAlways(6,0,3,3,10)
	QUIN J 1 A_PlaySoundEx("misc/quake","Voice",0,1)
	QUIN J 0 A_SpawnItemEx("QuintBossLandAttack")
	QUIN I 5
	QUIN J 0 A_JumpIfInventory("AtomicFireAmmo",2,"SeekBeforeAttack")
	QUIN I 0 A_GiveInventory("AtomicFireAmmo",1)
	Goto Bounce
	
	ChooseAttack:
	QUIN I 0 A_JumpIf(ACS_ExecuteWithResult(6,2)==1,"Bounce")
	QUIN I 6 A_TakeInventory("AtomicFireAmmo",99999)
	QUIN J 0 A_Jump(256,"CrusherJump","SpinJump","TeamAttack")
	QUIN J -1
	
	CrusherJump:
	QUIN I 2 A_FaceTarget
	QUIN J 0 A_ChangeVelocity(0.0,0.0,20.0,CVF_REPLACE|CVF_RELATIVE)
	QUIN J 0 A_PlaySoundEx("weapon/superboost","Voice",0,1)
	CrusherLoop:
	QUIN J 0 A_FaceTarget
	QUIN J 0 A_ChangeFlag("NOGRAVITY",1)
	QUIN J 0 A_ChangeVelocity(60.0,0.0,velz,CVF_REPLACE|CVF_RELATIVE)
	QUIN J 1 A_SpawnItemEx("QuintTrailFX")
	QUIN J 0 A_GiveInventory("AtomicFireAmmo",1)
	QUIN J 0 A_JumpIfInventory("AtomicFireAmmo",10,"Crusher")
	QUIN J 0 A_JumpIf(z-floorz<128,"CrusherLoop")
	QUIN J 0 A_JumpIf(ACS_ExecuteWithResult(5,1000,tid,1)<50,"Crusher")
	loop
	Crusher:
	QUIN J 1 A_Stop
	QUIN J 0 A_PlaySoundEx("misc/mwsburst","Voice",0,1)
	QUIN J 0 A_SpawnItemEx("QuintTrailFX")
	CrusherFalling:
	QUIN J 0 A_FaceTarget
	QUIN J 0 A_SpawnItemEx("QuintTrailFX")
	QUIN J 0 A_ChangeVelocity(0,0.0,-20.0,CVF_REPLACE|CVF_RELATIVE)
	QUIN J 1 A_Jumpif(floorz==z, "CrusherLand")
	loop
	CrusherLand:
	QUIN J 0 A_PlaySoundEx("misc/mm3explosion","Voice",0,1)
	QUIN J 0 ACS_ExecuteAlways(6,0,3,8,13)
	QUIN J 0 A_Stop
	QUIN J 0 A_TakeInventory("AtomicFireAmmo",99999)
	QUIN J 0 A_GiveInventory("CutterFlag",1)
	QUIN J 0 A_ChangeFlag("NOGRAVITY",0)
	QUIN J 0 //A_PlaySoundEx("","Voice",0,1)
	QUIN J 0 A_SpawnItemEx("QuintBossLandCrusher")
	QUIN I 28
	QUIN I 0 A_JumpIfInventory("CutterFlag",3,"Seek")
	Goto CrusherJump
	
	SpinJump:
	QUIN I 2 A_FaceTarget
	QUIN I 0 A_ChangeVelocity(48,0,20,CVF_RELATIVE|CVF_REPLACE)
	QUIN J 10
	QUIN J 0 A_PlaySoundEx("misc/quintspin","Voice",0,1)
	QUIN J 0 A_Stop
	QUIN I 0 A_ChangeVelocity(0,0,23,CVF_RELATIVE|CVF_REPLACE)
	Spinning:
	QUIN I 0 A_SetAngle(angle+30)
	QUIN I 0 A_SpawnItemEx("QuintSpinFX",0,0,-8,0,0,0,0)
	QUIN I 0 A_SpawnItemEx("QuintSpinFX",0,0,-8,0,0,0,180)
	QUIN I 0 A_ChangeVelocity(0,0,-1,CVF_RELATIVE)
	QUIN J 1 A_Jumpif(floorz==z, "SpinLand")
	loop
	SpinLand:
	QUIN J 0 ACS_ExecuteAlways(6,0,3,8,38)
	QUIN I 0 //A_ChangeFlag("SHOOTABLE",0)
	QUIN I 4 A_SpawnItemEx("QuintBossSpinCrusher",0,0,0,0,0,0,random(0,360))
	QUIN JIJIJIJIJIJIJ 4
	QUIN I 23// A_ChangeFlag("SHOOTABLE",1)
	Goto Seek
	
	TeamAttack:
	QUIN L 0 A_GiveInventory("BusterAmmo",1)
	QUIN L 0 A_SpawnItemEx("QuintBossSakugarneChaser",0,0,0)
	QUIN L 5 A_ChangeVelocity(0.0,0.0,16.0,CVF_REPLACE|CVF_RELATIVE)
	TeamFall:
	QUIN L 1 A_Jumpif(floorz==z, "TeamAttackChase")
	loop
	TeamAttackChase:
	QUIN A 0 A_ChangeFlag("FLOAT",1)
	QUIN A 0 A_ChangeFlag("FLOORHUGGER",1)
	//QUIN BBBBCCCCDDDDCCCCBBBBCCCCDDDDCCCC 1 A_Chase//("Phase2Missile")
	QUIN N 3 A_FaceTarget
	QUIN N 0 A_Jump(128,"TeamAttackDashRight")
	TeamAttackDashLeft:
	QUIN E 0 A_SetAngle(angle - random(45,60))
	Goto TeamAttackDash
	TeamAttackDashRight:
	QUIN E 0 A_SetAngle(angle + random(45,60))
	TeamAttackDash:
	QUIN KKKKKKKKKKKKK 1 A_ChangeVelocity(15.0,0.0,0.0,CVF_REPLACE|CVF_RELATIVE)
	TeamAttackMissile:
	QUIN F 0 A_Stop
	QUIN FFFF 4 A_FaceTarget
	QUIN F 0 A_SpawnItemEx("QuintBossShotSeeker", 0, 9, 29)
	QUIN FFF 6 A_FaceTarget//ACS_ExecuteAlways(6,0)
	QUIN F 5
	QUIN A 0 A_GiveInventory("AtomicFireAmmo",1)
	QUIN J 0 A_JumpIfInventory("AtomicFireAmmo",4,"Recall")
	QUIN A 3 A_ChangeFlag("NOPAIN",0)
	Goto TeamAttackChase
	Recall:
	QUIN A 0 A_GiveInventory("CrashBombAmmo",1)//A_ChangeFlag("BUDDHA",1)
	QUIN A 0 A_ChangeFlag("FLOAT",0)
	QUIN A 0 A_ChangeFlag("FLOORHUGGER",0)
	QUIN A 6 A_Stop
	QUIN A 0 ACS_Execute(6,0,1)
	Recalling:
	QUIN M 1 //A_Stop
	loop
	TeamAttackEnd:
	QUIN I 0 A_TakeInventory("BusterAmmo",999)
	QUIN A 0 A_TakeInventory("CrashBombAmmo",999)//A_ChangeFlag("BUDDHA",0)
	QUIN A 0 A_PlaySoundEx("weapon/sakugarne","Voice",0,0)
	QUIN JI 4
	Goto Seek
	
	/*
	Pain:
	QUIN N 3 A_FaceTarget
	QUIN N 0 A_FaceTarget
	QUIN E 0 A_SetAngle(random(0,360))
	QUIN E 0 A_ChangeVelocity(24.0,0.0,0.0,CVF_REPLACE|CVF_RELATIVE)
	QUIN KKKKKK 2
	QUIN K 0 A_Stop
	Goto TeamAttackMissile
	*/
	
	/*
	GrinderJump:
	QUIN I 2 A_FaceTarget
	QUIN J 10 A_ChangeVelocity(0.0,0.0,20.0,CVF_REPLACE|CVF_RELATIVE)
	QUIN J 0 A_Stop
	QUIN J 0 A_ChangeFlag("NOGRAVITY",1)
	QUIN I 0 A_SpawnItemEx("QuintGrinderFX",0,0,0,12,0,0,0)
	QUIN I 0 A_SpawnItemEx("QuintGrinderFX",0,0,0,12,0,0,45)
	QUIN I 0 A_SpawnItemEx("QuintGrinderFX",0,0,0,12,0,0,-45)
	QUIN I 0 A_SpawnItemEx("QuintGrinderFX",0,0,0,12,0,0,90)
	QUIN I 0 A_SpawnItemEx("QuintGrinderFX",0,0,0,12,0,0,-90)
	QUIN I 0 A_SpawnItemEx("QuintGrinderFX",0,0,0,12,0,0,135)
	QUIN I 0 A_SpawnItemEx("QuintGrinderFX",0,0,0,12,0,0,-135)
	QUIN I 0 A_SpawnItemEx("QuintGrinderFX",0,0,0,12,0,0,180)
	QUIN JJJJJJJJJJJJJJJJJJJJ 1 A_FaceTarget
	QUIN J 0 A_FaceTarget
	QUIN J 0 A_ChangeFlag("NOGRAVITY",0)
	QUIN J 0 A_ChangeVelocity(10.0,0.0,-15.0,CVF_REPLACE|CVF_RELATIVE)
	GrinderFall:
	QUIN J 1 A_Jumpif(floorz==z, "GrinderLand")
	loop
	GrinderLand:
	QUIN I 0 A_SpawnItemEx("QuintGrinderProjectile",0,0,0,25,0,0,0)
	QUIN IIIIJJJJIIIIJJJJIIIIJJJJJ 1 A_ChangeVelocity(35.0,0.0,0.0,CVF_REPLACE|CVF_RELATIVE)
	QUIN I 0 A_FaceTarget
	QUIN I 0 A_SpawnItemEx("QuintGrinderProjectile",0,0,0,25,0,0,0)
	QUIN IIIIJJJJIIIIJJJJIIIIJJJJJ 1 A_ChangeVelocity(35.0,0.0,0.0,CVF_REPLACE|CVF_RELATIVE)
	QUIN J 10 A_Stop
	Goto See
	*/
	
	/*
	Phase2:
	QUIN J 0 A_ChangeFlag("NOGRAVITY",0)
	QUIN I 0 A_TakeInventory("AtomicFireAmmo",99999)
	QUIN I 0 A_TakeInventory("CutterFlag",99999)
	QUIN I 0 A_SpawnItemEx("QuintBossSakugarneLeave")
	QUIN L 5 A_ChangeVelocity(0.0,0.0,16.0,CVF_REPLACE|CVF_RELATIVE)
	Phase2Fall:
	QUIN L 1 A_Jumpif(floorz==z, "Phase2Land")
	loop
	Phase2Land:
	QUIN A 8
	Phase2See:
	QUIN BBBBCCCC 1 A_Chase("Phase2Missile")
	QUIN DDDDCCCC 1 A_Chase("Phase2Missile","Phase2Missile",0)
	loop
	Phase2Missile:
	QUIN E 0 A_Jump(56,"Phase2Dash")
	QUIN E 0 A_FaceTarget
	QUIN F 6 A_CustomMissile("MegaShot",32,8,0,0)
	QUIN E 0 A_FaceTarget
	QUIN F 6 A_CustomMissile("MegaShot",32,8,0,0)
	QUIN E 0 A_FaceTarget
	QUIN F 6 A_CustomMissile("MegaShot",32,8,0,0)
	QUIN E 0 A_FaceTarget
	QUIN F 6 A_CustomMissile("MegaShot",32,8,0,0)
	Goto Phase2See
	Phase2Dash:
	QUIN N 3 A_FaceTarget
	QUIN N 0 A_FaceTarget
	QUIN E 0 A_SetAngle(random(angle-50,angle+50))
	QUIN E 0 A_ChangeVelocity(40.0,0.0,0.0,CVF_REPLACE|CVF_RELATIVE)
	QUIN KKKKKK 2
	QUIN K 0 A_Stop
	Goto Phase2Missile+1
	*/
	
	Death:
	QUIN H 0 A_FaceTarget
	//QUIN H 0 A_TakeFromTarget("BossHealth5", 9999)
	QUIN H 0 A_SpawnItemEx("QuintDefeatProp")
	QUIN J 0 A_JumpIfInventory("BusterAmmo",1,"Dead")
	QUIN H 0 A_SpawnItemEx("DrillExplode",0,0,32)
	Dead:
	QUIN H 0// Thing_Destroy(501)
	stop
}
}

actor QuintKillerProp
{
gravity 1.5
Scale 2.5
Height 46
Radius 34
renderstyle translucent
alpha 0.0
-SOLID
+LOOKALLAROUND
Translation "192:192=138:138", "198:198=130:130"
states
{
	Spawn:
	QUIN J 1 A_Jumpif(floorz==z, "BasicLand")
	QUIN J 0 A_FadeIn(0.1)
	loop
	BasicLand:
	QUIN J 0 A_Stop
	QUIN J 0 ACS_ExecuteAlways(6,0,3,3,10)
	QUIN J 1 A_PlaySoundEx("misc/quake","Voice",0,1)
	QUIN J 0 A_SpawnItemEx("QuintBossLandAttack")
	QUIN I 5
	Bounce:
	QUIN I 2 A_FaceTarget
	QUIN I 0 A_ChangeVelocity(20,9,20,CVF_RELATIVE|CVF_REPLACE)
	QUIN J 3
	Falling:
	QUIN J 1 A_Jumpif(floorz==z, "End")
	loop
	End:
	QUIN J 0 A_Stop
	QUIN J 1 A_PlaySoundEx("weapon/sakugarne","Voice",0,1)
	QUIN J 0 //A_SpawnItemEx("QuintBossLandAttack")
	QUIN I 5
	Looking:
	QUIN I 1 A_Look
	loop
	See:
	QUIN I 1 A_FaceTarget
	QUIN I 0 A_SpawnItemEx("QuintBoss2")
	stop
}
}

actor QuintBoss2 : QuintBoss
{
Health 500
damagefactor "Buster", 0.8
	// AtomicFireAmmo = Boss Script telling him to attack
	states
	{
	Spawn:
	QUIN I 0
	QUIN I 0 Thing_ChangeTID(0,501)
	QUIN I 0 Thing_Deactivate(501)
	QUIN I 17
	QUIN I 8 A_Look
	loop
	Seek:
	QUIN I 1 A_LookEx(0,0,0,0,360,"See")
	See:
	QUIN I 0 //A_TakeInventory("AtomicFireAmmo",99999)
	QUIN I 0 A_TakeInventory("CutterFlag",99999)
	QUIN I 2 //A_Jump(256,"TeamAttack")
	Bounce:
	QUIN I 2 A_FaceTarget
	QUIN I 0 A_ChangeVelocity(8,random(-14,14),20,CVF_RELATIVE|CVF_REPLACE)
	QUIN J 3
	Falling:
	QUIN J 1 A_Jumpif(floorz==z, "BasicLand")
	loop
	BasicLand:
	QUIN J 0 A_Stop
	QUIN J 0 ACS_ExecuteAlways(6,0,3,3,10)
	QUIN J 1 A_PlaySoundEx("misc/quake","Voice",0,1)
	QUIN J 0 A_SpawnItemEx("QuintBossLandAttackTwin")
	QUIN I 5
	QUIN J 0 A_JumpIfInventory("AtomicFireAmmo",1,"AttackWait")
	QUIN I 0 //A_GiveInventory("AtomicFireAmmo",1)
	Goto Bounce
	AttackWait:
	QUIN I 0 A_GiveInventory("LeafShieldAmmo",1)
	QUIN I 1 A_FaceTarget
	loop
	
	CrusherJump:
	QUIN I 2 A_FaceTarget
	QUIN J 0 A_ChangeVelocity(0.0,0.0,20.0,CVF_REPLACE|CVF_RELATIVE)
	QUIN J 0 A_PlaySoundEx("weapon/superboost","Voice",0,1)
	CrusherLoop:
	QUIN J 0 A_FaceTarget
	QUIN J 0 A_ChangeFlag("NOGRAVITY",1)
	QUIN J 0 A_ChangeVelocity(60.0,0.0,velz,CVF_REPLACE|CVF_RELATIVE)
	QUIN J 1 A_SpawnItemEx("QuintTrailFX")
	QUIN J 0 A_GiveInventory("AtomicFireAmmo",1)
	QUIN J 0 A_JumpIfInventory("AtomicFireAmmo",10,"Crusher")
	QUIN J 0 A_JumpIf(z-floorz<128,"CrusherLoop")
	QUIN J 0 A_JumpIf(ACS_ExecuteWithResult(5,1000,tid,1)<50,"Crusher")
	loop
	Crusher:
	QUIN J 1 A_Stop
	QUIN J 0 A_PlaySoundEx("misc/mwsburst","Voice",0,1)
	QUIN J 0 A_SpawnItemEx("QuintTrailFX")
	CrusherFalling:
	QUIN J 0 A_FaceTarget
	QUIN J 0 A_SpawnItemEx("QuintTrailFX")
	QUIN J 0 A_ChangeVelocity(0,0.0,-20.0,CVF_REPLACE|CVF_RELATIVE)
	QUIN J 1 A_Jumpif(floorz==z, "CrusherLand")
	loop
	CrusherLand:
	QUIN J 0 A_PlaySoundEx("misc/mm3explosion","Voice",0,1)
	QUIN J 0 ACS_ExecuteAlways(6,0,3,8,13)
	QUIN J 0 A_Stop
	QUIN J 0 A_TakeInventory("AtomicFireAmmo",99999)
	QUIN J 0 A_GiveInventory("CutterFlag",1)
	QUIN J 0 A_ChangeFlag("NOGRAVITY",0)
	QUIN J 0 //A_PlaySoundEx("","Voice",0,1)
	QUIN J 0 A_SpawnItemEx("QuintBossLandCrusher")
	CrusherWait:
	QUIN I -1
	stop
	
	SpinJump:
	QUIN I 2 A_FaceTarget
	QUIN I 0 A_ChangeVelocity(0,0,20,CVF_RELATIVE|CVF_REPLACE)
	QUIN J 10
	QUIN J 0 A_PlaySoundEx("misc/quintspin","Voice",0,1)
	QUIN J 0 A_Stop
	QUIN I 0 A_ChangeVelocity(0,0,23,CVF_RELATIVE|CVF_REPLACE)
	Spinning:
	QUIN I 0 A_SetAngle(angle+30)
	QUIN I 0 A_SpawnItemEx("QuintSpinFX",0,0,-8,0,0,0,0)
	QUIN I 0 A_SpawnItemEx("QuintSpinFX",0,0,-8,0,0,0,180)
	QUIN I 0 A_ChangeVelocity(0,0,-1,CVF_RELATIVE)
	QUIN J 1 A_Jumpif(floorz==z, "SpinLand")
	loop
	SpinLand:
	QUIN J 0 ACS_ExecuteAlways(6,0,3,8,38)
	QUIN J 0 A_TakeInventory("AtomicFireAmmo",99999)
	QUIN I 0 //A_ChangeFlag("SHOOTABLE",0)
	QUIN I 4 A_SpawnItemEx("QuintBossSpinCrusher2",0,0,0,0,0,0,random(0,360))
	QUIN JIJIJIJ 4
	SpinWait:
	QUIN I -1// A_ChangeFlag("SHOOTABLE",1)
	Goto Seek
	
	RageMode:
	QUIN J 0 A_Stop
	QUIN J 0 A_ChangeFlag("NOGRAVITY",0)
	Rageloop:
	QUIN J 1 A_Jumpif(floorz==z, "RageLand")
	loop
	RageLand:
	QUIN J 0 A_Stop
	QUIN J 1 A_PlaySoundEx("weapon/sakugarne","Voice",0,1)
	QUIN J 0 //A_SpawnItemEx("QuintBossLandAttack")
	QUIN I 40 A_FaceTarget
	RageSpinJump:
	QUIN I 2 A_FaceTarget
	QUIN I 0 A_ChangeVelocity(100,0,20,CVF_RELATIVE|CVF_REPLACE)
	QUIN J 10
	QUIN J 0 A_PlaySoundEx("misc/quintspin","Voice",0,1)
	QUIN J 0 A_Stop
	QUIN I 0 A_ChangeVelocity(0,0,80,CVF_RELATIVE|CVF_REPLACE)
	RageSpinning:
	QUIN I 0 A_SetAngle(angle+30)
	QUIN I 0 A_SpawnItemEx("QuintSpinFX",0,0,-8,0,0,0,0)
	QUIN I 0 A_SpawnItemEx("QuintSpinFX",0,0,-8,0,0,0,180)
	QUIN I 0 A_ChangeVelocity(0,0,-2,CVF_RELATIVE)
	QUIN J 1 A_Jumpif(floorz==z, "RageSpinLand")
	loop
	RageSpinLand:
	QUIN J 0 ACS_ExecuteAlways(6,0,3,8,38)
	QUIN J 0 A_TakeInventory("AtomicFireAmmo",99999)
	QUIN I 0 //A_ChangeFlag("SHOOTABLE",0)
	RageEarthquake:
	QUIN J 0 ACS_ExecuteAlways(6,0,3,2,28)
	QUIN I 4 A_SpawnItemEx("QuintBossSpinCrusher2",0,0,0,0,0,0,0)
	QUIN I 0 A_SetAngle(random(0,360))
	QUIN JIJ 6
	QUIN I 4 A_SpawnItemEx("QuintBossSpinCrusher2",0,0,0,0,0,0,8)
	QUIN JIJ 6
	QUIN I 0 A_GiveInventory("IceSlasherAmmo",1)
	QUIN I 0 A_JumpIfInventory("IceSlasherAmmo",8,"RageSpinEnd")
	loop
	RageSpinEnd:
	QUIN I 78 A_TakeInventory("IceSlasherAmmo",9999)
	Goto RageSpinJump
	
	Death:
	QUIN I 0 A_ChangeFlag("NOGRAVITY",1)
	QUIN I 0 A_ChangeFlag("NOINTERACTION",1)
	QUIN I 0 A_Stop
	QUIN I 0 A_FaceTarget
	QUIN I 0 A_SpawnItemEx("FakeDeathFX",0,0,32)
	QUIN I 0 A_PlaySoundEx("misc/devildeath", "Auto", 0, 1)
	QUIN I 0 A_SpawnItemEx("DrillExplode",0,0,32)
	QUIN I 0 ACS_Execute(6,0,6)
	QUIN I 0 A_JumpIfInventory("ThunderBeamAmmo",1,"Death2")
	stop
	Death2:
	QUIN I 0 A_SpawnItemEx("QuintDeathProp",0,0,0,-10,0,5)
	stop
	}
}

actor QuintBoss3 : QuintBoss2
{
	states
	{
	Spawn:
	QUIN I 0
	QUIN I 0 Thing_ChangeTID(0,500)
	QUIN I 0 Thing_Activate(501)
	QUIN I 8 A_Look
	loop
	
	SpinJump:
	QUIN I 2 A_FaceTarget
	QUIN I 0 A_ChangeVelocity(48,0,20,CVF_RELATIVE|CVF_REPLACE)
	QUIN J 10
	QUIN J 0 A_PlaySoundEx("misc/quintspin","Voice",0,1)
	QUIN J 0 A_Stop
	QUIN I 0 A_ChangeVelocity(0,0,23,CVF_RELATIVE|CVF_REPLACE)
	Spinning:
	QUIN I 0 A_SetAngle(angle+30)
	QUIN I 0 A_SpawnItemEx("QuintSpinFX",0,0,-8,0,0,0,0)
	QUIN I 0 A_SpawnItemEx("QuintSpinFX",0,0,-8,0,0,0,180)
	QUIN I 0 A_ChangeVelocity(0,0,-1,CVF_RELATIVE)
	QUIN J 1 A_Jumpif(floorz==z, "SpinLand")
	loop
	}
}

actor QuintDeathProp
{
Scale 2.5
Height 53
Radius 18
-SOLID
gravity 0.5
Translation "192:192=138:138", "198:198=130:130"
states
{
	Spawn:
	QUIN O 0
	QUIN O 0 A_ChangeVelocity(-5,0,5,CVF_RELATIVE)
	QUIN O 0 Thing_ChangeTID(0,503)
	QUIN O 1 A_SpawnItemEx("QuintDeathHelmet",0,0,4,-4,-4,8,0)
	QUIN O -1
	loop
	Dying:
	QUIN P -1 A_Stop
	stop
	Death:
	QUIN U 20 A_SetAngle(270)
	TNT1 A 5 
	QUIN U 5
	TNT1 A 5
	QUIN U 5
	TNT1 A 5
	QUIN U 5
	TNT1 A 5
	QUIN U 5
	TNT1 A 5
	QUIN U 5 
	TNT1 A 5 A_SpawnItemEx("FakeDeathFX",0,0,20,0,0,0,0)
	stop
}
}

actor QuintDeathHelmet
{
Gravity 0.4
+DOOMBOUNCE
+MISSILE
-SOLID
-NOGRAVITY
bouncecount 3
Translation "192:192=138:138", "198:198=130:130"
Radius 6
Height 6
scale 2.5
States
{
	Spawn:
	QUIN QRST 6 Thing_ChangeTID(0,506)
	loop
	Death:
	QUIN Q 1
	stop
}
}

actor QuintHelmetPickup : CustomInventory
{
Translation "192:192=138:138", "198:198=130:130"
inventory.amount 1
inventory.maxamount 1
+INVENTORY.ALWAYSPICKUP
Inventory.PickupSound "item/1up"
inventory.pickupmessage "Picked up Quint's remains."
scale 2.5
States
{
	Spawn:
	QUIN Q -1
	loop
	Pickup:
	QUIN Q 0 ACS_Execute(6,0,7)
	stop
}
}


actor QuintBossSakugarneChaser
{
MONSTER
Translation "192:192=138:138", "198:198=130:130"
Obituary "%o was erased from time by \cdQuint\c-."
scale 2.5
+SOLID
Height 70
Radius 34
Health 999999
painchance 0
+SHOOTABLE
+NODAMAGE
damagefactor "Misc", 0.0
+LOOKALLAROUND
-COUNTKILL
states
{
	Spawn:
	SAKU A 0
	SAKU A 0 Thing_ChangeTID(0,501)
	SAKU A 16
	SAKU A 1
	SAKU A 1 A_LookEx(0,0,0,0,360,"See")
	Goto Spawn+1
	See:
	SAKU A 1 Thing_ChangeTID(0,501)
	SAKU A 3 A_FaceTarget
	SAKU A 0 A_ChangeVelocity(10.0,0.0,10.0,CVF_REPLACE|CVF_RELATIVE)
	SAKU B 4
	Falling:
	SAKU B 0 A_JumpIfInventory("CutterFlag",1,"Recalling")
	SAKU B 1 A_Jumpif(floorz==z, "Land")
	loop
	Recalling:
	SAKU B 0 A_ChangeFlag("NOCLIP",1)
	SAKU B 1 A_Jumpif(floorz==z, "Recalled")
	loop
	Seek:
	SAKU A 1 A_LookEx(0,0,0,0,360,"See")
	loop
	Land:
	SAKU B 0 A_SpawnItemEx("QuintBossSakugarneAttack")
	SAKU B 0 A_PlaySoundEx("weapon/sakugarne","Voice",0,0)
	SAKU B 1 A_Stop
	SAKU B 0 A_JumpIfInventory("CutterFlag",1,"Recalled")
	Goto Seek
	Death:
	SAKU B 0 A_SpawnItemEx("QuintBossSakugarneLeave")
	stop
	Recalled:
	SAKU A 4 A_Stop
	SAKU B 0 A_ChangeFlag("SOLID",0)
	SAKU B 0 A_ChangeFlag("NOCLIP",1)
	SAKU B 0 A_ChangeVelocity((ACS_ExecuteWithResult(5,500,501) / 45) + 1,0.0,20.0,CVF_REPLACE|CVF_RELATIVE)
	Returning:
	SAKU B 1
	loop
}
}

actor QuintBossSakugarneAttack
{
PROJECTILE
damagetype "Misc"
States
{
	Spawn:
	TNT1 A 0
	TNT1 A 1 A_Explode(10,128,0)
	stop
}
}

actor QuintBossShotSeeker
{
+NOINTERACTION
height 1
radius 1
+NOGRAVITY
+LOOKALLAROUND
renderstyle none
	States
	{
	Spawn:
	PLAY AAAAAAAAAAAAAAA 1 A_LookEx(0,0,0,0,360,"See")
	loop
	See:
	PLAY A 1 A_FaceTarget
	PLAY AAA 6 ACS_ExecuteAlways(6,0)
	stop
	}
}

actor QuintBossShot : MegaShot
{
spawnid 154
damagetype "Misc"
//+RIPPER
+THRUSPECIES
species "Quint"
Obituary "%o was erased from time by \cdQuint\c-."
damage (10)
speed 16
States
{
Spawn:
TNT1 A 0
TNT1 A 1 ACS_ExecuteAlways(6,0,28)
TNT1 A 0
TNT1 A 1 A_PlaySoundEx("misc/devilfire",0,0,1)
BUST A 1 
goto spawn+4
Death:
BUST A 1
stop
}
}

actor QuintGrinderFX
{
+MISSILE
+NOGRAVITY
scale 1.5
renderstyle translucent
-SOLID
+NOINTERACTION
alpha 1.0
states
{
	Spawn:
	FCRA B 1 A_FadeOut(0.05)
	loop
}
}

actor QuintBossSakugarneLeave
{
+MISSILE
+NOGRAVITY
+NOINTERACTION
scale 2.5
renderstyle translucent
Speed 0
States
{
	Spawn:
	SAKU BA 4
	SAKU B 8 A_ChangeVelocity(0.0,0.0,20.0,CVF_REPLACE|CVF_RELATIVE)
	Death:
	SAKU B 1 A_FadeOut(0.25)
	loop
}
}

actor QuintGrinderProjectile
{
PROJECTILE
+RIPPER
+FLOORHUGGER
damagetype "Misc"
States
{
	Spawn:
	TNT1 AAAAAAAAAAAAAAAAAAAAAAAAA 1 A_SpawnItemEx("QuintDebris",0,0,0,12,random(-10,10),random(8,12),random(-5,5))
	stop
}
}

actor QuintBossSpinCrusher
{
PROJECTILE
damagetype "Misc"
States
{
	Spawn:
	TNT1 A 0
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,0)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,15)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,30)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,45)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,60)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,75)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,90)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,105)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,120)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,135)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,150)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,165)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,180)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,195)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,210)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,225)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,240)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,255)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,270)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,285)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,300)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,315)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,330)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,345)
	TNT1 A 0 A_PlaySoundEx("misc/hugequake2","Voice",0,1)
	
	TNT1 A 1 A_Explode(80,128,0)
	TNT1 AAAAAAAAA 2 A_SpawnItemEx("QuintDebris",0,0,5,0,random(2,8),random(5,10),random(0,360))
	
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,0+8)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,15+8)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,30+8)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,45+8)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,60+8)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,75+8)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,90+8)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,105+8)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,120+8)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,135+8)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,150+8)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,165+8)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,180+8)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,195+8)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,210+8)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,225+8)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,240+8)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,255+8)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,270+8)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,285+8)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,300+8)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,315+8)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,330+8)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,345+8)
	TNT1 A 0 A_PlaySoundEx("misc/hugequake2","Voice",0,1)

	TNT1 AAAAAAAAAAAAAA 2 A_SpawnItemEx("QuintDebris",0,0,5,0,random(2,8),random(5,10),random(0,360))
	stop
}
}

actor QuintBossSpinCrusher2 : QuintBossSpinCrusher
{
States
{
	Spawn:
	TNT1 A 0
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,0)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,15)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,30)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,45)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,60)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,75)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,90)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,105)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,120)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,135)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,150)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,165)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,180)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,195)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,210)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,225)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,240)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,255)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,270)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,285)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,300)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,315)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,330)
	TNT1 A 0 A_SpawnItemEx("QuintCrusherRock",0,0,10,10,0,1,345)
	TNT1 A 0 A_PlaySoundEx("misc/hugequake2","Voice",0,1)
	
	TNT1 A 1 A_Explode(80,128,0)

	TNT1 AAAAAAAAAAAAAA 2 A_SpawnItemEx("QuintDebris",0,0,5,0,random(2,8),random(5,10),random(0,360))
	stop
}
}

actor QuintSpinFX
{
scale 5.0
+MISSILE
renderstyle add
-SOLID
+NOINTERACTION
States
{
	Spawn:
	QBOP H 0 A_SetAngle(angle-5)
	QBOP H 0 A_FadeOut(0.08)
	QBOP H 1 A_ChangeVelocity(10,0,8,CVF_RELATIVE|CVF_REPLACE)
	QBOP H 0 A_SetAngle(angle-5)
	QBOP H 0 A_FadeOut(0.08)
	QBOP I 1 A_ChangeVelocity(10,0,8,CVF_RELATIVE|CVF_REPLACE)
	loop
}
}

actor QuintTrailFX
{
+MISSILE
+NOGRAVITY
scale 2.5
renderstyle translucent
-SOLID
+NOINTERACTION
alpha 0.9
Translation "192:192=138:138", "198:198=130:130"
states
{	
	Spawn:
	QUIN J 2 A_FadeOut(0.1)
	loop
}
}

actor QuintBossLandAttack
{
PROJECTILE
damagetype "Misc"
States
{
	Spawn:
	TNT1 A 0
	TNT1 AAAA 0 A_SpawnItemEx("QuintDebris",0,0,5,0,random(-10,10),random(8,12),random(0,360))
	TNT1 A 1 A_Explode(35,128,0)
	stop
}
}

actor QuintBossLandAttackTwin : QuintBossLandAttack
{
States
{
	Spawn:
	TNT1 A 0
	TNT1 AAAA 0 A_SpawnItemEx("QuintDebris",0,0,5,0,random(-10,10),random(8,12),random(0,360))
	TNT1 A 1 A_Explode(15,128,0)
	stop
}
}

actor QuintBossLandCrusher
{
PROJECTILE
damagetype "Misc"
States
{
	Spawn:
	TNT1 A 0
	TNT1 A 0 A_SpawnItemEx("QuintShockwavePart",0,0,0,18,0,0,0)
	TNT1 A 0 A_SpawnItemEx("QuintShockwavePart",0,0,0,18,0,0,15)
	TNT1 A 0 A_SpawnItemEx("QuintShockwavePart",0,0,0,18,0,0,30)
	TNT1 A 0 A_SpawnItemEx("QuintShockwavePart",0,0,0,18,0,0,45)
	TNT1 A 0 A_SpawnItemEx("QuintShockwavePart",0,0,0,18,0,0,60)
	TNT1 A 0 A_SpawnItemEx("QuintShockwavePart",0,0,0,18,0,0,75)
	TNT1 A 0 A_SpawnItemEx("QuintShockwavePart",0,0,0,18,0,0,90)
	TNT1 A 0 A_SpawnItemEx("QuintShockwavePart",0,0,0,18,0,0,105)
	TNT1 A 0 A_SpawnItemEx("QuintShockwavePart",0,0,0,18,0,0,120)
	TNT1 A 0 A_SpawnItemEx("QuintShockwavePart",0,0,0,18,0,0,135)
	TNT1 A 0 A_SpawnItemEx("QuintShockwavePart",0,0,0,18,0,0,150)
	TNT1 A 0 A_SpawnItemEx("QuintShockwavePart",0,0,0,18,0,0,165)
	TNT1 A 0 A_SpawnItemEx("QuintShockwavePart",0,0,0,18,0,0,180)
	TNT1 A 0 A_SpawnItemEx("QuintShockwavePart",0,0,0,18,0,0,195)
	TNT1 A 0 A_SpawnItemEx("QuintShockwavePart",0,0,0,18,0,0,210)
	TNT1 A 0 A_SpawnItemEx("QuintShockwavePart",0,0,0,18,0,0,225)
	TNT1 A 0 A_SpawnItemEx("QuintShockwavePart",0,0,0,18,0,0,240)
	TNT1 A 0 A_SpawnItemEx("QuintShockwavePart",0,0,0,18,0,0,255)
	TNT1 A 0 A_SpawnItemEx("QuintShockwavePart",0,0,0,18,0,0,270)
	TNT1 A 0 A_SpawnItemEx("QuintShockwavePart",0,0,0,18,0,0,285)
	TNT1 A 0 A_SpawnItemEx("QuintShockwavePart",0,0,0,18,0,0,300)
	TNT1 A 0 A_SpawnItemEx("QuintShockwavePart",0,0,0,18,0,0,315)
	TNT1 A 0 A_SpawnItemEx("QuintShockwavePart",0,0,0,18,0,0,330)
	TNT1 A 0 A_SpawnItemEx("QuintShockwavePart",0,0,0,18,0,0,345)
	TNT1 A 0 A_Explode(32, 80, 0)
	TNT1 AAAAAAAAAA 0 A_SpawnItemEx("QuintDebrisHarmless",0,0,5,0,random(2,8),random(5,10),random(0,360))
	TNT1 A 1 A_Explode(50,25,0)
	stop
}
}

actor QuintShockwavePart
{
PROJECTILE
Scale 2.0
damagetype "Misc"
//+FLOORHUGGER
Speed 30
Damage (5)
Radius 32
Height 8
+NOINTERACTION
States
{
Spawn:
	TNT1 A 0
	TNT1 A 1 ACS_ExecuteAlways(4,0)
	TNT1 A 1
	QBOP G 2
	QBOP G 5 A_ChangeFlag("NOINTERACTION",0)
	Death:
	TNT1 A 0 ACS_ExecuteAlways(4,0)
	QBOP GGGGGGGG 1 A_FadeOut(0.1)
	loop
}
}

actor QuintDebris
{
PROJECTILE
Height 32
Radius 32
scale 2.5
damagetype "Misc"
species "Quint"
+THRUSPECIES
Speed 5
Damage (10)
-NOGRAVITY
States
{
	Spawn:
	TNT1 A 0
	TNT1 A 1 ACS_ExecuteAlways(4,0)
	TNT1 A 0 A_Jump(256,"Debris1","Debris2","Debris3","Debris4")
	Debris1:
	QBOP A -1
	Debris2:
	QBOP B -1
	Debris3:
	QBOP C -1
	Debris4:
	QBOP E -1
	Death:
	MMFX F 0 A_ChangeFlag("NOGRAVITY",1)
	MMFX FGHI 3 A_Stop
	stop
}
}

actor QuintDebrisHarmless : QuintDebris
{
Damage 0
}

actor QuintCrusherRock
{
PROJECTILE
+SHOOTABLE
-NOBLOCKMAP
species "Quint"
+THRUSPECIES
mass 9999999999999
Health 28
DamageFactor "Buster", 0.0
DamageFactor "SilverTomahawk", 100.0
damagefactor "Misc", 0.0
Height 53
Radius 18
scale 2.5
Speed 5
Damage (12)
-NOGRAVITY
gravity 0.02
States
{
	Spawn:
	TNT1 A 0
	TNT1 A 1 ACS_ExecuteAlways(4,0)
	TNT1 A 0 A_Jump(256,"Debris3","Debris4")
	Debris3:
	TNT1 A 0 //A_ChangeFlag("NOBLOCKMAP",0)
	QBOP D -1 //A_ChangeFlag("NOGRAVITY",0)
	Debris4:
	TNT1 A 0 //A_ChangeFlag("NOBLOCKMAP",0)
	QBOP F -1 //A_ChangeFlag("NOGRAVITY",0)
	Death:
	MMFX F 0 A_ChangeFlag("NOGRAVITY",1)
	TNT1 AAAA 0 A_SpawnItemEx("QuintDebrisHarmless",0,0,5,0,random(-5,5),random(5,7),random(0,360))
	MMFX FGHI 5 A_Stop
	stop
}
}

actor QuintIntroProp
{
Scale 2.5
Height 53
Radius 18
Translation "192:192=138:138", "198:198=130:130"
states
{
	Spawn:
	QUIN L 1 A_Jumpif(floorz==z, "Land")
	loop
	Land:
	QUIN A -1
	Start:
	QUIN M 5
	QUIN M 30 A_SpawnItemEx("SakugarneIntro",0,0,400,0,0,0,0)
	QUIN M 0 A_PlaySoundEx("weapon/sakugarne","Voice",0,1)
	QUIN M 0 A_SpawnItemEx("QuintBoss")
	stop
}
}

actor QuintIntroProp2 : QuintIntroProp
{
Height 53
Radius 18
states
{
	Spawn:
	QUIN L 1 A_Jumpif(floorz==z, "Land")
	loop
	Land:
	QUIN A -1
	Start:
	QUIN M 5
	QUIN M 30 A_SpawnItemEx("SakugarneIntro",0,0,400,0,0,0,0)
	QUIN M 0 A_PlaySoundEx("weapon/sakugarne","Voice",0,1)
	QUIN M 0 A_SpawnItemEx("QuintBoss3")
	stop
}
}

actor SakugarneIntro
{
Scale 2.5
Translation "192:192=138:138", "198:198=130:130"
states
{
	Spawn:
	SAKU B 1 A_Jumpif(floorz==z, "Land")
	loop
	Land:
	SAKU B 2
	stop
}
}

actor MegamanXPole 11133
{
//$Category MM8BDM-Props
+SOLID
+FORCEYBILLBOARD
height 256
scale 2.5
radius 16
States
{
	Spawn:
	QBOP J -1
	stop
}
}

actor TimePortalProp 11134
{
//$Category MM8BDM-Props
renderstyle translucent
alpha 0.85
-SOLID
+NOGRAVITY
//+SOLID
height 5
radius 5
+VISIBILITYPULSE
scale 2.5
states
{
	Spawn:
	QBOP KLM 3 bright A_SpawnItemEx("TimePortalFXSpawner",256,0,random(-128,128),0,0,0,random(0,360))
	loop
}
}

actor TimePortalTemporary : TimePortalProp
{
-VISIBILITYPULSE
alpha 0.1
states
{
	Spawn:
	QBOP KLMKLMKLM 3 A_FadeIn(0.1)
	QBOP KLMKLMKLMKLMKLMKLM 3 
	FadeOut:
	QBOP KLM 3 A_FadeOut(0.1)
	loop
}
}

actor TimePortalFXSpawner
{
+NOINTERACTION
+NOGRAVITY
-SOLID
+MISSILE
renderstyle none
	States
	{
	Spawn:
	PLAY A 0
	PLAY A 0 A_FaceTarget
	PLAY A 8 A_CustomMissile("TimePortalFX",0)
	stop
	}
}


actor TimePortalFX
{
+NOINTERACTION
+NOGRAVITY
+CLIENTSIDEONLY
-SOLID
+MISSILE
//+NOBLOCKMAP
height 2
speed 1
radius 2
renderstyle add
alpha 0.1
scale 1.5
states
{
	Spawn:
	TNT1 A 0
	TNT1 A 0 A_Jump(256,"FX1","FX2","FX3")
	FX1:
	QBOP N 6 A_ChangeVelocity(velx/2,vely/2,velz/2,0)
	QBOP N 0 A_FadeIn(0.05)
	QBOP N 6 A_ChangeVelocity(velx/2,vely/2,velz/2,0)
	QBOP N 0 A_FadeIn(0.05)
	QBOP N 6 A_ChangeVelocity(velx/2,vely/2,velz/2,0)
	QBOP N 0 A_FadeIn(0.05)
	QBOP N 6 A_ChangeVelocity(velx/2,vely/2,velz/2,0)
	QBOP N 0 A_FadeIn(0.05)
	QBOP N 6 A_ChangeVelocity(velx/2,vely/2,velz/2,0)
	QBOP N 0 A_FadeIn(0.05)
	QBOP N 6 A_ChangeVelocity(velx/2,vely/2,velz/2,0)
	QBOP N 0 A_FadeIn(0.05)
	QBOP N 6 A_ChangeVelocity(velx/2,vely/2,velz/2,0)
	stop
	FX2:
	QBOP O 6 A_ChangeVelocity(velx/2,vely/2,velz/2,0)
	QBOP O 0 A_FadeIn(0.05)
	QBOP O 6 A_ChangeVelocity(velx/2,vely/2,velz/2,0)
	QBOP O 0 A_FadeIn(0.05)
	QBOP O 6 A_ChangeVelocity(velx/2,vely/2,velz/2,0)
	QBOP O 0 A_FadeIn(0.05)
	QBOP O 6 A_ChangeVelocity(velx/2,vely/2,velz/2,0)
	QBOP O 0 A_FadeIn(0.05)
	QBOP O 6 A_ChangeVelocity(velx/2,vely/2,velz/2,0)
	QBOP O 0 A_FadeIn(0.05)
	QBOP O 6 A_ChangeVelocity(velx/2,vely/2,velz/2,0)
	QBOP O 0 A_FadeIn(0.05)
	QBOP O 6 A_ChangeVelocity(velx/2,vely/2,velz/2,0)
	stop
	FX3:
	QBOP P 6 A_ChangeVelocity(velx/2,vely/2,velz/2,0)
	QBOP P 0 A_FadeIn(0.05)
	QBOP P 6 A_ChangeVelocity(velx/2,vely/2,velz/2,0)
	QBOP P 0 A_FadeIn(0.05)
	QBOP P 6 A_ChangeVelocity(velx/2,vely/2,velz/2,0)
	QBOP P 0 A_FadeIn(0.05)
	QBOP P 6 A_ChangeVelocity(velx/2,vely/2,velz/2,0)
	QBOP P 0 A_FadeIn(0.05)
	QBOP P 6 A_ChangeVelocity(velx/2,vely/2,velz/2,0)
	QBOP P 0 A_FadeIn(0.05)
	QBOP P 6 A_ChangeVelocity(velx/2,vely/2,velz/2,0)
	QBOP P 0 A_FadeIn(0.05)
	QBOP P 6 A_ChangeVelocity(velx/2,vely/2,velz/2,0)
	stop
}
}

actor QuintDefeatProp
{
Scale 2.5
+LOOKALLAROUND
Translation "192:192=138:138", "198:198=130:130"
//+NOGRAVITY
states
{
	Spawn:
	QUIN H 0
	QUIN H 1 Thing_ChangeTid(0,500)
	QUIN H 0 A_ChangeVelocity(-13.0,0.0,0.0,CVF_REPLACE|CVF_RELATIVE)
	QUIN H 0 A_SpawnItemEx("PainFX",0,0,3)
	QUIN H 0 A_PlaySoundEx("misc/mm3explosion","Voice",0,1)
	QUIN H 15 
	QUIN N 25 A_Stop
	QUIN N -1 ACS_Execute(10,0)
	loop
	Start:
	QUIN N 1 A_Look
	loop
	See:
	QUIN N 1 //A_FaceTarget
	QUIN M 0 A_ChangeFlag("NOCLIP",1)
	QUIN M 6 A_ChangeFlag("NOGRAVITY",1)
	QUIN M 0 A_SpawnItemEx("QuintDust",0,0,0,-2)
	QUIN M 0 A_ChangeVelocity(0,0,0.1,CVF_RELATIVE|CVF_REPLACE)
	Charging:
	QUIN K 0 A_JumpIf(ACS_NamedExecuteWithResult("QuintTackleCheck")==1, "Tackle")//A_JumpIfCloser(40, "Tackle")
	QUIN K 1 A_ChangeVelocity(8,0,velz,CVF_RELATIVE|CVF_REPLACE)
	loop
	Tackle:
	QUIN K 0 ACS_Execute(6,0,4)
	Charging2:
	QUIN K 1 A_ChangeVelocity(8,0,velz,CVF_RELATIVE|CVF_REPLACE)
	loop
}
}

actor QuintDust : HyperStormDust
{
Scale 2.5
}

actor QuintTackleInventory : CustomInventory
{
	states
	{
	Pickup:
	TNT1 A 0 SetPlayerProperty(0, 1, 3)
	//TNT1 A 0 A_ChangeFlag("NOINTERACTION",1)
	TNT1 A 0 A_ChangeVelocity(-23,0,1,CVF_RELATIVE|CVF_REPLACE)
	stop
	}
}

actor QuintTackleInventoryRestore : CustomInventory
{
	states
	{
	Pickup:
	TNT1 A 0 SetPlayerProperty(0, 0, 3)
	//TNT1 A 0 A_ChangeFlag("NOINTERACTION",0)
	TNT1 A 0 A_Stop
	stop
	}
}

actor MMXRoadAttacker
{
+CANPASS
+LOOKALLAROUND
scale 2.5
+NOBLOCKMONST
+SHOOTABLE
+SLIDESONWALLS
Health 40
Height 48
Radius 48
//+NORADIUSDMG
+NOTARGETSWITCH
-SOLID
	states
	{
	Spawn:
	QBOP Q 0
	QBOP Q 0 ACS_ExecuteAlways(6,0,26)
	QBOP QQQQRRRR 1 A_ChangeVelocity(1,0,0,CVF_RELATIVE)
	QBOP Q 0 A_Look
	Goto Spawn+2
	See:
	QBOP Q 0 A_JumpIf(z<224, "Death")
	QBOP QQQQ 1 A_ChangeVelocity(1,0,0,CVF_RELATIVE)
	QBOP Q 0 A_SpawnItemEx("MMXRoadAttackerDamager")
	QBOP Q 0 A_FaceTarget(11)
	QBOP Q 0 //A_JumpIfCloser(200,"Turn")
	QBOP Q 0 A_JumpIf(z<224, "Death")
	QBOP RRRR 1 A_ChangeVelocity(1,0,0,CVF_RELATIVE)
	QBOP Q 0 A_SpawnItemEx("MMXRoadAttackerDamager")
	QBOP Q 0 A_FaceTarget(11)
	QBOP Q 0// A_JumpIfCloser(200,"Turn")
	loop
	Death:
	TNT1 A 0 //A_SpawnItemEx("MMXRoadAttackerDestroyed", 0, 0, 0, velx, vely, velz, 0)
	TNT1 A 0 A_SpawnItemEx("DrillExplode",0,0,40)
	TNT1 A 0 A_PlaySoundEx("misc/mm3explosion","Voice",0,0)
	TNT1 A 10 ACS_ExecuteAlways(6,0,5)
	stop
	DropBigHealth:
	TNT1 A 0 A_SpawnItemEx("BigHealth",0,0,8,0,0,-10)
	stop
	DropHealth:
	TNT1 A 0 A_SpawnItemEx("SmallHealth",0,0,8,0,0,-10)
	stop
	DropEnergy:
	TNT1 A 0 A_SpawnItemEx("WeaponEnergy",0,0,8,0,0,-10)
	stop
	DropHardKnuckle:
	TNT1 A 0 A_SpawnItemEx("HardKnuckleWep",0,0,8,0,0,-10)
	stop
	DropETank:
	TNT1 A 0 A_SpawnItemEx("ETank",0,0,8,0,0,-10)
	stop
	DropMTank:
	TNT1 A 0 A_SpawnItemEx("MTank",0,0,8,0,0,-10)
	stop
	}
}

actor MMXRoadAttackerDestroyed : MMXRoadAttacker
{
-SHOOTABLE
+NOCLIP
	states
	{
	Spawn:
	PLAY AAAABBBB 1 A_ChangeVelocity(1,0,0,CVF_RELATIVE)
	PLAY A 0 A_JumpIf(velz!=0, "Death")
	loop
	Death:
	PLAY AAAABBBBAAAABBBBAAAABBBB 1
	TNT1 A 0 A_PlaySoundEx("misc/mm3explosion","Voice",0,1)
	TNT1 A 0 A_SpawnItemEx("DrillExplode",0,0,40)//A_ChangeVelocity(1,0,0,CVF_RELATIVE)
	stop
	}
}

actor MMXRoadAttackerDamager
{
PROJECTILE
damagetype "Misc"
states
{
	Spawn:
	TNT1 A 0
	TNT1 A 0 A_Explode(12,40,0,0,1)
	stop
}
}
