-- The Unthokkening by Wumbo -- Inspired by TelosTurntable's position on the thok debate -- Intended for use alongside my speed cap removal script, No Cap: https://mb.srb2.org/addons/no-cap.5804/ addHook("PostThinkFrame", do for player in players.iterate do if player.charability != CA_NONE then -- Disable Sonic's thok, as well as shield abilities for all characters that already have an ability if player.mo.skin == "sonic" then player.charability = CA_NONE else player.charflags = $1 | SF_NOSHIELDABILITY end end -- Allow players to run on water if they are on the ground and moving faster than their normal speed if player.realspeed and player.originalspeed and not (skins[player.mo.skin].flags & SF_RUNONWATER) then if player.realspeed > player.originalspeed and not (player.mo.eflags & MFE_UNDERWATER) and P_IsObjectOnGround(player.mo) then player.charflags = $1 | SF_RUNONWATER else player.charflags = $1 & ~SF_RUNONWATER end end end end) addHook("PlayerCmd", function(player, cmd) -- If a player with no abilities presses the jump button again during a jump, activate their shield ability if player.charability == CA_NONE and (player.mo.z - player.mo.floorz)/FRACUNIT > 10 and (player.powers[pw_shield] or (emeralds == 127 or player.powers[pw_emeralds] == 127) and player.rings >= 50 and not player.powers[pw_super]) and (cmd.buttons & BT_JUMP) and (player.pflags & PF_JUMPED) and not (player.pflags & PF_JUMPDOWN) then -- If the game version is v2.2.14 or newer, simulate a press of the dedicated shield button rather than the spin button if MODVERSION > 54 then cmd.buttons = $1 | BT_SHIELD else cmd.buttons = $1 | BT_SPIN end end end)