-- The Unthokkening by Wumbo -- Inspired by TelosTurntable's position on the thok debate -- Intended for use alongside a momentum mod of your choice addHook("PreThinkFrame", 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 elseif not (player.charflags & SF_NOSHIELDABILITY) then player.charflags = $1 | SF_NOSHIELDABILITY end end -- 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 (player.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 player.cmd.buttons = $1 | BT_SHIELD else player.cmd.buttons = $1 | BT_SPIN end end end end)