Commit graph

1820 commits

Author SHA1 Message Date
toaster
e7b63a5fad G_UpdateTimeStickerMedals, M_StartTimeAttack: If you've beaten all game-provided times, show your personal best record on the in-level HUD instead. 2023-02-05 19:17:07 +00:00
toaster
eab22e73a6 G_UpdateRecords: Play Medal-get sound on successful ET_TIME Medal get 2023-02-05 18:45:02 +00:00
toaster
55b7d21051 G_TickTimeStickerMedals, G_UpdateRecords, K_drawTimestamp: Jitter HUD on both Medal-earning success and general failure to reach desired time 2023-02-05 18:44:25 +00:00
toaster
eb16f9d5a9 G_TickTimeStickerMedals: Move the failed-record sound handling out of K_drawKartTimestamp 2023-02-05 18:31:59 +00:00
toaster
9c95d2d975 G_UpdateTimeStickerMedals: Use a memset to initialise the struct, rather than relying on manual pick-outs 2023-02-05 18:02:21 +00:00
toaster
4522ba3b4d stickermedalinfo, UpdateTimeStickerMedals: A centralised struct for Medal info attached to the time sticker.
- K_drawKartTimestamp: Significantly less messy, no longer dependent on static variables, and no longer iterates over M_GetLevelEmblems every rendered frame(!!)
    - TODO: Still handles playing sound in the drawer
- K_PrepareTimeAttack: Initial generation of a struct of emblems/text is handled on the menu
- G_UpdateRecords: Updated in-game if you unlock the next medal there
This commit was amended to centralise the new material in g_game.c and reduce the number of header additions required.
2023-02-05 17:42:28 +00:00
toaster
e874b5ba18 G_DoLoadLevel: do not apply profile if demo is played from titlescreen 2023-02-05 13:33:31 +00:00
toaster
2207115424 Time Attack: Update Medals on player exit, not on intermission
- M_UpdateRecordReplays: Split out M_UpdateRecords
- P_DoPlayerExit: Call M_UpdateRecords in modeattacking
2023-02-05 00:21:08 +00:00
toaster
96297aad1c Title demos: Add support for game loading vRes staff ghosts as title demos 2023-02-03 18:23:59 +00:00
toaster
87ee91638e D_ClearState, G_EndGame, G_GameEndTicker: Move netgame-specific server looping out of the general state-clearing function, for sanity's sake. 2023-01-31 14:09:21 +00:00
toaster
defa4511a8 G_EndGame: Do not open menu if D_ClearState runs netgame level loop behaviour 2023-01-31 13:57:53 +00:00
toaster
20e9b2f5e8 Restore menu state after playsim
- restoreMenu, M_SpecificMenuRestore
    - From any Cup Select, Level Select, or Time Attack context (including non-net replay playback), return to the relevant "core menu"
    - From any server OR server connection failure, return to the Online EGGA CHANNEL top-level menu
    - From netreplay, head to replay hut without incorrect gamestate/fade cope
    - Interruption for Challenges unlock sequence now happens on all menu returns, not just post-titlescreen
- M_StartControlPanel
    - Integrate with above
    - Handle menu re-initialisation properly under more contexts
- D_ClearState
    - Split out from D_StartTitle
    - Can be used alongside M_StartControlPanel to restore menu state from any play session in a way just as reliable as D_StartTitle was
2023-01-29 23:53:21 +00:00
Oni
271dae4643 Merge branch 'refcount-goofin' into 'master'
Additional P_SetTarget mobj_t pointer fixes on player struct

See merge request KartKrew/Kart!875
2023-01-25 01:00:42 +00:00
Oni
8a771521c2 Merge branch 'spectator-look' into 'master'
Re-implement spectator vertical look

See merge request KartKrew/Kart!898
2023-01-22 03:33:37 +00:00
Oni
5664c8addc Merge branch 'title-profile-tweaks' into 'master'
Small fixes for profile selection and skipping title screen

See merge request KartKrew/Kart!895
2023-01-22 02:51:28 +00:00
toaster
e6e1d6b042 Re-implement spectator vertical look
- Hold lookback to pivot the spectator's vertical aiming angle
    - Forward/backwards item throw/trick input aims up/down
    - Overrides forwards/backwards movement while lookback is held
    - Changes the spectator text to indicate that it's in aiming mode
2023-01-21 23:46:14 +00:00
toaster
2e35a40b80 SF_IRONMAN: handle randomised skin and hurt/death states differently
- P_DamageMobj
    - Become skin temporarily to show off the hurt frames
    - Sets charflags, so P_PlayerThink can handle reversion
    - Add sparkles for losing disguise
