Commit graph

1820 commits

Author SHA1 Message Date
toaster
19ef96351a roundqueue
A general purpose system that permits cacheing of GP progression in one place, but which permits future expansion and brings Online GP a little closer to reality.
- Stores a bunch of levels, gametypes, encore state, and restricted-by-rank-ness in sequence.
    - Initialised on GP cup select.
    - FUTURE WORK: Open to being initialised by other methods
- Digests its way through that sequence as maps are completed.
- Stores round number instead of `grandprixinfo`.
- Map commands as sent over the wire have been adjusted.
    - Sends round number and size of/position in roundqueue.
    - Now figures out GP Event Type from gametype.
        - Can be swung in the direction of a Special Stage with a hint flag.
        - This hint flag replaces "fromlevelselect", which was functionally vestigal.
2023-04-11 17:18:27 +01:00
Sally Coolatta
198672c845 Fix vote buffer for G_RandMap being broken 2023-04-11 01:19:30 -04:00
Sally Coolatta
31728166ca Adjust map anger conditions
Don't reset map anger when it votes for itself -- wait until the map gets played or it gets a genuine vote from someone.
2023-04-10 02:27:48 -04:00
Sally Coolatta
9c4ace6fbc Map anger
- Maps build anger every time a map isn't selected by anyone.
- If a map is ignored for 4 votes in a row, then on the 5th vote it shows up it will be angry enough to vote for itself when everyone else finishes voting.
- Once it gives its funny vote, or it gets played, it will calm down again.
- 13P+ vote icons are implemented; it's just a basic circle though cuz lazy.
- Made the roulette finish even faster.
- Bots can vote again but now behind a debug cvar.
2023-04-10 02:10:06 -04:00
Sally Coolatta
81871bc73b Rewrite random map buffer
Each map now just has a countdown for when they'll reappear (stored in mapheader), which gets decremented each time a new map is played. This means it's now compatible across gametype switches, is a lot less complex, and is easy to retrieve the value for a specific map without needing to iterate constantly.

Lots of the old unused code surrounding this function was also removed. Lastly, added a PARANOIA check for callAgainSoon being mishandled.
2023-04-10 02:10:03 -04:00
Sally Coolatta
8432d7e552 Big vote screen cleanup
- 4th map is now a regular option instead of dice.
- Add function to draw a maintained Combi Catcher object on screen.
- Put all vote static variables into either a "vote" struct or a "vote_draw" struct, if it's logic or drawing code.
- Prefix netcode vote globals with _g.
- Add enums/defines for vote magic numbers.
2023-04-10 02:09:59 -04:00
toaster
bbf2fc0b5f Merge branch 'tutorial-access' into 'master'
Tutorial access

See merge request KartKrew/Kart!1102
2023-04-06 17:02:59 +00:00
Sally Coolatta
15f60a1f14 Split thing voting screen to a new file 2023-04-03 20:57:31 -04:00
Eidolon
86dd34d807 Merge branch 'pad-rumble' into 'master'
Gamepad rumble

See merge request KartKrew/Kart!1098
2023-04-03 21:15:34 +00:00
toaster
6e819e1506 rumble2 rumble3 rumble4 typo 2023-04-03 10:37:03 +01:00
toaster
fbfb8a507d Extras menu: Add GT_TUTORIAL selection screen
- Disabled if no maps available/unlocked
- Has another exception for showing TEST RUN under all gametypes
- Splitplayers is forbidden
2023-04-03 00:28:38 +01:00
toaster
24d8b20124 GT_TUTORIAL
- Replaces `tutorialmode`.
- Forces gamespeed to Easy, with no POSITION.
    - Laps are currently disabled as well, but this can be changed if necessary.
- Hides Free Play.
- Does not count as a played round (except for Chao Keys).

`tutorialmap` has also been removed. This will be replaced in a later commit with something that plays nicer with Ring Racers' existing systems.
2023-04-03 00:28:37 +01:00
toaster
89fc9a618e Rumble toggle attached to profile
- Will silently merge conflict with !1093, make sure to adjust PROFILEVER handling
- (profile_t *)->rumble
- cv_rumble[MAXSPLITSCREENPLAYERS]
- cv_dummyprofilerumble
- Disables all current rumbles when toggling off
- Prevents new rumbles from being set while turned off
2023-04-02 23:16:58 +01:00
toaster
7a9779d242 Remove a bunch of mouse console variables that hold no relevance to us 2023-04-02 23:09:56 +01:00
AJ Martinez
d73b91bc81 Merge branch 'cascade-cleanup' into 'master'
Cascade Cleanup

