actor BassBoss1
{
	//$Category MM8BDM-Bosses
	Obituary "%o was left inferior to \ciBass\c-."
	MONSTER
	-COUNTKILL
	+NOBLOOD
	+MISSILEMORE
	+LOOKALLAROUND
	+SLIDESONWALLS
	Health 750
	mass 999999
	Radius 16
	Height 56
	Speed 0
	Scale 2.5
	Translation "198:198=95:95", "192:192=217:217"
	var int user_shotangle;
	States
	{
	Spawn:
		BSB0 M -1 A_Jump(256, "Seek")
		BSB0 M 1
		wait
	
	Intro:
		BSB0 A 0 A_ChangeFlag(NOGRAVITY, TRUE)
		BSB0 A 5 ThrustThingZ(0, 8, 0, 0)
		BSB0 A 0 A_Stop
		BSB0 AB 3
		goto Intro+3
	
	Lower:
		BSB0 A 0 A_ChangeFlag(NOGRAVITY, false)
		BSB0 A 0 A_SpawnItemEx("BassDamageGiver")
		BSB0 A 1 A_CheckFloor("Seek")
		wait
	
	Seek:
		BASS A 1
		BASS A 1 A_Look
		wait
		
	Retarget:
		BASS A 1 A_LookEx(0, 0, 0, 0, 360, "See")
		loop
	
	CostRetarget:
		BASS A 1 A_LookEx(0, 0, 0, 0, 360, "CostSee")
		loop

	ClearRetarget:
		BASS A 1 A_LookEx(0, 0, 0, 0, 360, "ClearSee")
		loop
	
	CostSee:
		BASS B 0 A_TakeInventory("CutterFlag", 2)
		BASS B 0 A_GiveInventory("WeaponCharge", 1)
		goto See
	
	ClearSee:
		BASS B 0 A_TakeInventory("CutterFlag", 9999)
		BASS B 0 A_GiveInventory("WeaponCharge", 1)
		BASS B 0 A_Stop
	See:
		BASS B 0 A_JumpIfInventory("CutterFlag", 4, "AttackCheck")
		BASS E 3 A_FaceTarget
		BASS B 0 A_SetAngle(angle + random(-2, 2)*15)
		BASS B 5 A_ChangeVelocity(15, random(-1, 1)*5, momz, CVF_RELATIVE|CVF_REPLACE)
		BASS C 5 A_ScaleVelocity(0.6)
		BASS B 0 A_GiveInventory("CutterFlag", 1)
	
		BASS B 0 A_JumpIfInventory("CutterFlag", 4, "AttackCheck")
		BASS C 3 A_FaceTarget
		BASS B 0 A_SetAngle(angle + random(-2, 2)*15)
		BASS D 5 A_ChangeVelocity(15, random(-1, 1)*5, momz, CVF_RELATIVE|CVF_REPLACE)
		BASS E 5 A_ScaleVelocity(0.6)
		BASS B 0 A_GiveInventory("CutterFlag", 1)
		loop
	
	AttackCheck:
		BASS B 0 A_JumpIfInventory("WeaponCharge", 5, "ChargeAttack")
		BASS B 0 A_Jump(96, "Leap")
		BSB1 B 0 A_Jump(96, "Dash")
		BASS B 0 A_Jump(192, "Attack")
		goto CostSee
	
	ChargeAttack:
		BASS B 0 A_Jump(128, "ChargeBuster")
		goto ChargeDash
	
	Leap:
		BSB1 B 0 A_Jump(96, "LeapBack")
		BSB1 B 0 A_FaceTarget
		BSB1 B 0 A_ChangeVelocity(12, 0, 15, CVF_RELATIVE|CVF_REPLACE)
		BSB1 B 0 A_Jump(96, "LeapShoot")
		BSB1 B 10
		BSB1 B 1 A_CheckFloor("Retarget")
		wait
	
	Dash:
		BSB1 A 0 A_FaceTarget
		BSB1 A 0 A_SpawnItemEx("BassDashDust")
		BSB1 AAA 5 A_ChangeVelocity(35, 0, 0, CVF_RELATIVE|CVF_REPLACE)
		BSB1 A 0 A_ScaleVelocity(0.5)
		BSB1 A 0 A_JumpIfCloser(96, "LeapBack")
		goto CostRetarget
	
	LeapShoot:
		BSB1 B 4
		BASS F 0 A_PlaySoundEx("weapon/adapterreturn", "auto", 0, 1)
		BSB1 C 6
		BASS B 0 A_PlaySoundEx("weapon/mbuster", "voice", 0, 1)
		BSB1 B 0 A_CustomMissile("BassBossShot", 32, 8, random(-5, 5))
		BSB1 CCCCC 1 A_CheckFloor("CostRetarget")
		goto LeapShoot+3
	
	LeapBack:
		BSB1 B 0 A_FaceTarget
		BSB1 B 0 A_ChangeVelocity(-24, 0, 8, CVF_RELATIVE|CVF_REPLACE)
		BASS F 0 A_PlaySoundEx("weapon/adapterreturn", "auto", 0, 1)
		BSB1 C 6
		BASS B 0 A_PlaySoundEx("weapon/mbuster", "voice", 0, 1)
		BSB1 B 0 A_CustomMissile("BassBossShot", 32, 8, random(-5, 5))
		BSB1 CCCCC 1 A_CheckFloor("CostRetarget")
		goto LeapBack+4
	
	Attack:
		BASS B 0 A_Jump(96, "BusterWave")
		BASS F 0 A_PlaySoundEx("weapon/adapterreturn", "auto", 0, 1)
		BASS F 0 A_FaceTarget
		BASS F 8 A_Stop
		BASS F 0 A_FaceTarget
		BASS B 0 A_PlaySoundEx("weapon/mbuster", "voice", 0, 1)
		BASS B 0 A_CustomMissile("BassBossShot", 32, 8, random(-5, 5))
		BASS F 4 A_FaceTarget
		BASS B 0 A_PlaySoundEx("weapon/mbuster", "voice", 0, 1)
		BASS B 0 A_CustomMissile("BassBossShot", 32, 8, random(-5, 5))
		BASS F 4 A_FaceTarget
		BASS B 0 A_PlaySoundEx("weapon/mbuster", "voice", 0, 1)
		BASS B 0 A_CustomMissile("BassBossShot", 32, 8, random(-5, 5))
		BASS F 4 A_FaceTarget
		BASS F 0 A_Jump(96, "CostRetarget")
		BASS B 0 A_PlaySoundEx("weapon/mbuster", "voice", 0, 1)
		BASS B 0 A_CustomMissile("BassBossShot", 32, 8, random(-5, 5))
		BASS F 4 A_FaceTarget
		BASS F 0 A_Jump(96, "ClearRetarget")
		BASS B 0 A_PlaySoundEx("weapon/mbuster", "voice", 0, 1)
		BASS F 4 A_CustomMissile("BassBossShot", 32, 8, random(-5, 5))
		Goto ClearRetarget
	
	BusterWave:
		BASS F 0 A_FaceTarget
		BASS F 0 A_ChangeVelocity(-25, 0, 5, CVF_RELATIVE|CVF_REPLACE)
		BSB1 B 3
		BSB1 B 1 A_CheckFloor(1)
		wait
		BASS F 0 A_PlaySoundEx("weapon/adapterreturn", "auto", 0, 1)
		BASS F 0 A_FaceTarget
		BASS F 0 A_SetAngle(angle + 60)
		BASS F 8 A_Stop
		BASS F 0 A_SetUserVar(user_shotangle, 120)
	BusterWaveLoop:
		BASS B 0 A_PlaySoundEx("weapon/mbuster", "voice", 0, 1)
		BASS F 1 A_SpawnItemEx("BassBossShot", 6, 0, 32, 50)
		BASS F 0 A_SetAngle(angle - 5)
		BASS F 0 A_SetUserVar(user_shotangle, user_shotangle-5)
		BASS F 0 A_JumpIf(user_shotangle > 0, "BusterWaveLoop")
		goto ClearRetarget
	
	ChargeBuster:
		BASS F 0 A_PlaySoundEx("weapon/chargeup", "voice", 0, 1)
		BASS FFFFFFF 5 A_FaceTarget
		BASS F 4 A_FaceTarget
		BASS F 0 A_PlaySoundEx("weapon/adapterchargeloop", "voice", 0, 1)
		BASS F 5 A_FaceTarget
		BASS F 0 A_PlaySoundEx("weapon/adapterchargeloop", "voice", 0, 1)
		BASS F 5 A_FaceTarget
		BASS F 0 A_PlaySoundEx("weapon/cfire", "voice", 0, 1)
		BASS F 0 ACS_ExecuteAlways(56, 0, 1, 1000, 50)
		BASS F 1
		BASS F 0 A_SpawnItemEx("BassChargeShot", 0, 9, 35, 50)
		BASS F 0 A_GiveInventory("GyroFlag", 1)
		BASS F 0 A_TakeInventory("WeaponCharge", 10)
	ChargeBusterWait:
		BASS F 1
		BASS F 0 A_JumpIfInventory("GyroFlag", 2, "ChargeBusterGloat")
		BASS F 0 A_JumpIfInventory("GyroFlag", 1, "ChargeBusterWait")
	ChargeBusterFail:
		BASS H 0 A_TakeInventory("GyroFlag", 10)
		BASS H 0 A_TakeInventory("WeaponCharge", 9999)
		BASS H 10
		goto ClearRetarget
	ChargeBusterGloat:
		BSB0 A 0 A_ChangeFlag(NOGRAVITY, TRUE)
		BSB0 A 5 ThrustThingZ(0, 8, 0, 0)
		BSB0 A 0 A_Stop
		BSB0 ABABABAB 3
		BSB0 A 0 A_ChangeFlag(NOGRAVITY, false)
		BASS H 0 A_TakeInventory("GyroFlag", 10)
		BASS H 0 A_TakeInventory("WeaponCharge", 9999)
		BSB0 A 1 A_CheckFloor("ClearRetarget")
		wait
	
	ChargeDash:
		BASS A 0 A_PlaySoundEx("weapon/chargeup", "voice", 0, 1)
		BSB1 JJJJJJJ 5 A_FaceTarget
		BSB1 J 4 A_FaceTarget
		BSB1 JJJ 0 // buffer to make sure the DashContinue state goes to the right place
		BSB1 A 0 A_JumpIfInventory("BassUnsticking", 1, "DashContinue")
		BSB1 A 0 A_SpawnItemEx("BassStuckHelper", 0, 0, 18, 28)
		BSB1 A 0 A_FaceTarget
	DashContinue:
		BSB1 A 0 A_PlaySoundEx("weapon/adapterchargeloop", "voice", 0, 1)
		BSB1 A 0 A_ChangeVelocity(25, 0, 0, CVF_RELATIVE|CVF_REPLACE)
		BSB1 AAAAA 1 A_JumpIfCloser(120, "DashKick")
		goto ChargeDash+9
	
	DashKick:
		BSB0 A 0 A_Stop
		BSB0 A 0 A_FaceTarget
		BSB1 D 5
		BSB1 A 0 A_PlaySoundEx("weapon/chargekick", "voice", 0, 1)
		BSB0 A 0 A_SpawnItemEx("BassBossKick", 0, 0, 32, 40)
		BASS F 0 A_TakeInventory("WeaponCharge", 10)
		BSB1 EFGHI 3
		BSB1 J 5
		BSB1 B 0 A_FaceTarget
		BSB1 B 0 A_ChangeVelocity(-24, 0, 8, CVF_RELATIVE|CVF_REPLACE)
		BSB1 B 5
		BSB1 B 1 A_CheckFloor("ClearRetarget")
		wait
	
	Death:
		BASS H 0 A_GiveInventory("IsDead")
		BASS H 0 A_SpawnItemEx("BassBossTransition")
		TNT1 A 2
		stop
	}
}

actor BassBossShot
{
	PROJECTILE
	damagetype "BassBuster"
	Speed 50
	Damage (6)
	radius 5
	height 5
	scale 2.5
	States
	{
	Spawn:
		TNT1 A 1
		BASB A 1
		wait
	}
}

actor BassChargeShot
{
	PROJECTILE
	+THRUSPECIES
	+ACTIVATEMCROSS
	Species "Bass"
	translation "220:220=4:4", "228:228=103:103" // Bass Colors: "220:220=95:95", "228:228=217:217"
	damagetype "BassBuster"
	Speed 50
	Damage (45)
	radius 16
	height 64
	scale 3.5
	States
	{
	Spawn:
		ARRS B 0
		ARRS B 0 A_GiveInventory("Once", 1)
		ARRS BC 1
		Goto Spawn+2
	Death:
		ARRS A 0 A_TakeFromTarget("GyroFlag", 1)
		stop
	Crash:
	XDeath:
		ARRS A 0 A_GiveToTarget("GyroFlag", 1)
		stop
	}
}

actor BassBossKick
{
	PROJECTILE
	radius 16
	height 64
	scale 2.5
	damage (45)
	translation "225:255=103:103" // Bass Colors: "4:4=217:217", "225:255=95:95"
	damagetype "Bass"
	speed 40
	States
	{
	Spawn:
		CKIC DEF 2
		stop
	XDeath:
		CKIC A 0 ACS_NamedExecuteAlways("core_radiuspull", 0, 5, 16, 0)
		TNT1 A 10
		stop
	}
}

actor BassDashDust
{
	Scale 1.0
	+NOINTERACTION
	+NOGRAVITY
	+MISSILE
	States
	{
	Spawn:
	MDAD HIJ 6
	stop
	}
}

actor BassDamageGiver
{
	+MISSILE
	+NOINTERACTION
	+NOGRAVITY
	-SOLID
	renderstyle none
	Height 1
	Radius 1
	States
	{
	Spawn:
		PLAY A 0 A_JumpIfInTargetInventory("IsDead", 1, "Death")
		PLAY AAAAAAAAAAAA 1 A_JumpIfInTargetInventory("WeaponCharge", 4, "MidChargeColors")
		PLAY A 0 A_GiveToTarget("BassDamageInventory", 1)
		loop
	MidChargeColors:
		PLAY A 0 A_JumpIfInTargetInventory("WeaponCharge", 5, "FullChargeColors")
		PLAY A 0 Thing_SetTranslation(325, 250)
		PLAY AAAAAA 1 A_JumpIfInTargetInventory("WeaponCharge", 5, "FullChargeColors")
		PLAY A 0 Thing_SetTranslation(325, 46)
		PLAY AAAAAA 1 A_JumpIfInTargetInventory("WeaponCharge", 5, "FullChargeColors")
		PLAY A 0 A_GiveToTarget("BassDamageInventory", 1)
		PLAY A 0 A_JumpIfInTargetInventory("WeaponCharge", 4, "MidChargeColors")
		goto Spawn
	FullChargeColors:
		PLAY A 0 A_JumpIfInTargetInventory("IsDead", 1, "Death")
		PLAY A 3 Thing_SetTranslation(325, 251)
		PLAY A 3 Thing_SetTranslation(325, 250)
		PLAY A 3 Thing_SetTranslation(325, 251)
		PLAY A 3 Thing_SetTranslation(325, 46)
		PLAY A 0 A_GiveToTarget("BassDamageInventory", 1)
		PLAY A 0 A_JumpIfInTargetInventory("WeaponCharge", 5, "FullChargeColors")
		goto Spawn
	Death:
		PLAY A 0
		stop
	}
}

