Skip to content

Shield Button Touchups

This merge request addresses all but the first point of #1152, fixing regressions from !2096 (merged), and makes some bonus tweaks as well. This merge request does the following, roughly in order of filename and place in file:

- GC_WEPSLOT8, GC_WEPSLOT9, and GC_WEPSLOT10 are aliased to GC_WEPSLOT7, with a deprecation warning as behaviour has changed (unlike the BT_USE alias). Any Lua scripts trying to do input.gameControlDown(GC_WEPSLOT8) won't work exactly as before !2096 (merged), but will no longer cause an error that stops the script.
- DEMOVERSION is incremented, and older replays will copy their player->cmd.buttons & BT_SPIN bit over to BT_SHIELD, hopefully matching pre-!2096 behaviour exactly. I've done some mild testing with and without shields, and older replays don't seem to desynch from shield abilities.
- In the gamepad settings, there's now a Shield axis, to match the Jump, Spin, Fire, and Fire Normal axes. JA_SHIELD is exposed to Lua.
- The #if NUM_WEAPONS > 10 sanity check is now #if NUM_WEAPONS > 7.
- P_SuperReady(player_t player, [boolean transform?]) is changed to P_SuperReady(player_t player, [superready_t type]). type should be SUPERREADY_CLASSIC (pre-!2096 behaviour, used when pressing Spin+Shield simultaneously), SUPERREADY_TRANSFORM ("transform with Shield button only" behaviour), or SUPERREADY_DETRANSFORM ("detransform with Shield button only" behaviour). If not specified, type defaults to SUPERREADY_CLASSIC, to not mess with existing scripts. These constants are exposed to Lua. Edit: This was undone by request.
- P_SuperReady(...) is now prevented by PF_JUMPSTASIS, not "either PF_STASIS or PF_JUMPSTASIS" (PF_FULLSTASIS), as it doesn't make sense to me that a player action is prevented by "either one" (nor "both") of them - an action should be prevented by one (or zero) of them only.
- !2096 (merged) split Super-detransformation code into a P_DoSuperDetransformation(player_t player) function. It's now exposed to Lua.
- The "Shield" control is renamed to "Shield Ability". To me, this makes it clearer that it "uses a shield's ability", rather than reducing/blocking damage taken. (The gamepad axis is only named "Shield Axis" to keep the axis names short, though.)
- Player code hopefully matches pre-!2096 behaviour when Spin and Shield are bound to the same button (read: when pressing/releasing Spin and Shield on the same tic - pressing one while already holding the other still treats them as separate actions). This is a hack - but the alternatives are a regression (being unable to play the game fully with "two buttons", Jump and Shield, plus breaking any old replays that use shield abilities) and adding a player variable for it (which would add unnecessary complexity to the in-game settings and the source code; a bigger hack).
- CTF-flag-tossing code has been moved back to where it came from, the Fire Flower has been reverted to not throw fireballs when you're "not IT" in Tag/Hide and Seek, Ringslinging/Fireballing has been reverted to still work when a player has PF_STASIS. The first one was likely moved by accident due to !2096 (merged) once replacing the CTF-flag-tossing functionality, the middle one seems strange to me gameplay-wise, the middle and latter both seem out of place in an otherwise-unrelated merge request (and the latter was likely made that way due to combining a check for Ringslinging and turning Super, with PF_STASIS added for the latter).
- PF_SHIELDDOWN is now set/unset even when the player has finished a stage and/or has PF_STASIS. (Technically, as PF_SPINDOWN is not(?) set when in NiGHTS mode, it might be possible to have PF_SPINDOWN linger when running out of NiGHTS time, press Spin+Shield on the tic that it runs out, and then trigger a Super transformation while grounded due to "pressing Shield while already holding Spin, so they must be separate actions", which wouldn't match pre-!2096 behaviour.)
- Record Attack's input display now shows an "SH" (Shield) button next to the "J" (Jump) and "S" (Spin) buttons. See the image below. I don't like how there's empty space below "SH", but stretching the camera box wider to fill it probably wouldn't be better.
- (Using capitalisation instead of colour-coding to demonstrate,) collecting the 7th Chaos Emerald used to say "50 rings, no shield, press SPIN mid-JUMP" pre-!2096, and said "get 50 rings then press SHIELD to TRANSFORM" post-!2096. It now says "get 50 rings, then press SHIELD to transform", with a comma, and without colouring on "transform" as it used to use colour for relevant button names only, not just emphasis.

Record Attack input display:
image

-

TL;DR:
- Binding Spin and Shield to the same button matches v2.2.13 and earlier's behaviour
- For Lua, P_DoSuperDetransformation(player) is now available, reverting the player into a non-Super form as if they had run out of Rings

Edited by Zwip-Zwap Zapony

Merge request reports