diff --git a/src/doomstat.h b/src/doomstat.h index dd0e8bc68..9dc8f4034 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -869,6 +869,7 @@ extern boolean rainbowstartavailable; extern tic_t linecrossed; extern boolean inDuel; extern UINT8 extralaps; +extern UINT8 overtimecheckpoints; extern tic_t bombflashtimer; // Used to avoid causing seizures if multiple mines explode close to you :) extern boolean legitimateexit; diff --git a/src/g_game.c b/src/g_game.c index dfcc624f1..226ea6d67 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -321,6 +321,7 @@ boolean rainbowstartavailable; // Boolean, keeps track of if the rainbow start w tic_t linecrossed; // For Time Attack boolean inDuel; // Boolean, keeps track of if it is a 1v1 UINT8 extralaps; // Duel extensions! +UINT8 overtimecheckpoints; // Duel overtime speedups! // Client-sided, unsynched variables (NEVER use in anything that needs to be synced with other players) tic_t bombflashtimer = 0; // Cooldown before another FlashPal can be intialized by a bomb exploding near a displayplayer. Avoids seizures. diff --git a/src/k_kart.c b/src/k_kart.c index 1fa198003..27969e032 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -146,6 +146,7 @@ void K_TimerReset(void) inDuel = rainbowstartavailable = false; linecrossed = 0; extralaps = 0; + overtimecheckpoints = 0; timelimitintics = extratimeintics = secretextratime = 0; g_pointlimit = 0; } @@ -466,7 +467,10 @@ fixed_t K_GetKartGameSpeedScalar(SINT8 value) if (cv_4thgear.value && !netgame && (!demo.playback || !demo.netgame) && !modeattacking) value = 3; - return ((13 + (3*value)) << FRACBITS) / 16; + fixed_t base = ((13 + (3*value)) << FRACBITS) / 16; + fixed_t duel = overtimecheckpoints*(1<position == 1) { player->duelscore += 1; + + if (leveltime > DUELOVERTIME) + { + overtimecheckpoints++; + K_AddMessage(va("MARGIN BOOST x%d", overtimecheckpoints), true, false); + S_StartSound(NULL, sfx_gsha6); + } + for (UINT8 i = 0; i < MAXPLAYERS; i++) { if (playeringame[i] && !players[i].spectator && &players[i] != player) diff --git a/src/k_kart.h b/src/k_kart.h index bf73ffcf2..3e4995dd2 100644 --- a/src/k_kart.h +++ b/src/k_kart.h @@ -74,6 +74,8 @@ Make sure this matches the actual number of states #define RINGVOLUMEREGEN 1 #define RINGTRANSPARENCYREGEN 3 +#define DUELOVERTIME (3*60*TICRATE) + #define MIN_WAVEDASH_CHARGE ((11*TICRATE/16)*9) #define MAXTOPACCEL (12*FRACUNIT) diff --git a/src/p_saveg.c b/src/p_saveg.c index d1999a03e..a4679ea8d 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -6681,6 +6681,7 @@ static void P_NetArchiveMisc(savebuffer_t *save, boolean resending) WRITEUINT8(save->p, rainbowstartavailable); WRITEUINT8(save->p, inDuel); WRITEUINT8(save->p, extralaps); + WRITEUINT8(save->p, overtimecheckpoints); WRITEUINT32(save->p, introtime); WRITEUINT32(save->p, starttime); @@ -6888,6 +6889,7 @@ static boolean P_NetUnArchiveMisc(savebuffer_t *save, boolean reloading) rainbowstartavailable = (boolean)READUINT8(save->p); inDuel = (boolean)READUINT8(save->p); extralaps = (boolean)READUINT8(save->p); + overtimecheckpoints = (boolean)READUINT8(save->p); introtime = READUINT32(save->p); starttime = READUINT32(save->p);