actor Quint_W2 : BaseMM8BDMWep_CBM
{
tag "$TAGC_KD"
dropitem "SakugarneWep"
Weapon.AmmoUse 0
Weapon.AmmoGive 28
Weapon.AmmoGive2 28
Obituary "$OB_SAKUGARNE"
Inventory.Pickupmessage "Power up! Sakugarne!"
weapon.ammotype "BackToTheAmmo"
weapon.ammotype2 "MMXQuintAmmo"
inventory.icon "SAKUSI"
States
{
Spawn:
C_0K D 1
loop

Deselect:
QBUS A 0 A_TakeInventory("QuintIsAir")
QBUS A 0 A_TakeInventory("SakugarneActive")
QBUS A 0 A_TakeInventory("NoJumpCancel")
QBUS A 0 A_TakeInventory("CBM_DisableJumpPower")
QBUS A 0 A_TakeInventory("CBM_165_SpeedPower")
QBUS A 0 A_TakeInventory("CBM_DisableSpeedPower")
goto DeselectSwap
Select:
QBUS A 0 A_TakeInventory("QuintIsAir")
QBUS A 0 A_TakeInventory("SakugarneActive")
QBUS A 0 A_TakeInventory("NoJumpCancel")
goto SelectSwap

Ready:
QBUS A 0 ACS_NamedExecuteWithResult("core_weaponcolor",DYE_QUINT,0,CBM_TCLR_DEFAULT)
QBUS A 0 A_GiveInventory("CBM_DisableJumpPowerGiver",1)//Disable Jump
QBUS A 0 A_GiveInventory("QuintNoPogo",1)
QBUS A 0 A_GiveInventory("NoJumpCancel",1)
QBUS A 0 A_GiveInventory("SakuAmmoDelay",1)
QBUS A 0 A_GunFlash("NoFlash",0)
Goto Ready1
Ready1:
QBUS A 1 A_WeaponReady(12)
Goto Fire

Fire:
QBUS A 0 A_JumpIfInventory("SakugarneActive",1,"AirStomp")
QBUS A 1 A_WeaponReady(12)
QBUS A 0 A_GiveInventory("QuintAmmoHelp_P",1)
QBUS A 0 A_JumpIf(z-floorz==0,"JumpStart")
QBUS A 0 A_JumpIf(momz==0,"FireV")
loop
FireV:
QBUS A 1 A_WeaponReady(12)
QBUS A 0 A_JumpIf(z-floorz==0,"JumpStart")
QBUS A 0 A_JumpIf(momz==0,"JumpStart")
goto Fire

JumpStart:
QBUS A 0 A_JumpIfInventory("SakugarneActive",1,"Air")
QBUS A 0 A_PlaySoundEx("weapon/sakugarne","Weapon")
QBUS A 0 A_GiveInventory("QuintYesPogo",1)
QBUS A 0 A_TakeInventory("QuintNoPogo",9)
QBUS A 0 A_GunFlash("NoFlash",0)
QBUS BC 2
QBUS C 0 A_GiveInventory("CBM_165_SpeedPowerGiver",1)
QBUS C 0 A_ChangeVelocity(0,0,16,CVF_RELATIVE)
QBUS C 0 A_GiveInventory("SakugarneActive",1)
QBUS C 2 A_GiveInventory("QuintIsAir",1)
QBUS C 2 A_GiveInventory("Quint_LeapWeaken")
Goto Air

Air:
QBUS C 0 A_JumpIfInventory("BackToTheAmmo",7,"Air2")
QBUS C 0 A_JumpIf(z-floorz==0,"Jump")
QBUS C 0 A_JumpIfInventory("VivifyDelay6",1,"AirBounce")
QBUS C 0 A_SpawnItemEx("QuintLeapCrush",4,0,-10,momx,momy,-100,0,8)
QBUS C 1 A_WeaponReady(12)
QBUS C 0 A_GiveInventory("QuintAmmoHelp_P",1)
//QBUS C 0 A_JumpIfInventory("IsBot",1,"BotAir")
loop
AirBounce:
QBUS A 3
QBUS B 3 A_TakeInventory("VivifyDelay6",1)
goto Air

Air2:
QBUS C 0 A_JumpIfInventory("BackToTheAmmo",28,"Air3")
QBUS C 0 A_JumpIf(z-floorz==0,"Jump")
QBUS C 0 A_JumpIfInventory("VivifyDelay6",1,"AirBounce")
QBUS C 0 A_SpawnItemEx("QuintLeapCrush",4,0,-10,momx,momy,-100,0,8)
QBUS C 1 A_WeaponReady(8)
QBUS C 0 A_GiveInventory("QuintAmmoHelp_P",1)
//QBUS C 0 A_JumpIfInventory("IsBot",1,"BotAir")
loop

Air3:
QBUS C 0 A_JumpIf(z-floorz==0,"Jump")
QBUS C 0 A_JumpIfInventory("VivifyDelay6",1,"AirBounce")
QBUS C 0 A_SpawnItemEx("QuintLeapCrush",4,0,-10,momx,momy,-100,0,8)
QBUS C 1 A_WeaponReady
QBUS A 0 A_GiveInventory("QuintAmmoHelp_P",1)
//QBUS C 0 A_JumpIfInventory("IsBot",1,"BotAir")
loop

BotAir:
QBUS C 0 A_Jump(2,1)
Goto Air
QBUS C 0 A_SelectWeapon("Quint_W")
Goto Air

AirStomp:
QBUS C 0 A_JumpIf(z-floorz==0,"JumpWaveCheck")
QBUS C 0 A_JumpIfInventory("VivifyDelay6",1,"AirBounce")
QBUS C 1 A_GiveInventory("Saku_AirThrust_P")
//QBUS C 0 A_JumpIfInventory("IsBot",1,"BotAirStomp")
QBUS C 0 A_JumpIf(z-floorz==0,"JumpWaveCheck")
QBUS C 0 A_JumpIfInventory("VivifyDelay6",1,"AirBounce")
QBUS C 1 A_GiveInventory("Saku_AirThrust_P2")
loop

BotAirStomp:
QBUS C 0 A_JumpIfCloser(96,"Altfire")
QBUS C 0 A_Jump(4,"SpinJump")
QBUS C 0 A_Jump(1,2)
QBUS C 0 A_Refire("AirReady")
Goto Air
QBUS C 0 A_SelectWeapon("Quint_W")
QBUS C 0 A_Refire("AirReady")
Goto Air

Jump:
QBUS A 0 A_JumpIfInventory("VivifyDelay6",1,"AirBounce")
QBUS A 0 A_SpawnItemEx("QuintSakuBlastLand",0,0,28)
QBUS A 0 A_GiveInventory("QuintDive_Pickup",1)
QBUS A 0 A_PlaySoundEx("weapon/sakugarne","Weapon")
QBUS A 0 A_TakeInventory("QuintIsAir",1)
QBUS A 0 A_GunFlash("NoFlash",0)
QBUS A 0 A_JumpIf(CallACS("cbm_GetPointerButtonInput",0,false) & BT_JUMP,"Jump2")

//QBUS A 0 A_SetArg(3,momy*100000)
//QBUS A 0 A_SetArg(2,momx*100000)

QBUS AABB 2
QBUS A 0 A_TakeInventory("CBM_DisableSpeedPower")//SetPlayerProperty(0,0,0)
//QBUS A 0 A_ChangeVelocity(Args[2]*0.00001,Args[3]*0.00001,16,CVF_REPLACE)//17 0 16 //CVF_RELATIVE
QBUS A 0 ThrustThingZ(0,64,0,0)
QBUS C 4 A_GiveInventory("QuintIsAir",1)
QBUS C 1 A_JumpIfInventory("IsBot",1,"BotJump")
QBUS C 1 A_GiveInventory("Quint_LeapWeaken")
QBUS A 0 A_WeaponReady(12)
Goto Air

BotJump:
QBUS C 2 A_Jump(20,3)
QBUS A 0
QBUS A 0 A_WeaponReady(12)
Goto Air
QBUS C 2 A_SelectWeapon("Quint_W")
QBUS A 0
QBUS A 0 A_WeaponReady(12)
Goto Air

Jump2:
QBUS AB 3
QBUS A 0 A_TakeInventory("CBM_DisableSpeedPower")//SetPlayerProperty(0,0,0)
QBUS A 0 ThrustThingZ(0,84,0,0)//A_ChangeVelocity(0,0,21,CVF_RELATIVE)//16,0,21
QBUS C 4 A_GiveInventory("QuintIsAir",1)
QBUS C 1
QBUS C 1 A_GiveInventory("Quint_LeapWeaken")
QBUS A 0 A_WeaponReady(12)
Goto Air

JumpWaveCheck:
QBUS A 0 A_JumpIfInventory("VivifyDelay6",1,"AirBounce")
QBUS A 0 A_JumpIfInventory("BackToTheAmmo",7,"JumpWave")
goto Jump+1
JumpWave:
QBUS A 0 A_PlaySoundEx("misc/mm3explosion","Body")
QBUS A 0 A_GiveInventory("Quint_FireWave_P")
QBUS A 0 ACS_NamedExecuteWithResult("core_stopplayer",0,1)
QBUS A 0 A_TakeInventory("QuintIsAir",1)
QBUS A 0 A_GunFlash("NoFlash",0)
QBUS AB 4 A_Stop
QBUS A 0 ACS_NamedExecuteWithResult("core_stopplayer",0,0)
goto Jump+3

Altfire:
QBUS C 0 A_JumpIfInventory("BackToTheAmmo",28,"SpinJump")
goto Air

SpinJump:
QBUS C 0 ACS_NamedExecuteWithResult("cbm_NoHitStunplayer",0,true)
QBUS C 0 A_GiveInventory("QuintSpinDiveSlow",1)
/*
QBUS C 0 A_ChangeVelocity(48,0,0,3)
QBUS C 0 A_JumpIfInventory("PlayerPropertyGrounded",1,2)
QBUS C 0 ThrustThingZ(0,80,0,0)
QBUS C 2
QBUS C 4 A_TakeInventory("WeaponCharge",999)
QBUS C 3 A_TakeInventory("BackToTheAmmo",28)
*/

QBUS C 0 A_TakeInventory("BackToTheAmmo",14)
QBUS C 0 A_TakeInventory("BackToTheAmmo",14,1)
QBUS C 0 A_TakeInventory("WeaponCharge",999)
QBUS C 0 ThrustThingZ(0,4,0,0)

QBUS C 1 A_SetArg(3,angle)
QBUS C 0 A_PlaySoundEx("misc/quintspin","Body")
QBUS C 0 A_Stop
QBUS C 0 A_JumpIfInventory("PlayerPropertyGrounded",1,"SpinningFall")
QBUS C 0 //A_ChangeVelocity(0,0,23,3)
goto SpinningUp
SpinningUp:
QBUS C 0 A_SetAngle(angle+30)
QBUS C 0 A_SpawnItemEx("QuintSakuAltSpin",0,0,-16,0,0,0,0,1)
QBUS C 0 ThrustThingZ(0,4,0,0)
QBUS C 1 A_GiveInventory("WeaponCharge",1)
QBUS C 0 A_JumpIfInventory("WeaponCharge",20,"SpinningPush")
goto SpinningUp
SpinningPush:
QBUS C 0 ThrustThing(args[3]*256/360,1,1,0)
QBUS C 0 A_GiveInventory("CBM_BeatBoostRemoveCheck_P")
QBUS C 0 A_GiveInventory("QuintSpinningDelay",1)
goto SpinningFall
SpinningFall:
QBUS C 0 A_SetAngle(angle+30)
QBUS C 0 A_SpawnItemEx("QuintSakuAltSpin",0,0,-16,0,0,0,0,1)
QBUS C 0 A_ChangeVelocity(0,0,-1,CVF_RELATIVE)
QBUS C 1 A_JumpIf(z-floorz==0,"SpinLand")
QBUS C 0 A_JumpIfInventory("WeaponCharge",26,"SpinLand")
QBUS C 0 A_JumpIfInventory("QuintSpinningDelay",1,"SpinningFall")
goto SpinningHelp
SpinningHelp:
QBUS C 0 ThrustThing(args[3]*256/360,20,1,0)
QBUS C 0 A_SetArg(3,random(0,255))
QBUS C 0 A_GiveInventory("WeaponCharge",1)
QBUS C 0 A_GiveInventory("QuintSpinningDelay",1)
goto SpinningFall

SpinLand:
QBUS C 0 A_SetAngle(args[3])
QBUS B 0 A_GiveInventory("CBM_DisableSpeedPowerGiver",1)
QBUS B 0 A_GiveInventory("QuintDive",1)
QBUS B 0 A_TakeInventory("QuintIsAir")
QBUS B 0 ACS_NamedExecuteWithResult("cbm_NoHitStunplayer",0,false)
QBUS B 0 A_TakeInventory("QuintSpinDiveSlow")
QBUS B 0 A_GunFlash("NoFlash",0)
QBUS B 0 A_FireCustomMissile("SakuRockCrusher",0,0,0,0)
QBUS BABABABABABABABA 2 A_Stop
QBUS A 0 A_TakeInventory("QuintDive")
Goto Jump+3

}
}

actor Quint_W : BaseMM8BDMWep_CBM
{
tag "$TAGC_KD2"
dropitem "SakugarneWep"
Weapon.AmmoUse 0
Weapon.AmmoGive 3
Weapon.AmmoGive2 28
Obituary "$OB_QUINTBUSTER"
Inventory.Pickupmessage "You Lose! Good day sir!"
weapon.ammotype "BackToTheAmmo"
weapon.ammotype2 "MMXQuintAmmo"
+WEAPON.NOAUTOAIM
inventory.icon "QBustIcn"
States
{
Spawn:
C_0K D 1
loop

Deselect:
QBUS D 0 A_TakeInventory("QuintDive")
goto DeselectSwap
Select:
QBUS D 0 A_TakeInventory("QuintDive")
QBUS D 0 A_TakeInventory("SakugarneActive")
goto SelectSwap

Ready:
QBUS D 0 ACS_NamedExecuteWithResult("core_weaponcolor",DYE_QUINT,0,CBM_TCLR_DEFAULT)
QBUS D 0 A_TakeInventory("CBM_DisableJumpPower")
QBUS D 0 A_TakeInventory("QuintYesPogo",1)
QBUS D 0 A_GiveInventory("QuintNoPogo",1)//A_GunFlash("NoFlash",0)
Goto Ready1
Ready1:
QBUS D 0 A_JumpIfInventory("MMXQuintAmmo",100,"Ready2")
QBUS D 9 A_WeaponReady(8)
QBUS D 0 A_GiveInventory("BackToTheAmmo",1)
loop
Ready2:
QBUS D 9 A_WeaponReady
QBUS D 0 A_GiveInventory("BackToTheAmmo",1)
loop

Fire:
QBUS D 0 A_JumpIfInventory("IsBot",1,"BotFire")
QBUS D 0 A_PlaySoundEx("weapon/GameBoyFire","Weapon")
QBUS D 0 A_FireCustomMissile("QShot",0,0,8,0)
QBUS EF 3
QBUS D 4 
QBUS D 0 A_GiveInventory("BackToTheAmmo",1)
goto Ready1

FireV://Lazy desync fix?
AirStomp://
JumpStart://
goto Fire

Altfire:
QBUS D 0 A_JumpIfInventory("MMXQuintAmmo",100,"Altfire2")
goto Ready1
Altfire2:
QBUS G 0 A_GiveInventory("Quint_SlideMMX_P")
QBUS G 0 A_GiveInventory("VivifyDelay10",1)
QBUS G 0 A_Refire(1)
goto AltfireH
AltfireH:
//QBUS MMXISGREAT
QBUS GGGGGGGGGG 1 A_GiveInventory("Quint_SlideThrust_P")
QBUS G 1 OffSet(-10,52)A_ChangeVelocity(momx*0.75,momy*0.75,momz,2)
QBUS G 1 OffSet(-20,72)
QBUS D 2 OffSet(12,112)
QBUS D 2 OffSet(9,92)
QBUS D 2 OffSet(6,72)
QBUS D 2 OffSet(3,52)
goto Ready1

BotFire:
QBUS D 0 A_JumpIfCloser(64,2)
QBUS D 0 A_Jump(8,1)
goto Fire+1
QBUS D 0 A_SelectWeapon("Quint_W2")
goto Fire+1
}
}

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

