addHook("PlayerThink", function(player) if player.needground == nil then player.needground = false end if (player.cmd.buttons & BT_CUSTOM1) and not P_IsObjectOnGround(player.mo) and not (player.lastbuttons & BT_CUSTOM1) and (player.needground == false) then local thokspeed = 50 if player.mo.eflags & MFE_UNDERWATER then thokspeed = thokspeed/2 end S_StartSound(player.mo, sfx_thok) player.mo.state = S_PLAY_ROLL P_InstaThrust(player.mo, player.mo.angle, thokspeed*FRACUNIT) player.needground = true P_SpawnThokMobj(player) end if (player.cmd.buttons & BT_CUSTOM3) and not P_IsObjectOnGround(player.mo) and not (player.lastbuttons & BT_CUSTOM3) and (player.needground == false) then local thokspeed = 10 if player.mo.eflags & MFE_UNDERWATER then thokspeed = thokspeed/2 end S_StartSound(player.mo, sfx_jump) player.mo.state = S_PLAY_ROLL P_SetObjectMomZ(player.mo, thokspeed*FRACUNIT, false) player.needground = true P_SpawnThokMobj(player) end if (player.cmd.buttons & BT_CUSTOM2) and not P_IsObjectOnGround(player.mo) and not (player.lastbuttons & BT_CUSTOM2) then local thokspeed = 15 if player.mo.eflags & MFE_UNDERWATER then thokspeed = thokspeed/2 end S_StartSound(player.mo, sfx_thok) player.mo.state = S_PLAY_ROLL P_SetObjectMomZ(player.mo, -thokspeed*FRACUNIT, false) player.pflags = $|PF_SPINNING P_SpawnThokMobj(player) end if player.needground == true and P_IsObjectOnGround(player.mo) == true then player.needground = false end end) addHook("PlayerThink", function(player) if (player.cmd.buttons & BT_FIRENORMAL) and not (player.lastbuttons & BT_FIRENORMAL) then if player.mo.state == S_PLAY_ROLL and player.pflags & PF_SPINNING then player.mo.state = S_PLAY_RUN player.pflags = $1 & ~PF_SPINNING end end end)