- P_KillPlayer
    - Sets charflags, so P_PlayerThink can handle reversion
    - Add extra sound for losing disguise
- G_PlayerReborn
    - Sets charflags in not-betweenmaps case as well, so P_PlayerThink can handle reversion
- P_SpawnPlayer
    - Use set skin for spawn again (partial revert of previously committed code)
- P_PlayerThink
    - More specific conditions for fakeskin reversion
        - Not hurt, dead, or respawning (except for last part of drop)
    - Add sound and sparkles for reapplying disguise
2023-01-21 14:43:54 +00:00
James R
63bed732f2 G_Responder: remove check to finalecount before opening menu from title screen
This is handled by M_StartControlPanel anyway and the
condition did not match anymore.
2023-01-19 21:28:03 -08:00
toaster
2a87cfcdf1 Additional P_SetTarget mobj_t pointer fixes on player struct
* CL_ClearPlayer (player departing server)
    - In GS_LEVEL, decrement refcount for all relevant pointer
    - Clearer comments
* G_PlayerReborn (initialisation before any player spawn)
    - Preserve skybox data and hoverhyudoro (except between maps)
    - Clean up follower handling
* Cross-codebase: use P_SetTarget for setting skybox-specific pointers, to match p_saveg.c
2023-01-08 15:15:44 +00:00
toaster
80d19a8458 Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart into save_p-unglobal-alt
# Conflicts:
#	src/g_demo.c
2023-01-03 19:45:18 +00:00
Sally Coolatta
aa4fd8ab13 Add functions to initialize savebuffer_t
g_demo.c is mostly unaltered because it is made of twigs.
2023-01-02 19:47:59 -05:00
Sally Coolatta
761be01dbb Contain end & size into savebuffer_t
I would've liked to make it use a single allocate function to do this very cleanly, but these cases were very clearly not meant to be standardized and use wildly different methods to allocate & free...
2023-01-01 00:23:23 -08:00
Sally Coolatta
38a35b6f78 Make save_p / savebuffers not global
This caused some scary issues with P_SaveNetGame the other day, and it's making ACS net sync harder. Let's just cut this off right now.

Also fixed some scary mix-ups in some of the Lua archiving code.
2023-01-01 00:22:56 -08:00
toaster
3357f56c9e G_RandMap should consider & all valid flags for gametype, not ==. 2022-12-31 22:44:49 +00:00
toaster
05241341b8 Remove the last few instances of gametype-specific colorisation 2022-12-31 21:38:52 +00:00
toaster
c857153c29 Unstaged closing brace 2022-12-31 19:03:13 +00:00
toaster
5b027ff2fe Instead of preventing lives for GTR_CAPSULES, prevent them for it being GPEVENT_BONUS 2022-12-31 19:00:52 +00:00
toaster
a86ed5c6cb Rework the conditions for the previous commit
- The "never force a retry" condition is now `!G_GametypeUsesLives()`
- In GT_SPECIAL *and* GT_VERSUS, check for K_IsPlayerLosing before retry, instead of bespoke check
2022-12-31 18:59:56 +00:00
toaster
44555be704 Change the conditions for forced retry at end of round
- If modeattacking, never
- If Sealed Star, if the UFO still exists or the emerald hasn't been picked up
2022-12-31 17:57:22 +00:00
toaster
3ee8713e46 Dehardcode menu gametype selection, part 1
- Introduce `menugametype`
    - Controlled by IT_KEYHANDLER/M_HandleMenuGametype
    - Excludes gametypes that do not support multiplayer by default
        - GTR_CAPSULES and GTR_BOSS for now, but also user-specifiable GTR_NOMP
- Remove gametype_cons_t and G_UpdateGametypeSelections, an obstacle in the way of infinitely allocatable custom gametypes
2022-12-30 15:23:26 +00:00
toaster
834150585b Rework demo time/laptime handling
* `ATTACKING_` constants have been changed to be flags
    - `ATTACKING_TIME` contains time data for all gametypes
    - `ATTACKING_LAPS` contains laps data for `GTR_CIRCUIT` on maps with more than 1 lap
* `demoflags` now contains raw `ATTACKING_` flags
* Best time/best lap demo files will now be saved properly again (broken since `new-menus`)
* Ghosts will now be loaded properly again (broken since `unlockables-undefeatable`)
2022-12-29 21:30:04 +00:00
toaster
03c8fd543f More fun rules for Special Stages
- GTR_ROLLINGSTART
    * Initial instathrust, as before
    * Forced MAXPLMOVE forward
    * Disable finish line beam
    * "Super transformation" sound
        - Reference to the previous entry in the series' Perfect Startboost mechanic
