Renable item timers and adjust for new assets

This commit is contained in:
NepDisk 2025-09-26 13:44:58 -04:00
parent eade241d3b
commit e098598a3d
4 changed files with 61 additions and 55 deletions

View file

@ -90,7 +90,7 @@
#define ASSET_HASH_TEXTURES_KART 0xb4211b2f32b6a291
#define ASSET_HASH_CHARS_KART 0x1e68a3e01aa5c68b
#define ASSET_HASH_MAPS_KART 0x38558ed00da41ce9
#define ASSET_HASH_MAIN_PK3 0x0f791c6b9d7c1c22
#define ASSET_HASH_MAIN_PK3 0x64ff2dec0b370774
#define ASSET_HASH_MAPPATCH_PK3 0xefe28bb9de73a31c
#define ASSET_HASH_BONUSCHARS_KART 0x60e6f13d822a7461
#ifdef USE_PATCH_FILE

View file

@ -185,57 +185,64 @@ void K_DisplayItemTimers(void)
"shoe",
stplyr->sneakertimer,
{qche("K_ISSHOE")},
{qche("HL_SNKR")},
{qche("K_TISHOE")},
1, -15, -15, -4, -2,
},
{ // invinc
"invincible",
stplyr->invincibilitytimer,
{qche("K_ISINV1"), qche("K_ISINV2"), qche("K_ISINV3"), qche("K_ISINV4"), qche("K_ISINV5"), qche("K_ISINV6")},
{qche("HL_INVNC")},
{qche("K_TIINV1"), qche("K_TIINV2"), qche("K_TIINV3"), qche("K_TIINV4"), qche("K_TIINV5"), qche("K_TIINV6")},
3, -15, -15, -4, -2,
},
{ // grow
"grow",
std::max<INT16>(0, stplyr->growshrinktimer),
{qche("K_ISGROW")},
{qche("HL_GROW")},
{qche("K_TIGROW")},
1, -15, -15, -4, -2,
},
{ // rocket sneakers
"rocketsneakers",
stplyr->rocketsneakertimer,
{qche("K_ISRSHE")},
{qche("ISPYRSHE")},
{qche("K_TIRSHE")},
1, -15, -15, -4, -2,
},
{ // hyudoro
"hyudoro",
stplyr->hyudorotimer,
{qche("K_ISHYUD")},
{qche("HL_HYU")},
{qche("K_TIHYUD")},
1, -15, -15, -4, -2,
},
{ // drift boost
"driftsparkboost",
stplyr->driftboost,
{qche("IT_ORB0"), qche("IT_ORB1"), qche("IT_ORB2"), qche("IT_ORB3"), qche("IT_ORB4"), qche("IT_ORB3"), qche("IT_ORB2"), qche("IT_ORB1")},
{qche("MSO_SPH1"), qche("MSO_SPH2"), qche("MSO_SPH3"), qche("MSO_SPH4")},
3,
{qche("K_DRSP1"), qche("K_DRSP2")},
{qche("K_TISRK1"), qche("K_TISRK2")},
2, -15, -15, -4, -2,
},
{ // start boost
"startboost",
stplyr->startboost,
{qche("K_ISSTB")},
{qche("K_SSSTB")},
1,
{qche("K_TISTB")},
1, -15, -15, -4, -2,
},
{ // ring boost
"ringboost",
stplyr->ringboost,
{qche("IT_RING")},
{qche("MSO_RNG")},
1,
{qche("K_ISRING")},
{qche("K_TIRING")},
1, -15, -15, -4, -2,
},
{ // flameshield
"flameshield",
stplyr->flametimer,
{qche("K_ISFLMS")},
{qche("K_TIFLMS")},
1, -15, -15, -4, -2,
},
};
@ -251,12 +258,8 @@ void K_DisplayItemTimers(void)
"spinout",
std::max<UINT16>(stplyr->spinouttimer, stplyr->wipeoutslow),
{qche("K_DIZZ1"), qche("K_DIZZ2"), qche("K_DIZZ3"), qche("K_DIZZ4")},
{qche("MSO_HRT1"), qche("MSO_HRT2"), qche("MSO_HRT3"), qche("MSO_HRT4")},
3,
0,
0,
0,
0,
{qche("K_TISPN1"), qche("K_TISPN2"), qche("K_TISPN3"), qche("K_TISPN4")},
3, -15, -15, -4, -2,
false,
true,
}
@ -266,27 +269,27 @@ void K_DisplayItemTimers(void)
"shrink",
std::max<INT16>(0, -stplyr->growshrinktimer),
{qche("K_ISSHRK")},
{qche("HL_SHRNK")},
3,
{qche("K_TISHRK")},
1,
-15,
-15,
-4,
-3,
-2,
false,
true,
}
);
timers.push_back(
{ // spb
"blueshell",
"spb",
(INT32)spbTimers[stplyr-players],
{qche("IT_SPB1"), qche("IT_SPB2")},
{qche("IT_SPBS1"), qche("IT_SPBS2")},
{qche("K_ISSPB")},
{qche("K_TISPB")},
1,
0,
0,
0,
0,
-15,
-15,
-4,
-2,
false,
(stplyr->position == K_GetBestRank())
}
@ -296,18 +299,14 @@ void K_DisplayItemTimers(void)
{ // boosts
"boosts",
K_StackingActive() ? stplyr->numboosts : 0,
{qche("IT_BOOST0"), qche("IT_BOOST1"), qche("IT_BOOST2"), qche("IT_BOOST3"), qche("IT_BOOST4"), qche("IT_BOOST3"), qche("IT_BOOST2"), qche("IT_BOOST1")},
{qche("MSO_SPD1"), qche("MSO_SPD2"), qche("MSO_SPD3"), qche("MSO_SPD4"), qche("MSO_SPD3"), qche("MSO_SPD2")},
3,
0,
0,
0,
0,
{qche("K_DRSP1"), qche("K_DRSP2")},
{qche("K_TISRK1"), qche("K_TISRK2")},
2, -15, -15, -3, -2,
true,
}
);
timers.push_back(
/*timers.push_back(
{ // dead
"spr_realisticexplosion",
stplyr->deadtimer ? std::max<INT32>(0, TICRATE - stplyr->deadtimer) : 0,
@ -321,15 +320,15 @@ void K_DisplayItemTimers(void)
false,
true,
}
);
);*/
// insert unsortable timers
timers.insert(timers.end(), addTimers_unsorted.begin(), addTimers_unsorted.end());
if ((K_NotFreePlay() && !modeattacking) || r_splitscreen > 0) // "HOME" style, with icons at the bottom
if (!modeattacking) // "HOME" style, with icons at the bottom
{
INT32 itemx = 160, itemy = 160;
INT32 flags = V_SNAPTOBOTTOM|V_SLIDEIN|V_SPLITSCREEN;
INT32 itemx = 160, itemy = 170;
INT32 flags = V_SNAPTOBOTTOM|V_SPLITSCREEN;
INT32 stepx = 25;
INT32 viewnum = R_GetViewNumber();
@ -397,9 +396,9 @@ void K_DisplayItemTimers(void)
textcmap = cmap;
}
if (fastcmp(t.name, "invincibilitytimer"))
if (fastcmp(t.name, "boosts"))
{
cmap = R_GetTranslationColormap(TC_RAINBOW, (skincolornum_t)K_RainbowColor(leveltime), GTC_CACHE);
flags |= V_GREENMAP;
}
if (t.counter) // don't show up as time
@ -411,7 +410,10 @@ void K_DisplayItemTimers(void)
// very bad!
if (t.badtimer)
textcmap = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_CRIMSON, GTC_CACHE);
{
flags |= V_REDMAP;
//textcmap = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_CRIMSON, GTC_CACHE);
}
patch_t *item = t.patches_small[patchnum];
V_DrawFixedPatch((itemx - (item->width/2))<<FRACBITS, (itemy + t.yoffs_small)<<FRACBITS, FRACUNIT, flags, t.patches_small[patchnum], cmap);
@ -431,7 +433,7 @@ void K_DisplayItemTimers(void)
itemx += stepx;
}
}
else // FREEPLAY - Move these to the left side, where the rankings usually are
/*else // FREEPLAY - Move these to the left side, where the rankings usually are
{
if (r_splitscreen) // How?
return;
@ -512,4 +514,5 @@ void K_DisplayItemTimers(void)
fy += step;
}
}
*/
}

