diff --git a/src/doomstat.h b/src/doomstat.h index e9a3442ac..88e9bd66d 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -125,7 +125,7 @@ struct recorddata_t #define MV_BEATEN (1<<1) #define MV_ENCORE (1<<2) #define MV_SPBATTACK (1<<3) -#define MV_MAX (MV_VISITED|MV_BEATEN|MV_ENCORE) +#define MV_MAX (MV_VISITED|MV_BEATEN|MV_ENCORE|MV_SPBATTACK) #define MV_MP ((MV_MAX+1)<<1) // Set if homebrew PWAD stuff has been added. diff --git a/src/g_game.c b/src/g_game.c index cf32b67ea..a0d187790 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2451,9 +2451,18 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps) itemamount = 0; growshrinktimer = 0; bumper = ((gametyperules & GTR_BUMPERS) ? K_StartingBumperCount() : 0); - rings = ((gametyperules & GTR_SPHERES) ? 0 : 5); - if (modeattacking & ATTACKING_SPB) + if (gametyperules & GTR_SPHERES) + { + rings = 0; + } + else if (modeattacking & ATTACKING_SPB) + { rings = 20; + } + else + { + rings = 5; + } spheres = 0; kickstartaccel = 0; khudfault = 0; diff --git a/src/k_menu.h b/src/k_menu.h index 06753e754..fb41a64a2 100644 --- a/src/k_menu.h +++ b/src/k_menu.h @@ -799,6 +799,7 @@ void M_StartTimeAttack(INT32 choice); void M_ReplayTimeAttack(INT32 choice); void M_HandleStaffReplay(INT32 choice); void M_SetGuestReplay(INT32 choice); +void M_TimeAttackTick(void); boolean M_TimeAttackInputs (INT32 choice); // MP selection diff --git a/src/k_menudraw.c b/src/k_menudraw.c index 1a4a465e1..547da7ed6 100644 --- a/src/k_menudraw.c +++ b/src/k_menudraw.c @@ -2372,23 +2372,25 @@ void M_DrawTimeAttack(void) V_DrawRightAlignedString(rightedge-12, timeheight, highlightflags, "BEST TIME:"); K_drawKartTimestamp(timerec, 162+t, timeheight+6, 0, 1); - - - const UINT8 anim_duration = 16; - const UINT8 anim = (timeattackmenu.ticker % (anim_duration * 2)) < anim_duration; - - INT32 buttonx = 162 + t; - INT32 buttony = timeheight; - - if (anim) - V_DrawScaledPatch(buttonx + 35, buttony - 3, V_SNAPTOLEFT, W_CachePatchName("TLB_I", PU_CACHE)); - else - V_DrawScaledPatch(buttonx + 35, buttony - 3, V_SNAPTOLEFT, W_CachePatchName("TLB_IB", PU_CACHE)); - - if (timeattackmenu.ticker > (timeattackmenu.spbflicker + TICRATE/6) || timeattackmenu.ticker % 2) + // SPB Attack control hint + menu overlay + if (levellist.newgametype == GT_RACE && levellist.levelsearch.timeattack == true) { - if (cv_dummyspbattack.value) - V_DrawMappedPatch(buttonx + 7, buttony - 1, 0, W_CachePatchName("K_SPBATK", PU_CACHE), R_GetTranslationColormap(TC_DEFAULT, SKINCOLOR_RED, GTC_MENUCACHE)); + const UINT8 anim_duration = 16; + const UINT8 anim = (timeattackmenu.ticker % (anim_duration * 2)) < anim_duration; + + INT32 buttonx = 162 + t; + INT32 buttony = timeheight; + + if (anim) + V_DrawScaledPatch(buttonx + 35, buttony - 3, V_SNAPTOLEFT, W_CachePatchName("TLB_I", PU_CACHE)); + else + V_DrawScaledPatch(buttonx + 35, buttony - 3, V_SNAPTOLEFT, W_CachePatchName("TLB_IB", PU_CACHE)); + + if (timeattackmenu.ticker > (timeattackmenu.spbflicker + TICRATE/6) || timeattackmenu.ticker % 2) + { + if (cv_dummyspbattack.value) + V_DrawMappedPatch(buttonx + 7, buttony - 1, 0, W_CachePatchName("K_SPBATK", PU_CACHE), R_GetTranslationColormap(TC_DEFAULT, SKINCOLOR_RED, GTC_MENUCACHE)); + } } } diff --git a/src/k_roulette.c b/src/k_roulette.c index 53bb753db..57f948880 100644 --- a/src/k_roulette.c +++ b/src/k_roulette.c @@ -1244,8 +1244,7 @@ void K_FillItemRouletteData(const player_t *player, itemroulette_t *const roulet { presetlist = K_KartItemReelBreakTheCapsules; } - - if (modeattacking & ATTACKING_SPB) + else if (modeattacking & ATTACKING_SPB) { presetlist = K_KartItemReelSPBAttack; } diff --git a/src/menus/play-local-race-time-attack.c b/src/menus/play-local-race-time-attack.c index fedb71b35..f96b7b6b5 100644 --- a/src/menus/play-local-race-time-attack.c +++ b/src/menus/play-local-race-time-attack.c @@ -19,17 +19,20 @@ consvar_t cv_dummyspbattack = CVAR_INIT ("dummyspbattack", "Off", CV_HIDDEN|CV_C struct timeattackmenu_s timeattackmenu; +void M_TimeAttackTick(void) +{ + timeattackmenu.ticker++; +} + boolean M_TimeAttackInputs(INT32 ch) { const UINT8 pid = 0; const boolean buttonR = M_MenuButtonPressed(pid, MBT_R); (void) ch; - timeattackmenu.ticker++; - - if (buttonR) + if (buttonR && levellist.newgametype == GT_RACE) { - cv_dummyspbattack.value = !(cv_dummyspbattack.value); + CV_AddValue(&cv_dummyspbattack, 1); CV_SPBAttackChanged(); timeattackmenu.spbflicker = timeattackmenu.ticker; if (cv_dummyspbattack.value) @@ -69,7 +72,7 @@ menu_t PLAY_TimeAttackDef = { NULL, 2, 5, M_DrawTimeAttack, - NULL, + M_TimeAttackTick, NULL, NULL, M_TimeAttackInputs diff --git a/src/menus/transient/level-select.c b/src/menus/transient/level-select.c index 461473bd9..20442ceb6 100644 --- a/src/menus/transient/level-select.c +++ b/src/menus/transient/level-select.c @@ -230,6 +230,9 @@ boolean M_LevelListFromGametype(INT16 gt) first = false; } + if (levellist.levelsearch.timeattack == false || levellist.newgametype != GT_RACE) + CV_SetValue(&cv_dummyspbattack, 0); + // Obviously go to Cup Select in gametypes that have cups. // Use a really long level select in gametypes that don't use cups. diff --git a/src/p_mobj.c b/src/p_mobj.c index 45fa389d2..8fe24ffed 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -12185,6 +12185,10 @@ static boolean P_AllowMobjSpawn(mapthing_t* mthing, mobjtype_t i) return false; } break; + case MT_RING: + if (modeattacking & ATTACKING_SPB) + return false; + break; default: break; } @@ -12224,10 +12228,7 @@ static mobjtype_t P_GetMobjtypeSubstitute(mapthing_t *mthing, mobjtype_t i) if ((i == MT_RANDOMITEM) && (gametyperules & (GTR_PAPERITEMS|GTR_CIRCUIT)) == (GTR_PAPERITEMS|GTR_CIRCUIT)) return MT_PAPERITEMSPOT; - - if ((i == MT_RING) && (modeattacking & ATTACKING_SPB)) - return MT_THOK; - + return i; }