Commit graph

199 commits

Author SHA1 Message Date
toaster
edd3e8bbea UCRP_PODIUMNOCONTINUES
Fires if no continues have been used (as tracked on the Ceremony Ranking screen)
2023-10-18 00:42:59 +01:00
toaster
acdb7fd869 UCRP_CHASEDBYSPB
True if the player has PF_RINGLOCK (SPB on the HUD). Probably the cleanest implementation.
Stacks well with "finish in 1st".
2023-10-18 00:10:40 +01:00
toaster
fa2e54dd13 UCRP_FAULTED
- `Condition1 = Faulted Yes`
    - `FAULT during POSITION`
    - for example, combine with "& finish in 1st"
- `Condition1 = Faulted No`
    - `don't FAULT during POSITION`
2023-10-17 23:21:47 +01:00
toaster
35ca8e6191 UCRP_SPEEDOMETER
Provide a percentage between 100 and 999 inclusive.
Reach that speed on the speedometer at any point during the race to achieve the condition.
2023-10-17 22:53:40 +01:00
toaster
9e1aec4298 UCRP_RETURNMARKTOSENDER
"when cursed with Eggmark, blow up the racer responsible"
Just a simple condition. Either it happens or it doesn't.
MT_SPBEXPLOSION now tracks whether it was made by KITEM_EGGMAN or KITEM_SPB, too!
2023-10-17 22:25:47 +01:00
toaster
3e494a342c UCRP_GACHABOMMISER
Break a target (Prison Egg/UFO) using exactly one Gachabom again and again
Becomes invalid if an Insta-Whip collides with a target, or you throw two at the same time
2023-10-17 21:09:22 +01:00
toaster
01b97cb829 Update UCRP_UFOATTACKMETHOD into UCRP_TARGETATTACKMETHOD
Supports Prison Eggs and Gachabom now as well.
For the original behaviour, combine with the new UCRP_SMASHUFO.
2023-10-17 21:03:20 +01:00
toaster
d11fe78e90 UCRP_UFOATTACKMETHOD
`Condition1 = UfoAttackMethod [type]`
    - "smash a UFO Catcher using only [type]"
        - Combine with `Prefix_SealedStar` or `Prefix_IsMap [special stage stage]`
        - Shows up as "???"
    - Types supported:
        - `Boost` - "boost power" (sneakers)
        - `Whip` - "Insta-Whip"
        - `Banana` - "Bananas"
        - `Orbinaut`- "Orbinauts"
        - `Jawz` - "Jawz"
        - `SPB` - "Self Propelled Bombs"
    - Other types could be added on request, these were just the easy ones

In addition, the prototype for P_MobjWasRemoved was moved to `p_mobj.h`.
It's EXTREMELY important that we're able to safely check mobj pointers anywhere a mobj_t is possible to observe, without including the full `p_local.h`...
2023-10-17 01:07:03 +01:00
toaster
d4e3d8433d UCRP_TRACKHAZARD
A series of 100 booleans on the roundconditions struct, one per possible lap.
Allows for a full suite of track hazard touching conditions - see the following examples.

- `Condition1 = Prefix_IsMap RR_MOTOBUGMOTORWAY
- `Condition1 = TrackHazard No`
- `Condition1 = IsMap RR_MOTOBUGMOTORWAY`
    - "MOTOBUG MOTORWAY: Don't touch any track hazard"
- `Condition1 = Prefix_GrandPrix`
- `Condition1 = IsMap RR_HARDBOILEDSTADIUM`
- `Condition1 = TrackHazard Yes`
- `Condition1 = And`
- `Condition1 = FinishPlace 1`
    - "GRAND PRIX: On HARD-BOILED STADIUM, touch a track hazard every lap & finish in 1st"
- `Condition1 = Prefix IsMap RR_DEATHEGG`
- `Condition1 = Trackhazard No 8`
    - "DEATH EGG ZONE: Don't touch any track hazard on lap 8"
- `Condition1 = Prefix_IsMap RR_SPEEDHIGHWAY
- `Condition1 = TrackHazard No Final`
    - "SPEED HIGHWAY: Don't touch any track hazard on the final lap"
2023-10-16 17:09:12 +01:00
toaster
6b2e0a508d UCRP_RINGS, UCRP_RINGSEXACT
`Rings 10` - "with at least 10 Rings"
`RingsExact -14` - "with exactly -14 Rings"
(`Rings 20` will also be parsed as "with exactly -20 Rings")
2023-10-15 00:17:20 +01:00
toaster
b2aac22856 UCRP_FINISHPERFECT
Complete a perfect round (1st every lap) to get this
2023-10-14 23:21:51 +01:00
toaster
52674c7bb2 UC_UNLOCKPERCENT
- `UnlockPercent 40 AltMusic` - "Get 40% of alternate music"
- `UnlockPercent 1 Color` - "Get 1% of Spray Cans"
- `UnlockPercent 20 Map` - "Get 20% of Courses"
- `UnlockPercent 55 Cup` - "Get 55% of Cups"
- `UnlockPercent 100` - "Get 100% completion"
    - Provide a percentage and, optionally, an Unlockable type
    - This only works for Unlockable Types where there are expected to be more than one per board