View file

@ -2780,7 +2780,7 @@ static void K_drawKartSpeedometer(void)
// (negative speed IS really high speed :V)
if (convSpeed > 999 || convSpeed < 0)
convSpeed = 999;
if (cv_speed_xoffset.value == 0 && cv_speed_yoffset.value == 0)
{
if ((gametyperules & GTR_BUMPERS) && !(gametyperules & GTR_CIRCUIT))
@ -2792,8 +2792,8 @@ static void K_drawKartSpeedometer(void)
oldringoffset = 6;
}
}
if (cv_newspeedometer.value == 0)
if (cv_newspeedometer.value == 0)
{
switch (cv_kartspeedometer.value) {
case 1:
@ -3978,7 +3978,7 @@ static void K_drawKartMinimap(void)
return;
if (lt_exitticker < length)
minimaptrans = (((INT32)lt_exitticker)*minimaptrans)/((INT32)length);
}
else if (r_splitscreen == 3) // 4P centered
{
@ -5151,7 +5151,7 @@ static void K_drawLapSplitTimestamp(void)
INT32 color = stplyr->karthud[khud_splitcolor];
INT32 ahead = stplyr->karthud[khud_splitwin];
// INT32 pos = stplyr->karthud[khud_splitposition];
INT32 splitflags = V_HUDTRANS|V_SNAPTOTOP|V_SNAPTORIGHT|V_SPLITSCREEN;
// debug
@ -5191,7 +5191,7 @@ static void K_drawLapSplitTimestamp(void)
UINT8 *colormap = R_GetTranslationColormap(TC_DEFAULT, K_GetHudColor(), GTC_CACHE);
V_DrawMappedPatch(TIME_X, TIME_Y, splitflags, ((gamemap == 2) ? kp_lapstickerwide[1] : kp_timestickerwide[1]), colormap);
}
char buffer[32];
snprintf(buffer, 32, "%02i'%02i\"%02i",
G_TicsToMinutes(split, true),
@ -5529,7 +5529,7 @@ static void K_DrawClusterDebugger(void)
if (stplyr != &players[displayplayers[0]]) // only for p1
return;
INT32 vflags = V_6WIDTHSPACE|V_ALLOWLOWERCASE;
if (K_UsingLegacyCheckpoints())
@ -5751,7 +5751,7 @@ void K_drawKartHUD(void)
K_drawLapStartAnim();
}
//K_DisplayItemTimers();
K_DisplayItemTimers();
if (modeattacking || freecam) // everything after here is MP and debug only
return;
@ -5765,7 +5765,7 @@ void K_drawKartHUD(void)
if (r_splitscreen == 0 && (stplyr->pflags & PF_WRONGWAY) && ((leveltime / 8) & 1) && !stplyr->exiting)
{
V_DrawCenteredString(BASEVIDWIDTH>>1, 176, V_REDMAP|V_SNAPTOBOTTOM, "WRONG WAY");
V_DrawCenteredString(BASEVIDWIDTH>>1, cv_itemtimers.value && !modeattacking ? 191 : 179, V_REDMAP|V_SNAPTOBOTTOM, "WRONG WAY");
}
if ((netgame || cv_mindelay.value) && r_splitscreen && Playing())

View file

@ -7334,6 +7334,9 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
K_QuiteSaltyHop(player);
player->prevonground = P_IsObjectOnGround(player->mo);
// Update SPB timer...
K_UpdateSPBTimer();
}
void K_KartResetPlayerColor(player_t *player)