//Borrowed Miguel's core of the hard drop
local dashcooldown =  TICRATE*4/3
local dashspeed = 14  * FRACUNIT

addHook("ThinkFrame", function()
	for player in players.iterate do
	-- initialize custom variables
	player.dashing = player.dashing or false
	player.dash_cooldown = player.dash_cooldown or 0
	
		-- Decrement cooldown if any
	if player.dash_cooldown and player.dash_cooldown >= 0 then
		player.dash_cooldown = player.dash_cooldown - 1
	end  

	if player.mo and player.mo.valid and not (gametype == GT_LTMMURDERMYSTERY) and player.mo.skin == "superguide" and P_IsObjectOnGround(player.mo) and player.rings >= 5 and player.dash_cooldown <= 0 then
	local custom2_pressed = (player.cmd.buttons & BT_CUSTOM2) ~= 0

	if custom2_pressed  then
		P_Thrust(player.mo, player.mo.angle, FixedMul(dashspeed, player.mo.scale)) -- do the fucking dash
		player.rings = player.rings - 5
		player.dash_cooldown = dashcooldown
		S_StartSound(player.mo, sfx_gdsh)
	end
end
end
end)

addHook("PlayerQuit", function(player)
	player.shield_triggered = false
	player.shield_cooldown = 0
	player.has_ghost_trail = false
end)