Merge branch 'hivolt-replays' into 'master'

Fix SPB Attack and Class R attack ghosts

Closes #1628

See merge request kart-krew-dev/ring-racers-internal!2768
This commit is contained in:
Oni VelocitOni 2025-08-26 05:00:34 +00:00
commit 1d141e2954
6 changed files with 63 additions and 9 deletions

View file

@ -2344,6 +2344,10 @@ void G_SetDemoCheckpointTiming(player_t *player, tic_t time, UINT8 checkpoint)
boolean polite = (cv_attacksplits.value == 1);
// Class R doesn't have coherent times, just watch the leader.
if (K_LegacyRingboost(player))
polite = false;
// "Next" Mode: Find the weakest ghost who beats our best time.
// Don't set a ghost if we have no set time (oldbest == UINT32_MAX)
if (polite)
@ -3577,7 +3581,7 @@ void G_AddGhost(savebuffer_t *buffer, const char *defdemoname)
p++; // SUBVERSION
ghostversion = READUINT16(p);
if (ghostversion < MINDEMOVERSION || ghostversion > DEMOVERSION)
{
// too old, cannot support.

View file

@ -588,10 +588,9 @@ static void G_UpdateRecordReplays(void)
{
modeprefix = "spb-";
}
if (K_LegacyRingboost(&players[consoleplayer]))
else if (K_LegacyRingboost(&players[consoleplayer]))
{
modeprefix = "classr-";
modeprefix = "hivolt-";
}
if (players[consoleplayer].pflags & PF_NOCONTEST)

View file

@ -3108,6 +3108,9 @@ fixed_t K_PlayerTripwireSpeedThreshold(const player_t *player)
{
fixed_t required_speed = 2 * K_GetKartSpeed(player, false, false); // 200%
if (K_LegacyRingboost(player))
return required_speed;
if (specialstageinfo.valid)
required_speed = 3 * K_GetKartSpeed(player, false, false) / 2; // 150%
@ -9484,13 +9487,13 @@ static inline BlockItReturn_t PIT_AttractingRings(mobj_t *thing)
return BMIT_CONTINUE; // find other rings
}
boolean K_LegacyRingboost(player_t *player)
boolean K_LegacyRingboost(const player_t *player)
{
if (netgame)
return false;
if (modeattacking == ATTACKING_SPB)
return false;
if (!modeattacking)
if (!modeattacking || (modeattacking & ATTACKING_SPB))
return false;
if (!(skins[player->skin]->flags & SF_HIVOLT))
return false;

View file

@ -46,7 +46,7 @@ Make sure this matches the actual number of states
#define BAIL_MAXCHARGE (84) // tics to bail when in painstate nad in air, on ground is half, if you touch this, also update Obj_BailChargeThink synced animation logic
#define BAIL_DROP (FRACUNIT)
#define BAIL_BOOST (6*FRACUNIT/5)
#define BAIL_BOOST (6*FRACUNIT/5)
#define BAIL_CREDIT_DEBTRINGS (true)
#define BAIL_DROPFREQUENCY (2)
#define BAILSTUN (TICRATE*6)
@ -348,7 +348,7 @@ UINT16 K_GetEXP(player_t *player);
UINT32 K_GetNumGradingPoints(void);
boolean K_LegacyRingboost(player_t *player);
boolean K_LegacyRingboost(const player_t *player);
void K_BotHitPenalty(player_t *player);

View file

@ -461,7 +461,17 @@ void M_ReplayTimeAttack(INT32 choice)
const char *modeprefix = "";
if (cv_dummyspbattack.value)
{
modeprefix = "spb-";
}
else
{
const INT32 skinid = R_SkinAvailableEx(cv_skin[0].string, false);
if (skinid >= 0 && (skins[skinid]->flags & SF_HIVOLT))
{
modeprefix = "hivolt-";
}
}
switch (choice)
{
@ -521,7 +531,17 @@ static void M_WriteGuestReplay(INT32 ch)
const char *modeprefix = "";
if (cv_dummyspbattack.value)
{
modeprefix = "spb-";
}
else
{
const INT32 skinid = R_SkinAvailableEx(cv_skin[0].string, false);
if (skinid >= 0 && (skins[skinid]->flags & SF_HIVOLT))
{
modeprefix = "hivolt-";
}
}
if (TA_GuestReplay_Str != NULL)
{
@ -580,7 +600,17 @@ void M_SetGuestReplay(INT32 choice)
const char *modeprefix = "";
if (cv_dummyspbattack.value)
{
modeprefix = "spb-";
}
else
{
const INT32 skinid = R_SkinAvailableEx(cv_skin[0].string, false);
if (skinid >= 0 && (skins[skinid]->flags & SF_HIVOLT))
{
modeprefix = "hivolt-";
}
}
if (FIL_FileExists(va("%s"PATHSEP"media"PATHSEP"replay"PATHSEP"%s"PATHSEP"%s-%sguest.lmp", srb2home, timeattackfolder, G_BuildMapName(levellist.choosemap+1), modeprefix)))
{
@ -622,6 +652,14 @@ void M_StartTimeAttack(INT32 choice)
modeprefix = "spb-";
}
else
{
const INT32 skinid = R_SkinAvailableEx(cv_skin[0].string, false);
if (skinid >= 0 && (skins[skinid]->flags & SF_HIVOLT))
{
modeprefix = "hivolt-";
}
}
// DON'T SOFTLOCK
CON_ToggleOff();

View file

@ -7842,7 +7842,17 @@ static void P_LoadRecordGhosts(void)
gpath = Z_StrDup(va("%s" PATHSEP "media" PATHSEP "replay" PATHSEP "%s" PATHSEP "%s", srb2home, timeattackfolder, G_BuildMapName(gamemap)));
if (encoremode)
modeprefix = "spb-";
{
modeprefix = "-spb";
}
else
{
const INT32 skinid = R_SkinAvailableEx(cv_skin[0].string, false);
if (skinid >= 0 && (skins[skinid]->flags & SF_HIVOLT))
{
modeprefix = "-hivolt";
}
}
enum
{