actor MMXQuintAmmo : Ammo
{
inventory.amount 1
inventory.maxamount 300
+INVENTORY.IGNORESKILL
}


actor QuintYesPogo : Inventory{}
actor QuintNoPogo : Inventory{}


actor QuintDive : Inventory{}

actor QuintIsAir : Inventory{}

actor SakuAmmoDelay : Powerup
{
+INVENTORY.ADDITIVETIME
Powerup.Duration 6
}

actor QuintSpinDiveSlow : PowerSpeed
{
powerup.duration -30
Speed 0.25
+POWERSPEED.NOTRAIL
}

actor QuintSpinningDelay : Powerup
{
Powerup.Duration 88
}

actor Quint_FireWave_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_TakeInventory("BackToTheAmmo",2)
TNT1 A 0 A_TakeInventory("BackToTheAmmo",5,1)
TNT1 A 0 A_FireCustomMissile("SakuShockwaveSpawner",0,0,0,-16)
stop
}
}

actor Saku_AirThrust_P : CustomInventory
{
States
{
Pickup:
//TNT1 A 0 A_LOGINT(MOMX*MOMX+MOMY*MOMY)
//TNT1 A 0 A_LOGINT(MOMX)
//TNT1 A 0 A_LOGINT(MOMY)
TNT1 A 0 A_SpawnItemEx("SakuTrailFX",0,0,0,0,0,0,0,1)
Thrust:
TNT1 A 0 A_SpawnItemEx("QuintLeapCrush",4,0,-10,momx,momy,-100,0,8)
TNT1 A 0 A_ChangeVelocity(1,0,-1,CVF_RELATIVE)
TNT1 A 0 A_ChangeVelocity(momx*1.045,momy*1.045,momz,CVF_REPLACE)
stop
}
}
actor Saku_AirThrust_P2 : Saku_AirThrust_P{States{Pickup:goto Thrust}}

