Merge remote-tracking branch 'origin/master' into duel

This commit is contained in:
AJ Martinez 2025-05-25 15:38:38 -04:00
commit 4b00703856
7 changed files with 108 additions and 4 deletions

View file

@ -728,7 +728,7 @@ consvar_t cv_kartspeed = UnsavedNetVar("gamespeed", "Auto Gear").values(kartspee
consvar_t cv_teamplay = UnsavedNetVar("teamplay", "Off").on_off();
consvar_t cv_kartusepwrlv = UnsavedNetVar("usepwrlv", "Yes").yes_no();
consvar_t cv_kartusepwrlv = UnsavedNetVar("mobiums", "Yes").yes_no();
void LiveStudioAudience_OnChange(void);
#ifdef DEVELOP

View file

@ -2264,6 +2264,7 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps)
INT32 kickstartaccel;
INT32 checkpointId;
boolean enteredGame;
tic_t spectatewait;
UINT8 lastsafelap;
UINT8 lastsafecheatcheck;
UINT16 bigwaypointgap;
@ -2553,6 +2554,7 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps)
checkpointId = players[player].checkpointId;
enteredGame = players[player].enteredGame;
spectatewait = players[player].spectatewait;
p = &players[player];
memset(p, 0, sizeof (*p));
@ -2626,6 +2628,7 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps)
p->karthud[khud_fault] = khudfault;
p->kickstartaccel = kickstartaccel;
p->checkpointId = checkpointId;
p->spectatewait = spectatewait;
p->ringvolume = 255;
p->ringtransparency = 255;

View file

@ -13585,8 +13585,8 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL, // xdeathstate
sfx_None, // deathsound
0, // speed
95*FRACUNIT, // radius
95*FRACUNIT, // height
108*FRACUNIT, // radius
50*FRACUNIT, // height
0, // display offset
100, // mass
0, // damage

View file

