From 279d802959eacbdb3d7bba38da0ab5498bea7ac9 Mon Sep 17 00:00:00 2001 From: AJ Martinez Date: Wed, 6 Mar 2024 20:19:51 -0700 Subject: [PATCH] Faster TA tally, new TA music --- src/k_tally.cpp | 4 +++- src/k_tally.h | 2 +- src/p_setup.cpp | 6 ++++++ src/p_setup.h | 2 ++ src/p_spec.c | 2 +- src/p_user.c | 8 ++++++++ 6 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/k_tally.cpp b/src/k_tally.cpp index 3beafcfc2..53a0fbb7f 100644 --- a/src/k_tally.cpp +++ b/src/k_tally.cpp @@ -863,7 +863,7 @@ void level_tally_t::Tick(void) else { state = TALLY_ST_DONE; - delay = 5*TICRATE; + delay = (modeattacking) ? 2*TICRATE: 5*TICRATE; } } break; @@ -1407,5 +1407,7 @@ boolean K_PlayerTallyActive(player_t *player) tic_t K_TallyDelay(void) { + if (modeattacking) + return TICRATE; return ((gametyperules & GTR_BUMPERS) ? 4 : 3) * TICRATE; } diff --git a/src/k_tally.h b/src/k_tally.h index d763e54e2..9f7c3d866 100644 --- a/src/k_tally.h +++ b/src/k_tally.h @@ -20,7 +20,7 @@ #define TALLY_WINDOW_SIZE (2) -#define MUSIC_COUNTDOWN_MAX (K_TallyDelay() + 8*TICRATE) +#define MUSIC_COUNTDOWN_MAX (K_TallyDelay() + (modeattacking ? 5*TICRATE : 8*TICRATE)) typedef enum { diff --git a/src/p_setup.cpp b/src/p_setup.cpp index feeb08d7c..42b3482bf 100644 --- a/src/p_setup.cpp +++ b/src/p_setup.cpp @@ -156,6 +156,10 @@ boolean stoppedclock; boolean levelloading; UINT8 levelfadecol; +tic_t oldbest; +// I cannot fucking believe this is needed, but gamedata is updated at exactly +// the wrong time to check your record in the tally screen. + virtres_t *curmapvirt; // BLOCKMAP @@ -8706,6 +8710,8 @@ boolean P_LoadLevel(boolean fromnetsave, boolean reloadinggamestate) G_SaveGameData(); } + oldbest = G_GetBestTime(gamemap - 1); + P_MapEnd(); // tm.thing is no longer needed from this point onwards if (!udmf && !P_CanWriteTextmap()) diff --git a/src/p_setup.h b/src/p_setup.h index 72bafc3b4..e07b9c179 100644 --- a/src/p_setup.h +++ b/src/p_setup.h @@ -34,6 +34,8 @@ extern INT32 numdmstarts, numcoopstarts, numredctfstarts, numbluectfstarts, numf extern boolean levelloading; extern UINT8 levelfadecol; +extern tic_t oldbest; + extern lumpnum_t lastloadedmaplumpnum; // for comparative savegame extern virtres_t *curmapvirt; diff --git a/src/p_spec.c b/src/p_spec.c index c4ca508ed..35023bc5d 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -4558,7 +4558,7 @@ static void P_SetupSignObject(mobj_t *sign, mobj_t *pmo, boolean error) mobj_t *cur = sign, *prev = NULL; // Setup the sign itself - P_SetScale(sign, (sign->destscale = 3 * sign->scale / 2)); // 1.5x + P_SetScale(sign, (sign->destscale = 5 * sign->scale / 2)); // 2.5x P_SetTarget(&sign->target, pmo); P_SetMobjState(sign, S_SIGN_POLE); diff --git a/src/p_user.c b/src/p_user.c index 179a2792a..1fdafd4aa 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -711,6 +711,14 @@ void P_EndingMusic(void) { jingle = "_win"; } + + if (modeattacking) + { + if (players[consoleplayer].realtime < oldbest && oldbest != (tic_t)UINT32_MAX) + jingle = "newrec"; + else + jingle = "norec"; + } } skippingposition: