actor SakugarneBoss : BaseMM8BDMWep_CBM
{
dropitem "SakugarneWepCDropped"
Weapon.AmmoUse 0
Weapon.AmmoGive 28
Weapon.SlotNumber 6
Obituary "$OB_SAKUGARNE"
Inventory.Pickupmessage "Power up! Sakugarne!"
weapon.ammotype "BackToTheAmmo"
inventory.icon "SAKUSI"
States
{
Spawn:
C_0K D 1
loop
Ready:
SAKH A 0 ACS_ExecuteAlways(998,0,946)
SAKH A 0 ACS_ExecuteAlways(648,0,1)//Disable Jump
SAKH A 0 A_TakeInventory("QuintNoPogo",1)
SAKH A 0 A_GiveInventory("QuintYesPogo",1)
SAKH A 0 A_GiveInventory("JumpCanclerDisable",1)
SAKH A 0 A_GunFlash
Goto ReadyQ
ReadyQ:
SAKH A 1 A_WeaponReady
//SAKH A 0 A_JumpIf(z-floorz>0, "ReadyQ")
Goto Fire//+3
Deselect:
TNT1 A 0 A_TakeInventory("SakugarneActive",1)
TNT1 A 0 A_TakeInventory("SakuRockCheck",1)
TNT1 A 0 A_TakeInventory("JumpCanclerDisable",1)
TNT1 A 0 ACS_ExecuteAlways(648,0,0)
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
SAKH A 1 A_Lower
Loop
Select:
TNT1 A 0 A_TakeInventory("SakugarneActive",1)
TNT1 A 0 A_TakeInventory("SakuRockCheck",1)
TNT1 A 0 A_TakeInventory("JumpCanclerDisable",1)
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
SAKH A 1 A_Raise
Loop

Fire:
SAKH A 0 A_JumpIfInventory("SakugarneActive",1,"AirReady")
SAKH A 0 A_JumpIf(z-floorz==0,"Jump")
SAKH A 0 A_SpawnItemEx("SakugarneCrushB",6,0,-10,momx,momy,-100,0,8)
SAKH A 1 A_WeaponReady
SAKH A 0 A_JumpIfInventory("QuintDive",1,"RockSpread")
loop

Air:
SAKH C 0 A_JumpIf(z-floorz==0,"Jump")
SAKH C 0 A_SpawnItemEx("SakugarneCrushB",6,0,-10,momx,momy,-100,0,8)
SAKH C 1 A_WeaponReady
SAKH C 0 A_JumpIfInventory("IsBot",1,"BotAir")
SAKH C 0 A_JumpIfInventory("QuintDive",1,"RockSpread")
loop

BotAir:
SAKH C 0 A_Jump(2,2)
SAKH C 0 A_JumpIfInventory("QuintDive",1,"RockSpread")
Goto Air
SAKH C 0 A_SelectWeapon("QuintBusterBoss")
Goto Air

AirReady:
SAKH C 0 A_JumpIf(z-floorz==0,"Jump2")
SAKH C 0 A_SpawnItemEx("SakugarneCrushB",6,0,-10,momx,momy,-100,0,8)
SAKH C 1 A_WeaponReady(WRF_NOPRIMARY)
SAKH C 0 A_JumpIfInventory("IsBot",1,"BotAirReady")
SAKH C 0 A_Refire("AirReady")
SAKH C 0 A_JumpIfInventory("QuintDive",1,"RockSpread")
goto Air

BotAirReady:
SAKH C 0 A_JumpIfInventory("QuintDive",1,"RockSpread")
SAKH C 0 A_JumpIfCloser(96,"Altfire")
SAKH C 0 A_Jump(4,"Altfire")
SAKH C 0 A_Jump(1,2)
SAKH C 0 A_Refire("AirReady")
Goto Air
SAKH C 0 A_SelectWeapon("QuintBusterBoss")
SAKH C 0 A_Refire("AirReady")
Goto Air

Jump:
SAKH A 0 A_FireCustomMissile("SakugarneDrillerB",0,0,0,0)
SAKH A 0 A_FireCustomMissile("SakugarneDrillerB2",0,0,0,0)
SAKH A 0 A_GiveInventory("SakuRock_Pickup",1)
SAKH A 0 A_PlaySoundEx("weapon/sakugarne","Weapon")//+3
SAKH A 0 A_TakeInventory("QuintIsAir",1)
SAKH A 0 A_GunFlash
SAKH AABB 2
SAKH A 0 A_JumpIfInventory("QuintDive",1,"JumpDive")
SAKH A 0 A_TakeInventory("SakuRockCheck",1)
SAKH A 0 SetPlayerProperty(0,0,0)
SAKH A 0 A_Recoil(-18)
SAKH A 0 ThrustThingZ(0,60,0,0)//A_ChangeVelocity(17,0,16, CVF_RELATIVE)
SAKH C 5 A_GiveInventory("QuintIsAir",1)
SAKH C 5 A_JumpIfInventory("IsBot",1,"BotJump")
SAKH A 0 A_GiveInventory("SakugarneActive",1)
SAKH A 0 A_WeaponReady(12)
Goto Air

JumpDive:
SAKH B 0 A_TakeInventory("QuintDive",1)
SAKH BA 2
SAKH A 0 A_GiveInventory("SakuRock_PickupX",1)
goto Jump+3

BotJump:
SAKH C 5 A_Jump(24,3)
SAKH A 0 A_GiveInventory("SakugarneActive",1)
SAKH A 0 A_WeaponReady(12)
Goto Air
SAKH C 5 A_SelectWeapon("QuintBusterBoss")
SAKH A 0 A_GiveInventory("SakugarneActive",1)
SAKH A 0 A_WeaponReady(12)
Goto Air

Jump2:
SAKH A 0 A_FireCustomMissile("SakugarneDrillerB",0,0,0,0)
SAKH A 0 A_FireCustomMissile("SakugarneDrillerB2",0,0,0,0)
SAKH A 0 A_GiveInventory("SakuRockCheck",1)
SAKH A 0 A_GiveInventory("SakuRock_Pickup",1)
SAKH A 0 A_PlaySoundEx("weapon/sakugarne","Weapon")//+4
SAKH A 0 A_TakeInventory("QuintIsAir",1)
SAKH A 0 A_GunFlash
SAKH AB 3
SAKH A 0 A_JumpIfInventory("QuintDive",1,"JumpDive2")
SAKH A 0 SetPlayerProperty(0,0,0)
SAKH A 0 //A_Recoil(-10)
SAKH A 0 A_ChangeVelocity(16,0,21,CVF_RELATIVE)//ThrustThingZ(0,80,0,0)
SAKH C 5 A_GiveInventory("QuintIsAir",1)
SAKH C 5 A_JumpIfInventory("IsBot",1,"BotJump2")
SAKH A 0 A_WeaponReady(12)
Goto Air

JumpDive2:
SAKH B 0 A_TakeInventory("QuintDive",1)
SAKH BA 2
SAKH A 0 A_GiveInventory("SakuRock_PickupX",1)
goto Jump2+4

BotJump2:
SAKH C 5 A_Jump(12,2)
SAKH A 0 A_WeaponReady(12)
Goto Air
SAKH C 5 A_SelectWeapon("QuintBusterBoss")
SAKH A 0 A_WeaponReady(12)
Goto Air

NoAmmo:
SAKH A 1 A_Refire("AirReady")
goto Ready2
Altfire:
SAKH C 0 A_GiveInventory("QuintDive",1)
Rockspread:
SAKH C 0 //A_Stop
SAKH C 1 ThrustThingZ(0,-200,0,1)
goto Air
Flash:
TNT1 A 1// A_TakeInventory("JumpCancler",2)
TNT1 A 0 //A_JumpIfInventory("IsDead",1,"NoFlash")
stop//loop
}
}

