This caused some scary issues with P_SaveNetGame the other day, and it's making ACS net sync harder. Let's just cut this off right now.
Also fixed some scary mix-ups in some of the Lua archiving code.
An effectively useless global scope boolean that literally checks for the presence of a finish line, created in and used only by things we inherited from vanilla SRB2
* Battle-like item box respawn handling inverse of GTR_CIRCUIT
* Make battle fullscreen overlay forbid GTR_CIRCUIT
* Make GTR_ITEMARROWS actually do something
* Make everything related to points actually use GTR_POINTLIMIT
* Fobid sphere addition without GTR_SPHERES, to mirror ring addition forbidding
- The "never force a retry" condition is now `!G_GametypeUsesLives()`
- In GT_SPECIAL *and* GT_VERSUS, check for K_IsPlayerLosing before retry, instead of bespoke check
- Solved by leveraging M_GetFirstLevelInList alongside existing M_CountLevelsInList calls
- Also optimises the above calls in the M_CupLocked case, since that's no longer being directly used otherwise
- Replacement for LF2_VISITNEEDED, which was itself a Kart-specific inversion of LF2_NOVISITNEEDED
- Prevents selection in time attack before you've beaten the level in another context (GP, or MP if applicable)
- Should be used for Sealed Stars (and Adventure Example) exclusively IMO, but usable for others too
Related adjustments:
- Allow a map to have a `TypeOfLevel` of 0 without error
- Change the Condition String for UC_MAPVISITED to "Finish a round on X" (previously "Beat X")
Add SRB2_ASSERT, superceding I_Assert
This assertion macro always expands to a call of srb2::do_assert, which
is overloaded with two templates: one which applies if the provided
Level is less than or equal to the SRB2_ASSERTION_LEVEL, and one which
is a no-op. When optimizations are enabled, this will verifiably remove
the evaluation of the expression in all cases, instead of evaluating the
expression and doing nothing with it.
Add srb2::NotNull wrapper utility
This is meant to be used in places where pointers are used as
parameters. It can be used with any pointer-like type, not just raw
pointers. During construction of NotNull, the pointer will be asserted
not-null in debug and paranoia builds, and in release optimizations with
no assertions, the code decays gracefully to standard pointer-passing.
Will make long-term management of this menu easier, and pushes aside some inconsistencies between graphics
May be reverted in part or full if it doesn't work for particular assets
Multiplayer map select now uses the value of `menugametype` accessible just above it on the menu, instead of having to select from a hardcoded set of options
- Add "Gametype" toggle option to pause menu for admins
- A/Confirm button on any gametype other than current to do random map in new gametype
- C/Extra button to return to current gametype
- A/Confirm button on current gametype does a funny noise and nothing else right now, idk what to do
- `randomlevel` supports the same `-gametype` parameter as `map`
- Both `randomlevel` and `map`'s `-gametype` parameter prohibits `GTR_FORBIDMP` mask gametype changes in netgames
- `randomlevel` properly sets encore based on `cv_kartencore`'s value (and permitting `GTR_ENCORE`)
- Split out `menugametype` change functions
- `yellowmap` now remaps all intermediary shades of grey to match funny pause menu remaps
- Introduce `menugametype`
- Controlled by IT_KEYHANDLER/M_HandleMenuGametype
- Excludes gametypes that do not support multiplayer by default
- GTR_CAPSULES and GTR_BOSS for now, but also user-specifiable GTR_NOMP
- Remove gametype_cons_t and G_UpdateGametypeSelections, an obstacle in the way of infinitely allocatable custom gametypes
- Should support custom gametypes, but haven't been thoroughly testing those
- Custom gametypes must now be unique by name
- Custom gametypes now have a maximum name length of 31
* `ATTACKING_` constants have been changed to be flags
- `ATTACKING_TIME` contains time data for all gametypes
- `ATTACKING_LAPS` contains laps data for `GTR_CIRCUIT` on maps with more than 1 lap
* `demoflags` now contains raw `ATTACKING_` flags
* Best time/best lap demo files will now be saved properly again (broken since `new-menus`)
* Ghosts will now be loaded properly again (broken since `unlockables-undefeatable`)
- Don't spawn the KI if the duration <= 0
- If the KI spawned but the duration <= 0 for any other reason remove the object instead of performing the division
Requested by Charyb.
- LE_PINCHPHASE (-2 or 65534) for busting open the Catcher
- LE_BOSSDEAD (-4 or 65532) for grabbing the emerald
Would like to use args for UDMF compatibility but there is no spawnpoint for the Catcher so it's hardcoded for now
If you smuggle an SPB to after the death of the UFO Catcher, spawn a single, free-on-straightways manta ring before it blows up.
Testing shows that you can get hit by the SPB's explosion only if you use the free manta ring just before a sneaker panel... but also Sal thinks it's cool and I think it adds depth
* Standardises conditions under which the UFO Catcher can be "targeted" (Jawz, SPB, tether)
* Makes SPBs explode a little ahead of driving distance if UFO Catcher is no longer targetable
- Clear console prints immediately after menu clear (fixes the prints on the black screen before loading level from menu)
- Last kart standing, not last hedgehog standing 🥹
* Both GT_SPECIAL and GT_VERSUS.
* Access controlled by SECRET_SPECIALATTACK. (You're blue now.)
Related changes to precipitate:
* Cups that only have one map in them get selected immediately, rather than off-the-cuff.
* Done by seperating out a new function M_LevelSelected from M_LevelSelectHandler
* Maps that only have one lap in them don't have a visible lap timestamp sticker.
* Fix a cup with *no* valid maps for the current ruleset being hypothetically selectable