
//Thanks to Bloops for posting this code in on the OS sevearl months ago where I can just easily steal it.
local abilityadded = false
addHook("MapLoad", function()
    if not(abilityadded)
        and(K_AddAbility)
		print ("Weightless Kirby Added!")
		kirbyabilitytable["nasya"] = K_AddAbility(K_Weightless, true, "WEIGHTL")*-1
        abilityadded = true
    end
end)



rawset(_G, "K_Weightless", function(checkflags, destroy, late, player)
	if (checkflags) then 
		return 0
	end
	if (destroy) then
		player.cantwirl = 0
		return
	end
	if (late) then
		return
	end
	if (player.twirling == nil) then
		player.twirling = 0
	end
	
	player.cantwirl = 1
	if not (P_IsObjectOnGround(player.mo)) then
		player.mo.momz = $1-P_GetMobjGravity(player.mo)
		player.mo.momz = $1-(FRACUNIT/10)
	end
	return
end)