actor BackToTheAmmo : Ammo
{
inventory.amount 1
inventory.maxamount 3
+INVENTORY.IGNORESKILL
}


actor QuintYesPogo :OnceC{}
actor QuintNoPogo :OnceC{}

actor SakuRockCheck :OnceC{}

actor SakuRockDiagonal :OnceC{}

actor QuintDive :OnceC{}

actor QuintIsAir :OnceC{}

actor Sakugarne1C
{
Scale 2.5
-SOLID
+NOGRAVITY
+CLIENTSIDEONLY
+DONTBLAST
+NOINTERACTION
+NOTIMEFREEZE
States
{
Spawn:
QBUS S 0
QBUS S 1
stop
}
}

actor Sakugarne2C : Sakugarne1C
{
States
{
Spawn:
QBUS T 0
QBUS T 1
stop
}
}

actor SakuRock_Pickup : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_JumpIfInventory("QuintDive",1,"Pickup0X")
TNT1 A 0 A_JumpIfInventory("SakuRockCheck",1,"Pickup0")
stop
Pickup0X:
TNT1 A 0 SetPlayerProperty(0,1,0)
goto Pickup0
Pickup0:
TNT1 A 0 A_JumpIfInventory("SakuRockDiagonal",1,"Pickup0")
goto Pickup1
Pickup1:
TNT1 A 0 A_SpawnItemEx("SakuRock",3,0,16,12,0,7,0,1)
TNT1 A 0 A_SpawnItemEx("SakuRock",3,0,16,12,0,7,90,1)
TNT1 A 0 A_SpawnItemEx("SakuRock",3,0,16,12,0,7,180,1)
TNT1 A 0 A_SpawnItemEx("SakuRock",3,0,16,12,0,7,270,1)
TNT1 A 0 A_GiveInventory("SakuRockDiagonal",1)
goto End
Pickup2:
TNT1 A 0 A_SpawnItemEx("SakuRock",3,0,16,12,0,7,45,1)
TNT1 A 0 A_SpawnItemEx("SakuRock",3,0,16,12,0,7,135,1)
TNT1 A 0 A_SpawnItemEx("SakuRock",3,0,16,12,0,7,225,1)
TNT1 A 0 A_SpawnItemEx("SakuRock",3,0,16,12,0,7,315,1)
TNT1 A 0 A_TakeInventory("SakuRockDiagonal",1)
goto End
End:
TNT1 A 0
stop
}
}