See merge request KartKrew/Kart!1128
2023-04-02 21:19:53 +00:00
Eidolon
a71c7dfad6 Reset device rumble on exitlevel, exitgame, map 2023-04-02 21:56:40 +01:00
James R
062d238f2f G_BuildTiccmd: update correct localangle while in parties 2023-04-02 17:26:34 +01:00
James R
62624efcef Parties: fix interaction with viewpoint management / spectator mode
- Fixes G_ResetView and G_ResetViews not accounting for
  parties -- fixes viewpoint switching while in parties.
- Fixes spectator controls sometimes activating while in
  parties.
2023-04-02 17:26:34 +01:00
toaster
3bd0fd8330 G_ExitLevel: Fix K_PlayerFinishGrandPrix not being called in Sealed Star
Fixes Emerald collection not being recorded
2023-03-31 18:38:29 +01:00
AJ Martinez
495b51f6c2 Merge branch 'licenses' into 'master'
Add LICENSE-3RD-PARTY.txt

See merge request KartKrew/Kart!1110
2023-03-31 03:00:58 +00:00
Sal
fe34e04abe Merge branch 'encore-fixies' into 'master'
Fix random Encore vote, error if ENCORE/TWEAKMAP lump is invalid, add debugencorevote command

Closes #333

See merge request KartKrew/Kart!1101
2023-03-29 00:32:00 +00:00
Sal
83b5b26a12 Merge branch 'packet-hack' into 'master'
Experimental: Improve level load processing

See merge request KartKrew/Kart!1077
2023-03-28 23:41:33 +00:00
James R
3b67f99d0d RRID: correct remaining instances of hardcoded sizes to defines 2023-03-28 03:54:29 -07:00
AJ Martinez
66c6ba125d Final fixup for profile-level keys and passing to player_t 2023-03-28 01:20:41 -07:00
James R
a5aefa5b29 Fix vote encore scramble getting overridden by cvar 2023-03-26 06:55:22 -07:00
Chromatian Keiske
77117bbc9f Merge branch 'fix-retry' into 'master'
Fix retry life/rank farming + fix buffered retry

Closes #475

See merge request KartKrew/Kart!1083
2023-03-25 05:50:06 +00:00
Oni
b9bbb6cb8a Merge branch 'conditions-cascading' into 'master'
Conditions Cascading

Closes #366

See merge request KartKrew/Kart!1053
2023-03-23 23:51:30 +00:00
James R
f5f85cc3e4 Refactor lives and rank increase to occur at level end transition, not when the player finishes
Fixes exploiting retries after finishing in good standing
to farm lives and rank. These are now applied when you can
no longer retry.

Extra life sound effect still plays as soon as you finish
the race.
2023-03-22 20:49:33 -07:00
James R
d878d3941d Call G_MapEventsToControls before M_Responder and G_Responder
Fixes buffered keyup events not having any effect when
exiting the menu back to the Title Screen.
2023-03-22 16:49:36 -07:00
Sally Coolatta
ffb65a3583 Experimental: Improve level load processing
- P_PreTicker ("defrosting") is dead. Levels now actually start on tic 0 instead of tic 2.
- Netxcmds are ran before G_Ticker, instead of after.
- All netxcmds are required to be processed before the level will finish loading (up to 5 gametics, to prevent any possible lock-up from malicious clients).
2023-03-22 10:59:29 -04:00
AJ Martinez
312e847151 Merge branch 'fix-faulty-mobj-references' into 'master'
Fix faulty references for monitors and players

