Commit graph

1533 commits

Author SHA1 Message Date
AJ Martinez
53f14bd14a Make Random map vote only use the visible vote choices (random = don't care) 2023-02-21 16:29:52 -07:00
toaster
9e494e45d0 D_IsPlayerHumanAndGaming means they're *human*, ie not a bot 🥹 2023-02-17 18:15:25 +00:00
toaster
ff29d446eb forcecharacter: Rename to end the snickering. 2023-02-17 17:19:27 +00:00
toaster
4d607ccdec Tidy up conditions for forceskin to not include !K_CanChangeRules or Playing. 2023-02-17 16:36:38 +00:00
toaster
05ee3df2f4 d_netcmd.c: Tidy up conditions for changing skin/color.
- Got_NameAndColor: Incorporate check for cv_restrictskinchange and FREE PLAY
- CanChangeSkin: Boil away all the useless conditions, combine with CanChangeSkinWhilePlaying
2023-02-17 15:50:25 +00:00
toaster
7d2accb044 Got_TeamChange: only do mobj kill/PST_REBORN stuff in GS_LEVEL. 2023-02-17 14:41:47 +00:00
toaster
8fb1ffe5fe Got_NameAndColor: If the player's skin is changed by the packet, make them a spectator.
- Doesn't apply on join, intro camera spin turnaround, or outside of GS_LEVEL.
- Extract some of Got_TeamChange's behaviour into a new FinalisePlaystateChange function.
2023-02-17 14:40:44 +00:00
toaster
e3eb3ed9f8 Command_Map_f: Guess gametype of map in offline GP, as well as from titlescreen/menu 2023-02-16 15:31:25 +00:00
toaster
97c8d201eb Command_Map_f: Respect value of splitplayers cvar
Permits testing multiple players in GP by your lonesome without having to manipulate multiple controllers at once.
2023-02-16 15:28:31 +00:00
toaster
3bfd4be29e AltTitle_OnChange: Actually correctly set cv_alttitle instead of cv_itemfinder if modified when unlocked 2023-02-04 18:04:56 +00:00
toaster
84a98475ff Command_ExitGame_f: Return to title if restoreMenu is NULL 2023-02-04 17:07:24 +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
toaster
dafd6d5dfa New console command "minigen"
- Generates "MINIMAP.png" in your srb2home
- Uses inherited automap code to render to a temporary buffer
    - Because am_map.c is a mess of filescope static variables right now, this only works when the automap is disabled.
- Currently an equal alternate method to SLADE's map image export, but because we're in control, additional features can be added later...
    - TODO: Off vertically by one pixel on GHZ. Otherwise effectively identical in shape
    - TODO: the colours are rancid, I wonder if they were even updated for the 2.2 palette

Related:
- Use identical linear-time mechanisms for detecting borders of map geometry between automap and minimap
    - Automap was previously using iteration over all vertices
    - Minimap was previously pointlessly writing min/max values twice
2023-01-23 12:33:35 +00:00
James R
ba27c87ff0 Add capsuletest cvar
- capsuletest off - default behavior.

- capsuletest multiplayer - always spawn non time attack
capsules, even in FREE PLAY.

- capsuletest timeattack - always spawn time attack
capsules, even in multiplayer.
2023-01-11 21:46:21 -08:00
James R
94e3050f10 Do not overwrite compbranch in case of detached HEAD 2023-01-05 18:32:54 -08:00
James R
55636fa690 Separate git commit subject line from comprevision, add SRB2_COMP_NOTE 2023-01-05 18:32:20 -08: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
Oni
46005089f1 Merge branch 'rulesify' into 'master'
Rulesify (resolves #375)

Closes #360 and #375

See merge request KartKrew/Kart!836
2023-01-03 02:43:52 +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
James R
5887c36111 Show CMAKE_BUILD_TYPE on title screen
Includes a hint if optimizations may have been turned off.
2023-01-02 01:46:05 -08: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
James R
77d54a09fe Remove global lua_save_p and use savebuffer_t for LUA_Archive / LUA_UnArchive 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
42a6b03e48 Remove "circuitmap"
An effectively useless global scope boolean that literally checks for the presence of a finish line, created in and used only by things we inherited from vanilla SRB2
2022-12-31 23:27:59 +00:00
toaster
425a02d09b Make GTR_BUMPERS less monolithic
* Battle-like item box respawn handling inverse of GTR_CIRCUIT
* Make battle fullscreen overlay forbid GTR_CIRCUIT
* Make GTR_ITEMARROWS actually do something
* Make everything related to points actually use GTR_POINTLIMIT
* Fobid sphere addition without GTR_SPHERES, to mirror ring addition forbidding
2022-12-31 23:12:41 +00:00
toaster
ebb2a79666 Dehardcode menu gametype selection, part 2
- Add "Gametype" toggle option to pause menu for admins
    - A/Confirm button on any gametype other than current to do random map in new gametype
    - C/Extra button to return to current gametype
    - A/Confirm button on current gametype does a funny noise and nothing else right now, idk what to do
- `randomlevel` supports the same `-gametype` parameter as `map`
- Both `randomlevel` and `map`'s `-gametype` parameter prohibits `GTR_FORBIDMP` mask gametype changes in netgames
- `randomlevel` properly sets encore based on `cv_kartencore`'s value (and permitting `GTR_ENCORE`)
- Split out `menugametype` change functions
- `yellowmap` now remaps all intermediary shades of grey to match funny pause menu remaps
2022-12-30 20:35:55 +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
1ac0c44f77 Permit using the gametype option for Command_Map_f when not playing multiplayer 2022-12-27 14:34:54 +00:00
toaster
63f75fcba1 Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart into rulesify 2022-12-27 11:36:03 +00:00
James R
cc30118e3b Adjust formatting of git branch in game
- Detect and highlight detached HEAD on title screen and in console
- Remove '-' between branch and commit in console
2022-12-27 01:00:57 -08: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
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
59bc094fac We don't have *one* Single Player mode - we have as many gametypes as there are, now. 2022-12-24 22:44:40 +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
fbc3af2096 Pre-emptive fixes for custom gametypes
- Handle mismatched gametypes for client and server on voting screen
- I_Error when running out of gametypes
- Reduce gametype freeslots slightly to avoid colliding with VOTEMODIFIER_ENCORE
2022-12-24 21:21:03 +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
Sally Coolatta
82df346417 Merge branch 'master' into special-stages 2022-12-22 05:18:56 -05:00
Sally Coolatta
df96c633bc Set Battle for Boss warp 2022-12-20 19:47:20 -05:00
toaster
33167078c8 Merge branch 'capsules-improvement' into 'master'
Break the Capsules additions

See merge request KartKrew/Kart!793
2022-12-20 21:26:46 +00:00
Sally Coolatta
a7ff0afc8b Merge branch 'master' into capsules-improvement 2022-12-19 01:12:07 -05:00
Sally Coolatta
526a2b7de1 Fix not being able to use map command to go to SS 2022-12-18 02:43:31 -05:00
VelocitOni
8cd36dbf03 Merge branch 'master' into unlockables-undefeatable 2022-12-18 01:59:04 -05: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
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
toaster
e7c79ab461 M_CheckNetUnlockByID
System for netsyncing unlocks, inspired by but with nowhere near as many moving parts as (STJr/SRB2!1756).
* `gamedata->unlocked[MAXUNLOCKABLES]` is duplicated to `netUnlocked[MAXUNLOCKABLES]` (or all `true` in `dedicated`
* New `local` boolean for M_SecretUnlocked
* Removed last vestiges of SRB2 special stage token code because it occupied the spot in the netsave we wanted to use.
* Correct typing of multiple `m_cond` functions that returned `boolean` constants as `UINT8`s.
2022-12-09 17:26:52 +00:00
toaster
fefaee1982 SECRET_FOLLOWER
Completely clientside, unlike SECRET_SKIN. Followers have no gameplay function, and it saves us having to write even more to our demos/netsaves. Replaces SECRET_WARP.
Also:
- Now don't apply skins or followers from profiles if the skin is locked - instead, get the closest skin in stats. (Same function as from demos!)
- If you're looking at a profile and the skin or follower are locked, make them solid colour (TC_BLINK).
- Don't show the ring cursor before you've selected a profile.
2022-12-04 01:09:08 +00:00
Sally Coolatta
81cefa2697 Gachabom initial pass
They simply use Kitchen Sink's item icon and Orbinaut's sprites.

The forward toss behavior needs fine-tuning to use more MT_BANANA style behavior.
2022-11-28 02:41:42 -05:00
toaster
6d0637d39d Unlockable skins (in a way friendly to #define MAXSKINS 255)
Mammoth commit, sorry. I only realised halfway through writing it that SECRET_SKIN was only partially merged.

Ports from 2.2:
- Merge SECRET_SKIN (STJr/SRB2!1474)
    - Default skin is now handled by checking all skins for unlock status, and I_Erroring if none are available
    - Don't show skin names on game startup, to keep our secrets hidden
    - Unlockables now have string variables zallocated.
         - For skin names rather than numbers.
    - Correctly clean up memory when freeing unlockables and emblems.

Bespoke code:
- For temporary testing. `unlocks.pk3`
    - Using this for rapid testing gameboot SOC instead of patch.pk3 because of the intent to turn that into scripts.pk3
- Don't not save gamedata in DEVELOP builds, even if you've used cheats!
- `player->availabilities` is now an array of UINT8
    - (MAXSKINS + 7)/8 entries, or 32 bytes.
    - Included with XD_ADDPLAYER instead of XD_NAMEANDCOLOR.
         - Simplifies a lot of logic with respect to demos, skin changes mid-game, etc.
             - Seriously, there's a lot of random places in the code that just iterate over MAXSPLITSCREENPLAYERS and g_localplayers to update availabilities in real time in a way that's not particularly netsafe...
         - Lines up with the plan for handling unlocks when returning to menus.
         - Was included with XD_ADDBOT, but that actually overruns the netxcmd buffer at first mapload with 7 bots. We might need to consider expanding the size of the netxcmd buffer...
    - In demos, can be interpreted as both relative to the original replay and the current skin list depending on boolean context provided to R_SkinUsable.
    - Used for SF_IRONMAN (and will crash if all other skins are inaccessible).
- Grand Prix bot randomisation uses the host's unlocks.
- Don't show locked characters on the fancy new character select.
-  DXD_JOINDATA for demos
    - Replaces the dual-purpose behaviour of DXD_PLAYSTATE
    - Contains availabilities
    - Handles bot material in a different way
- Forceskin restrictions
    - Won't run in demos, because it's assumed recorded DXD_SKIN will handle all the conversions the original match had
    - Won't run if K_CanChangeRules says no
- Correctly set `mapvisited` on level visit, even in [fake gasp] MULTIPLAYER/NETGAMES!! 🥹
- Added updating unlockables and extra emblems on `mapvisited` update.
    - Currently fails to produce the cecho, but that'll be stripped out entirely in a future commit so I'm not bothered.
2022-11-27 22:53:29 +00:00
toaster
8179b39773 ForceAllSkins cleanup 2022-11-27 16:21:45 +00:00