- For cross-file consistency in the author of this commit's name and username
- To note that the author of this commit performed significant work on code that would eventually be compiled into r_skins.c on several occasions since 2016 up to the present day
- To catch work performed by the author of this commit in 2023
- If you add a file (and you've unlocked Addons on non-DEVELOP builds) this gets achieved
- Also, Custom # of Rounds Played conditions will show "Custom" only if Addons are loaded
- Race, Capsule, Battle, Special, Custom
- All categories can now be used for Rounds Played condition
- UCRP_SEALEDSTAR now hides if you haven't beaten a single Sealed Star yet
In addition, introduce M_ClearStats
- As more statistics get added, clearing them manually in G_LoadGameData and M_EraseDataResponse is just going to get annoying
- Change around the options on the Erase Data screen to
- Make it clear that erasing all game data won't clear your Profiles
- Add an option to clear stats by themselves, rather than only permitting via complete gamedata wipe
- Move to the "Challenges" terminology over SRB2's "Secrets" terminology
- Move some entries that were previously handled in M_ClearSecrets into M_ClearStats
- Added to Statistics screen
- Caps at "999,999,999+".
- Controls UC_TOTALRINGS condition
- Improve description for UC_MATCHESPLAYED condition
- Says "Rounds" now
- Improve Statistics text for playtime
- Dynamically changes visible units of time (seconds, minutes, hours, days.......)
- UCRP_PREFIX_ISMAP: a prefix version of UCRP_ISMAP
- The condition string for UC_EMBLEM has been updated to match other relevant prefixes.
- UC_COMMA: a second string-relevance-only condition, for inserting a comma where only a human could find it natural
Partial duplicate of MR 1010, but 1) wanted to guarantee no merge conflicts before I forgot and 2) I added things in previous commits which needed stronger guarding
- Combine multiple adjacent saves
- Generally could happen during game ticking, combined via gamedata->deferredstate
- DEFINITELY happened in splitscreen PWR handling, adjust those loops directly
- Write "dirty" state via gamedata->crashflags on everything except safe, intentful unloads
- Add UC_CRASH, which unlocks dependent on the above "dirty" state being present at gamedata load
- We can use this for something more useful and less funny later.
- Play "O_LOSERC" on the menu, starting with the Challenges screen, if a UC_CRASH condition has been met.
- M_UpdateUnlockablesAndExtraEmblems: If Playing() and GS_LEVEL, call a bunch of funny conditions for every non-spectator splitscreen player.
- Called every tick in P_Ticker. May be foolish. May duplicate effort. Worth extra attention later.
- Add a bunch of stacking-together UCRP_REQUIRESPLAYING condition types.
- A collection of PREFIXes
- Grand Prix
- Bonus Round
- Time Attack
- Break The Capsules
- Sealed Star
- A collection of specific prerequisites
- Current map is [map value]
- Character is [character string that gets parsed after skin load]
- M_UpdateConditionSetsPending(), because SOC is bad and loaded before skins
- A collection of win conditions (TODO: these still work in FREE PLAY)
- Finish in good standing
- Break all the capsules
- No Contest
- Finish at least [place]
- Finish at [place] exactly
- Finish at [time, tics]
- Finish at [time, tics] exactly
- Finish with at least [time, tics] left (GTR_TIMELIMIT only)
- An AND to concatenate them together (literally just for text adjustment)
- Use sfx_achiev when any Challenge is completed
- If picking up MT_EMBLEM *doesn't* immediately complete a challenge, use sfx_ncitem as before
- Bugfix: this sound is played even when online, which it wasn't previously doing (because the object couldn't be destroyed and play its sound)
An ET_TIME emblem with a nonzero tag is directly bound to a staff ghost's finish time. This will make late development medal implementation signifcantly easier.
* Correctly identify that two columns with only one major unlock will have 6 empty tile slots, not two. This will result in less underutilised Challenges grid space.
- 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")
Relatively quick port from v1., but with under-the-hood changes to match the Emblem/Medal and Extra Medal reworks. We can make it prettier (and contain more data) later.
- New `flags` field
- Permits coexistence of var and flags
- `notMedal` boolean is now `GE_NOTMEDAL`
- New `GE_TIMED` flag
- Disappears `var` tics after `starttime`
- Improved M_GetConditionString handling for specific Emblem grabs
- More explicit error handling for invalid Emblem
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.
- Make the `SECRET_` constants an easily reshuffable `enum` instead of a series of byzantine `#define`s
- Includes SECRET_CUP and SECRET_MAP in preperation
- Begin the conceptual seperation between Emblems (special in-level objects) and Medals (specific type of emblem that adds to the counter)
- Rename UC_TOTALMEDALS and M_GotEnoughMedals, since the count is a Medals only thing
- M_CountMedals, in addition to being renamed, now has an `all` boolean parameter since getting the total is no longer as easy as `emblems + extraemblems`
Draws a preview of an unlock in the bottom left corner.
- Currently only supports unlocked ones (needs a roughly character-sized question mark graphic created)
- Currently only supports SECRET_SKIN and SECRET_FOLLOWER
Also, makes the area available to M_BuildConditionSetString smaller to avoid crossing into that region
Has ifdef'd out code for conditions to change between white and yellow when achieved to match V1 behaviour... wasn't able to figure out why it wasn't working, so dummied out for now.
* `gamedata->unlockpending[MAXUNLOCKABLES]` stores info to prevent the same unlock causing multiple sounds, and simplify `M_GetNextAchievedUnlock`
* Remove the DEVELOP cechotext
* Each unlock on the challenges menu updates all the unlockables, rather than just `M_CheckUnlockConditions`
* The unlock update function handles the incoming unlock sound itself if `loud` is true. This will allow us to quickly replace every sound at once when we've made a decision what to use
Also:
* Fixes the size of the savebuffer allocation in `G_SaveGame` to account for the challengegrid array.
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.
* Challengegrid now loops and scrolls horizontally.
- Scroll position currently tied directly to selected row/column, but can (and will) be seperated relatively easily later.
- In `DEVELOP` builds always scrolls - but in release builds, if someone makes a custom gamedata with less than 20 challengegrid columns (BASEVIDWIDTH/16), it'll remain static.
* Challenge ticker now automatically unlocks all pending at a rate of ~one per second.
- Based on VC discussion and Kirby Air Ride.
- Since no user input necessary, screen is now part-faded when unlocks are pending.
* Drawing a specific grid tile is now its own `k_menudraw.c` function.
* There is now a light grey grid around unselected tiles.
* Unlock explosions now use the tile's colour or, if not provided, the current profile's color.
Completely clientside, unlike SECRET_SKIN. Followers have no gameplay function, and it saves us having to write even more to our demos/netsaves. Replaces SECRET_WARP.
Also:
- Now don't apply skins or followers from profiles if the skin is locked - instead, get the closest skin in stats. (Same function as from demos!)
- If you're looking at a profile and the skin or follower are locked, make them solid colour (TC_BLINK).
- Don't show the ring cursor before you've selected a profile.