mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Rework intertype_t
- Now you select based on whether you want to rank by
- Time always (Race, Special)
- Score always (might be useful for custom gametypes..?)
- Time in 1P, Score otherwise (Battle, Versus)
- No longer has gametype-specific text colours on the intermission
- Also cleans up a case where invalid music could play for winning a custom gametype without GTR_CIRCUIT *or* GTR_BUMPERS
This commit is contained in:
parent
63f75fcba1
commit
470f82104d
5 changed files with 44 additions and 50 deletions
|
|
@ -6396,9 +6396,9 @@ struct int_const_s const INT_CONST[] = {
|
||||||
|
|
||||||
// Intermission types
|
// Intermission types
|
||||||
{"int_none",int_none},
|
{"int_none",int_none},
|
||||||
{"int_race",int_race},
|
{"int_time",int_time},
|
||||||
{"int_battle",int_battle},
|
{"int_score",int_score},
|
||||||
{"int_battletime", int_battletime},
|
{"int_scoreortimeattack", int_scoreortimeattack},
|
||||||
|
|
||||||
// Jingles (jingletype_t)
|
// Jingles (jingletype_t)
|
||||||
{"JT_NONE",JT_NONE},
|
{"JT_NONE",JT_NONE},
|
||||||
|
|
|
||||||
|
|
@ -2995,7 +2995,7 @@ static gametype_t defaultgametypes[] =
|
||||||
"GT_RACE",
|
"GT_RACE",
|
||||||
GTR_CIRCUIT|GTR_BOTS|GTR_ENCORE,
|
GTR_CIRCUIT|GTR_BOTS|GTR_ENCORE,
|
||||||
TOL_RACE,
|
TOL_RACE,
|
||||||
int_race,
|
int_time,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
},
|
},
|
||||||
|
|
@ -3006,17 +3006,18 @@ static gametype_t defaultgametypes[] =
|
||||||
"GT_BATTLE",
|
"GT_BATTLE",
|
||||||
GTR_SPHERES|GTR_BUMPERS|GTR_PAPERITEMS|GTR_POWERSTONES|GTR_KARMA|GTR_ITEMARROWS|GTR_CAPSULES|GTR_BATTLESTARTS|GTR_POINTLIMIT|GTR_TIMELIMIT|GTR_OVERTIME|GTR_CLOSERPLAYERS,
|
GTR_SPHERES|GTR_BUMPERS|GTR_PAPERITEMS|GTR_POWERSTONES|GTR_KARMA|GTR_ITEMARROWS|GTR_CAPSULES|GTR_BATTLESTARTS|GTR_POINTLIMIT|GTR_TIMELIMIT|GTR_OVERTIME|GTR_CLOSERPLAYERS,
|
||||||
TOL_BATTLE,
|
TOL_BATTLE,
|
||||||
int_battle,
|
int_scoreortimeattack,
|
||||||
0,
|
0,
|
||||||
2,
|
2,
|
||||||
},
|
},
|
||||||
|
|
||||||
// GT_SPECIAL
|
// GT_SPECIAL
|
||||||
{
|
{
|
||||||
"Special",
|
"Special",
|
||||||
"GT_SPECIAL",
|
"GT_SPECIAL",
|
||||||
GTR_CATCHER|GTR_CIRCUIT,
|
GTR_CATCHER|GTR_CIRCUIT,
|
||||||
TOL_SPECIAL,
|
TOL_SPECIAL,
|
||||||
int_race,
|
int_time,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
},
|
},
|
||||||
|
|
@ -3027,7 +3028,7 @@ static gametype_t defaultgametypes[] =
|
||||||
"GT_VERSUS",
|
"GT_VERSUS",
|
||||||
GTR_BOSS|GTR_SPHERES|GTR_BUMPERS|GTR_POINTLIMIT|GTR_CLOSERPLAYERS|GTR_NOCUPSELECT|GTR_ENCORE,
|
GTR_BOSS|GTR_SPHERES|GTR_BUMPERS|GTR_POINTLIMIT|GTR_CLOSERPLAYERS|GTR_NOCUPSELECT|GTR_ENCORE,
|
||||||
TOL_BOSS,
|
TOL_BOSS,
|
||||||
int_battle,
|
int_scoreortimeattack,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -720,6 +720,7 @@ boolean P_EndingMusic(player_t *player)
|
||||||
{
|
{
|
||||||
char buffer[9];
|
char buffer[9];
|
||||||
boolean looping = true;
|
boolean looping = true;
|
||||||
|
boolean racetracks = !!(gametyperules & GTR_CIRCUIT);
|
||||||
INT32 bestlocalpos, test;
|
INT32 bestlocalpos, test;
|
||||||
player_t *bestlocalplayer;
|
player_t *bestlocalplayer;
|
||||||
|
|
||||||
|
|
@ -773,7 +774,7 @@ boolean P_EndingMusic(player_t *player)
|
||||||
|
|
||||||
#undef getplayerpos
|
#undef getplayerpos
|
||||||
|
|
||||||
if ((gametyperules & GTR_CIRCUIT) && bestlocalpos == MAXPLAYERS+1)
|
if (racetracks == true && bestlocalpos == MAXPLAYERS+1)
|
||||||
sprintf(buffer, "k*fail"); // F-Zero death results theme
|
sprintf(buffer, "k*fail"); // F-Zero death results theme
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -787,9 +788,11 @@ boolean P_EndingMusic(player_t *player)
|
||||||
|
|
||||||
S_SpeedMusic(1.0f);
|
S_SpeedMusic(1.0f);
|
||||||
|
|
||||||
if ((gametyperules & GTR_CIRCUIT))
|
if (racetracks == true)
|
||||||
|
{
|
||||||
buffer[1] = 'r';
|
buffer[1] = 'r';
|
||||||
else if ((gametyperules & GTR_BUMPERS))
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
buffer[1] = 'b';
|
buffer[1] = 'b';
|
||||||
looping = false;
|
looping = false;
|
||||||
|
|
|
||||||
|
|
@ -334,7 +334,7 @@ static void Y_CalculateMatchData(UINT8 rankingsmode, void (*comparison)(INT32))
|
||||||
//
|
//
|
||||||
void Y_IntermissionDrawer(void)
|
void Y_IntermissionDrawer(void)
|
||||||
{
|
{
|
||||||
INT32 i, whiteplayer = MAXPLAYERS, x = 4, hilicol = V_YELLOWMAP; // fallback
|
INT32 i, whiteplayer = MAXPLAYERS, x = 4, hilicol = highlightflags;
|
||||||
|
|
||||||
if (intertype == int_none || rendermode == render_none)
|
if (intertype == int_none || rendermode == render_none)
|
||||||
return;
|
return;
|
||||||
|
|
@ -357,11 +357,6 @@ void Y_IntermissionDrawer(void)
|
||||||
if (!r_splitscreen)
|
if (!r_splitscreen)
|
||||||
whiteplayer = demo.playback ? displayplayers[0] : consoleplayer;
|
whiteplayer = demo.playback ? displayplayers[0] : consoleplayer;
|
||||||
|
|
||||||
if (modeattacking)
|
|
||||||
hilicol = V_ORANGEMAP;
|
|
||||||
else
|
|
||||||
hilicol = ((intertype == int_race) ? V_SKYMAP : V_REDMAP);
|
|
||||||
|
|
||||||
if (sorttic != -1 && intertic > sorttic)
|
if (sorttic != -1 && intertic > sorttic)
|
||||||
{
|
{
|
||||||
INT32 count = (intertic - sorttic);
|
INT32 count = (intertic - sorttic);
|
||||||
|
|
@ -374,7 +369,7 @@ void Y_IntermissionDrawer(void)
|
||||||
x += (((16 - count) * vid.width) / (8 * vid.dupx));
|
x += (((16 - count) * vid.width) / (8 * vid.dupx));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (intertype == int_race || intertype == int_battle || intertype == int_battletime)
|
if (intertype == int_time || intertype == int_score)
|
||||||
{
|
{
|
||||||
#define NUMFORNEWCOLUMN 8
|
#define NUMFORNEWCOLUMN 8
|
||||||
INT32 y = 41, gutter = ((data.numplayers > NUMFORNEWCOLUMN) ? 0 : (BASEVIDWIDTH/2));
|
INT32 y = 41, gutter = ((data.numplayers > NUMFORNEWCOLUMN) ? 0 : (BASEVIDWIDTH/2));
|
||||||
|
|
@ -397,7 +392,7 @@ void Y_IntermissionDrawer(void)
|
||||||
{
|
{
|
||||||
switch (intertype)
|
switch (intertype)
|
||||||
{
|
{
|
||||||
case int_battle:
|
case int_score:
|
||||||
timeheader = "SCORE";
|
timeheader = "SCORE";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
@ -532,7 +527,7 @@ void Y_IntermissionDrawer(void)
|
||||||
V_DrawRightAlignedThinString(x+152+gutter, y-1, (data.numplayers > NUMFORNEWCOLUMN ? V_6WIDTHSPACE : 0), "NO CONTEST.");
|
V_DrawRightAlignedThinString(x+152+gutter, y-1, (data.numplayers > NUMFORNEWCOLUMN ? V_6WIDTHSPACE : 0), "NO CONTEST.");
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (intertype == int_race || intertype == int_battletime)
|
if (intertype == int_time)
|
||||||
{
|
{
|
||||||
snprintf(strtime, sizeof strtime, "%i'%02i\"%02i", G_TicsToMinutes(data.val[i], true),
|
snprintf(strtime, sizeof strtime, "%i'%02i\"%02i", G_TicsToMinutes(data.val[i], true),
|
||||||
G_TicsToSeconds(data.val[i]), G_TicsToCentiseconds(data.val[i]));
|
G_TicsToSeconds(data.val[i]), G_TicsToCentiseconds(data.val[i]));
|
||||||
|
|
@ -668,7 +663,7 @@ void Y_Ticker(void)
|
||||||
if (intertic < TICRATE || intertic & 1 || endtic != -1)
|
if (intertic < TICRATE || intertic & 1 || endtic != -1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (intertype == int_race || intertype == int_battle || intertype == int_battletime)
|
if (intertype == int_time || intertype == int_score)
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
if (!data.rankingsmode && sorttic != -1 && (intertic >= sorttic + 8))
|
if (!data.rankingsmode && sorttic != -1 && (intertic >= sorttic + 8))
|
||||||
|
|
@ -750,27 +745,27 @@ void Y_Ticker(void)
|
||||||
//
|
//
|
||||||
void Y_DetermineIntermissionType(void)
|
void Y_DetermineIntermissionType(void)
|
||||||
{
|
{
|
||||||
|
// no intermission for GP events
|
||||||
|
if (grandprixinfo.gp == true && grandprixinfo.eventmode != GPEVENT_NONE)
|
||||||
|
{
|
||||||
|
intertype = int_none;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// set initially
|
// set initially
|
||||||
intertype = gametypes[gametype]->intermission;
|
intertype = gametypes[gametype]->intermission;
|
||||||
|
|
||||||
// TODO: special cases
|
// special cases
|
||||||
if (intertype == int_battle)
|
if (intertype == int_scoreortimeattack)
|
||||||
{
|
{
|
||||||
if (grandprixinfo.gp == true && grandprixinfo.eventmode != GPEVENT_NONE)
|
UINT8 i = 0, nump = 0;
|
||||||
|
for (i = 0; i < MAXPLAYERS; i++)
|
||||||
{
|
{
|
||||||
intertype = int_none;
|
if (!playeringame[i] || players[i].spectator)
|
||||||
}
|
continue;
|
||||||
else
|
nump++;
|
||||||
{
|
|
||||||
UINT8 i = 0, nump = 0;
|
|
||||||
for (i = 0; i < MAXPLAYERS; i++)
|
|
||||||
{
|
|
||||||
if (!playeringame[i] || players[i].spectator)
|
|
||||||
continue;
|
|
||||||
nump++;
|
|
||||||
}
|
|
||||||
intertype = (nump < 2 ? int_battletime : int_battle);
|
|
||||||
}
|
}
|
||||||
|
intertype = (nump < 2 ? int_time : int_score);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -836,23 +831,18 @@ void Y_StartIntermission(void)
|
||||||
if (prevmap >= nummapheaders || !mapheaderinfo[prevmap])
|
if (prevmap >= nummapheaders || !mapheaderinfo[prevmap])
|
||||||
I_Error("Y_StartIntermission: Internal map ID %d not found (nummapheaders = %d)", prevmap, nummapheaders);
|
I_Error("Y_StartIntermission: Internal map ID %d not found (nummapheaders = %d)", prevmap, nummapheaders);
|
||||||
|
|
||||||
|
if (!(gametyperules & GTR_CIRCUIT) && (timer > 1))
|
||||||
|
S_ChangeMusicInternal("racent", true); // loop it
|
||||||
|
|
||||||
switch (intertype)
|
switch (intertype)
|
||||||
{
|
{
|
||||||
case int_battle:
|
case int_score:
|
||||||
case int_battletime:
|
|
||||||
{
|
{
|
||||||
if (timer > 1)
|
|
||||||
S_ChangeMusicInternal("racent", true); // loop it
|
|
||||||
|
|
||||||
// Calculate who won
|
// Calculate who won
|
||||||
if (intertype == int_battle)
|
Y_CalculateMatchData(0, Y_CompareScore);
|
||||||
{
|
break;
|
||||||
Y_CalculateMatchData(0, Y_CompareScore);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// FALLTHRU
|
case int_time:
|
||||||
case int_race:
|
|
||||||
{
|
{
|
||||||
// Calculate who won
|
// Calculate who won
|
||||||
Y_CalculateMatchData(0, Y_CompareTime);
|
Y_CalculateMatchData(0, Y_CompareTime);
|
||||||
|
|
|
||||||
|
|
@ -26,9 +26,9 @@ void Y_SetupVoteFinish(SINT8 pick, SINT8 level);
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
int_none,
|
int_none,
|
||||||
int_race, // Race
|
int_time, // Always time
|
||||||
int_battle, // Battle (score-based)
|
int_score, // Always score
|
||||||
int_battletime, // Battle (time-based)
|
int_scoreortimeattack, // Score unless 1P
|
||||||
} intertype_t;
|
} intertype_t;
|
||||||
|
|
||||||
extern intertype_t intertype;
|
extern intertype_t intertype;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue