Commit graph

95 commits

Author SHA1 Message Date
AJ Martinez
3212a97547 Eggmanexplode 4*TICRATE -> 6*TICRATE 2023-02-25 19:26:58 -07:00
AJ Martinez
26fb34d94b Roulette reel lag compensation 2023-02-25 17:42:43 -07:00
VelocitOni
5bffc13db9 Reduce Gardentop Odds
A bit of a problem still, because I noticed that k_roulette.c isn't matched with our google doc. But this should be less annoying for now
2023-02-23 02:36:55 -05:00
James R
b0a4350454 Merge branch 'gachaboss' into 'master'
Use intermittent Gachabom in boss item table

See merge request KartKrew/Kart!954
2023-02-22 11:25:21 +00:00
AJ Martinez
00aa69ca0a Buff eggbox speed, allow contact transfers 2023-02-21 23:00:56 -07:00
AJ Martinez
ccef5bc5c9 Use intermittent Gachabom in boss item table 2023-02-21 20:34:50 -07:00
AJ Martinez
065111af86 Use Super Ring 'assistance' only in 1st 2023-02-11 19:47:41 -07:00
James R
ae16f124db K_GetTotallyRandomResult: use NULL roulette data
This fixes random paper items spawner RNG not advancing.
2023-01-03 05:30:53 -08:00
James R
339cb1e8b8 K_KartGetItemOdds: apply GTR_CIRCUIT checks
- No restriction on whether more than one player may
receive the same type of shield outside of Race.
- SPB is now technically allowed outside of Race, if item
odds permit.
- powerItems and assorted checks no longer apply outside
of Race.
2023-01-03 05:29:59 -08:00
James R
a37eccd708 Split powerItem etc conditions from K_KartGetItemOdds 2023-01-03 04:42:48 -08:00
James R
aab661cad8 Split shields and SPB special conditions from K_KartGetItemOdds 2023-01-03 04:42:48 -08:00
toaster
e45282bdff K_GetPossibleSpecialTarget()
* Standardises conditions under which the UFO Catcher can be "targeted" (Jawz, SPB, tether)
* Makes SPBs explode a little ahead of driving distance if UFO Catcher is no longer targetable
2022-12-28 23:31:46 +00:00
toaster
c47faa37ab ONLY have Super Ring in item reel if UFO is busted 2022-12-27 23:12:04 +00:00
toaster
17dd15b998 "Special Mode" (Sealed Stars) and "Versus Mode" (bosses) are now gametypes
* 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()`.
2022-12-26 23:06:24 +00:00
toaster
eb74ec3904 Change the rules for some things selected in the previous commit.
- Only show lap count and gamespeed on rankings if GTR_CIRCUIT
- Adjust offsets for speedometer/accessability icons with GTR_BUMPERS|GTR_SPHERES
- Only show Karma on Bumpers hud with GTR_KARMA
- Permit battle fullscreen without GTR_KARMA
- Make the Break The Capsules roulette show up with GTR_CAPSULES, not absence of GTR_CIRCUIT
- Don't push Break The Capsules roulette to the item list twice
- Make the special mode switching of int_battle happen for all instances of int_battle, not just GT_BATTLE
2022-12-26 22:06:26 +00:00
toaster
8431e52687 All playsim-internal distinctions between Race and Battle are now gametype rules.
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
2022-12-24 22:43:00 +00:00
Sally Coolatta
86c3a8ab78 Fix Gachabom merge 2022-12-22 05:35:35 -05:00
Sally Coolatta
82df346417 Merge branch 'master' into special-stages 2022-12-22 05:18:56 -05:00
Sally Coolatta
85604cfd2e Merge branch 'master' into special-stages 2022-12-19 01:53:41 -05:00
Sally Coolatta
321c8bf976 Update k_roulette.c 2022-12-19 01:13:44 -05:00
Sally Coolatta
021f829112 Update k_roulette.c 2022-12-19 01:12:18 -05:00
Sally Coolatta
659dc8270e Roulette speed thing
- Slightly slower at start
- More reasonable default
2022-12-18 01:10:34 -05:00
Sally Coolatta
9ba5a97aa4 Set actual firstDist for Special Stages
Fixes wild roulette speed
2022-12-18 01:00:28 -05:00
Sally Coolatta
36e9a56f29 Add K_TimeAttackRules
Lets Time Attack capsules spawn in Free Play, and prevents Time Attack specific rules from happening in Special Stages
2022-12-17 01:05:30 -05:00
Sally Coolatta
e7ae65f30e Next round of UFO tweaks
- Damage depends on item thrown at it.
- UFO speeds up when getting damaged.
- Made UFO speed up more often.
- First Special Stage item column is active farther back.
- Items can't be disabled if rules can't be changed.
- Item column code with items disabled uses fractional precision.
- Fixed bug with the new item table code to support different lengths better.
- Tweaked UFO speed values again.
- UFO is no longer solid.
2022-12-15 23:16:26 -05:00
Sally Coolatta
dc6caf1eb3 Implement the Special Stage item table 2022-12-15 23:12:51 -05:00
Sally Coolatta
05413eeb2d Add proper comments for each function
(I think this is the only code style I want to actively enforce :p)
2022-12-15 16:19:06 -05:00
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
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
Sally Coolatta
8d43acccb7 Use predetermined roulette speed for Time Attack 2022-12-13 18:03:44 -05: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
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
a73e62c163 Re-add roulette itemList user
Turns out the Z_Free error is something else in r_patch.c, seems unrelated to what I made.
2022-12-12 16:59:29 -05:00
Sally Coolatta
b0537de79e Re-implement debugitemodds 2022-12-12 16:44:24 -05:00
Sally Coolatta
9e3ded610d Get rid of my TODO notes
I implemented it, lol
2022-12-12 16:19:45 -05:00
Sally Coolatta
63f6b18d59 No user for roulette itemlist
Fixes the occasional Z_Free complaint
2022-12-12 11:55:28 -05:00
Sally Coolatta
8d2eb9220d Make Super Ring flood happen at 0 rings too 2022-12-12 11:46:03 -05:00
Sally Coolatta
13d7c791f5 Make the slowest speed slower
Was designed for Snap's tiny item sprites, for the huge ones it still feels pretty fast. The fastest speed is unchanged, though :)
2022-12-12 04:36:32 -05:00
Sally Coolatta
e45cef44df Make bots stop roulette instead of waiting it out
Done in kind of a lazy way, might revisit later.
2022-12-12 04:35:51 -05:00
Sally Coolatta
c8f3533b00 Roulette speed adjustments
- Speeds up the farther in the course you are
- Speeds up the further in the front you are
- Slows down before the 20 second mark
2022-12-12 04:01:09 -05:00
Sally Coolatta
10145b75d1 Fix incorrect item reel in actual races 2022-12-12 02:59:58 -05:00
Sally Coolatta
202c505664 Implement roulette visuals 2022-12-12 02:18:18 -05:00
Sally Coolatta
534026764c Make Eggman Mark actually work 2022-12-12 00:22:14 -05:00
Sally Coolatta
a481e4b34b Deterministic roulette
The roulette contains NO (non-seeded) RNG anymore. You manually stop it at any time.

Still needs the visual of the items scrolling, to make it not blind.
2022-12-11 23:58:11 -05:00