See merge request KartKrew/Kart!1071
2023-03-22 07:43:37 +00:00
James R
d0719ef5ba Fix mobj reference management of player->mo
Thanks to toaster
2023-03-20 20:00:10 -07:00
toaster
e27a15fd14 F_IntroResponder, G_Responder: Permit both Title Screen and Intro/titledemo to respond to trigger inputs over JOYAXISRANGE/2
Likewise, the author of this commit uses a trigger for A(ccel)
2023-03-19 18:06:19 +00:00
toaster
1acf00daa6 G_PlayerInputAnalog: Only attempt default binds for menu if no binds are reachable by GetValueFromControlTable for that button
- GetValueFromControlTable: Return 0 only if a single G_KeyIsAvailable returns true for any bind
    - Otherwise returns NO_BINDS_REACHABLE -- #define'd as (-1)
    - Does not cover the `menucontrolreserved` check, which could maybe be moved to the opposite end of the function if it causes problems.
2023-03-19 17:48:24 +00:00
toaster
4c0077e07c Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart into conditions-cascading 2023-03-19 13:01:06 +00:00
James R
8de2910dcb Merge branch 'file-fixems' into 'master'
File Fixems

See merge request KartKrew/Kart!1055
2023-03-18 11:09:11 +00: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
c33ae4ae62 Gamedata: Fix issues with cup windata handling
- G_SaveGameData: correctly increase length of buffer to account for cup name
- G_LoadGameData: digest the cup's associated windata even if it's not loaded
2023-03-17 13:09:58 +00:00
toaster
90591942ad musicwads
Record number of music files which we were able to add, so Addons menu shows the correct number of addons loaded.
Also marks main music files in `listwad` command.
2023-03-15 17:33:55 +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
2e1efaff0c Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart into conditions-cascading
# Conflicts:
#	src/k_battle.c
#	src/k_hud_track.cpp
#	src/k_kart.c
#	src/p_inter.c
2023-03-14 21:59:19 +00:00
Sally Coolatta
d7c80af490 Correct backslashes 2023-03-14 08:03:17 -04:00
Sally Coolatta
0b622639e0 Fully implement existing script type
Missed in the original merge.
2023-03-14 08:02:56 -04:00
toaster
5b48c52b65 G_DoCompleted: Call S_StopSounds earlier so legitimate exit condition sound isn't insta-wiped 2023-03-14 11:52:54 +00:00
Oni
9f4c080964 Merge branch 'dynamic-controllers' into 'master'
Handle gamepads from interface dynamically

Closes #397

See merge request KartKrew/Kart!1018
2023-03-13 07:56:34 +00:00
James R
1f70b9c63c Merge remote-tracking branch 'origin/bumpers-ARE-health' 2023-03-13 00:51:44 -07:00
Sally Coolatta
0a11eef569 Default controls in menus works for all players
Prevents keyboard-only profile softlock.
2023-03-13 00:04:40 -04:00
toaster
45891ac22f G_GetNextMap: Go to TEST RUN when the next Race map in a GP is invalid
Resolves #366
2023-03-12 20:53:46 +00:00
toaster
241475155b Rename "Break the Capsules" to "Prison Break"
We had this collective consciousness bigbrain moment in VC together, and it can literally only happen in this branch because unlocks.pk3 is the only main-game asset that needs to change for it
Solves the big problem we had with mixing up Item Capsules and ~~Battle Capsules~~ PRISON EGGS
2023-03-12 20:17:46 +00:00
toaster
01f6eb71f5 Optimisation: reduce the number of calls to M_CheckUnlockConditions
- For P_Ticker()'s calls to M_UpdateUnlockablesAndExtraEmblems
    - Do not check non-UCRP_REQUIRESPLAYING conditions
        - Controlled by a new `boolean doall` parameter to M_UpdateUnlockablesAndExtraEmblems
        - Most other contexts have this as true
        - Forced true if update is meant to be silent
    - Only check UCRP_REQUIRESPLAYING conditions if a relevant property has been touched
        - Controlled by a new `boolean checkthisframe` property on roundcondition_t
        - Set in all contexts where roundcondition_t is modified
        - Would also be set on lap change, but that case is already covered by the following
- Check all conditions, both UCRP_REQUIRESPLAYING and not, on:
    - local player K_HandleLapIncrement
    - local player P_DoPlayerExit
    - local player P_DoTimeOver
    - Controlled by a new `boolean deferredconditioncheck` property on gamedata_t
2023-03-12 13:52:28 +00:00