2023-10-14 18:42:27 +01:00
toaster
1c4750a0a2 readcondition: Support non-fragmented parameters that can be used for the Challenge Description directly
- "DescriptionOverride" (new!)
    - Provide a full description in place of the params and this will be used
    - Any conditions that are before it will not be wiped, so you can prefix it if you need to
    - Can be used with any other set of Conditions
        - `Condition1 = DescriptionOverride Complete the sentence: "ring racers (???)"`
- "Password"
    - Now supports passwords that contain spaces
        - `Condition1 = Password race as a ring!`
- "WetPlayer"
    - Now supports liquids that contain spaces
    - HOWEVER, it comes with the following caveats as part of the change:
        - The strictness level must be provided first.
        - You can't leave the strictness out. The previous default behaviour now requires STANDARD to be explicitly written.
        - `Condition1 = WetPlayer Standard Mega Mack` can be used, now.
2023-10-13 16:25:05 +01:00
toaster
f8de2cfc83 UC_PRISONEGGCD
Gamedata minor version was updated again.
(God this was a weirdly big amount of work and it's not even polished.)
- Condition1 = PrisonEggCD [Level that has to be unlocked]
- Approximately every 30 Prison Eggs destroyed, you get a shot at a Prison Egg Drop.
    - The only Prison Egg Drop implemented right now is an Alt Music CD.
    - Your [Wild Prize] is guaranteed to be selected only from conditions associated with levels that are unlocked!
- Only spawns in Grand Prix Bonus Rounds, for netsync and game design.
- The number is fuzzed. If you start the level with 0 Prison Eggs to destroy, it selects a random number of Prisons in the level to bust.
- If you miss the pickup (such as into a deathpit), you'll get another shot in the immediate next Bonus Round you play.

Also:
- The number of Chao Keys you start your gamedata with is now part of the header file, not buried in the wiping function.
- Removed the ACTUAL last object definition vestiges of the Emerald Hunt gamemode.
2023-10-12 21:12:08 +01:00
toaster
d784f6ad4a SECRET_ALTMUSIC
Restricts a map's alt music, in order of music definition.
Supports out-of-order discoveries!
2023-10-08 21:22:58 +01:00
toaster
ce3b6e304b Add UC_MAPMYSTICMELODY
If you activate an Ancient Shrine on that level, the condition triggers and the Challenge is achieved.
2023-10-06 22:32:43 +01:00
toaster
b937b1a7bc Add UCRP_MAKERETIRE
- `Condition1 = MakeRetire Eggrobo`
- Fires when:
    - Not a cooperative context
    - You've finished in good standing
    - Another player has both
        - PF_NOCONTEST
        - The skin specified in the condition
Also makes rivalname-handling for K_InitGrandPrixBots `const char *`, since the author of this commit had to reference that code.
2023-10-05 14:36:00 +01:00
toaster
5ac1854b1b The conversion rate for Rounds to Keys is now 32:1 per popular consensus 2023-09-29 10:03:05 +01:00
toaster
911588a5fe Challenges Tutorial messages
Currently exists for:
- Generating a Chao Key
- Attempting to use a Chao Key on a Major Challenge
    - Only shows after Generating a Chao Key just so it doesn't fire before you know what's going on
Text is preliminary
2023-09-29 00:25:51 +01:00
toaster
07afe6cb06 Challenge Grid is 5 tiles high now again
I'm sorry, it was just TOO SWAG.
Gamedata minor version increment
2023-09-28 22:30:26 +01:00
toaster
b33597e225 Beginnings of system for using Chao Keys on large tiles
- M_UpdateChallengeGridExtraData: Register whether major unlock tiles have had every surrounding Challenge cleared (CHE_ALLCLEAR)
- M_DrawChallengeTile: For locked tiles with CHE_ALLCLEAR, show a little dot (temporary drawer)
2023-09-27 16:02:28 +01:00
toaster
595b3d67d5 Add UC_CHARACTERWINS
Just in case I don't get to do a major pass on adding a ton of extra unlockable conditions later, this is an easy, quick add featuring a stat gamedata and the statistics menu has been tracking for a while.
2023-08-23 18:58:10 +01:00
toaster
e1b7cb66cb Rework the Spray Can system to ACTUALLY be what we want
Instead of being specific to each level, Spray Cans are stored in a list on gamedata that will be stepped along each Spray Can you collect.
They are only assigned to a level on collection - which prevents you from farming the same easy location for every colour in the game.

In addition, this new system is one step short of dehardcoding them entirely. Now only Spray Cans specifically asked for by the existence of UC_SPRAYCAN will be put in the list, and if a secondary parameter is either "Yes" or "True", it will be put at the head of the list. This could technically support custom skincolours one day, but the author of this commit doesn't care to do the last bit of work necessary to make it happen.

There's a slight extra overhead in that skincolor_t now also holds a `cache_spraycan` (renamed from `cachedcan`, which maps had previously)

Currently, there's no safeguard against grabbing it on a custom course - you'll lose the Spray Can as soon as you load a fresh game again - but  I consider that easy to fix (tomorrow) and necessary before merger, because the author of this commit does NOT want complaints on release because we forgot to protect users who keep on losing their skincolors.
2023-08-23 00:46:46 +01:00
toaster
b03c82b8b2 Implement UC_SPRAYCAN condition
Currently impossible to achieve, but will work once I draw the rest of the owl
2023-08-19 15:09:18 +01:00
toaster
1d06637a38 First pass at assigning unique spraycans to level headers
Increments gamedata minor version, be aware
- M_AssignSpraycans
    - Called in M_FinaliseGameData.
    - Attaches a hardcoded set of colours to all race maps in cup order, stopping once we run out.
    - The colours are shuffled, with some "freebies" always at the head of the list.
    - Integrates partial lists pretty well.
    - In DEVELOP builds, I_Errors if it produces corrupted state.
- G_LoadGameData, G_SaveGameData
    - Save & Load is implemented for these assignments
2023-08-19 15:08:55 +01:00
toaster
fb8795c8da M_FinaliseGameData
Creates a central landing point where gamedata loads/creates can be finalised properly.

In addition, gamedata wipes caused by data erase or custom SOC gamedata can no longer be saved in a partway corrupted state if they were to crash midway through.
2023-08-19 14:32:11 +01:00
James R
943086a902 K_TimerInit: disable POSITION in FREE PLAY 2023-08-12 16:38:01 -07:00
toaster
1ec5b74892 Implement SECRET_MEMETAUNTS
Permits "Meme" player taunt voice and "Meme" follower horn options
2023-06-28 19:31:40 +01:00
toaster
4344221252 Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart into seeecret-colors 2023-06-28 12:48:50 +01:00
toaster
5036719280 Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart into seeecret-colors
# Conflicts:
#	src/k_menudraw.c
2023-06-26 23:25:47 +01:00
toaster
c9817b957a New unlockable type for watching the Credits from start to finish
Also makes gamedata save/load a little more forward compatible longterm by making a UINT32 bitfield for various once-event flags, with increased minor version
2023-06-26 22:32:47 +01:00
toaster
060c03f011 Ring Racers-specific Evaluation
- Four evaluation modes.
    - Perfect
        - Currently no visual implementation
    - All others have a cool set of visuals
        - Multi-stage animation of a glowing threat and a Star that's Sealed
        - If they're relevant, show the gems you HAVEN'T grabbed
        - Three modes here
            - No gems
                - For Easy mode, asks you to brave a higher difficulty
            - Chaos Emeralds
                - Not all 7 chaos emeralds? Push your rank harder!
            - Super Emeralds
                - Not all 7 super emeralds? Further challenge awaits!
- `useBlackRock` to make evaluation context less specific for custom material is replaced with `useSeal` option
- M_CheckCupEmeralds(difficulty)
    - Returns the Emeralds you have for that difficulty
    - Obviously returns 0 for Easy
    - Makes the method of checking collected Emeralds for cup contexts significantly easier
2023-06-25 23:49:20 +01:00
toaster
bf5aa4b5d8 M_GetNextAchievedUnlock: Skip over adding Chao Keys if you've already unlocked everything
I considered restricting it even further to "unlock every minor unlock that can be unlocked by a Chao Key", but decided that if you haven't "completed the game" yet, you should still be periodically reminded of it.
2023-06-09 16:46:58 +01:00
toaster
8efd4788e7 enum gdmusic_t
Replaces existing musicflag system, which only had one flag, with a priority system that overrides menu music in general.
Also adds the CHAO KEY FREE DDL WORKING 2023 goofy music for matchesplayed Chao Key generation.
2023-06-07 23:05:19 +01:00
toaster
e162fffecf UC_PASSWORD
Unlockable type that supports entering (case-insensitive) string
2023-06-07 17:46:21 +01:00
toaster
f106d14d69 M_SanitiseChallengeGrid
Attempts to recover Challenge Grids that aren't quite appropriate for the current suite of unlocks.
- If there's multiple small tiles pointing to the same unlock, turn the later ones empty.
- If there's a small tile that SHOULD present on the grid and an empty spot, put the needed tile in that spot.
- Otherwise, regenerate the entire grid.
This will permit us to change the number of unlockables without forcing people to run with the command line param `-resetchallengegrid` to see 'em.
2023-06-07 17:46:21 +01:00
toaster
cc29c23ac6 Fix the width of the pending keys for gamedata to prevent unintentional rollover 2023-05-30 21:09:15 +01:00
toaster
0c7d66791b Expand datatype for Unlockables, emblems (Medals + nonmedals), and Conditions.
Made sure there is more than enough headroom for our current purposes.
It should be easy to double again if necessary now that the datatypes have been increased... but that would be obscene at this point
- 1024 Unlockables and 1024 Conditions (these were always tied together in slots)
- 2048 emblems (Medals + nonmedals). If we ship with ~250 maps this permits 8 Medals per map - which is higher than we intend right now but could easily fill out in patches
2023-05-30 21:08:29 +01:00
toaster
1527471678 Character win records
Track wins per character.
- If you have an existing gamedata of minor version 2 or earlier, attempt to import your last-used profile's wins onto the character you last used on that profile, so you're not starting from nothing. It's not quite accurate, but it's something.
- Much like map headers and cups, these are also tracked in an unloaded_skins_t linked list. That work was done in this commit because gamedata is actually loaded before even base-game characters, which is annoying but at least confirmed it was working quicker.
- TEMPORARY: Your per-character wins are displayed in your latest-log.txt, in lieu of an update to the in-game statistics menu
2023-05-30 12:21:41 +01:00
Sally Coolatta
c486ec19af SECRET_COLOR 2023-04-25 14:19:52 +01:00
toaster
945a00df6e Permit emblem pickups that take on the visage of a Follower
- If Global-type map emblem has GE_FOLLOWER, attempt to take on the appearance of the follower specified by var2.
    - Unlike MT_RANDOMAUDIENCE, this picks whether the object should be floating or hopping based on the specified mode of the source Follower.
    - Always chooses to face the nearest player.
- Rearrange some properties affected by Obj_Audience/audience.c to not conflict with MT_EMBLEM
2023-04-21 15:17:43 +01:00
toaster
66d8d8757e emblem_t: Add var2/stringVar2 2023-04-21 15:09:49 +01:00
AJ Martinez
3012839138 Serverside PWR: Completely rip out profile PWR, add PWR to XD_ADDPLAYER 2023-04-11 19:38:02 +01:00
toaster
8d66b279f8 FREE PLAY: Correct mistaken assumptions.
- Make the check consistent between HUD and Challenge conditions by revolving both around M_NotFreePlay.
    - The HUD appearance checked every individual component of K_CanChangeRules, so just straight up do that here.
    - If the rules can be changed, battleprisons is always FREE PLAY no matter how many players are present (because it can change quickly).
2023-04-03 00:28:38 +01:00
toaster
3e900d7f57 G_DirtyGameData: Dirty bit only applied in I_Error and signal handlers, nowhere else
- Unfortunately, the way this system previously worked, the unlock was given to you for free if you accidentially opened two copies of the game at once.
- Instead, open the file in r+ mode, shimmy along 5 bytes, and write a `true` to be read later.
- Far more memory safe than rewriting the entire gamedata out on crash.

ALSO:
- crashflags has been split into boolean evercrashed and UINT8 musicflags.
    - We don't need to track if the LAST session was a crash, at least not right now.
    - Opens the floor up to other music like Loser Club happening on the Challenges menu.
2023-03-17 14:42:06 +00:00
toaster
3ead0d09c4 Jartha review: Issues with activation and comments of UCRP_WETPLAYER and UCRP_FALLOFF 2023-03-17 13:00:17 +00:00
toaster
7f3836f916 Chao Key changes
- Chao Keys are now UINT16 instead of UINT8
- The maximum number of Chao Keys is now 9999, which is the largest number of 9s that can fit in a UINT16
- Used keys no longer count towards your total
Will mildly corrupt gamedatas made with previous conditions-cascading builds, but only in a way that gives you extra keys than you've earned.
2023-03-15 14:49:22 +00:00
toaster
2d7ef00e29 Discoveries while self-reviewing during description creation
- Rename "FinishAllPrisons" and correct text to refer to Prisons
- Do not hint at greater speeds for UCRP_ISDIFFICULTY
2023-03-14 20:59:51 +00:00
toaster
db1b3dd7c9 GDCONVERT_ROUNDSTOKEY: Make 20 in DEVELOP builds instead of 4, for a closer-to-realistic progression 2023-03-14 11:31:09 +00:00
toaster
425f260914 Never consider TEST RUN locked
- Repairs access to TEST RUN cup
- We want to make it an unlockable later, so...
- M_MapLocked data types corrected
2023-03-12 20:41:00 +00:00