actor SakuArgMath_Pickup : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_JumpIf(Args[2]<0,"S_2")
TNT1 A 0 A_JumpIf(Args[3]<0,"S_3")
TNT1 A 0 A_ChangeVelocity(Args[2]+Args[3],0,16,3)
stop
S_2:
TNT1 A 0 A_JumpIf(Args[3]<0,"S_23")
TNT1 A 0 A_ChangeVelocity(Args[2]*-1+Args[3],0,16,3)
stop
S_3:
TNT1 A 0 A_ChangeVelocity(Args[2]+Args[3]*-1,0,16,3)
stop
S_23:
TNT1 A 0 A_ChangeVelocity(Args[2]*-1+Args[3]*-1,0,16,3)
stop
}
}

actor QuintDive_Pickup : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_JumpIfInventory("QuintDive",1,"Pickup0X")
stop
Pickup0X:
TNT1 A 0 //A_Stop
TNT1 A 0 A_TakeInventory("QuintDive",9)
TNT1 A 0 A_GiveInventory("CBM_DisableSpeedPower",1)//SetPlayerProperty(0,1,0)
stop
}
}

actor QuintAmmoHelp_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_JumpIfInventory("SakuAmmoDelay",1,"No")
goto PickupA
PickupA:
TNT1 A 0 A_GiveInventory("BackToTheAmmo",1)
TNT1 A 0 A_JumpIfInventory("PlayerPropertyRage",1,2)
TNT1 AA 0 A_GiveInventory("SakuAmmoDelay",1)
stop
No:
TNT1 A 0
stop
}
}