@ -39,7 +39,7 @@ menuitem_t OPTIONS_Server[] =
{IT_STRING | IT_CVAR, "CPU Level", "Bots can fill unused slots. How strong should they be?",
NULL, {.cvar = &cv_kartbot}, 0, 0},
{IT_STRING | IT_CVAR, "Use PWR.LV", "Should players should be rated on their performance?",
{IT_STRING | IT_CVAR, "Use Mobiums", "Should players should be rated on their performance?",
NULL, {.cvar = &cv_kartusepwrlv}, 0, 0},
{IT_STRING | IT_CVAR, "Antigrief Timer (seconds)", "How long can players stop progressing before they're removed?",

View file

@ -3797,6 +3797,12 @@ boolean R_ThingVisible (mobj_t *thing)
case MT_BATTLECAPSULE_PIECE:
case MT_SPRAYCAN:
case MT_PLAYER:
case MT_LANDMINE:
case MT_SSMINE:
case MT_SSMINE_SHIELD:
case MT_CHECKPOINT_END:
case MT_SIGNSPARKLE:
case MT_THOK: // checkpoint parts
return false;
default:

View file

@ -951,6 +951,18 @@ void Y_PlayerStandingsDrawer(y_data_t *standings, INT32 xoffset)
i--;
}
while (true);
if (standings->rankingsmode)
{
if (standings->isduel)
{
Y_DrawRankMode(BASEVIDWIDTH / 2 + xoffset, BASEVIDHEIGHT - 19, true);
}
else
{
Y_DrawRankMode(x + 122, returny - yspacing + 7, false);
}
}
}
//
@ -1627,6 +1639,88 @@ void Y_DrawIntermissionButton(INT32 startslide, INT32 through, boolean widescree
}
}
//
// Y_DrawRankMode
//
// Draws EXP or MOBIUMS label depending on context.
// x and y designate the coordinates of the most bottom-right pixel to draw from (because it is the left extent and patch heights that vary),
// or the bottom-center if center is true.
//
void Y_DrawRankMode(INT32 x, INT32 y, boolean center)
{
boolean useMobiums = (powertype != PWRLV_DISABLED);
INT32 textWidth, middleLeftEdge, middleRightEdge, middleWidth;
char text[8];
char iconPatchName[8];
UINT8 iconWidth; // the graphic paddings are inconsistent...
UINT8 *iconColormap;
UINT8 *stickerColormap;
patch_t *iconPatch;
patch_t *stickerTail = static_cast<patch_t*>(W_CachePatchName("INT_STK1", PU_CACHE));
patch_t *stickerMiddle = static_cast<patch_t*>(W_CachePatchName("INT_STK2", PU_CACHE));
patch_t *stickerHead = center ? stickerTail : static_cast<patch_t*>(W_CachePatchName("INT_STK3", PU_CACHE));
UINT32 stickerHeadFlags = 0;
UINT8 stickerHeadOffset = 0;
if (useMobiums)
{
snprintf(text, sizeof text, "MOBIUMS");
snprintf(iconPatchName, sizeof iconPatchName, "K_STMOB");
iconWidth = 22;
iconColormap = R_GetTranslationColormap(TC_DEFAULT, static_cast<skincolornum_t>(SKINCOLOR_NONE), GTC_CACHE);
stickerColormap = R_GetTranslationColormap(TC_DEFAULT, static_cast<skincolornum_t>(SKINCOLOR_TEA), GTC_CACHE);
}
else
{
snprintf(text, sizeof text, "EXP");
snprintf(iconPatchName, sizeof iconPatchName, "K_STEXP");
iconWidth = 16;
iconColormap = R_GetTranslationColormap(TC_RAINBOW, static_cast<skincolornum_t>(SKINCOLOR_MUSTARD), GTC_CACHE);
stickerColormap = R_GetTranslationColormap(TC_DEFAULT, static_cast<skincolornum_t>(SKINCOLOR_MUSTARD), GTC_CACHE);
}
iconPatch = static_cast<patch_t*>(W_CachePatchName(iconPatchName, PU_CACHE));
textWidth = (INT32)V_ThinStringWidth(text, 0);
middleLeftEdge = x - iconWidth - textWidth - 8;
middleRightEdge = x - stickerHead->width;
middleWidth = middleRightEdge - middleLeftEdge;
if (center)
{
// flip the right-hand sticker tail and keep it left-aligned
stickerHeadFlags |= V_FLIP;
stickerHeadOffset += stickerHead->width;
// sliiightly extend the right side of the sticker
middleWidth += 2;
middleRightEdge += 2;
// shift all components to the right so that our x coordinates are center-aligned
#define CENTER_SHIFT (stickerHead->width + middleWidth / 2)
x += CENTER_SHIFT;
middleLeftEdge += CENTER_SHIFT;
middleRightEdge += CENTER_SHIFT;
#undef CENTER_SHIFT
}
// draw sticker
V_DrawMappedPatch(middleRightEdge + stickerHeadOffset, y - stickerHead->height, stickerHeadFlags, stickerHead, stickerColormap);
V_DrawStretchyFixedPatch(
middleLeftEdge << FRACBITS,
(y - stickerMiddle->height) << FRACBITS,
(middleWidth << FRACBITS) / stickerMiddle->width + 1,
FRACUNIT,
0, stickerMiddle, stickerColormap
);
V_DrawMappedPatch(middleLeftEdge - stickerTail->width, y - stickerTail->height, 0, stickerTail, stickerColormap);
// draw icon and text
V_DrawMappedPatch(x - iconPatch->width - 6, y - iconPatch->height + 4, 0, iconPatch, iconColormap);
V_DrawThinString(middleLeftEdge - 1, y - 9, 0, text);
}
void Y_DrawIntermissionHeader(fixed_t x, fixed_t y, boolean gotthrough, const char *headerstring, boolean showroundnum, boolean small)
{
const INT32 v_width = (small ? BASEVIDWIDTH/2 : BASEVIDWIDTH);

View file

@ -56,6 +56,7 @@ void Y_Ticker(void);
void Y_PlayerStandingsDrawer(y_data_t *standings, INT32 xoffset);
void Y_RoundQueueDrawer(y_data_t *standings, INT32 offset, boolean doanimations, boolean widescreen);
void Y_DrawIntermissionButton(INT32 startslide, INT32 through, boolean widescreen);
void Y_DrawRankMode(INT32 x, INT32 y, boolean center);
void Y_StartIntermission(void);
void Y_MidIntermission(void);