actor BassDamageInventory : CustomInventory
{
	+INVENTORY.AUTOACTIVATE
	States
	{
	Use:
		TNT1 A 0 A_SpawnItemEx("BassDamageRadius", 0, 0, 32, 0, 0, 0, 0, SXF_ABSOLUTEMOMENTUM)
		stop
	}
}

actor BassDamageRadius
{
	PROJECTILE
	Damagetype "Bass"
	Height 1
	Radius 1
	Speed 0
	Damage (0)
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 A 0 A_Explode(25,80,0)
		stop
	}
}

actor BassStuckHelper
{
	-SOLID
	+NOGRAVITY
	+MISSILE
	-FLOORCLIP
	height 1
	radius 16
	States
	{
	Spawn:
		TNT1 A 1
		stop
	Death:
		TNT1 A 0 A_SpawnItemEx("BassGiveUnstuck")
		stop
	}
}

actor BassGiveUnstuck : BassDamageGiver
{
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 A 0 A_JumpIfInTargetInventory("BassUnstuckCooldown", 1, "End")
		TNT1 A 0 A_JumpIfInTargetInventory("BassUnsticking", 1, "End")
		TNT1 A 0 A_GiveToTarget("BassUnsticking", 1)
		TNT1 A 0 A_GiveToTarget("BassUnstickTurn", 1)
		TNT1 AAAAAAAAAAA 1 // A_GiveToTarget("BassUnstickMove", 1)
		TNT1 A 0 A_TakeFromTarget("BassUnsticking", 1)
		TNT1 A 0 A_GiveToTarget("BassUnstuckCooldown", 1)
	End:
		TNT1 A 0
		stop
	}
}

actor BassUnstuckCooldown : Powerup
{
	Powerup.duration -2
}

actor BassUnsticking : Once {}

actor BassUnstickTurn : CustomInventory
{
	+INVENTORY.AUTOACTIVATE
	States
	{
	Use:
		TNT1 A 0 A_SetAngle(angle + (1+random(0, 1)*-2)*90)
		stop
	}
}

actor BassUnstickMove : CustomInventory
{
	+INVENTORY.AUTOACTIVATE
	States
	{
	Use:
		TNT1 A 0 A_ChangeVelocity(12, 0, 0, CVF_RELATIVE|CVF_REPLACE)
		stop
	}
}

// [Russ] BassBoss2 was replaced but all the other actors are kept in case people use them
// legacy hell

// PHASE 2 //

