//BOB MAPS
addHook("PlayerThink", function(player)
	if player.speed != 0 and player.mo.state == S_PLAY_DETERMIN 
	or player.speed != 0 and player.mo.state == S_PLAY_LOOKIN 
	or player.speed != 0 and player.mo.state == S_PLAY_PANTY 
	or player.speed != 0 and player.mo.state == S_PLAY_FREEZING 
	or player.speed != 0 and player.mo.state == S_PLAY_COUGH 
	or player.speed != 0 and player.mo.state == S_PLAY_PHONE 
	or player.speed != 0 and player.mo.state == S_PLAY_WAIT2 
	or player.speed != 0 and player.mo.state == S_PLAY_SHOWOFF then
        player.mo.state = S_PLAY_WALK
	end
end)

local animTable = {
  [0] = S_PLAY_WAIT2,
  [01] = S_PLAY_PHONE,
  [02] = S_PLAY_PHONE,
  [03] = S_PLAY_DETERMIN,
  [04] = S_PLAY_COUGH,
  [05] = S_PLAY_WAIT2,
  [06] = S_PLAY_DETERMIN,
  [07] = S_PLAY_LOOKIN,
  [08] = S_PLAY_FREEZING,
  [09] = S_PLAY_DETERMIN,
  [10] = S_PLAY_PHONE,
  [11] = S_PLAY_LOOKIN,
  [12] = S_PLAY_SHOWOFF,
  [13] = S_PLAY_WAIT2,
  [14] = S_PLAY_WAIT2,
  [15] = S_PLAY_DETERMIN,
  [16] = S_PLAY_PANTY,
  [22] = S_PLAY_DETERMIN,
  [23] = S_PLAY_DETERMIN,
  [25] = S_PLAY_SHOWOFF,
  [26] = S_PLAY_DETERMIN,
  [27] = S_PLAY_DETERMIN,
  [30] = S_PLAY_FREEZING,
  [31] = S_PLAY_MELEE,
  [32] = S_PLAY_PHONE,
  [33] = S_PLAY_LOOKIN,
}

addHook("PlayerThink", function(player)
    if (player.mo and player.mo.valid and player.powers[pw_underwater] == 0 and player.mo.skin == "m.jimmyharold") then
		if player.mo.state == S_PLAY_WAIT and gamemap <= 33 and not player.powers[pw_super] then
			player.mo.state = animTable[gamemap]
        end
	elseif(player.mo and player.mo.valid and player.powers[pw_underwater] >= 2 and player.powers[pw_underwater] <= 9*TICRATE and player.mo.skin == "m.jimmyharold") then
		player.mo.state = S_PLAY_WATEWORRY
    end
end)

addHook("PlayerThink", function(player)
	if (player.mo and player.mo.valid and player.powers[pw_underwater] == 0 and player.mo.skin == "m.jimmyharold") then
		if player.mo.state == S_PLAY_RIDE then
			if (leveltime % 630 == 0)
				S_StartSound(player.mo, sfx_krcbac)
			end
		end
	end
end)





