//Originally By Spectra i just yoinked it cus i know fuckall bout charabilities
addHook("ThinkFrame", function(player)
	for player in players.iterate
		if player.mo.valid
		and P_IsObjectOnGround(player.mo) and not player.powers[pw_super] then
		player.flutteruses = 3
		elseif P_IsObjectOnGround(player.mo) and player.powers[pw_super] then
		player.flutteruses = 10
		end
	end
end)

addHook("AbilitySpecial", function(player)
	player.flutteruses = player.flutteruses or 0
	if player.jump_count == nil then player.jump_count = 0 end
	if player.mo.skin ~= "superguide" then return end
	if player.pflags & PF_THOKKED  then return end
	if player.mo.state == S_PLAY_GJUP then return end
	if (gametype == GT_LTMMURDERMYSTERY) then return end

	local actionspd = player.actionspd

	player.pflags = $ & ~PF_JUMPED
	P_DoJump(player, false)
	
	P_SetObjectMomZ(player.mo, 8 * FRACUNIT)
	P_SpawnThokMobj(player)
	player.mo.state = S_PLAY_SPRING
	player.flutteruses = player.flutteruses - 1
	player.pflags = $ |PF_NOJUMPDAMAGE

	if (player.mo.info.attacksound and not player.spectator) then S_StartSound(player.mo, player.mo.info.attacksound) end
	if player.flutteruses <= 0 then
	player.pflags = $ |PF_THOKKED
	end
	if P_IsObjectOnGround(player.mo) and not player.powers[pw_super] then
	player.flutteruses = 3
	elseif P_IsObjectOnGround(player.mo) and player.powers[pw_super] then
	player.flutteruses = 10
	end
	return true
end)