actor BassBoss2
{
	//$Category MM8BDM-Bosses
	Obituary "%o faced the true side of \ctBass\c-."
	MONSTER
	-COUNTKILL
	+NOBLOOD
	+NOGRAVITY
	+SLIDESONWALLS
	-SOLID
	Health 1000
	mass 999999
	Radius 16
	Height 56
	Scale 2.5
	Speed 8
	Damagefactor 1.6
	Translation "198:198=95:95", "192:192=62:62"
	var int user_flyZ; // This is set in the ACS.
	var int user_pointQueue[2];
	var int user_shotangle;
	States
	{
		Spawn:
			BSB2 A 1
			wait
			
		SpawnIn:
			BSB2 A 0 A_SpawnItemEx("BassBossWings", -8, 0, 32)
			BSB2 A 0 ACS_ExecuteAlways(56, 0, 6) // Set Bass's flight point to the height of his path points
			BSB2 A 0 A_SetUserArray(user_pointQueue, 0, random(232, 235))
			BSB2 A 0 A_ChangeFlag(NOGRAVITY, false)
			BSB2 A 0 ThrustThingZ(0, 25, 1, 0)
			BSB2 A 35 
			BSB2 A 0 A_ChangeFlag(NOGRAVITY, true)
			BSB2 AAAAAAAAAAAAAAAAAAAA 1 ThrustThingZ(0, 5, 0, 1)
			BSB2 A 20
			BSB2 A 0 A_Stop
			BSB2 A 0 A_PlaySoundEx("weapon/pharaoh2", "auto", 0, 1)
			BSB2 A 0 A_GiveInventory("WeaponCharge", 1)
			Goto Intro
		
		Intro:
			BSB0 F 3 A_SpawnItemEx("BassBossAuraQuake", -1, 0, -10)
			BSB0 FG 3 
			Goto Intro+1

		Lower:
			BSB2 A 0 A_TakeInventory("WeaponCharge", 999)
			BSB0 H 0
			BSB2 A 1 A_LookEx(0, 0, 2048, 0, 0, "See")
			BSB2 A 0 A_Wander
			Goto Lower+1
		
		// Movement, transition from attacks
		See:
			BSB2 A 0 A_TakeInventory("WeaponCharge", 999)
			BSB2 A 0 A_JumpIf(z < user_flyZ+32, "FlyUp")
			Goto SeekBeforePoint
		FlyUp:
			BSB2 A 1 ThrustThingZ(0, 45, 0, 0)
			BSB2 A 0 A_JumpIf(z < user_flyZ+16, "FlyUp")
			BSB2 A 0 A_JumpIf(z > user_flyZ+32, "FlyDown")
			BSB2 A 0 A_JumpIfInventory("BusterAmmo", 2, "AttackEnd")
			goto SeekBeforePoint
		FlyDown:
			BSB2 A 1 ThrustThingZ(0, 22, 1, 0)
			BSB2 A 1 A_JumpIf(z > user_flyZ+32, "FlyDown")
			BSB2 A 1 A_JumpIf(z < user_flyZ+16, "FlyUp")
			BSB2 A 1 A_JumpIfInventory("BusterAmmo", 2, "AttackEnd")
			goto SeekBeforePoint
		SeekBeforePoint:
			BSB2 A 1 A_LookEx(0, 0, 2048, 0, 0, "ChoosePoint")
			loop
		ReachedPoint:
			BSB2 AAAAA 1 A_JumpIfTracerCloser(10, "SeekBeforePoint")
		ChoosePoint:
			BSB2 A 1 A_Stop
			BSB2 A 0 A_JumpIfInventory("TrebleBoostAmmo", 3, "Land")
			BSB2 A 0 A_JumpIfInventory("BusterAmmo", 2, "ChooseAttack")
			BSB2 A 0 A_JumpIfInventory("QuickBoomerangAmmo", 3, "BusterAttack")
		SelectPoint:
			BSB2 A 0 ACS_ExecuteAlways(56, 0, 7) // Choose Bass's next path point
			BSB2 A 0 A_GiveInventory("QuickBoomerangAmmo", 1)
			BSB2 A 1
			Goto ChasePoint
		ChasePoint:
			BSB2 A 0 A_FaceTracer(0,0)
			BSB2 A 1 A_ChangeVelocity(20, 0, 5*sin(pitch+10), CVF_RELATIVE|CVF_REPLACE)
			BSB2 A 0 A_JumpIfTracerCloser(73, "ReachedPoint")
			loop
		ChooseAttack:
			BSB2 A 0 A_FaceTarget
			BSB2 A 0 A_PlaySoundEx("weapon/pharaoh2", "auto", 0, 1)
			BSB2 A 0 A_GiveInventory("WeaponCharge", 1)
			BSB0 FGFGFGFGFGFG 3
			BSB0 A 0 A_Jump(256, "RainShots", "LaserShot", "FollowShots")
			goto ChargeShots
		AttackEnd:
			BSB2 A 0 A_JumpIf(z < user_flyZ, "FlyUp")
			BSB2 A 0 A_JumpIf(z > user_flyZ+32, "FlyDown")
			BSB2 A 0 A_TakeInventory("BusterAmmo", 999)
			BSB2 B 0 A_TakeInventory("AtomicFireAmmo", 999)
			goto ChoosePoint+2
			
		Land:
			BSB2 A 1 ThrustThingZ(0, 35, 1, 0)
			BSB2 A 1 A_FaceTarget
			BSB2 A 0 A_JumpIf(z-floorz > 0, "Land")
			BSB2 A 1 A_Stop
			BSB2 A 0 A_GiveInventory("TrebleBoostAmmo", 1)
			BSB3 A 15
			
			BSB3 B 5 A_FaceTarget(0, 180)
			BSB3 B 0 A_JumpIf(pitch < 7 && -pitch < 7, "BusterWave")
			BSB3 B 5 A_FaceTarget(0, 180)
			BSB3 B 0 A_JumpIf(pitch < 7 && -pitch < 7, "BusterWave")
			BSB3 B 5 A_FaceTarget(0, 180)
			BSB3 B 0 A_JumpIf(pitch < 7 && -pitch < 7, "BusterWave")
			BSB3 B 5 A_FaceTarget(0, 180)
			BSB3 B 0 A_JumpIf(pitch < 7 && -pitch < 7, "BusterWave")
			BSB3 B 5 A_FaceTarget(0, 180)
			BSB3 B 0 A_JumpIf(pitch < 7 && -pitch < 7, "BusterWave")
			BSB3 B 5 A_FaceTarget(0, 180)
			BSB3 B 0 A_JumpIf(pitch < 7 && -pitch < 7, "BusterWave")
			BSB3 B 5 A_FaceTarget(0, 180)
			BSB3 B 0 A_JumpIf(pitch < 7 && -pitch < 7, "BusterWave")
			goto ChargeShots
			
		ChargeShots:
			BSB3 C 0 A_TakeInventory("WeaponCharge", 999)
			BSB3 CCCCCCCCCCCCCCC 1 A_FaceTarget(0, 180)
			BSB3 C 0 A_PlaySoundEx("weapon/cfire", "voice", 0, 1)
			BSB3 C 0 A_CustomMissile("Bass2ChargeShot", 35, 9)
			BSB3 CCCCCCCCCC 1 A_FaceTarget(0, 180)
			BSB3 C 0 ACS_ExecuteAlways(56, 0, 1, 1000, 50) // Lead aim
			BSB3 C 1
			BSB3 C 0 A_PlaySoundEx("weapon/cfire", "voice", 0, 1)
			BSB3 C 0 A_SpawnItemEx("Bass2ChargeShot", 0, 9, 35, cos(-pitch)*50, 0, sin(pitch)*50)
			BSB3 A 10
			BSB3 A 0 A_TakeInventory("TrebleBoostAmmo", 10)
			BSB3 A 0 A_PlaySoundEx("weapon/superboost", "voice", 0, 1)
			goto FlyUp
			
		BusterWave:
			BSB3 C 0 A_PlaySoundEx("weapon/adapterreturn", "auto", 0, 1)
			BSB3 C 0 A_FaceTarget
			BSB3 C 0 A_SetAngle(angle + 60)
			BSB3 C 8 A_Stop
			BSB3 C 0 A_SetUserVar(user_shotangle, 120)
		BusterWaveLoop:
			BSB3 C 0 A_PlaySoundEx("weapon/mbuster", "voice", 0, 1)
			BSB3 C 1 A_SpawnItemEx("BassBossShot", 6, 0, 32, 50)
			BSB3 C 0 A_SetAngle(angle - 5)
			BSB3 C 0 A_SetUserVar(user_shotangle, user_shotangle-5)
			BSB3 C 0 A_JumpIf(user_shotangle > 0, "BusterWaveLoop")
			BSB3 A 10
			BSB2 A 0 A_TakeInventory("TrebleBoostAmmo", 10)
			BSB2 A 0 A_PlaySoundEx("weapon/superboost", "voice", 0, 1)
			goto FlyUp
			
		BusterAttack:
			BSB2 F 0 A_PlaySoundEx("weapon/adapterreturn", "auto", 0, 1)
			BSB2 BBBBBBBB 1 A_FaceTarget
			
			BSB2 A 0 A_PlaySoundEx("weapon/mbuster", "voice", 0, 1)
			BSB2 B 0 A_CustomMissile("BassBossShot", 36, -9,   frandom(-7.5, 7.5))
			BSB2 BBB 1 A_FaceTarget
			BSB2 A 0 A_PlaySoundEx("weapon/mbuster", "voice", 0, 1)
			BSB2 B 0 A_CustomMissile("BassBossShot", 36, -9,   frandom(-7.5, 7.5))
			BSB2 BBB 1 A_FaceTarget
			BSB2 A 0 A_PlaySoundEx("weapon/mbuster", "voice", 0, 1)
			BSB2 B 0 A_CustomMissile("BassBossShot", 36, -9,   frandom(-7.5, 7.5))
			BSB2 BBB 1 A_FaceTarget
			
			BSB2 A 0 A_PlaySoundEx("weapon/mbuster", "voice", 0, 1)
			BSB2 B 0 A_CustomMissile("BassBossShot", 36, -9,   frandom(-7.5, 7.5))
			BSB2 BBB 1 A_FaceTarget
			BSB2 A 0 A_PlaySoundEx("weapon/mbuster", "voice", 0, 1)
			BSB2 B 0 A_CustomMissile("BassBossShot", 36, -9,   frandom(-7.5, 7.5))
			BSB2 BBB 1 A_FaceTarget
			BSB2 A 0 A_PlaySoundEx("weapon/mbuster", "voice", 0, 1)
			BSB2 B 0 A_CustomMissile("BassBossShot", 36, -9,   frandom(-7.5, 7.5))
			BSB2 BBB 1 A_FaceTarget
			
			BSB2 A 0 A_PlaySoundEx("weapon/mbuster", "voice", 0, 1)
			BSB2 B 0 A_CustomMissile("BassBossShot", 36, -9,   frandom(-7.5, 7.5))
			BSB2 BBB 1 A_FaceTarget
			BSB2 A 0 A_PlaySoundEx("weapon/mbuster", "voice", 0, 1)
			BSB2 B 0 A_CustomMissile("BassBossShot", 36, -9,   frandom(-7.5, 7.5))
			BSB2 BBB 1 A_FaceTarget
			BSB2 A 0 A_PlaySoundEx("weapon/mbuster", "voice", 0, 1)
			BSB2 B 0 A_CustomMissile("BassBossShot", 36, -9,   frandom(-7.5, 7.5))
			BSB2 BBB 1 A_FaceTarget
			
			BSB2 A 0 A_GiveInventory("BusterAmmo", 1)
			BSB2 A 0 A_TakeInventory("QuickBoomerangAmmo", 999)
			BSB2 A 0 A_JumpIf(z < user_flyZ, "FlyUp")
			BSB2 A 0 A_GiveInventory("TrebleBoostAmmo", 1)
			goto ChoosePoint+2
			
		LaserShot:
			BSB2 B 0 A_TakeInventory("WeaponCharge", 999)
			BSB2 B 0 A_TakeInventory("AtomicFireAmmo", 999)
			BSB2 B 0 A_GiveInventory("AtomicFireAmmo", 40)
			BSB2 B 0 A_PlaySoundEx("weapon/superboost", "voice", 0, 1)
			BSB2 B 0 ThrustThingZ(0, 9, 1, 0)
			BSB2 D 0 A_ChangeVelocity(-6, 0, momz, CVF_RELATIVE|CVF_REPLACE)
			BSB2 A 5 A_ChangeVelocity(-1, 0, 0, CVF_RELATIVE)
			BSB2 B 0 A_FaceTarget(6)
			BSB2 A 5 A_ChangeVelocity(-1, 0, 0, CVF_RELATIVE)
			BSB2 B 0 A_FaceTarget(6)
			BSB2 A 5 A_ChangeVelocity(1, 0, 0, CVF_RELATIVE)
			BSB2 B 0 A_FaceTarget(6)
			BSB2 A 5 A_ChangeVelocity(1, 0, 0, CVF_RELATIVE)
			BSB2 B 0 A_FaceTarget(6)
			BSB2 A 5 A_ChangeVelocity(1, 0, 0, CVF_RELATIVE)
			BSB2 B 0 A_FaceTarget(6)
			BSB2 W 5 A_ChangeVelocity(1, 0, 0, CVF_RELATIVE)
			BSB2 B 0 A_FaceTarget(6)
			BSB2 W 5 A_ChangeVelocity(1, 0, 0, CVF_RELATIVE)
			BSB2 B 0 A_FaceTarget(6)
			BSB2 W 5 A_Stop
			BSB2 W 10
			BSB2 B 0 A_SpawnItemEx("Bass2LaserSpawner", 0, 0, 32)
		LaserShotLoop:
			BSB2 B 0 A_FaceTarget(6)
			BSB2 B 0 A_PlaySoundEx("weapon/lshot", "voice", 0, 1)
			BSB2 B 0 A_SpawnItemEx("Bass2WallDetect")
			BSB2 U 2 A_ChangeVelocity(30, 0, momz, CVF_RELATIVE|CVF_REPLACE)
			BSB2 B 0 A_TakeInventory("AtomicFireAmmo", 1)
			BSB2 A 0 A_JumpIfInTargetInventory("BassLaserImmune", 1, "LaserShotHitLoop")
			BSB2 B 0 A_JumpIfInventory("AtomicFireAmmo", 1, "LaserShotLoop")
			BSB2 B 0 A_StopSoundEx("voice")
			BSB2 B 0 A_Stop
			goto AttackEnd
		LaserShotHitLoop:
			BSB2 B 0 A_PlaySoundEx("weapon/lshot", "voice", 0, 1)
			BSB2 B 0 A_SpawnItemEx("Bass2WallDetect")
			BSB2 D 2 A_ChangeVelocity(24, 0, 0, CVF_RELATIVE|CVF_REPLACE)
			BSB2 B 0 A_TakeInventory("AtomicFireAmmo", 1)
			BSB2 B 0 A_JumpIfInventory("AtomicFireAmmo", 1, "LaserShotHitLoop")
			BSB2 B 0 A_StopSoundEx("voice")
			BSB2 B 0 A_Stop
			goto AttackEnd
		RainShots:
			BSB2 B 0 A_TakeInventory("WeaponCharge", 999)
			BSB2 B 0 A_PlaySoundEx("weapon/adapterreturn", "auto", 0, 1)
			BSB2 BBBBBBBBBBBBBBBBBBBBBBBBBBBBBB 1 A_FaceTarget
			BSB2 WWWWWWWWWWWWWWDDDD 1 A_FaceTarget
			BSB2 A 0 A_PlaySoundEx("weapon/cfire", "voice", 0, 1)
			BSB2 B 0 A_SpawnItemEx("Bass2RainSpawner", 0, 9, 50, 0, 0, 50)
			BSB2 DDDDDDDDDD 1
			BSB2 DDDDDDDDDD 1
			BSB2 DDDDDDDDDD 1
			BSB2 A 0 A_PlaySoundEx("weapon/cfire", "voice", 0, 1)
			BSB2 B 0 A_SpawnItemEx("Bass2RainSpawner", 0, 9, 50, 0, 0, 50, 11.25)
			BSB2 DDDDDDDAAAAAAAAAAAAAAA 5 A_FaceTarget
			goto AttackEnd
		FollowShots:
			BSB2 B 0 A_TakeInventory("WeaponCharge", 999)
			BSB2 B 0 A_TakeInventory("AtomicFireAmmo", 999)
			BSB2 B 0 A_GiveInventory("AtomicFireAmmo", 40)
			BSB2 B 0 A_PlaySoundEx("weapon/chargeup", "voice", 0, 1)
			BSB0 FFFFFGFGFGFGF 3 A_FaceTarget(0, 180)
			BSB2 B 0 A_PlaySoundEx("weapon/adapterchargeloop", "voice", 1, 1)
			BSB0 FGFGFGFGFGFGF 3
		FollowShotsLoop:
			BSB2 C 0 A_FaceTarget(0, 180)
			BSB2 C 1 A_ChangeVelocity(30*cos(pitch), 0, 30*sin(pitch), CVF_RELATIVE|CVF_REPLACE)
			BSB2 C 0 A_JumpIfCloser(128, "ShootFollowShots")
			BSB2 C 0 A_FaceTarget(0, 180)
			BSB2 C 1 A_ChangeVelocity(30*cos(pitch), 0, 30*sin(pitch), CVF_RELATIVE|CVF_REPLACE)
			BSB2 C 0 A_JumpIfCloser(128, "ShootFollowShots")
			BSB2 C 0 A_FaceTarget(0, 180)
			BSB2 C 1 A_ChangeVelocity(30*cos(pitch), 0, 30*sin(pitch), CVF_RELATIVE|CVF_REPLACE)
			BSB2 C 0 A_JumpIfCloser(128, "ShootFollowShots")
			
			BSB2 V 0 A_FaceTarget(0, 180)
			BSB2 V 1 A_ChangeVelocity(30*cos(pitch), 0, 30*sin(pitch), CVF_RELATIVE|CVF_REPLACE)
			BSB2 V 0 A_JumpIfCloser(128, "ShootFollowShots")
			BSB2 V 0 A_FaceTarget(0, 180)
			BSB2 V 1 A_ChangeVelocity(30*cos(pitch), 0, 30*sin(pitch), CVF_RELATIVE|CVF_REPLACE)
			BSB2 V 0 A_JumpIfCloser(128, "ShootFollowShots")
			BSB2 V 0 A_FaceTarget(0, 180)
			BSB2 V 1 A_ChangeVelocity(30*cos(pitch), 0, 30*sin(pitch), CVF_RELATIVE|CVF_REPLACE)
			BSB2 V 0 A_JumpIfCloser(128, "ShootFollowShots")
			loop
		ShootFollowShots:
			BSB2 A 0 A_Stop
			BSB2 A 0 A_PlaySoundEx("weapon/cfire", "voice", 0, 1)
			BSB2 B 0 A_SpawnItemEx("Bass2BurstShot", 0, -9, 36, 50*cos(pitch), 0, 50*sin(pitch)+frandom(-15, 15), frandom(-20, 20))
			BSB2 B 0 A_TakeInventory("AtomicFireAmmo", 1)
			BSB2 B 2
			BSB2 B 0 A_JumpIfInventory("AtomicFireAmmo", 1, "ShootFollowShots")
			BSB2 B 35
			goto AttackEnd
			
		Death:
			BSB2 I 0 ACS_Execute(55, 0, 2)
			BSB2 I 0 A_TakeInventory("AtomicFireAmmo", 9999)
			BSB2 I 0 SetPlayerProperty(1, 2, PROP_INVULNERABILITY)
			BSB2 I 0 A_ChangeFlag(FLOAT, false)
			BSB2 I 0 A_ChangeFlag(NOGRAVITY, false)
			BSB2 I 0 A_Stop
			BSB2 I 0 Thing_Remove(327)
			BSB2 I 0 A_FaceTarget
			BSB2 I 0 A_Recoil(10)
			BSB2 I 0 ThrustThingZ(0, 12, 0, 0)
			BSB2 I 0 A_PlaySoundEx("weapon/cfire", "voice", 0, 1)
			BSB2 I 0 A_SpawnItemEx("BassExplode", random(-48,48), random(-8,48), random(0,48))
			BSB2 IIIIIIII 1 A_CheckFloor("End")
			goto Death+10
		End:
			BSB2 B 0 A_Stop
			BSB2 J 10 A_SpawnItemEx("ShockFX", random(0, 25), 0, random(0,25), 0, 0, 0, random(0,360)) 
			loop
	}
}