actor Quint_SlideThrust_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_JumpIf(CallACS("cbm_IsDashingDisabled"),"DashEnd")
TNT1 A 0 A_JumpIfInventory("PlayerPropertyGrounded",1,"Dash2")
goto Dash1
Dash1:
TNT1 A 0 A_ChangeVelocity(Args[2]*0.00001,Args[3]*0.00001,0,CVF_REPLACE)
goto DashEnd
Dash2:
TNT1 A 0 A_ChangeVelocity(Args[2]*0.00001,Args[3]*0.00001,momz,CVF_REPLACE)
goto DashEnd
DashEnd:
TNT1 A 0 A_SpawnItemEx("SakuDashTrailFX",0,0,0,0,0,0,0,1)
stop
}
}

actor QuintSlideDelay : Powerup
{
Powerup.Duration -2
+INVENTORY.ALWAYSPICKUP
}
actor QuintHasSlid_F : Inventory{}

actor Quint_SlideRestore_H : BasicHelper
{
+SERVERSIDEONLY
States
{
Spawn:
TNT1 A 1
TNT1 A 5
Spawn2:
TNT1 A 0 A_JumpIfInTargetInventory("QuintSlideDelay",1,2)
TNT1 A 0 A_GiveToTarget("MMXQuintAmmo",1+CallACS("core_checkrune",RUNE_RAGE,2))
TNT1 A 1 A_JumpIfInTargetInventory("QuintNoPogo",1,1)
TNT1 A 1
TNT1 A 0 A_JumpIfInTargetInventory("MMXQuintAmmo",0,"Death")
TNT1 A 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"Death")
TNT1 A 0 A_JumpIfInTargetInventory("QuintHasSlid_F",1,"Spawn2")
goto Death
Death:
TNT1 A 1 A_TakeFromTarget("QuintHasSlid_F",99)
stop
}
}

actor Quint_SlideMMX_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_PlaySoundEx("weapon/GameBoyMMXDash","Weapon")
TNT1 A 0 A_ChangeVelocity(40,0,momz,3)
TNT1 A 0 A_SetArg(3,momy*100000)
TNT1 A 0 A_SetArg(2,momx*100000)
TNT1 A 0 A_GiveInventory("QuintSlideDelay",1)
TNT1 A 0 A_JumpIfInventory("QuintHasSlid_F",1,3)
TNT1 A 0 A_GiveInventory("QuintHasSlid_F",1)
TNT1 A 0 A_SpawnItemEx("Quint_SlideRestore_H",0,0,24)
TNT1 A 0 A_JumpIfInventory("MMXQuintAmmo",100,1)
stop
TNT1 A 0 A_TakeInventory("MMXQuintAmmo",50)
TNT1 A 0 A_TakeInventory("MMXQuintAmmo",50,1)
stop
}
}


