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
- For P_Ticker()'s calls to M_UpdateUnlockablesAndExtraEmblems
- Do not check non-UCRP_REQUIRESPLAYING conditions
- Controlled by a new `boolean doall` parameter to M_UpdateUnlockablesAndExtraEmblems
- Most other contexts have this as true
- Forced true if update is meant to be silent
- Only check UCRP_REQUIRESPLAYING conditions if a relevant property has been touched
- Controlled by a new `boolean checkthisframe` property on roundcondition_t
- Set in all contexts where roundcondition_t is modified
- Would also be set on lap change, but that case is already covered by the following
- Check all conditions, both UCRP_REQUIRESPLAYING and not, on:
- local player K_HandleLapIncrement
- local player P_DoPlayerExit
- local player P_DoTimeOver
- Controlled by a new `boolean deferredconditioncheck` property on gamedata_t
- UCRP_ISDIFFICULTY
- Example: IsDifficulty Hard - "on Hard difficulty"
- Does what it says on the tin
- You can't specify Easy because there is nothing easier than Easy
- Does it based on the GPsetting if in grand prix, or the level setting otherwise
- UCRP_PODIUMCUP
- Example: PodiumCup Ring - "complete RING CUP"
- Example: PodiumCup Barrier Silver - "get Silver or better on BARRIER CUP"
- Example: PodiumCup Goggles S - "get grade S on GOGGLES CUP"
- Basically a monolithic cup completion handler.
- Only happens after rankings begins in Podium ceremony.
- UCRP_PODIUMEMERALD
- Example: PodiumEmerald - "collect the Emerald"
- Get the Emerald to the ceremony and this is yours.
- UCRP_PODIUMPRIZE
- Example: PodiumPrize - "collect the prize"
- LITERALLY identical to PodiumEmerald except the string
- Doing it seperately from PodiumCup means we can't check whether that cup uses an Emerald or another Catcher Prize automagically
Measures whether you have all 7 Chaos Emeralds, 7 Super Emeralds, or 14 Emeralds
- Hidden if you haven't entered a special stage yet
- Checks all cups and all relevant difficulties outside of GS_LEVEL
- You can specify a difficulty of Normal, Hard, or Master
Record whether you've ever successfully entered a special stage
Used for conditions which were previously checking for whether you'd completed a special stage - which I think is a bit too restrictive for someone figuring out what next to lab
- Start with 3, per Sakurai's prior art.
- Earn them per certain number of rounds
- DEVELOP builds: once every 4 rounds
- Release builds: once every 50 rounds
- Has an internal cap based on the maximum number of unlockables supported.
- Possible future work could adjust this to restrict based on the maximum number of unlockables unlocks.pk3 actually has set.
- Use on the Challenges screen to bust open small tiles with hints (or the very first tile, if you haven't unlocked anything yet).
- Will do a funny shake if you try anything else.
- Interrupts menu flow just like getting an unlock.
- The matches you've played will tick upwards, giving you keys as they loop over.
- Previously was extern scope UINT32 for all players, but this permits one player in a netgame taking a secret path while others don't.
- Attempted to make user-specifiable string, but while I can undo the effects of strtok for the condition, I cannot undo the effects of strupr - so it's disabled for now until we come up with a more robust and hopefully direct system.
- Also removed some old SRB2-originated assumptions that you couldn't unlock anything in multiplayer from the unlocktrigger system.
- Exists on every player struct to simplify writes, but A) not netsynced and B) only checked for local players
- Updated in the relevant locations - no centralised ticking at the moment
- Has a number of new associated conditions that require playing (UCRP's).
- The following require [True/False] as supplementary information.
- FallOff
- TouchOffroad
- TouchSneakerPanel
- RingDebt
- The following have no supplementary information because they're universally a specific achievement.
- TripwireHyuu
- SPBNeuter
- LandmineDunk
- HitMidair
- The following has specific requirements that can be set.
- WetPlayer [name of fluid]
- Append "Strict" to forbid even skimming the surface of the map's fluid.
- All `cv_dummyspbattack`-related material is now gated with the assistance of SECRET_SPBATTACK.
- SPB_ATTACK
- Add UC_MAPSPBATTACK condition.
- Both this and emblems with MV_SPBATTACK have the string "SPB ATTACK: Conquer [LEVEL NAME]", compared to the regular round completion conditions having "Finish a round on [LEVEL NAME]".
- If SPBATTACK is not unlocked, shows ???: Conquer [LEVEL NAME] instead
- 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.