actor BassBossWings
{
	+MISSILE
	+NOINTERACTION
	-SOLID
	+NOGRAVITY
	+CLIENTSIDEONLY
	Scale 2.5
	Radius 1
	Height 1
	States
	{
	Spawn:
		TRB2 EF 1 A_Warp(AAPTR_TARGET, -8, 0, 32, 0, WARPF_INTERPOLATE|WARPF_NOCHECKPOSITION)
		TRB2 A 0 A_JumpIfInTargetInventory("TrebleBoostAmmo", 4, "SpawnNull")
		loop
	SpawnNull:
		TNT1 A 1
		TNT1 A 0 A_JumpIfInTargetInventory("TrebleBoostAmmo", 4, "SpawnNull")
		goto Spawn
	}
}

actor BassBossAuraQuake : BassBossWings
{
	Scale 3.5
	renderstyle translucent
	alpha 0.8
	States
	{
	Spawn:
	SpawnH:
		BSB0 H 1 A_Warp(AAPTR_TARGET, -1, 0, -10, 0, WARPF_INTERPOLATE|WARPF_NOCHECKPOSITION)
		BSB0 A 0 A_Quake(2, 4, 0, 2048)
		BSB0 A 0 A_JumpIfInTargetInventory("WeaponCharge", 1, "SpawnI")
		goto SpawnInvis
	SpawnI:
		BSB0 I 1 A_Warp(AAPTR_TARGET, -1, 0, -10, 0, WARPF_INTERPOLATE|WARPF_NOCHECKPOSITION)
		BSB0 A 0 A_Quake(2, 4, 0, 2048)
		BSB0 A 0 A_JumpIfInTargetInventory("WeaponCharge", 1, "SpawnJ")
		goto SpawnInvis
	SpawnJ:
		BSB0 J 1 A_Warp(AAPTR_TARGET, -1, 0, -10, 0, WARPF_INTERPOLATE|WARPF_NOCHECKPOSITION)
		BSB0 A 0 A_Quake(2, 4, 0, 2048)
		BSB0 A 0 A_JumpIfInTargetInventory("WeaponCharge", 1, "SpawnH")
		goto SpawnInvis
	SpawnInvis:
		TNT1 A 1 A_Warp(AAPTR_TARGET, -1, 0, -10, 0, WARPF_INTERPOLATE|WARPF_NOCHECKPOSITION)
		TNT1 A 0 A_JumpIfInTargetInventory("WeaponCharge", 1, "Spawn")
		loop
	}
}