actor SakuRock_PickupX : SakuRock_Pickup
{
States
{
Pickup:
goto Pickup0
}
}

actor SakuRock
{
//Translation "195:195=248:248",  "204:204=215:215"
Obituary "$OB_QUINTROCK"
PROJECTILE
-NOGRAVITY
Damage (10)
Height 12
Radius 12
scale 2.5
Speed 20
damagetype "SakuDrill"
States
{
Spawn:
QROC A 1
loop
}
}


actor SakugarneCrushB : SakugarneCrush
{
+THRUGHOST
+DONTBLAST
damage (6)//20
damagetype "SakugarneB"
//Obituary "$OB_SAKUGARNE"
Radius 20//30
Height 2
States
{
Spawn:
TNT1 A 1//2
stop
}
}

actor SakugarneDrillerB : BasicExplosion
{
damagetype "Sakugarne"
Obituary "$OB_QUINTEXPLODE"
States
{
Spawn:
TNT1 A 0
TNT1 A 1 A_Explode(12,144,0,0,144)
stop
}
}

actor SakugarneDrillerB2 : BasicExplosion
{
damagetype "SakugarneB"
Obituary "$OB_QUINTEXPLODE"
States
{
Spawn:
TNT1 A 0
TNT1 A 1 A_Explode(26,144,0,0,32)
stop
}
}

actor QuintBusterBoss : BaseMM8BDMWep_CBM
{
dropitem "SakugarneWepCDropped"
Weapon.AmmoUse 0
Weapon.AmmoGive 3
Weapon.SlotNumber 1
Obituary "$OB_QUINTBUSTER"
Inventory.Pickupmessage "You Lose! Good day sir!"
weapon.ammotype "BackToTheAmmo"
+WEAPON.NOAUTOAIM
inventory.icon "MBUSTERI"
States
{
Spawn:
C_0K D 1
loop
Ready:
QBUS B 0 ACS_ExecuteAlways(998,0,946)
QBUS B 0 ACS_ExecuteAlways(648,0,0)
QBUS B 0 A_TakeInventory("QuintYesPogo",1)
QBUS B 0 A_GiveInventory("QuintNoPogo",1)//A_GunFlash
goto ReadyQ
ReadyQ:
QBUS B 1 A_WeaponReady
Goto ReadyQ
Deselect:
QBUS B 0 A_TakeInventory("QuintDive",99)
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
QBUS B 1 A_Lower
Loop
Select:
QBUS B 0 A_TakeInventory("QuintDive",99)
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
QBUS B 1 A_Raise
Loop
Fire:
QBUS B 0 A_TakeInventory("SakugarneActive",1)
QBUS B 0 A_JumpIfInventory("IsBot",1,"BotFire")
QBUS B 0 A_PlaySoundEx("weapon/GameBoyFire","Weapon")
QBUS B 0 A_GiveInventory("QuintMain_CI",1)
QBUS CD 3
QBUS B 2
goto ReadyQ
BotFire:
QBUS B 0 A_JumpIfCloser(64,2)
QBUS B 0 A_Jump(8,1)
goto Fire+2
QBUS B 0 A_SelectWeapon("SakugarneBoss")
goto Fire+2
NoAmmo:
QBUS B 0
Goto ReadyQ
Flash:
TNT1 A 1
stop
}
}

Actor QShot : MegaShot
{
Translation "204:204=215:215"
Obituary "$OB_QUINTBUSTER"
speed 32
States
{
Spawn:
TNT1 A 2
BUST T 1 
goto spawn+1
Death:
BUST T 1
stop
}
}

actor QShotB : QShot{translation "204:204=205:205"}
actor QShotR : QShot{translation "204:204=171:171"}
actor QShotO : QShot{translation "204:204=104:104"}
actor QShotP : QShot{translation "204:204=229:229"}

actor QuintMain_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("QShot",random(3,-3),0,8,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("QShotB",random(3,-3),0,8,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("QShotR",random(3,-3),0,8,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("QShotO",random(3,-3),0,8,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("QShotP",random(3,-3),0,8,0)
goto Done
}
}