Commit graph

20995 commits

Author SHA1 Message Date
Sally Coolatta
6554c8bfb1 Improve scope handling of the roulette
All of the player_t references are now full-const instead of const pointer after a certain point. This is because I've made two mistakes so far of modifying the player with this, when it's supposed to be safe to call for HUD as well.

Also uses this split to add a more efficient way to prevent multi-Shrink/SPB.

Also handles NULL player better, for the sake of Battle's K_CreatePaperItem.
2022-12-15 02:13:46 -05:00
Sally Coolatta
167df6cca7 Remove item roulette between maps 2022-12-15 01:44:09 -05:00
Sally Coolatta
ffe9d5cd1d Properly support small splitscreen itembox 2022-12-15 01:41:34 -05:00
Sally Coolatta
f7e53ec811 Cleanup lots of the older roulette code
- Most of it now requires a reference to itemroulette_t, rather than copying all of the variables over.
- Increased the effect of Frantic Items, as the old scaling was made extremely low because  item distance was exponential back then.
- A lot of variables are pre-calculated in itemroulette_t instead of redoing the calculations every time (player count, first place's dist, etc)
- Make most of these functions only accessible by k_roulette.c
- Even when single items get forced into your roulette, the Super Ring Debt effect can happen
- Make the game support setting single items from other gametypes (Pogo Spring-only races work now)
- Fix some item distances not accounting for scale
- Prevent multiple of certain items from rolling at once; Shrinks (not a big deal) and SPBs (OH GOD NO)
2022-12-15 01:23:23 -05:00
VelocitOni
c5372f4ce3 Merge branch 'master' into capsules-improvement 2022-12-14 23:19:34 -05:00
James R
c32134849f Merge branch 'clipping-rectangle' into 'master'
Clipping rectangle

See merge request KartKrew/Kart!806
2022-12-15 04:11:56 +00:00
Oni
f4ab4d753d Merge branch 'broly' into 'master'
Broly's ki on explosions

See merge request KartKrew/Kart!809
2022-12-15 03:56:39 +00:00
James R
b97c8cd176 Make explosions louder from a distance 2022-12-14 19:54:33 -08:00
James R
130953fc7e Add sfx to Broly ki 2022-12-14 19:54:33 -08:00
James R
9017ca1c20 Delay mine explosion sound until after Broly ki 2022-12-14 19:54:33 -08:00
James R
2d52e4a047 Colorize Broly ki to player color 2022-12-14 19:54:33 -08:00
James R
2ec29b2586 Adjust mine and explosion to center Broly ki 2022-12-14 19:54:33 -08:00
James R
34dec00539 Add K_SpawnBrolyKi, green circle shrinks during explosion hitlag 2022-12-14 19:54:31 -08:00
toaster
88d41f6721 SECRET_ALTTITLE
My final indulgence for this branch. One cvar that swaps a patch
2022-12-14 20:18:53 +00:00
toaster
e10df0ee68 Gamedata minor version
Matches Profiles, etc (including the funny "from the future" alert)
Also updates major VERSIONCHECK, so when this starts getting tested amongst the devteam it'll be explicitly not cross-compatible
2022-12-14 18:06:21 +00:00
toaster
42f4f28e06 Statistics menu
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.
2022-12-14 17:53:35 +00:00
toaster
2fbbe52ded Cache level ID for Emblems, too 2022-12-14 17:50:00 +00:00
toaster
c7db580338 Remove debug print from Unlockable SOC color parse 2022-12-14 17:31:10 +00:00
toaster
c693be47f8 Fix possible out of bounds memory access for M_MapLocked 2022-12-14 17:30:39 +00:00
toaster
6545b693d4 Make level titles capitalised on Challenges menu 2022-12-14 17:29:22 +00:00
toaster
f87db3cfab Further K_DrawMapThumbnail changes.
- Precache M_NOLVL.
- Make all width calculations relative to a lump 320 pixels wide, to make outdated map thumbnails much, MUCH more visible.
- Add K_DrawLikeMapThumbnail to draw a 320x200 patch like a map thumbnail (currently used only for RANDOMLVL).
2022-12-14 13:08:06 +00:00
Sally Coolatta
8d43acccb7 Use predetermined roulette speed for Time Attack 2022-12-13 18:03:44 -05:00
Sally Coolatta
6b8a011aa1 Flicker other items when selecting
Makes the lerp back to the middle less jarring, since the items that were just there won't disappear.
2022-12-13 18:02:21 -05:00
toaster
19ab3a8445 Only show hints if an unlocked tile is adjacent 2022-12-13 22:28:46 +00:00
toaster
2a35f7d197 Adjust y offset for challenge description 2022-12-13 22:20:24 +00:00
toaster
5bb149c47a Permit M_CheckNetUnlockByID if conditionset is zeroed 2022-12-13 22:20:06 +00:00
toaster
7081ffd509 Fixes and changes for Emblem system
- 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
2022-12-13 22:19:37 +00:00
toaster
0e8c739efc Fix M_GetLevelEmblems to work with gamemap index (as it was used for) instead of mapheaderinfo index 2022-12-13 22:11:07 +00:00
toaster
dbb96dabd6 Fix M_UnlockableFollowerNum to work with followers whose names have spaces in 2022-12-13 22:10:35 +00:00
toaster
e2e6ce6108 Fix follower translation colormap to use TC_DEFAULT 2022-12-13 21:48:49 +00:00
toaster
117b4c6a7b GAMEDATA MainCfg SOC block adustment
Discussed in DMs
- All other `MainCfg` block properties require a custom gamedata (or be a main file) to be modified
- When a custom gamedata is set, clear all unlockables, conditionsets, and emblems are unconditionally cleared
- You may also Clear Levels only if a custom gamedata is used
2022-12-13 18:20:52 +00:00
toaster
b26da37477 Forgot to stage compilation fix 2022-12-13 18:10:47 +00:00
toaster
ff1574f80f Allow for marking Emblems as "not a Medal" via SOC definition
Also remove long-unused `hint` string
2022-12-13 17:48:35 +00:00
Sally Coolatta
2a546df3fb Fix debugger breaking, reduce size 2022-12-13 12:44:11 -05:00
toaster
47901939d5 Actually lock Time Attack and Capsule Attack behind SECRET_TIMEATTACK and SECRET_BREAKTHECAPSULES 2022-12-13 17:37:26 +00:00
toaster
ac95f8b494 Improve the Preview area for Challenges significantly.
- New Previews of random-per-session maps with an overlay for
    - SECRET_ENCORE (Phantom Ruby)
    - SECRET_TIMEATTACK and SECRET_BREAKTHECAPSULES (Lap center circle stopwatch)
    - SECRET_HARDSPEED (Rocket Sneaker, a sneaky reference to the current MS webview)
- Fix the position of SECRET_MAP's map to match the above
- Add a grey background at the bottom to really bring the feng shui together
2022-12-13 17:25:47 +00:00
Sally Coolatta
c184567361 No longer dynamically allocate roulette list
Done with the issues trying to sync this memory over the wire, so now it's just a long static array...
2022-12-13 12:06:52 -05:00
toaster
d5ab51fe38 Fixed unsignedness of M_UnlockableMapNum return type 2022-12-13 16:18:56 +00:00
toaster
0ef95875fa Fix copypaste typo for M_MapLocked 2022-12-13 16:15:48 +00:00
toaster
fc6eff65c2 Cache the result of M_UnlockableSkinNum/FollowerNum/MapNum/Cup
Improves performance on mapheader iteration for M_Map/CupLocked significantly.
2022-12-13 16:15:31 +00:00
toaster
20c754ca66 Preview for SECRET_CUP and SECRET_MAP
Includes a dummied out alternate SECRET_CUP with more consistency to the idea of graphics exclusively in lower left, but matching the cup select screen won out.
2022-12-13 14:49:33 +00:00
toaster
2871ccb4f1 Rewrite level restrictions
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.
2022-12-13 13:45:17 +00:00
toaster
76e290678f Groundwork for later commits
- 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`
2022-12-13 13:07:46 +00:00
Sally Coolatta
59ee8177d7 Try some things for roulette sync
- PU_STATIC instead of PU_LEVEL, since player_t is always kept around anyway.
- Don't alloc itemList when cap is 0
- Read/write 0 when itemList is NULL
2022-12-13 00:00:37 -05:00
Sally Coolatta
7713ce0ebb Fix speed being messed up near level start
Used the wrong constant, leftover from an earlier experiment that was only partially reverted. Fixes "ghost" roulettes.
2022-12-12 19:41:33 -05:00
Sally Coolatta
8534703de6 Further improve item debugger visibility
- Half the scale of the item graphics, and reduce the spacing, so more of the reel can fit in one column.
- Move the item table text over to the right, depending on how many columns were drawn.
- Display the item roulette speed, as well.
2022-12-12 17:43:32 -05:00
Eidolon
51e0bed20a c++: add finally RAII utility
This mirrors the `finally` utility in Guidelines Support Library for
ensuring that a cleanup function is always called when the utility
object leaves scope, even when unwinding the stack from an exception.
This is to aid in transitioning malloc/free pairs in function bodies to
be more exception-safe.
2022-12-12 16:40:56 -06:00
Eidolon
15acefcc33 c++: Make some defines C++-valid 2022-12-12 16:38:25 -06:00
Eidolon
dceeadd3aa Don't preproc. define inline in C++ 2022-12-12 16:34:26 -06:00
Eidolon
7423b05f46 Redefine boolean for C++ compatibility 2022-12-12 16:34:25 -06:00