actor Bass2BurstShot
{
	PROJECTILE
	+DONTBLAST
	+HITTRACER
	damagetype "BassBuster"
	Speed 50
	Damage (12)
	radius 8
	height 5
	scale 2.5
	States
	{
	Spawn:
		BSB0 KL 2
		loop
	XDeath:
		BSB0 A 0 A_CheckFlag("SHOOTABLE", "DeathGive", AAPTR_TRACER)
		stop
	DeathGive:
		BSB0 A 0 A_GiveInventory("Bass2BurstWeaken", 1, AAPTR_TRACER)
		stop
	}
}

actor Bass2BurstWeaken : PowerProtection
{
	Damagefactor "BassBuster", 0.6
	Powerup.duration -2
}

// [Russ] Shamelessly stolen from Gumballtoid

actor Bass2ChargeShot
{
	PROJECTILE
	+DONTBLAST
	translation "198:198=95:95", "192:192=62:62", "210:210=56:56"
	damagetype "BassBuster"
	Speed 50
	Damage (20)
	radius 8
	height 5
	scale 2.5
	States
	{
	Spawn:
		CBUS A 0 A_SpawnItemEx("Bass2ChargeShotFX",-32,0,0,momx/2,momy/2,momz/2,0,SXF_ABSOLUTEMOMENTUM|SXF_TRANSFERTRANSLATION)
		CBUS ABCH 2
		loop
	}
}

actor Bass2ChargeShotFX 
{
	+NOINTERACTION
	+CLIENTSIDEONLY
	Scale 2.5
	States
	{
	Spawn:
		CBUS DE 2
		goto Death
	Death:
		CBUS F 1 A_FadeOut(0.5)
		loop
	}
}

actor Bass2LaserDamager
{
	PROJECTILE
	+HITTRACER
	Damagetype "BassLaser"
	Damage (30)
	Speed 0
	Height 32
	Radius 20
	Scale 2.5
	States
	{
	Spawn:
		BASL A 0
		BASL A 0 A_CheckFloor("Graphic")
		BASL A 0 A_SpawnItemEx("Bass2LaserDamager", 0, 0, -16, momx, momy, momz, 0, SXF_ABSOLUTEANGLE|SXF_ABSOLUTEMOMENTUM)
		BASL A 1 A_JumpIf(true, "Graphic")
		wait
	Graphic:
		BASL A 1 BRIGHT
		stop
	XDeath:
		BASL A 0 A_GiveInventory("BassLaserImmune", 1, AAPTR_TRACER)
		BASL AB 1
		stop
	Death:
		BASL A 0 A_SpawnItemEx("Bass2LaserExplode", 0, 0, 0, momx, momy)
		stop
	}
}

actor Bass2LaserDamager2 : Bass2LaserDamager
{
	States
	{
	Spawn:
		BASL A 0
		BASL A 0 A_CheckFloor("Graphic")
		BASL A 0 A_SpawnItemEx("Bass2LaserDamager", 0, 0, -16, momx, momy, momz, 0, SXF_ABSOLUTEANGLE|SXF_ABSOLUTEMOMENTUM)
		BASL B 1 A_JumpIf(true, "Graphic")
		wait
	Graphic:
		BASL B 1 BRIGHT
		stop
	}
}

actor Bass2LaserSpawner
{
	PROJECTILE
	+NOINTERACTION
	States
	{
	Spawn:
		TNT1 A 0 A_Warp(AAPTR_TARGET, 0, 0, 0, 0, WARPF_INTERPOLATE|WARPF_NOCHECKPOSITION)
		TNT1 A 1 A_SpawnItemEx("Bass2LaserDamager", -momx, 0, 0, momx, momy, momz, 0, SXF_ABSOLUTEMOMENTUM)
		TNT1 A 0 A_Warp(AAPTR_TARGET, 0, 0, 0, 0, WARPF_INTERPOLATE|WARPF_NOCHECKPOSITION)
		TNT1 A 1 A_SpawnItemEx("Bass2LaserDamager2", -momx, 0, 0, momx, momy, momz, 0, SXF_ABSOLUTEMOMENTUM)
		TNT1 A 0 A_JumpIfInTargetInventory("AtomicFireAmmo", 1, "Spawn")
		stop
	}
}

actor Bass2LaserExplode
{
	PROJECTILE
	+RIPPER
	+FLOORHUGGER
	damage (0)
	height 1
	radius 1
	Scale 2.5
	States
	{
	Spawn:
		BASL A 0
		BASL AAAA 0 A_SpawnItemEx("Bass2LaserRubble", 0, 0, 0, random(2, 8), 0, random(4, 12), random(0, 359))
		BASL CDCD 1
		stop
	}
}

