local function BallBoost(player)
if player.mo.skin ~= "cheeseboi" then
return
end

if not (player.cmd.buttons & BT_CUSTOM1) then return end
		if not (player.powers[pw_carry] == CR_NIGHTSMODE) 
	    and not (player.powers[pw_carry]) 
		and not (player.pflags & PF_STASIS) 
		and not (player.mo.tracer and player.mo.tracer.type == MT_TUBEWAYPOINT) 
		and not (player.mo.state == S_PLAY_SUPER_TRANS1)
	    and not (player.mo.state == S_PLAY_SUPER_TRANS2)
	    and not (player.mo.state == S_PLAY_SUPER_TRANS3)
	    and not (player.mo.state == S_PLAY_SUPER_TRANS4)
	    and not (player.mo.state == S_PLAY_SUPER_TRANS5)
	    and not (player.mo.state == S_PLAY_SUPER_TRANS6)
	    and not (player.mo.state == S_PLAY_STND)
	    and not (player.mo.state == S_PLAY_WAIT)
		and not (player.mo.state == S_PLAY_RIDE)
	    and not (player.mo.state == S_PLAY_PAIN)
	    and not (player.mo.state == S_PLAY_GASP)
	    and not (player.mo.state == S_PLAY_GLIDE_LANDING)
	    and not (player.mo.state == S_PLAY_DEAD)
	    and not (player.mo.state == S_PLAY_DRWN)
		and not (player.pflags & PF_FINISHED)
if (player.mo.eflags & MFE_UNDERWATER) then
P_InstaThrust(player.mo, player.drawangle, player.actionspd + 9*FRACUNIT)
player.mo.state = S_PLAY_DASH
end
if not (player.mo.eflags & MFE_UNDERWATER) then
P_InstaThrust(player.mo, player.drawangle, player.actionspd + 15*FRACUNIT)
player.mo.state = S_PLAY_DASH
end
end
end
end
addHook("PlayerThink", BallBoost)

addHook("PlayerCanDamage", function(player, mobj)
	if player.mo and player.mo.skin == "cheeseboi" and player.mo.state == S_PLAY_DASH and not P_PlayerInPain(player)
	and (mobj.flags&MF_ENEMY or mobj.flags&MF_BOSS) return true end
end, MT_PLAYER)

addHook("MobjDamage", function(target, inflictor, source, damage, damagetype)
	if target.player and target.skin == "cheeseboi" and not (damagetype&DMG_DEATHMASK)
	and player.mo.state == S_PLAY_DASH
		P_DoPlayerPain(target.player, source, inflictor)
		P_PlayDeathSound(target)
		P_PlayerFlagBurst(target.player)
		return true
	end
end, MT_PLAYER)

addHook("PlayerThink", function(p)
        if not (p and p.mo and p.mo.valid and p.mo.skin == "cheeseboi") return end
		 p.powers[pw_spacetime] = 30*TICRATE
end)

addHook ("MobjMoveCollide", function (player, spike)
	if player.mo.skin == "cheeseboi" and player.mo.state == S_PLAY_DASH
		if (spike.type == MT_SPIKE
		or spike.type == MT_WALLSPIKE)
			if (player.z + player.height < spike.z) 
			or (player.z > spike.z + spike.height)
				return false
			else
				P_KillMobj(spike,player,player)
			end
		end
	end
end)

addHook ("MobjMoveCollide", function (player, spike)
	if player.mo.skin == "cheeseboi" and player.mo.state == S_PLAY_DASH
		if (player.cmd.buttons & BT_JUMP)
		player.mo.state == S_PLAY_JUMP
		end
	end
end)