Lower Duel HUD, global option to disable/enable Duel

This commit is contained in:
Antonio Martinez 2025-06-06 21:32:37 -04:00
parent 9da8751d56
commit 4af7ab2555
8 changed files with 20 additions and 7 deletions

View file

@ -727,6 +727,7 @@ void KartSpeed_OnChange(void);
consvar_t cv_kartspeed = UnsavedNetVar("gamespeed", "Auto Gear").values(kartspeed_cons_t).onchange_noinit(KartSpeed_OnChange);
consvar_t cv_teamplay = UnsavedNetVar("teamplay", "Off").on_off();
consvar_t cv_duel = UnsavedNetVar("duel", "On").on_off();
consvar_t cv_kartusepwrlv = UnsavedNetVar("mobiums", "Yes").yes_no();

View file

@ -82,6 +82,7 @@ extern consvar_t cv_kartbot;
extern consvar_t cv_karteliminatelast;
extern consvar_t cv_thunderdome;
extern consvar_t cv_teamplay;
extern consvar_t cv_duel;
extern consvar_t cv_kartusepwrlv;
#ifdef DEVELOP
extern consvar_t cv_kartencoremap;
@ -182,7 +183,6 @@ typedef enum
XD_SCHEDULETASK, // 34
XD_SCHEDULECLEAR, // 35
XD_AUTOMATE, // 36
// 37 is free
XD_MAPQUEUE = XD_AUTOMATE+2, // 38
XD_CALLZVOTE, // 39
XD_SETZVOTE, // 40

View file

@ -872,6 +872,7 @@ extern UINT8 gamespeed;
extern boolean franticitems;
extern boolean encoremode, prevencoremode;
extern boolean g_teamplay;
extern boolean g_duelpermitted;
extern tic_t wantedcalcdelay;
extern tic_t itemCooldowns[NUMKARTITEMS - 1];

View file

@ -296,6 +296,9 @@ boolean franticitems; // Frantic items currently enabled?
// (Certain gametypes can override this -- prefer using G_GametypeHasTeams().)
boolean g_teamplay;
// Server wants to allow Duel mode?
boolean g_duelpermitted;
// Voting system
UINT16 g_voteLevels[VOTE_NUM_LEVELS][2]; // Levels that were rolled by the host
SINT8 g_votes[VOTE_TOTAL]; // Each player's vote

View file

@ -3308,7 +3308,7 @@ static void K_drawKartDuelScores(void)
player_t *foe = K_DuelOpponent(stplyr);
INT32 basex = 0;
INT32 basey = 40;
INT32 basey = 48;
INT32 flags = V_SNAPTOLEFT|V_HUDTRANS|V_SLIDEIN;
// score bars, here barheight is the size of bars at tied score

View file

@ -121,7 +121,13 @@ boolean K_DuelItemAlwaysSpawns(mapthing_t *mt)
boolean K_InRaceDuel(void)
{
return (inDuel && (gametyperules & GTR_CIRCUIT) && !(mapheaderinfo[gamemap-1]->levelflags & LF_SECTIONRACE)) && !specialstageinfo.valid;
return (
inDuel &&
(gametyperules & GTR_CIRCUIT) &&
!(mapheaderinfo[gamemap-1]->levelflags & LF_SECTIONRACE) &&
!specialstageinfo.valid &&
g_duelpermitted
);
}
player_t *K_DuelOpponent(player_t *player)
@ -15149,10 +15155,6 @@ void K_CheckSpectateStatus(boolean considermapreset)
if (!cv_allowteamchange.value)
return;
// DON'T allow if you've hit the in-game player cap
if (cv_maxplayers.value && numhumans >= cv_maxplayers.value)
return;
// Get the number of players in game, and the players to be de-spectated.
for (i = 0; i < MAXPLAYERS; i++)
{

View file

@ -56,6 +56,9 @@ menuitem_t OPTIONS_Gameplay[] =
{IT_HEADER, "Duel...", NULL,
NULL, {NULL}, 0, 0},
{IT_STRING | IT_CVAR, "Duel", "A one-versus-one tug of war! Disable for standard racing.",
NULL, {.cvar = &cv_duel}, 0, 0},
{IT_STRING | IT_CVAR, "Duel Time Limit", "How long it takes for Margin Boost to kick in (seconds).",
NULL, {.cvar = &cv_dueltimelimit}, 0, 0},

View file

@ -7674,6 +7674,7 @@ static void P_InitLevelSettings(void)
gamespeed = multi_speed ? KARTSPEED_EASY : gametypes[gametype]->speed;
franticitems = false;
g_teamplay = false;
g_duelpermitted = false;
if (K_PodiumSequence() == true)
{
@ -7721,6 +7722,8 @@ static void P_InitLevelSettings(void)
}
franticitems = (boolean)cv_kartfrantic.value;
g_teamplay = (boolean)cv_teamplay.value; // we will overwrite this later if there is not enough players
g_duelpermitted = (boolean)cv_duel.value; // Ignored if too many players, see K_InRaceDuel
}
memset(&battleovertime, 0, sizeof(struct battleovertime));