actor SakuShockwaveSpawner : BasicExplosion
{
damagetype "Quint_SakuLand"
Obituary "$OB_QUINTEXPLODE"
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_SpawnItemEx("SakuShockwaveBit",0,0,0,20,0,0,0)
TNT1 A 0 A_SpawnItemEx("SakuShockwaveBit",0,0,0,20,0,0,15)
TNT1 A 0 A_SpawnItemEx("SakuShockwaveBit",0,0,0,20,0,0,30)
TNT1 A 0 A_SpawnItemEx("SakuShockwaveBit",0,0,0,20,0,0,45)
TNT1 A 0 A_SpawnItemEx("SakuShockwaveBit",0,0,0,20,0,0,60)
TNT1 A 0 A_SpawnItemEx("SakuShockwaveBit",0,0,0,20,0,0,75)
TNT1 A 0 A_SpawnItemEx("SakuShockwaveBit",0,0,0,20,0,0,90)
TNT1 A 0 A_SpawnItemEx("SakuShockwaveBit",0,0,0,20,0,0,105)
TNT1 A 0 A_SpawnItemEx("SakuShockwaveBit",0,0,0,20,0,0,120)
TNT1 A 0 A_SpawnItemEx("SakuShockwaveBit",0,0,0,20,0,0,135)
TNT1 A 0 A_SpawnItemEx("SakuShockwaveBit",0,0,0,20,0,0,150)
TNT1 A 0 A_SpawnItemEx("SakuShockwaveBit",0,0,0,20,0,0,165)
TNT1 A 0 A_SpawnItemEx("SakuShockwaveBit",0,0,0,20,0,0,180)
TNT1 A 0 A_SpawnItemEx("SakuShockwaveBit",0,0,0,20,0,0,195)
TNT1 A 0 A_SpawnItemEx("SakuShockwaveBit",0,0,0,20,0,0,210)
TNT1 A 0 A_SpawnItemEx("SakuShockwaveBit",0,0,0,20,0,0,225)
TNT1 A 0 A_SpawnItemEx("SakuShockwaveBit",0,0,0,20,0,0,240)
TNT1 A 0 A_SpawnItemEx("SakuShockwaveBit",0,0,0,20,0,0,255)
TNT1 A 0 A_SpawnItemEx("SakuShockwaveBit",0,0,0,20,0,0,270)
TNT1 A 0 A_SpawnItemEx("SakuShockwaveBit",0,0,0,20,0,0,285)
TNT1 A 0 A_SpawnItemEx("SakuShockwaveBit",0,0,0,20,0,0,300)
TNT1 A 0 A_SpawnItemEx("SakuShockwaveBit",0,0,0,20,0,0,315)
TNT1 A 0 A_SpawnItemEx("SakuShockwaveBit",0,0,0,20,0,0,330)
TNT1 A 0 A_SpawnItemEx("SakuShockwaveBit",0,0,0,20,0,0,345)
TNT1 A 0 A_Explode(120,128,0,0,128)
TNT1 AAAAAAAAAA 0 A_SpawnItemEx("SakuRockCrushFX",0,0,5,0,random(2,8),random(5,10),random(0,360),1)
TNT1 A 1
stop
}
}

actor SakuShockwaveBit : ProjSpawnFuncActor
{
PROJECTILE
damagetype "Quint_Wave"
Obituary "$OB_QUINTROCK"
//+FLOORHUGGER
Damage (60)
Radius 32
Height 8
Speed 30
Scale 2.0
States
{
Spawn:
TNT1 A 0
TNT1 A 1
QBOP G 10
QBOP GGG 1 A_FadeOut(0.25)
stop
Death:
TNT1 A 1
stop
}
}

actor Quint_WaveProtect : PowerProtection
{
Powerup.Duration 7
DamageFactor "Quint_Wave", 0.2
}

actor PainQuint_LeapHit : BasicWatcher
{
States
{
Spawn:
TNT1 A 0 nodelay A_GiveToTarget("QuintLeap_Hit_P",1,AAPTR_TARGET)
stop
}
}

actor QuintLeapCrush
{
PROJECTILE
damagetype "Quint_Leap"
Obituary "$OB_QUINTCRUSH"
+DONTBLAST
+DONTREFLECT
+THRUGHOST
damage (320+CallACS("core_checkrune",RUNE_SPREAD,2)*640)
Radius 28
Height 2
renderstyle none
States
{
Spawn:
TNT1 A 1
stop
}
}

actor Quint_LeapWeaken : PowerDamage
{
Powerup.Duration 9
DamageFactor "Quint_Leap", 0.5
}

actor Quint_LeapProtect : PowerProtection
{
Powerup.Duration 8
DamageFactor "Quint_Leap", 0.0
}