actor Bass2LaserRubble : Bass2LaserExplode
{
	-FLOORHUGGER
	-NOGRAVITY
	gravity 2.0
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 A 0 A_Jump(256, "Spawn1", "Spawn2", "Spawn3", "Spawn4", "Spawn5", "Spawn6")
		BASL E 1
		wait
	Spawn1:
		BASL F 1
		wait
	Spawn2:
		BASL G 1
		wait
	Spawn3:
		BASL H 1
		wait
	Spawn4:
		BASL I 1
		wait
	Spawn5:
		BASL J 1
		wait
	Spawn6:
		BASL K 1
		wait
	}
}

actor Bass2RubbleSpawner
{
	+THRUACTORS
	+MOVEWITHSECTOR
	States
	{
	Spawn:
		TNT1 A 1
		wait
	Fire:
		TNT1 A 0
		TNT1 A 0 A_SpawnItemEx("DrillExplode", 0, 0, 0, 0, 0, 0, 0, SXF_NOCHECKPOSITION)
		TNT1 AAAA 0 A_SpawnItemEx("Bass2LaserRubble", 0, 0, 0, random(2, 8), 0, random(4, 12), random(0, 359), SXF_NOCHECKPOSITION)
		goto Spawn
	}
}

actor BassLaserImmune : PowerProtection
{
	powerup.duration -3
	damagefactor "BassLaser", 0.0
}

actor Bass2WallDetect
{
	PROJECTILE
	+THRUACTORS
	speed 50
	radius 24
	height 10
	States
	{
	Spawn:
	TNT1 A 0
	TNT1 A 0 A_SpawnItemEx("Bass2WallDetectShot", 0, 0, 0, 50, 0, 0, 0)
	stop
	}
}

actor Bass2WallDetectShot : Bass2WallDetect
{
	States
	{
	Spawn:
	TNT1 A 2
	stop
	Death:
	TNT1 A 0 A_TakeFromTarget("AtomicFireAmmo", 999)
	stop
	}
}

actor Bass2RainSpawner
{
	PROJECTILE
	Height 10
	Radius 5
	Scale 2.5
	States
	{
	Spawn:
		BSB2 EFGH 2
		loop
	Death:
		BSB2 EFGHEF 5 A_FadeOut
		BSB0 K 0 A_SpawnItemEx("Bass2Rain", 96, 0, 0, 0, 0, -5, 0)
		BSB0 K 0 A_SpawnItemEx("Bass2Rain", 96, 0, 0, 0, 0, -5, 22.5)
		BSB0 K 0 A_SpawnItemEx("Bass2Rain", 96, 0, 0, 0, 0, -5, 45)
		BSB0 K 0 A_SpawnItemEx("Bass2Rain", 96, 0, 0, 0, 0, -5, 67.5)
		BSB0 K 0 A_SpawnItemEx("Bass2Rain", 96, 0, 0, 0, 0, -5, 90)
		BSB0 K 0 A_SpawnItemEx("Bass2Rain", 96, 0, 0, 0, 0, -5, 112.5)
		BSB0 K 0 A_SpawnItemEx("Bass2Rain", 96, 0, 0, 0, 0, -5, 135)
		BSB0 K 0 A_SpawnItemEx("Bass2Rain", 96, 0, 0, 0, 0, -5, 157.5)
		BSB0 K 0 A_SpawnItemEx("Bass2Rain", 96, 0, 0, 0, 0, -5, 180)
		BSB0 K 0 A_SpawnItemEx("Bass2Rain", 96, 0, 0, 0, 0, -5, 202.5)
		BSB0 K 0 A_SpawnItemEx("Bass2Rain", 96, 0, 0, 0, 0, -5, 225)
		BSB0 K 0 A_SpawnItemEx("Bass2Rain", 96, 0, 0, 0, 0, -5, 247.5)
		BSB0 K 0 A_SpawnItemEx("Bass2Rain", 96, 0, 0, 0, 0, -5, 270)
		BSB0 K 0 A_SpawnItemEx("Bass2Rain", 96, 0, 0, 0, 0, -5, 292.5)
		BSB0 K 0 A_SpawnItemEx("Bass2Rain", 96, 0, 0, 0, 0, -5, 315)
		BSB0 K 0 A_SpawnItemEx("Bass2Rain", 96, 0, 0, 0, 0, -5, 337.5)
		stop
	}
}

actor Bass2Rain
{
	PROJECTILE
	+THRUACTORS
	translation "210:210=56:56"
	alpha 0.2
	Height 10
	Radius 48
	Scale 2.5
	Speed 1
	damage (0)
	States
	{
	Spawn:
		BASB A 0
		BASB A 0 A_SpawnItemEx("Bass2Rain", 128, 0, 0, 0, 0, -5)
		BSB2 KLMNKL 4 A_FadeIn
		BSB2 G 0 A_GiveInventory("WeaponCharge", 1)
		BSB2 G 0 A_ScaleVelocity(6.0)
	SpawnLoop:
		BSB2 KLMN 4
		loop
	Death:
		BASB A 0 A_JumpIfInventory("WeaponCharge", 1, "DeathExplode")
	End:
		BASB A 0
		stop
	DeathExplode:
		BASB A 0 A_JumpIf(ceilingz-z > 1000, "End")
		BASB A 0 A_PlaySoundEx("misc/mm3explosion", "auto")
		TNT1 A 0 A_ChangeFlag(FLOORHUGGER, true)
		TNT1 A 0 A_Explode(15, 48, 0, 0, 48)
		BSB2 OPQ 2
		BSB2 RST 2 A_FadeOut(0.2)
		stop
	}
}

// CUT SCENE STUFF

actor BassBossTransition
{
	+SOLID
	Radius 6
	Height 56
	Scale 2.5
	Translation "198:198=95:95", "192:192=217:217"
	States
	{
	Spawn:
		BASS H 0
		BASS H 0 A_CheckFloor(2)
		BASS H 0 A_Recoil(20)
		BASS HHH 8 A_SpawnItemEx("BassExplode", random(-48,48), random(-8,48), random(0,48))
		BASS H 0 ACS_Execute(55, 0, 0)
		BASS H 0 A_CheckFloor("Waiting")
		BASS H 8 A_SpawnItemEx("BassExplode", random(-48,48), random(-8,48), random(0,48))
		Goto Spawn+8
	Waiting:
		BSB0 C 20
		BSB0 D 18
		loop
	Observe:
		BSB0 C -1
		wait
	Smirk:
		BSB0 E -1
		wait
	Float:
		BSB1 B 5 A_ChangeVelocity(0, 0, 9, CVF_RELATIVE|CVF_REPLACE)
		BSB1 B 6
		BSB0 A 0 A_ChangeFlag(NOGRAVITY, TRUE)
		BSB0 A 0 A_Stop
		BSB0 AB 3
		goto Float+3
	Transform:
		BSB0 A 0 A_ChangeFlag(NOINTERACTION, TRUE)
		BSB0 ABABAB 3
		stop
	}
}

actor SuperBassBossTransition : BassBossTransition
{
	+NOGRAVITY
	+FLOATBOB
	Floatspeed 2
	Radius 16
	Height 56
	Scale 2.5
	Translation "198:198=95:95", "192:192=62:62"
	States
	{
	Spawn:
		BSB0 A 0
		BSB0 A 0 A_SpawnItemEx("SuperBassBossAuraQuake")//, -1, 0, -(z-floorz)+4)
		BSB0 A 0 Thing_ChangeTID(0, 325)
		goto Gloat
	Gloat:
		//BSB0 FG 3 A_Quake(1, 4, 0, 512)
		BSB0 F 4 A_PlaySoundEx("misc/hugequake2", "auto", 0, 1)
		loop
	Shoot:
		BSB0 F 0 A_ChangeFlag(FLOATBOB, FALSE)
		BSB2 A 0 A_SpawnItemEx("SuperBassTransitionAttack", 0, 0, 128)
		BSB2 AA 3 A_Quake(2, 4, 0, 512)
		goto Shoot+2
	}
}

actor SuperBassBossAura
{
	+NOINTERACTION
	Radius 0
	Height 0
	Scale 3.5
	renderstyle translucent
	alpha 0.8
	States
	{
	Spawn:
		TNT1 A 0 
		TNT1 A 0 Thing_ChangeTID(0, 327) 
		TNT1 A 0 Thing_SetTranslation(325, 178)
		TNT1 A 1 A_GiveToTarget("SuperBassBossAura1", 1)
		TNT1 A 1 A_GiveToTarget("SuperBassBossAura2", 1)
		TNT1 A 1 A_GiveToTarget("SuperBassBossAura3", 1)
		TNT1 A 0 Thing_SetTranslation(325, 252)
		TNT1 A 1 A_GiveToTarget("SuperBassBossAura1", 1)
		TNT1 A 1 A_GiveToTarget("SuperBassBossAura2", 1)
		TNT1 A 1 A_GiveToTarget("SuperBassBossAura3", 1)
		Goto Spawn+2
	}


/*
	+THRUACTORS
	+NOINTERACTION
	+NOGRAVITY
	Scale 3.5
	renderstyle translucent
	alpha 0.8
	States
	{
	Spawn:
		BSB0 H 0
		BSB0 H 0 Thing_ChangeTID(0, 327) // [Russ] I would use a jump state, but that destroys the actor
		BSB0 HIJ 1
		Goto Spawn+2
	Death:
		BSB0 A 0
		stop
	}
*/
}


actor SuperBassBossAuraQuake 
{
	/*+THRUACTORS
	+NOINTERACTION
	+NOGRAVITY
	PROJECTILE
	*/
	+NOINTERACTION
	Radius 0
	Height 0
	Scale 3.5
	renderstyle translucent
	alpha 0.8
	States
	{
	Spawn:
		TNT1 A 0 
		TNT1 A 0 Thing_ChangeTID(0, 327) 
		TNT1 A 0 Thing_SetTranslation(325, 178)
		TNT1 A 1 A_GiveToTarget("SuperBassBossAura1", 1)
		TNT1 A 0 A_Quake(1, 4, 0, 1024)
		TNT1 A 1 A_GiveToTarget("SuperBassBossAura2", 1)
		TNT1 A 0 A_Quake(1, 4, 0, 1024)
		TNT1 A 1 A_GiveToTarget("SuperBassBossAura3", 1)
		TNT1 A 0 A_Quake(1, 4, 0, 1024)
		TNT1 A 0 Thing_SetTranslation(325, 252)
		TNT1 A 1 A_GiveToTarget("SuperBassBossAura1", 1)
		TNT1 A 0 A_Quake(1, 4, 0, 1024)
		TNT1 A 1 A_GiveToTarget("SuperBassBossAura2", 1)
		TNT1 A 0 A_Quake(1, 4, 0, 1024)
		TNT1 A 1 A_GiveToTarget("SuperBassBossAura3", 1)
		TNT1 A 0 A_Quake(1, 4, 0, 1024)

		/*BSB0 HIJ 1 A_Quake(1, 4, 0, 1024)
		BSB0 H 0 Thing_SetTranslation(325, 178)
		BSB0 HIJ 1 A_Quake(1, 4, 0, 1024)
		BSB0 H 0 Thing_SetTranslation(325, 252)
		*/
		Goto Spawn+2
	}
}

actor SuperBassBossAura1 : CustomInventory
{
inventory.amount 1
inventory.maxamount 1
+AUTOACTIVATE
States
{
Spawn:
TNT1 A 1
loop
Use:
TNT1 A 1 A_SpawnItemEx("SuperBassBossAuraFX1",-1,0,-10,momx, momy, momz, 0, SXF_ABSOLUTEMOMENTUM, 0)
stop
}
}

actor SuperBassBossAura2 : CustomInventory
{
	+INVENTORY.AUTOACTIVATE
	States
	{
	Use:
		TNT1 A 0
		TNT1 A 0 A_SpawnItemEx("SuperBassBossAuraFX2", -1, 0, -10)
		stop
	}
}

actor SuperBassBossAura3 : CustomInventory
{
	+INVENTORY.AUTOACTIVATE
	States
	{
	Use:
		TNT1 A 0
		TNT1 A 0 A_SpawnItemEx("SuperBassBossAuraFX3", -1, 0, -10)
		stop
	}
}
actor SuperBassBossAuraFX1
{
	+THRUACTORS
	+NOINTERACTION
	+NOGRAVITY
	Scale 3.5
	renderstyle translucent
	alpha 0.8
	States
	{
	Spawn:
		BSB0 H 0
		BSB0 H 1
		stop
	}
}

actor SuperBassBossAuraFX2 : SuperBassBossAuraFX1
{
	States
	{
	Spawn:
		BSB0 I 0
		BSB0 I 1
		stop
	}
}

actor SuperBassBossAuraFX3 : SuperBassBossAuraFX1
{
	States
	{
	Spawn:
		BSB0 J 0
		BSB0 J 1
		stop
	}
}

actor SuperBassTransitionAttack
{
	PROJECTILE
	+THRUACTORS
	Scale 4.5
	Damage (0)
	height 10
	radius 10
	Speed 15
	renderstyle add
	alpha 0.2
	States
	{
	Spawn:
		BSB0 K 0
		BSB0 K 0 A_PlaySoundEx("weapon/centauruncloak", "auto", 0, 1)
		BSB0 KLKLKL 3 A_FadeIn
		BSB0 K 0 A_SetTranslucent(1.0, 0)
		BSB0 K 3
		BSB0 K 0 ThrustThingZ(0, 96, 1, 0)
		BSB0 K 0 A_Recoil(-40)
	SpawnLoop:
		BSB0 KL 4
		loop
	Death:
		BSB0 K 0 A_PlaySoundEx("weapon/cfire","Auto",0,1)
		BSB0 K 0 ACS_Execute(55, 0, 1)
		stop
	}
}

actor TrebleBossScene
{
	Height 56
	Radius 16
	Scale 2.5
	States
	{
	Spawn:
		TRBL F 1 A_CheckFloor("In")
		TRBL F 0 ThrustThingZ(0, 50, 1, 0)
		loop
	In:
		TRBL F 0 A_ChangeFlag(FLOORHUGGER, TRUE)
		TRBL GH 2
		TRBL E 5 A_PlaySoundEx("misc/polarroar","Voice")
		TRBL AABCBCBC 4
		Goto In+4
	Fusion:
		TRBL B 18
		TRBL E 5 A_PlaySoundEx("misc/polarroar","Voice")
		TRBL B 5
		TRBL E 0 A_SpawnItemEx("TrebleBossSceneJump", 0, 0, 0, 5, 0, 15)
		TRBL Z 4
		stop
	}
}

actor TrebleBossSceneJump
{
	PROJECTILE
	Height 56
	Radius 16
	Scale 2.5
	-NOGRAVITY
	States
	{
	Spawn:
		TBS0 A 0
		TBS0 A 0 Thing_ChangeTID(0, 326)
		TBS0 A 1
		wait
	}
}

actor BassExplode
{
	-SOLID
	+NOGRAVITY
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 A 0 A_PlaySoundEx("weapon/cfire","Auto",0,1)
		TNT1 A 0 A_SpawnItemEx("DrillExplode")
		stop
	}
}

actor SuperAdaptorBassFight : AdaptorUpgrade
{
	+INVENTORY.AUTOACTIVATE
	States
	{
	SpawnLoop:
		BSSA A 1
		loop
	Use:
		BSSA A 0 A_GiveInventory("AdaptorUpgrade", 1)
		stop
	}
}

actor WoundedTreble
{
scale 2.5
-SOLID
States
{
Spawn:
TBS0 B -1
loop
}
}