timelimitintics-related shenanigans

- Play a countdown sound (same as introcountdown) per each of the last 3 seconds
- Jitter the time display HUD extra strong in a two-tic window around the above
- Fix timelimitintics not being set in TESTOVERTIMEINFREEPLAY builds (which is now all DEVELOP builds)
This commit is contained in:
toaster 2022-10-16 14:21:52 +01:00
parent 6ed9ddc069
commit ce020d7207
3 changed files with 38 additions and 26 deletions

View file

@ -670,6 +670,11 @@ extern int compuncommitted;
/// Experimental attempts at preventing MF_PAPERCOLLISION objects from getting stuck in walls.
//#define PAPER_COLLISIONCORRECTION
#ifdef DEVELOP
// Easily make it so that overtime works offline
#define TESTOVERTIMEINFREEPLAY
#endif
/// FINALLY some real clipping that doesn't make walls dissappear AND speeds the game up
/// (that was the original comment from SRB2CB, sadly it is a lie and actually slows game down)
/// on the bright side it fixes some weird issues with translucent walls

View file

@ -1421,9 +1421,10 @@ void K_drawKartTimestamp(tic_t drawtime, INT32 TX, INT32 TY, INT16 emblemmap, UI
if (leveltime & 1)
jitter = -jitter;
}
else if (drawtime < 5*TICRATE)
else if (drawtime <= 5*TICRATE)
{
jitter = 1;
jitter = ((drawtime <= 3*TICRATE) && (((drawtime-1) % TICRATE) >= TICRATE-2))
? 3 : 1;
if (drawtime & 2)
jitter = -jitter;
}

View file

@ -590,9 +590,6 @@ void P_TouchStarPost(mobj_t *post, player_t *player, boolean snaptopost)
player->starpostnum = post->health;
}
// Easily make it so that overtime works offline
#define TESTOVERTIMEINFREEPLAY
/** Checks if the level timer is over the timelimit and the round should end,
* unless you are in overtime. In which case leveltime may stretch out beyond
* timelimitintics and overtime's status will be checked here each tick.
@ -616,34 +613,43 @@ void P_CheckTimeLimit(void)
return;
}
if (secretextratime)
if (leveltime < (timelimitintics + starttime))
{
secretextratime--;
timelimitintics++;
}
else if (extratimeintics)
{
timelimitintics++;
if (leveltime & 1)
;
else
if (secretextratime)
{
if (extratimeintics > 20)
{
extratimeintics -= 20;
timelimitintics += 20;
}
secretextratime--;
timelimitintics++;
}
else if (extratimeintics)
{
timelimitintics++;
if (leveltime & 1)
;
else
{
timelimitintics += extratimeintics;
extratimeintics = 0;
if (extratimeintics > 20)
{
extratimeintics -= 20;
timelimitintics += 20;
}
else
{
timelimitintics += extratimeintics;
extratimeintics = 0;
}
S_StartSound(NULL, sfx_ptally);
}
S_StartSound(NULL, sfx_ptally);
}
}
if (leveltime < (timelimitintics + starttime))
else
{
if (timelimitintics + starttime - leveltime <= 3*TICRATE)
{
if (((timelimitintics + starttime - leveltime) % TICRATE) == 0)
S_StartSound(NULL, sfx_s3ka7);
}
}
return;
}
if (gameaction == ga_completed)
return;