actor QuintLeap_Hit_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_GiveInventory("VivifyDelay6",1)
TNT1 A 0 A_PlaySoundEx("weapon/ToadCrush","SoundSlot7")
goto PickupT
PickupT:
TNT1 A 0 A_JumpIf(CallACS("cbm_GetPointerButtonInput",0,false) & BT_JUMP,"PickupT2")
goto PickupT1
PickupT1:
TNT1 A 0 ThrustThingZ(0,60,0,0)
stop
PickupT2:
TNT1 A 0 ThrustThingZ(0,100,0,0)
stop
}
}


actor QuintSakuBlastLand : BasicExplosion
{
damagetype "Quint_SakuLand"
Obituary "$OB_QUINTEXPLODE"
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_SpawnItemEx("QuintSakuBlastLandFX",frandom(0,6),0,-20,frandom(1,3),0,Frandom(2,6),random(0,17)*4,1)
TNT1 A 0 A_SpawnItemEx("QuintSakuBlastLandFX",frandom(0,6),0,-20,frandom(1,3),0,Frandom(2,6),random(18,35)*4,1)
TNT1 A 0 A_SpawnItemEx("QuintSakuBlastLandFX",frandom(0,6),0,-20,frandom(1,3),0,Frandom(2,6),random(36,53)*4,1)
TNT1 A 0 A_SpawnItemEx("QuintSakuBlastLandFX",frandom(0,6),0,-20,frandom(1,3),0,Frandom(2,6),random(54,71)*4,1)
TNT1 A 0 A_SpawnItemEx("QuintSakuBlastLandFX",frandom(0,6),0,-20,frandom(1,3),0,Frandom(2,6),random(72,89)*4,1)
TNT1 A 0 A_Explode(80+CallACS("core_checkrune",RUNE_SPREAD,2)*160,128,0,0,128)
TNT1 A 0 A_SetDamageType("Quint_SakuLand2")
TNT1 A 0 A_Explode(120+CallACS("core_checkrune",RUNE_SPREAD,2)*240,128,0,0,32)
TNT1 A 4
stop
}
}

actor QuintSakuBlastLandFX : BasicGraphicEffectM
{
-NOGRAVITY
+THRUACTORS
+FLOORCLIP
Radius 3
Height 3
Speed 5
Scale 1.0
States
{
SpawnFrame:
TNT1 A 0
TNT1 A 0 A_Jump(256,"Debris1","Debris2","Debris3","Debris4","Debris5")
Debris1:
QROC A -1
wait
Debris2:
QROC B -1
wait
Debris3:
QROC C -1
wait
Debris4:
QROC D -1
wait
Debris5:
QROC E -1
wait
}
}

actor QuintSakuAltSpin : BasicExplosion
{
damagetype "Quint_Spin"
Obituary "$OB_SAKUGARNE"
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_SpawnItemEx("QuintSakuAltSpinFX",0,0,8,0,0,0,0,1)
TNT1 A 0 A_SpawnItemEx("QuintSakuAltSpinFX",0,0,8,0,0,0,180,1)
TNT1 A 4 A_Explode(70+CallACS("core_checkrune",RUNE_SPREAD,2)*140,64,0,0,64)
stop
}
}


actor QuintSakuAltSpinFX : BasicGraphicEffect
{
renderstyle add
Scale 5.0
States
{
SpawnFrame:
QROC H 0 A_SetAngle(angle-5)
QROC H 0 A_FadeOut(0.08)
QROC H 1 A_ChangeVelocity(10,0,8,3)
QROC I 0 A_SetAngle(angle-5)
QROC I 0 A_FadeOut(0.08)
QROC I 1 A_ChangeVelocity(10,0,8,3)
loop
}
}


actor SakuRockCrusher : BasicExplosion
{
Translation "202:202=214:214","199:199=248:248","204:204=215:215"
var int user_A;
var int user_R;
damagetype "Quint_Rock"
Obituary "$OB_QUINTROCK"
ReactionTime 24//2
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_PlaySoundEx("misc/hugequake2","Weapon")
TNT1 A 0 A_PlaySoundEx("misc/hugequake2","Voice")
TNT1 A 0 A_Explode(80,128,0,0,128)
TNT1 A 0 A_SetUserVar("user_A",random(0,179))
TNT1 A 0 A_SetUserVar("user_R",user_A+180)
Spawn2:
TNT1 A 0 A_SpawnItemEx("SakuRockCrush",0,0,0,25,0,5,0+user_A)
TNT1 A 0 A_SpawnItemEx("SakuRockCrush",0,0,0,25,0,5,180+user_A)
TNT1 A 1 A_SpawnItemEx("SakuRockCrushFX",0,0,5,0,random(2,8),random(5,10),random(0,360),1,128)
TNT1 A 0 A_CountDown
TNT1 A 0 A_SetUserVar("user_A",user_A+15)
TNT1 A 0 A_JumpIf(user_A>=user_R,"Spawn3")
loop
Spawn3:
TNT1 A 0 A_SetUserVar("user_A",user_A+8)
TNT1 A 0 A_SetUserVar("user_R",user_R+188)
goto Spawn2
Death:
TNT1 AAAA 1 A_SpawnItemEx("SakuRockCrushFX",0,0,5,0,random(2,8),random(5,10),random(0,360),1)
stop
}
}