- GTR_SPECIALSTART
    * Instant white fade
    * No titlecard (overridden by Boss intro)
    * Starting warp sound
- Match slidein time with no traditional titlecard to the end of the playsim intro fade
- Remove G_IsSpecialStage
2022-12-27 17:58:35 +00:00
toaster
470f82104d Rework intertype_t
- Now you select based on whether you want to rank by
    - Time always (Race, Special)
    - Score always (might be useful for custom gametypes..?)
    - Time in 1P, Score otherwise (Battle, Versus)
- No longer has gametype-specific text colours on the intermission
- Also cleans up a case where invalid music could play for winning a custom gametype without GTR_CIRCUIT *or* GTR_BUMPERS
2022-12-27 14:33:58 +00:00
toaster
2b32baffbb Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart into rulesify 2022-12-26 23:31:50 +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
d29e43f80d Remove GTR_CAMPAIGN
Controlled three things: Vintage SRB2 cutscenes, a certain type of reset on map commands, and whether to go to ceremony/evaluation/credits. All three should be controlled by grandprixinfo.gp instead, since that persists cross-gametype.
2022-12-26 22:29:31 +00:00
toaster
a8a60460fb Server startup cleanup
* Don't do a shoddy attempt at guessing initial gametype in G_DeferedInitNew
* Fix map command on main menu regression (no longer HOM void)
2022-12-26 22:16:14 +00:00
toaster
185b36bd27 gametype_t
- New array of pointers to structures in memory (currently mixing static for base-game and Callocated for custom)
- Centralises a metric-ton of previously seperately handled properties into one struct
    - Gametype_Names[]
    - Gametype_ConstantNames[]
    - gametypetol[]
    - timelimits[]
    - pointlimits[]
    - gametypedefaultrules[]
- Don't attempt to guess custom gametype in Replay Hut (requires more work to make custom gametypes behave across the entire experience)
- I_Error if invalid gametype set
- gametyperules is deprecated since it will never be modified seperately from gametype (temporarily a #define, don't wanna bloat this commit too much)
2022-12-26 01:07:57 +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
toaster
d95ac73f3b Remove Gametype Preference and Voting Rule Change cvars
* The consensus has moved against gametype changes in voting, so strip it out
* Encorescramble already independently controls setting Encore, so don't keep the outdated randomisation method
Done in this branch because it uses gametype constants directly, both in a cvar and function, and I want to get rid of as many of those as possible
2022-12-24 17:03:36 +00:00
toaster
78bc4fdac9 Further changes in anticipation of potential future TESTER builds.
* Create a seperate `unlocks.pk3` so we can customise what the testers have.
* Make TESTERS(/HOSTTESTERS) builds have their own default gamedata.
2022-12-24 16:21:24 +00:00
toaster
d0cd059c5e Rework the Level List functions to operate off a provided levelsearch_t pointer.
* Prevents the dependency on a `levellist` global that could be corrupted
* Fixes the issue where cups that were not unlocked would not show up on the cup select (because `M_MapLocked` would make `M_CanShowLevelInList` fail).
* Shows both Race and Battle maps in the cup unlock preview.
2022-12-19 21:18:36 +00:00
toaster
8e88a840bb Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart into unlockables-undefeatable
# Conflicts:
#	src/k_menudraw.c
#	src/k_menufunc.c
2022-12-19 20:13:44 +00:00
toaster
6a5029c83b Use GTR_NOCUPSELECT as the controlling factor in advancemap next 2022-12-18 14:45:31 +00:00
toaster
b9f18ffc24 More things use the menu map selection rules
* G_GetFirstMapOfGametype now uses the menu functions instead of repeating the effort
* GTR_NOCUPSELECT - allows gametypes to opt out of cup selection
2022-12-18 13:57:39 +00:00
VelocitOni
8cd36dbf03 Merge branch 'master' into unlockables-undefeatable 2022-12-18 01:59:04 -05:00
toaster
5f9854e898 First steps to making battle maps cup-based.
* Permit a map existing in multiple cups, rather than I_Error
    - The reason we didn't permit this before was because of marathon plans/advancemap next.
    - To that end, in that progression type, a map is only considered in its first valid cup.
2022-12-17 19:16:18 +00:00
Sally Coolatta
167df6cca7 Remove item roulette between maps 2022-12-15 01:44:09 -05: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
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