//swimming
//addHook("PlayerThink", function(player)
//	if (player.mo and player.mo.valid and player.mo.skin == "m.jimmyharold")
//		if player.powers [pw_underwater] >= 1 and player.mo.state != S_PLAY_PAIN and player.mo.state != S_PLAY_SPRING 
//		and not (player.mo.eflags & MFE_GOOWATER) then
//			if (player.cmd.buttons & BT_USE) then
//				player.mo.momz = $ - 1*FRACUNIT/2
//			elseif (player.cmd.buttons & BT_USE) and player.mo.momz <= 5*FRACUNIT - 5*FRACUNIT then
//				player.mo.momz = 5*FRACUNIT - 5*FRACUNIT
//			elseif (player.cmd.buttons & BT_JUMP) then
//				player.mo.momz = $ + 1*FRACUNIT/2
//			elseif (player.cmd.buttons & BT_JUMP) and player.mo.momz >= 5*FRACUNIT then
//				player.mo.momz = 5*FRACUNIT
//			else
//				if player.mo.momz >= 0 - 1*FRACUNIT then
//					player.mo.momz = $ - 1*FRACUNIT/2
//				elseif player.mo.momz <= 0 - 1*FRACUNIT then
//					player.mo.momz = $ + 1*FRACUNIT/2
//				end
//			end
//		end
//	end
//end)

addHook("PlayerThink", function(player)
	if (player.mo and player.mo.valid and player.mo.skin == "m.jimmyharold")
		if not player.powers [pw_super] then
			player.supertapready = true
			player.supertapping = false
		elseif player.supertapready then
			player.supertapping = true
			player.supertapready = false
		else
			player.supertapping = false
		end
	elseif player.supertapping then
		print ("updated gamemode to creative")
	end
end)

addHook("PlayerThink", function(player)
	if (player.mo and player.mo.valid and player.mo.skin == "m.jimmyharold")
		if player.supertapping then
			print ("updated gamemode to creative")
		end
	end
end)

//underwater music drowning
addHook("PlayerThink", function(player)
	player.jimhearing = $ or 100
	if (player.mo and player.mo.valid and player.mo.skin == "m.jimmyharold")
		player.jimhearing = $ or 100
		if (player.mo.eflags & MFE_UNDERWATER) and player.jimhearing >= 20 then
			S_SetInternalMusicVolume(player.jimhearing, player)
			player.jimhearing = $ - 1
		elseif (player.mo.eflags & MFE_UNDERWATER) and player.jimhearing == 19 then
			S_SetInternalMusicVolume(19, player)
			if player.powers [pw_underwater] == (((20*TICRATE)/5)*1) + (11*TICRATE) then
				S_StartSound(player.mo, sfx_jimuw3)
				S_StartSound(player.mo, sfx_jimuwa)
			elseif player.powers [pw_underwater] == (((20*TICRATE)/5)*2) + (11*TICRATE) then
				S_StartSound(player.mo, sfx_jimuw3)
			elseif player.powers [pw_underwater] == (((20*TICRATE)/5)*3) + (11*TICRATE) then
				S_StartSound(player.mo, sfx_jimuw2)
				S_StartSound(player.mo, sfx_jimuwa)
			elseif player.powers [pw_underwater] == (((20*TICRATE)/5)*4) + (11*TICRATE) then
				S_StartSound(player.mo, sfx_jimuw2)
			end
		elseif player.jimhearing <= 99 and not (player.mo.eflags & MFE_UNDERWATER) and player.dashmode < 3*TICRATE then
			player.jimhearing = $ + (5/2)
			S_SetInternalMusicVolume(player.jimhearing, player)
			S_StopSoundByID(player.mo, sfx_jimuwa)
		else
			if player.dashmode < 3*TICRATE then
				player.jimhearing = 100
				S_SetInternalMusicVolume(100, player)
				player.whooshtimer = 0
				S_StopSoundByID(player.mo, sfx_gofast)
			else
				player.jimhearing = 40
				S_SetInternalMusicVolume(40, player)
				player.whooshtimer = $ or 0
				player.whooshtimer = $ + 1
				if player.whooshtimer % 350 == 0 
				or player.whooshtimer == 1 then
					S_StartSound(player.mo, sfx_gofast)
				end
			end
		end
	end
end)

addHook("PlayerThink", function(player)
	if (player.mo and player.mo.valid and player.mo.skin == "m.jimmyharold")
		if (player.mo.eflags & MFE_UNDERWATER) or player.powers [pw_underwater] 
		or player.powers [pw_super]then
			player.smakuse = false
		end
	end
end)