actor Quint_RockProtect : PowerProtection
{
Powerup.Duration 6
DamageFactor "Quint_Rock", 0.25
}

actor SakuRockCrush : ProjSpawnFuncActor
{
PROJECTILE
damagetype "Quint_Rock"
Obituary "$OB_QUINTROCK"
-NOGRAVITY
+BOUNCEONFLOORS
+BOUNCEONWALLS
+BOUNCEONCEILINGS
//+ALLOWBOUNCEONACTORS
+CANBOUNCEWATER
WALLBOUNCEFACTOR 0.85
BOUNCEFACTOR 0.85
Bouncecount 3

+THRUSPECIES
Species "DumbQuintRock"
+SHOOTABLE
-NOBLOCKMAP
+DONTDRAIN
+NOTARGETSWITCH
+NOPAIN
Health 280

gravity 0.5
Damage (120)
Radius 18
Height 18
Speed 5
scale 2.5
States
{
Spawn:
TNT1 A 0
TNT1 A 1
TNT1 A 0 A_Jump(256,"Debris3","Debris4")
Debris3:
TNT1 A 0
QROC D -1
Debris4:
TNT1 A 0
QROC F -1
Death:
NMFX A 0 A_SetGravity(0.0)
NMFX A 0 A_Stop
NMFX AAA 0 A_SpawnItemEx("SakuRockCrushFX",0,0,5,0,random(-5,5),random(5,8),random(0,360),1)
NMFX ABCD 3
stop
}
}


actor SakuRockCrushFX : BasicGraphicEffectM
{
-NOGRAVITY
+THRUACTORS
+FLOORCLIP
Radius 4
Height 4
Scale 2.0
States
{
SpawnFrame:
TNT1 A 0
TNT1 A 0 A_Jump(256,"Debris1","Debris2","Debris3","Debris4")
Debris1:
QROC A -1
wait
Debris2:
QROC B -1
wait
Debris3:
QROC C -1
wait
Debris4:
QROC E -1
wait
Death:
TNT1 A 0 A_SpawnItemEx("SakuRockCrushFX2",0,0,20,0,0,0,0,1)
stop
}
}
actor SakuRockCrushFX2 : BasicGraphicEffect
{
Scale 2.0
States
{
SpawnFrame:
NMFX ABCD 2
stop
}
}

actor SakuTrailFX : BasicClientSide
{
renderstyle translucent
alpha 0.9
states
{
Spawn:
TNT1 A 0
TNT1 A 0 //ACS_NamedExecuteWithResult("core_copytranslation")
QEGA Y 1 A_FadeOut(0.1)
wait
}
}
actor SakuDashTrailFX : BasicClientSide
{
renderstyle translucent
alpha 0.9
states
{
Spawn:
TNT1 A 1
TNT1 A 0 //ACS_NamedExecuteWithResult("core_copytranslation")
QEGA K 1 A_SetTranslucent(0.9,1)
QEGA K 1 A_SetTranslucent(0.6,0)
QEGA K 1 A_SetTranslucent(0.8,1)
QEGA K 1 A_SetTranslucent(0.5,0)
QEGA K 1 A_SetTranslucent(0.7,1)
QEGA K 1 A_SetTranslucent(0.4,0)
stop
}
}

actor QShot : ProjSpawnFuncActor
{
PROJECTILE
damagetype "Quint_Shot"
Obituary "$OB_QUINTBUSTER"
+BRIGHT
Damage (100)
radius 10
height 5
Speed 35
scale 2.5
States
{
Spawn:
TNT1 A 2
BUST A 1
wait
Death:
BUST A 1
stop
}
}

actor Quint_W_NormalBar : NormalBar {Args 138,130}
actor Quint_W_ScriptBar : ScriptBar {}
actor Quint_W2_NormalBar : NormalBar {Args 138,130}
actor Quint_W2_ScriptBar : ScriptBar {}