//Air Boost
addHook("PlayerThink", function(player)
	if player.mo.skin == "kaydensbag"
		if (player.mo.state == S_PLAY_JUMP)
		and (player.cmd.buttons & BT_CUSTOM1)
           P_SpawnGhostMobj(player.mo)
		   player.mo.state = S_PLAY_SPRING
		   P_SetObjectMomZ(player.mo, 19*FRACUNIT)
		   S_StartSound(player.mo, sfx_zoom)
		end
	end
end)
//Divethok
addHook("PlayerThink", function(player)
	if (player.mo and player.mo.valid and player.mo.skin == "kaydensbag") and not player.rafatransfrom 
		if not (player.cmd.buttons & BT_TOSSFLAG) then
			player.jumptapready = true
			player.jumptapping = false
		elseif player.jumptapready then
			player.jumptapping = true
			player.jumptapready = false
		else
			player.jumptapping = false
		end
		
		if player.jumptapping then
			if P_IsObjectOnGround(player.mo) == false and player.smakuse == false then
				P_SetObjectMomZ(player.mo, (1 - 17*FRACUNIT), true) 
				S_StartSound(player.mo,sfx_zoom, player)
				player.smakuse = true
				player.mo.state = S_PLAY_FALL
				player.timon = true
				player.pflags = $ |PF_SPINNING
			end
		elseif P_IsObjectOnGround(player.mo) == true then
			player.smakuse = false
			player.timon = false
			player.timer = 0
		elseif player.timon == true then
			player.timer = $ + 1
			P_SpawnGhostMobj(player.mo)
			if player.timer >= 5 and player.timer <= 35 
			and (player.mo.momz <= 15*FRACUNIT or (P_MobjFlip(player.mo) == (0 - 1) and player.mo.momz >= (0 - 15*FRACUNIT))) then 
				P_SetObjectMomZ(player.mo, (7*FRACUNIT), true)  
				player.mo.state = S_PLAY_ROLL
				player.pflags = $ & ~PF_SPINNING
				S_StartSound(player.mo,sfx_spndsh, player)
			elseif player.timer >= 1*TICRATE - 1*TICRATE/2 and player.timer <= 2*TICRATE then
				player.mo.state = S_PLAY_SPRING
				player.pflags = $ & ~PF_SPINNING
				player.timon = false
				player.timer = 0
			end
			if P_IsObjectOnGround(player.mo) then
				P_RadiusAttack(player.mo, player.mo, 128*FRACUNIT)
			end
		end
	end
end)
-- No Thok Super Float lua by TeriosSonic
-- Free to use as long as you credit me.
addHook("PlayerThink", function(player)
    if player.mo and player.mo.skin == "kaydensbag" -- charname here
        if player.powers[pw_super] -- If you're super...
		and player.cmd.buttons & BT_USE -- ...and you're holding Spin...
		and not(P_IsObjectOnGround(player.mo))
		and player.pflags & PF_JUMPED
            player.charability = CA_THOK -- ...then you'll have the Thok ability!
        else
            player.charability = CA_JUMPTHOK -- This is the ability you'll have while these parameters are not fullfilled
        end
    end
end)
//double jump (not shield)
addHook("ThinkFrame", do
	for player in players.iterate
		if player.mo and player.mo.skin == "kaydensbag"
					   
	   if not (player.mo.usedown) then
	   player.mo.usedown = 0
	   end
	  if not (player.mo.doublejump) then
	   player.mo.doublejump = 0
	   end	   
	   if (player.cmd.buttons & BT_FIRENORMAL)
	   and (player.mo.usedown == 0)
	   and (player.pflags & PF_JUMPED)
	   and player.powers[pw_carry] == CR_NONE
	   and not (player.pflags & PF_THOKKED)
	   and not (player.powers[pw_carry])
	    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 P_IsObjectOnGround(player.mo)
	   S_StartSound(player.mo, sfx_jump)
	   player.mo.usedown = 1
	   player.mo.usejump = 1
	   player.mo.state = S_PLAY_ROLL
	   P_SetObjectMomZ(player.mo, 17*FRACUNIT, false)
	   player.pflags = $1|PF_THOKKED
	   --player.pflags = $1 & ~PF_JUMPED
	   end
	   if (player.mo.doublejump == 1)
	   and not P_IsObjectOnGround(player.mo)
	   player.pflags = $1|PF_THOKKED
	  -- player.pflags = $1 & ~PF_JUMPED
	   end
	   if not (player.cmd.buttons & BT_FIRENORMAL)
	   and (player.mo.usedown == 1)
	   player.mo.usedown = 0
	   end
	   
	    end
	end
end)