Replaces g_splitscreen.c with g_party.cpp. Simplifies
party management functions.
Moves externs out of already bloated doomstat.h and
g_game.h into g_party.h.
Cuts down on globals spam.
A little off-piste, but a trivial addition since I'm changing this part of the code.
- Plays in Position outside of Encore
- Shows up first in the Sound Test sequence for that map
Record number of music files which we were able to add, so Addons menu shows the correct number of addons loaded.
Also marks main music files in `listwad` command.
- Defaults to 1, AKA Sonic 1/2 monitor
- Set to 2 for Sonic 3k monitor
- Supports a range of 1-9 and A-Z
- Permits fine-grained rapid-prototype stretch goal Chaotix monitor stuff later in development
We had this collective consciousness bigbrain moment in VC together, and it can literally only happen in this branch because unlocks.pk3 is the only main-game asset that needs to change for it
Solves the big problem we had with mixing up Item Capsules and ~~Battle Capsules~~ PRISON EGGS
Save your best GP stats across sessions.
- Saved into gamedata
- Deliniated per difficulty option
- Draw onto cupgrid in GP cup select
- Best grade
- Whether you've ever gotten the Emerald
- TODO: Always shows Chaos Emerald, will need updating when Super Emerald graphics are created
- Monitor status changes depending on recorded position
- 1st: Gold, shiny
- 2nd: Silver, shiny
- 3rd: Bronze, shiny
- 4th and downwards: Beige, barely different
- Wiped with G_ClearRecords
Also, to avoid circular dependencies:
- KARTSPEED/KARTGP constants moved from command.h to doomstat.h
- gp_rank_e enums moved from k_rank.h to doomstat.h
- Bots follow a slightly more strict path via waypoints
- Bots decide their starting waypoint path depending on their position. (The 1st place winner will start by chasing waypoint ID 1, etc)
- The map used for podium sequence can be decided via `PodiumMap = x` in MainCfg.
TODO:
- Camera work
- Add Lose / Win animation states when stopping at final waypoint
- Adjust physics so that the bots can follow the path more strictly in this mode
- Actually go to it after GP
- Replace battlewanted global with g_hiscore, keeps track
of the current highest number of points.
- Adds HUD tracking for player(s) with the hiscore.
- Should target both players in a tie.
- Demos are VERY large and should not be cached for every map in the game all at once.
- Instead, store a small amount of data related to staff ghosts for later reference.
- best time (for use in Medals)
- best lap (maybe use for Medals too)
- player name (for use in Time Attack menu)
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
- 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")
- 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`)
- GTR_ROLLINGSTART
* Initial instathrust, as before
* Forced MAXPLMOVE forward
* Disable finish line beam
* "Super transformation" sound
- Reference to the previous entry in the series' Perfect Startboost mechanic
- GTR_SPECIALSTART
* Instant white fade
* No titlecard (overridden by Boss intro)
* Starting warp sound
- Match slidein time with no traditional titlecard to the end of the playsim intro fade
- Remove G_IsSpecialStage
* The existing structs are now exclusively for handling extra data.
* `specialStage` has been renamed to `specialstageinfo`, to reflect that it is not the sole arbiter.
* `specialstageinfo.valid` and `bossinfo.valid` are what must be checked before grabbing data from either struct.
* These are turned on when the gametype extra data is successfully initialised, not on map start.
* `K_InitBossHealthBar(...)` for `bossinfo.valid`
* `K_InitSpecialStage(void)` for `specialstageinfo.valid`
* `K_CanChangeRules(...)` no longer checks these
* No longer uses duplicate encore information.
* The map command (and -warp) now guesses gametype using a general `G_GuessGametypeByTOL(UINT32)` function
* Grabs the first gametype with an overlap between the requested TOL and the gametype's TOL.
* The cool Versus-specific intro is now checked via `K_CheckBossIntro()`.
Controlled three things: Vintage SRB2 cutscenes, a certain type of reset on map commands, and whether to go to ceremony/evaluation/credits. All three should be controlled by grandprixinfo.gp instead, since that persists cross-gametype.
- New array of pointers to structures in memory (currently mixing static for base-game and Callocated for custom)
- Centralises a metric-ton of previously seperately handled properties into one struct
- Gametype_Names[]
- Gametype_ConstantNames[]
- gametypetol[]
- timelimits[]
- pointlimits[]
- gametypedefaultrules[]
- Don't attempt to guess custom gametype in Replay Hut (requires more work to make custom gametypes behave across the entire experience)
- I_Error if invalid gametype set
- gametyperules is deprecated since it will never be modified seperately from gametype (temporarily a #define, don't wanna bloat this commit too much)
New:
- GTR_POWERSTONES
- Handles spawning in Battle Emeralds (currently only works stacked with GTR_PAPERITEMS)
- GTR_ENCORE
- Codifies that Race can use Encore and Battle can't.
- GTR_CLOSERPLAYERS
- A gametype where players are encouraged/expected to be closer together. (All of the following was GT_BATTLE specific)
- Drafting/tether has increased strength/effective distance
- Spindashing is stronger
- Invincibility chaining has less effect
- Grow has a lower total duration
- Flame shield is more uncontrollable
Extra functionality
- GTR_CAPSULES
- Prevents usage of lives in Grand Prix (so Race, and the upcoming Special and Boss gametypes, can have 'em)
- GTR_CIRCUIT
- When not present, Flame Shield has perma-full meter
- When not present, overrides gamespeed with KARTSPEED_EASY
- Presence of Best Lap sticker in Time Attack menu
- Seperation between Time Attack and Break The Capsules modeattacking roulettes
- GTR_POINTLIMIT
- Handles the switch between a gametype recording/displaying Times and Scores in a few places
- Handles displaying "WANTED" players on the minimap
Missing simple substitutions
- A whole bunch of cases where player->bumpers was checked with gametype == GT_BATTLE rather than GTR_BUMPER
- GTR_OVERTIME handles the overtime special icon on the minimap
- GTR_BATTLESTARTS is honoured in K_DoIngamerespawn
- The Replay hut is closer to supporting custom gametypes
Removals
- GTR_LIVES
- GTR_SPECIALBOTS
- Given that grand prix persists between modes, these are special game-controlled features and not gametype-specific.
- GTR_WANTED
- WANTED as it existed is functionally dead
- Handle mismatched gametypes for client and server on voting screen
- I_Error when running out of gametypes
- Reduce gametype freeslots slightly to avoid colliding with VOTEMODIFIER_ENCORE
Now uses `SECRET_CUP` and `SECRET_MAP` with a stringVar saying the map lump/cup name, instead of `SECRET_NONE` and a levelheader `unlockrequired` property.
System for netsyncing unlocks, inspired by but with nowhere near as many moving parts as (STJr/SRB2!1756).
* `gamedata->unlocked[MAXUNLOCKABLES]` is duplicated to `netUnlocked[MAXUNLOCKABLES]` (or all `true` in `dedicated`
* New `local` boolean for M_SecretUnlocked
* Removed last vestiges of SRB2 special stage token code because it occupied the spot in the netsave we wanted to use.
* Correct typing of multiple `m_cond` functions that returned `boolean` constants as `UINT8`s.
- M_MapLocked
- If a level has a cup, will return true if that cup is locked
- will return always false in marathon mode (not yet accessible, that'll be another branch's work, but thinking ahead)
- Getting rid of a bunch of index fudging caused by SINT8 rather than UINT8 - we can use MAXUNLOCKABLES as the special invalid value
A small piece of (STJr/SRB2!1756).
Due to how RR currently handles time attack records and how it WILL handle unlocks, it's not currently feasible to split everything such that you can have two independent gamedata_t... but what's done so far is certainly more sane and less dependent on global variables
Other minor refactors:
- M_UpdateUnlockablesAndExtraEmblems and M_SilentUpdateUnlockablesAndEmblems are now one function with a boolean for loudness
- Unlock prints are currently living in the console, since the cecho stuff was a little broken
All typedefs for structs that were present in other header
files have been moved to here. (Except node_t because the
renderer and netcode both define node_t LOL.)