mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-03-09 12:46:19 +00:00
SPB Attack: review fixup omnibus
This commit is contained in:
parent
c1baff583c
commit
320685cf97
8 changed files with 48 additions and 30 deletions
|
|
@ -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.
|
||||
|
|
|
|||
13
src/g_game.c
13
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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue