*A biggie: two-tier intermission screen!

* Have the entire thing slide the fuck away a short while into the intermission.
	* The tab screen is modified to work off similar behaviour and presentation.
* To go with it, a revamp of how Battle's scoring is handled.
	* It's now considered "hits", and is stored in a reuse in one of the vanilla NiGHTS variables, allowing it to use exactly the same ranking mechanisms as race.
	* No more resetting of score between battle rounds.
* Minor, unrelated general code cleanup in places.
* Disable the YEEEAH in splitscreen, otherwise you'll hear it *all the time*.
This commit is contained in:
toaster 2018-07-18 20:23:46 +01:00
parent 69cefa4450
commit 2b7298e959
10 changed files with 453 additions and 482 deletions

View File

@ -2140,8 +2140,8 @@ static void Command_Map_f(void)
}
}
if (!(i = COM_CheckParm("-force")) && newgametype == gametype && !G_BattleGametype()) // SRB2Kart
newresetplayers = false; // if not forcing and gametypes is the same and not battle
if (!(i = COM_CheckParm("-force")) && newgametype == gametype) // SRB2Kart
newresetplayers = false; // if not forcing and gametypes is the same
// don't use a gametype the map doesn't support
if (cv_debug || i || cv_skipmapcheck.value)
@ -3237,7 +3237,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
{
if (G_BattleGametype()) // SRB2kart
{
players[playernum].score = 0;
players[playernum].marescore = 0;
if (K_IsPlayerWanted(&players[playernum]))
K_CalculateBattleWanted();
}

View File

@ -521,7 +521,7 @@ typedef struct player_s
tic_t startedtime; // Time which you started this mare with.
tic_t finishedtime; // Time it took you to finish the mare (used for display)
INT16 finishedrings; // The rings you had left upon finishing the mare
UINT32 marescore; // score for this nights stage
UINT32 marescore; // SRB2Kart: Battle score
UINT32 lastmarescore; // score for the last mare
UINT8 lastmare; // previous mare
INT32 maxlink; // maximum link obtained

View File

@ -594,7 +594,7 @@ void F_CreditDrawer(void)
UINT16 i;
fixed_t y = (80<<FRACBITS) - 5*(animtimer<<FRACBITS)/8;
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31);
//V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31);
// Draw background
V_DrawSciencePatch(0, 0 - FixedMul(32<<FRACBITS, FixedDiv(credbgtimer%TICRATE, TICRATE)), V_SNAPTOTOP, W_CachePatchName("CREDTILE", PU_CACHE), FRACUNIT);
@ -916,7 +916,7 @@ void F_TitleScreenDrawer(void)
if (finalecount < 50)
{
V_DrawFill(0, 0, 320, 200, 31);
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31);
V_DrawSmallScaledPatch(84, 36, 0, ttbanner);
@ -927,7 +927,7 @@ void F_TitleScreenDrawer(void)
}
else if (finalecount < 52)
{
V_DrawFill(0, 0, 320, 200, 120);
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 120);
V_DrawSmallScaledPatch(84, 36, 0, ttkflash);
}
else
@ -1076,7 +1076,7 @@ void F_WaitingPlayersDrawer(void)
INT32 flags = V_FLIP;
const char *waittext1 = "You will join";
const char *waittext2 = "the next race...";
V_DrawFill(0, 0, 320, 200, 31);
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31);
V_DrawCreditString((160 - (V_CreditStringWidth(waittext1)>>1))<<FRACBITS, 48<<FRACBITS, 0, waittext1);
V_DrawCreditString((160 - (V_CreditStringWidth(waittext2)>>1))<<FRACBITS, 64<<FRACBITS, 0, waittext2);
V_DrawFixedPatch((160<<FRACBITS) - driver[frame]->width / 2, 150<<FRACBITS, 1<<FRACBITS, flags, driver[frame], waitcolormap);
@ -1315,7 +1315,7 @@ void F_CutsceneDrawer(void)
// Fade to any palette color you want.
if (cutscenes[cutnum]->scene[scenenum].fadecolor)
{
V_DrawFill(0,0,BASEVIDWIDTH,BASEVIDHEIGHT,cutscenes[cutnum]->scene[scenenum].fadecolor);
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, cutscenes[cutnum]->scene[scenenum].fadecolor);
F_WipeEndScreen();
F_RunWipe(cutscenes[cutnum]->scene[scenenum].fadeinid, true);
@ -1323,7 +1323,7 @@ void F_CutsceneDrawer(void)
F_WipeStartScreen();
}
}
V_DrawFill(0,0, BASEVIDWIDTH, BASEVIDHEIGHT, 31);
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31);
if (cutscenes[cutnum]->scene[scenenum].picname[picnum][0] != '\0')
{

View File

@ -2227,7 +2227,7 @@ static inline void G_PlayerFinishLevel(INT32 player)
p->starpostcount = 0;
// SRB2Kart: exitlevel shouldn't get you the points
if (!p->exiting)
if (!p->exiting && !(p->pflags & PF_TIMEOVER))
{
p->pflags |= PF_TIMEOVER;
if (G_RaceGametype())
@ -2258,7 +2258,7 @@ static inline void G_PlayerFinishLevel(INT32 player)
void G_PlayerReborn(INT32 player)
{
player_t *p;
INT32 score;
INT32 score, marescore;
INT32 lives;
INT32 continues;
UINT8 charability;
@ -2308,6 +2308,7 @@ void G_PlayerReborn(INT32 player)
INT32 wanted;
score = players[player].score;
marescore = players[player].marescore;
lives = players[player].lives;
continues = players[player].continues;
ctfteam = players[player].ctfteam;
@ -2368,6 +2369,7 @@ void G_PlayerReborn(INT32 player)
memset(p, 0, sizeof (*p));
p->score = score;
p->marescore = marescore;
p->lives = lives;
p->continues = continues;
p->pflags = pflags;
@ -2454,7 +2456,7 @@ void G_PlayerReborn(INT32 player)
P_FindEmerald(); // scan for emeralds to hunt for
// Reset Nights score and max link to 0 on death
p->marescore = p->maxlink = 0;
p->maxlink = 0;
// If NiGHTS, find lowest mare to start with.
p->mare = P_FindLowestMare();
@ -3419,7 +3421,7 @@ static void G_DoWorldDone(void)
D_MapChange(nextmap+1,
gametype,
ultimatemode,
(forceresetplayers || G_BattleGametype()), // resetplayer in Battle for more equality
forceresetplayers,
0,
false,
false);
@ -4116,6 +4118,8 @@ void G_InitNew(UINT8 pultmode, const char *mapname, boolean resetplayer, boolean
// Clear cheatcodes too, just in case.
players[i].pflags &= ~(PF_GODMODE|PF_NOCLIP|PF_INVIS);
players[i].marescore = 0;
if (resetplayer) // SRB2Kart
{
players[i].score = 0;

View File

@ -1128,7 +1128,7 @@ static void HU_drawGametype(void)
flags = V_REDMAP;
else
flags = V_SKYMAP;
V_DrawString(4, (splitscreen ? 184 : 192), flags, gametype_cons_t[gametype].strvalue);
V_DrawString(4, 188, flags, gametype_cons_t[gametype].strvalue);
}
//
@ -1317,108 +1317,97 @@ void HU_Erase(void)
//
void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, INT32 whiteplayer)
{
INT32 i;
INT32 i, j, hilicol, rightoffset = 240;
const UINT8 *colormap;
//this function is designed for 9 or less score lines only
I_Assert(scorelines <= 9);
V_DrawFill(1, 26, 318, 1, 0); //Draw a horizontal line because it looks nice!
V_DrawFill(1, 26, 318, 1, 0); // Draw a horizontal line because it looks nice!
if (scorelines > 9)
{
V_DrawFill(160, 26, 1, 154, 0); // Draw a vertical line to separate the two sides.
V_DrawFill(1, 180, 318, 1, 0); // And a horizontal line near the bottom.
rightoffset = 156;
}
if (cons_menuhighlight.value)
hilicol = cons_menuhighlight.value;
else if (modeattacking)
hilicol = V_ORANGEMAP;
else
hilicol = ((gametype == GT_RACE) ? V_SKYMAP : V_REDMAP);
for (i = 0; i < scorelines; i++)
{
if (players[tab[i].num].spectator)
if (players[tab[i].num].spectator || !players[tab[i].num].mo)
continue; //ignore them.
V_DrawString(x + 20, y,
((tab[i].num == whiteplayer) ? V_YELLOWMAP : 0)
| ((players[tab[i].num].health > 0) ? 0 : V_60TRANS)
| V_ALLOWLOWERCASE, tab[i].name);
((tab[i].num == whiteplayer)
? hilicol|V_ALLOWLOWERCASE
: V_ALLOWLOWERCASE),
tab[i].name);
// Draw emeralds
if (!players[tab[i].num].powers[pw_super]
|| ((leveltime/7) & 1))
if (players[tab[i].num].mo->color)
{
HU_DrawEmeralds(x-12,y+2,tab[i].emeralds);
}
if (players[tab[i].num].health <= 0)
V_DrawSmallTranslucentPatch (x, y-4, V_80TRANS, livesback);
else
V_DrawSmallScaledPatch (x, y-4, 0, livesback);
if (tab[i].color == 0)
{
colormap = colormaps;
if (players[tab[i].num].powers[pw_super])
V_DrawSmallScaledPatch(x, y-4, 0, superprefix[players[tab[i].num].skin]);
colormap = R_GetTranslationColormap(players[tab[i].num].skin, players[tab[i].num].mo->color, GTC_CACHE);
if (players[tab[i].num].mo->colorized)
colormap = R_GetTranslationColormap(TC_RAINBOW, players[tab[i].num].mo->color, GTC_CACHE);
else
colormap = R_GetTranslationColormap(players[tab[i].num].skin, players[tab[i].num].mo->color, GTC_CACHE);
V_DrawSmallMappedPatch(x, y-4, 0, faceprefix[players[tab[i].num].skin], colormap);
if (G_BattleGametype() && players[tab[i].num].kartstuff[k_bumper] > 0)
{
if (players[tab[i].num].health <= 0)
V_DrawSmallTranslucentPatch(x, y-4, V_80TRANS, faceprefix[players[tab[i].num].skin]);
else
V_DrawSmallScaledPatch(x, y-4, 0, faceprefix[players[tab[i].num].skin]);
}
}
else
{
if (players[tab[i].num].powers[pw_super])
{
colormap = R_GetTranslationColormap(players[tab[i].num].skin, players[tab[i].num].mo ? players[tab[i].num].mo->color : tab[i].color, GTC_CACHE);
V_DrawSmallMappedPatch (x, y-4, 0, superprefix[players[tab[i].num].skin], colormap);
}
else
{
colormap = R_GetTranslationColormap(players[tab[i].num].skin, players[tab[i].num].mo ? players[tab[i].num].mo->color : tab[i].color, GTC_CACHE);
if (players[tab[i].num].health <= 0)
V_DrawSmallTranslucentMappedPatch (x, y-4, V_80TRANS, faceprefix[players[tab[i].num].skin], colormap);
else
V_DrawSmallMappedPatch (x, y-4, 0, faceprefix[players[tab[i].num].skin], colormap);
INT32 bumperx = x-5;
for (j = 0; j < players[tab[i].num].kartstuff[k_bumper]; j++)
{
bumperx -= 3;
V_DrawSmallMappedPatch(bumperx, y+6, 0, W_CachePatchName("K_BLNICO", PU_CACHE), colormap);
}
}
}
if (G_GametypeUsesLives()) //show lives
V_DrawRightAlignedString(x, y+4, V_ALLOWLOWERCASE|((players[tab[i].num].health > 0) ? 0 : V_60TRANS), va("%dx", players[tab[i].num].lives));
else if (G_TagGametype() && players[tab[i].num].pflags & PF_TAGIT)
{
if (players[tab[i].num].health <= 0)
V_DrawSmallTranslucentPatch(x-32, y-4, V_60TRANS, tagico);
else
V_DrawSmallScaledPatch(x-32, y-4, 0, tagico);
}
if (G_BattleGametype() && players[tab[i].num].kartstuff[k_bumper] <= 0)
V_DrawSmallScaledPatch(x-2, y-4, 0, W_CachePatchName("K_NOBLNS", PU_CACHE));
if (G_RaceGametype())
{
if (circuitmap)
#define timestring(time) va("%i:%02i.%02i", G_TicsToMinutes(time, true), G_TicsToSeconds(time), G_TicsToCentiseconds(time))
if (players[tab[i].num].exiting)
{
if (players[tab[i].num].exiting)
V_DrawRightAlignedString(x+240, y, V_YELLOWMAP, va("%d:%02d.%02d",
players[tab[i].num].realtime/(60*TICRATE),
players[tab[i].num].realtime/TICRATE % 60,
players[tab[i].num].realtime % TICRATE));
//V_DrawRightAlignedString(x+240, y, 0, va("%i:%02i.%02i", G_TicsToMinutes(players[tab[i].num].realtime,true), G_TicsToSeconds(players[tab[i].num].realtime), G_TicsToCentiseconds(players[tab[i].num].realtime)));
else
V_DrawRightAlignedString(x+240, y, 0, va("(CP%02d) %d:%02d.%02d",
tab[i].count,
players[tab[i].num].starposttime/(60*TICRATE),
players[tab[i].num].starposttime/TICRATE % 60,
(int)((players[tab[i].num].starposttime % TICRATE) * (100.00f/TICRATE))));
//V_DrawRightAlignedString(x+240, y, ((players[tab[i].num].health > 0) ? 0 : V_60TRANS), va("%u", tab[i].count));
V_DrawRightAlignedString(x, y-4, hilicol, "FIN");
V_DrawRightAlignedString(x+rightoffset, y, hilicol, timestring(players[tab[i].num].realtime));
}
if (players[tab[i].num].pflags & PF_TIMEOVER)
V_DrawRightAlignedThinString(x+rightoffset, y-1, 0, "TIME OVER...");
else if (circuitmap)
{
V_DrawRightAlignedString(x, y-4, 0, "Lap");
V_DrawRightAlignedString(x, y+4, 0, va("%d", tab[i].count));
V_DrawRightAlignedString(x+rightoffset, y, 0, timestring(players[tab[i].num].starposttime));
}
else
V_DrawRightAlignedString(x+240, y, ((players[tab[i].num].health > 0) ? 0 : V_60TRANS), va("%i:%02i.%02i", G_TicsToMinutes(tab[i].count,true), G_TicsToSeconds(tab[i].count), G_TicsToCentiseconds(tab[i].count)));
V_DrawRightAlignedString(x+rightoffset, y, 0, timestring(tab[i].count));
#undef timestring
}
else
V_DrawRightAlignedString(x+240, y, ((players[tab[i].num].health > 0) ? 0 : V_60TRANS), va("%u", tab[i].count));
V_DrawRightAlignedString(x+rightoffset, y, ((players[tab[i].num].health > 0) ? 0 : V_60TRANS), va("%u", tab[i].count));
y += 16;
if (i == 9)
{
y = 32;
x += BASEVIDWIDTH/2;
}
}
}
//
// HU_DrawTeamTabRankings
//
void HU_DrawTeamTabRankings(playersort_t *tab, INT32 whiteplayer)
/*void HU_DrawTeamTabRankings(playersort_t *tab, INT32 whiteplayer)
{
INT32 i,x,y;
INT32 redplayers = 0, blueplayers = 0;
@ -1579,7 +1568,7 @@ void HU_DrawDualTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scoreline
x += BASEVIDWIDTH/2;
}
}
}
}*/
//
// HU_DrawEmeralds
@ -1675,9 +1664,9 @@ static void HU_DrawRankings(void)
{
patch_t *p;
playersort_t tab[MAXPLAYERS];
INT32 i, j, scorelines;
INT32 i, j, scorelines, numplayersingame = 0, lowestposition = 2;
boolean completed[MAXPLAYERS];
UINT32 whiteplayer;
UINT32 whiteplayer = MAXPLAYERS;
// draw the current gametype in the lower right
HU_drawGametype();
@ -1750,7 +1739,8 @@ static void HU_DrawRankings(void)
// When you play, you quickly see your score because your name is displayed in white.
// When playing back a demo, you quickly see who's the view.
whiteplayer = demoplayback ? displayplayer : consoleplayer;
if (!splitscreen)
whiteplayer = demoplayback ? displayplayer : consoleplayer;
scorelines = 0;
memset(completed, 0, sizeof (completed));
@ -1759,83 +1749,59 @@ static void HU_DrawRankings(void)
for (i = 0; i < MAXPLAYERS; i++)
{
tab[i].num = -1;
tab[i].name = 0;
tab[i].name = NULL;
tab[i].count = INT32_MAX;
if (G_RaceGametype() && !circuitmap)
tab[i].count = INT32_MAX;
}
for (j = 0; j < MAXPLAYERS; j++)
{
if (!playeringame[j] || players[j].spectator)
if (!playeringame[i] || players[i].spectator)
continue;
numplayersingame++;
}
for (j = 0; j < numplayersingame; j++)
{
for (i = 0; i < MAXPLAYERS; i++)
{
if (playeringame[i] && !players[i].spectator)
{
if (G_RaceGametype())
{
if (circuitmap)
{
if ((unsigned)players[i].laps+1 >= tab[scorelines].count && completed[i] == false)
{
tab[scorelines].count = players[i].laps+1;
tab[scorelines].num = i;
tab[scorelines].color = players[i].skincolor;
tab[scorelines].name = player_names[i];
}
}
else
{
if (players[i].realtime <= tab[scorelines].count && completed[i] == false)
{
tab[scorelines].count = players[i].realtime;
tab[scorelines].num = i;
tab[scorelines].color = players[i].skincolor;
tab[scorelines].name = player_names[i];
}
}
}
else if (gametype == GT_COMPETITION)
{
// todo put something more fitting for the gametype here, such as current
// number of categories led
if (players[i].score >= tab[scorelines].count && completed[i] == false)
{
tab[scorelines].count = players[i].score;
tab[scorelines].num = i;
tab[scorelines].color = players[i].skincolor;
tab[scorelines].name = player_names[i];
tab[scorelines].emeralds = players[i].powers[pw_emeralds];
}
}
else
{
if (players[i].score >= tab[scorelines].count && completed[i] == false)
{
tab[scorelines].count = players[i].score;
tab[scorelines].num = i;
tab[scorelines].color = players[i].skincolor;
tab[scorelines].name = player_names[i];
tab[scorelines].emeralds = players[i].powers[pw_emeralds];
}
}
}
if (!playeringame[i] || players[i].spectator || completed[i])
continue;
if (players[i].kartstuff[k_position] >= lowestposition)
continue;
tab[scorelines].num = i;
lowestposition = players[i].kartstuff[k_position];
}
completed[tab[scorelines].num] = true;
i = tab[scorelines].num;
completed[i] = true;
tab[scorelines].name = player_names[i];
if (G_RaceGametype())
{
if (circuitmap)
tab[scorelines].count = players[i].laps+1;
else
tab[scorelines].count = players[i].realtime;
}
else
tab[scorelines].count = players[i].marescore;
scorelines++;
lowestposition += 2;
}
if (scorelines > 20)
scorelines = 20; //dont draw past bottom of screen, show the best only
if (G_GametypeHasTeams())
HU_DrawTeamTabRankings(tab, whiteplayer); //separate function for Spazzo's silly request
else if (scorelines <= 9)
HU_DrawTabRankings(40, 32, tab, scorelines, whiteplayer);
else
HU_DrawDualTabRankings(32, 32, tab, scorelines, whiteplayer);
/*if (G_GametypeHasTeams())
HU_DrawTeamTabRankings(tab, whiteplayer); //separate function for Spazzo's silly request -- gotta fix this up later
else if (scorelines > 10)*/
HU_DrawTabRankings(((scorelines > 9) ? 32 : 40), 32, tab, scorelines, whiteplayer);
/*else
HU_DrawDualTabRankings(32, 32, tab, scorelines, whiteplayer);*/
// draw spectators in a ticker across the bottom
if (!splitscreen && G_GametypeHasSpectators())

View File

@ -55,8 +55,6 @@ typedef struct
{
UINT32 count;
INT32 num;
INT32 color;
INT32 emeralds;
const char *name;
} playersort_t;
@ -105,8 +103,8 @@ char HU_dequeueChatChar(void);
void HU_Erase(void);
void HU_clearChatChars(void);
void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, INT32 whiteplayer);
void HU_DrawTeamTabRankings(playersort_t *tab, INT32 whiteplayer);
void HU_DrawDualTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, INT32 whiteplayer);
//void HU_DrawTeamTabRankings(playersort_t *tab, INT32 whiteplayer);
//void HU_DrawDualTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, INT32 whiteplayer);
void HU_DrawEmeralds(INT32 x, INT32 y, INT32 pemeralds);
INT32 HU_CreateTeamScoresTbl(playersort_t *tab, UINT32 dmtotals[]);

View File

@ -3264,12 +3264,12 @@ static void K_KartUpdatePosition(player_t *player)
{
if (player->exiting) // End of match standings
{
if (players[i].score > player->score) // Only score matters
if (players[i].marescore > player->marescore) // Only score matters
position++;
}
else
{
if (players[i].kartstuff[k_bumper] == player->kartstuff[k_bumper] && players[i].score > player->score)
if (players[i].kartstuff[k_bumper] == player->kartstuff[k_bumper] && players[i].marescore > player->marescore)
position++;
else if (players[i].kartstuff[k_bumper] > player->kartstuff[k_bumper])
position++;
@ -3924,7 +3924,7 @@ void K_CalculateBattleWanted(void)
continue;
if (j == i)
continue;
if (players[j].kartstuff[k_wanted] == players[i].kartstuff[k_wanted] && players[j].score > players[i].score)
if (players[j].kartstuff[k_wanted] == players[i].kartstuff[k_wanted] && players[j].marescore > players[i].marescore)
position++;
else if (players[j].kartstuff[k_wanted] > players[i].kartstuff[k_wanted])
position++;
@ -4018,7 +4018,7 @@ void K_CheckBumpers(void)
return;
numingame++;
winnerscoreadd += players[i].score;
winnerscoreadd += players[i].marescore;
if (players[i].kartstuff[k_bumper] <= 0) // if you don't have any bumpers, you're probably not a winner
continue;
@ -4026,7 +4026,7 @@ void K_CheckBumpers(void)
return;
winnernum = i;
winnerscoreadd -= players[i].score;
winnerscoreadd -= players[i].marescore;
}
/*if (numingame <= 1)
@ -4034,7 +4034,7 @@ void K_CheckBumpers(void)
if (winnernum > -1 && playeringame[winnernum])
{
players[winnernum].score += winnerscoreadd;
players[winnernum].marescore += winnerscoreadd;
CONS_Printf(M_GetText("%s recieved %d point%s for winning!\n"), player_names[winnernum], winnerscoreadd, (winnerscoreadd == 1 ? "" : "s"));
}
@ -4173,7 +4173,7 @@ void K_LoadKartHUDGraphics(void)
kp_facefourth = W_CachePatchName("K_PFACE4", PU_HUDGFX);
// Extra ranking icons
kp_rankbumper = W_CachePatchName("K_BLNICO", PU_HUDGFX);
kp_rankbumper = W_CachePatchName("K_BLNICO", PU_HUDGFX);
kp_ranknobumpers = W_CachePatchName("K_NOBLNS", PU_HUDGFX);
// Battle graphics
@ -4770,8 +4770,6 @@ static void K_drawKartPositionFaces(void)
INT32 i, j, ranklines;
boolean completed[MAXPLAYERS];
INT32 rankplayer[MAXPLAYERS];
INT32 rankcolor[MAXPLAYERS];
INT32 myplayer;
INT32 bumperx;
UINT8 *colormap;
patch_t *localpatch = kp_facenull;
@ -4779,8 +4777,6 @@ static void K_drawKartPositionFaces(void)
ranklines = 0;
memset(completed, 0, sizeof (completed));
memset(rankplayer, 0, sizeof (rankplayer));
memset(rankcolor, 0, sizeof (rankcolor));
myplayer = demoplayback ? displayplayer : consoleplayer;
for (i = 0; i < MAXPLAYERS; i++)
rankplayer[i] = -1;
@ -4796,15 +4792,18 @@ static void K_drawKartPositionFaces(void)
&& (rankplayer[ranklines] < 0 || players[i].kartstuff[k_position] < players[rankplayer[ranklines]].kartstuff[k_position]))
{
rankplayer[ranklines] = i;
rankcolor[ranklines] = players[i].skincolor;
}
}
completed[rankplayer[ranklines]] = true;
i = rankplayer[ranklines];
completed[i] = true;
if (ranklines == 4)
break; // Only draw the top 4 players
ranklines++;
}
if (ranklines > 4) ranklines = 4; // Only draw the top 4 players
Y -= (9*ranklines);
for (i = 0; i < ranklines; i++)
@ -4814,68 +4813,21 @@ static void K_drawKartPositionFaces(void)
bumperx = FACE_X+18;
if (rankcolor[i] == 0)
{
colormap = colormaps;
if (rankplayer[i] != myplayer)
{
V_DrawSmallTranslucentPatch(FACE_X, Y, V_HUDTRANS|V_SNAPTOLEFT, faceprefix[players[rankplayer[i]].skin]);
if (G_BattleGametype() && players[rankplayer[i]].kartstuff[k_bumper] > 0)
{
for (j = 0; j < players[rankplayer[i]].kartstuff[k_bumper]; j++)
{
V_DrawSmallTranslucentPatch(bumperx, Y+10, V_HUDTRANS|V_SNAPTOLEFT, kp_rankbumper);
bumperx += 3;
}
}
}
else
{
V_DrawSmallScaledPatch(FACE_X, Y, V_HUDTRANS|V_SNAPTOLEFT, faceprefix[players[rankplayer[i]].skin]);
if (G_BattleGametype() && players[rankplayer[i]].kartstuff[k_bumper] > 0)
{
for (j = 0; j < players[rankplayer[i]].kartstuff[k_bumper]; j++)
{
V_DrawSmallScaledPatch(bumperx, Y+10, V_HUDTRANS|V_SNAPTOLEFT, kp_rankbumper);
bumperx += 3;
}
}
}
}
else
if (players[rankplayer[i]].mo->color)
{
colormap = R_GetTranslationColormap(players[rankplayer[i]].skin, players[rankplayer[i]].mo->color, GTC_CACHE);
if (players[rankplayer[i]].mo->colorized)
{
colormap = R_GetTranslationColormap(TC_RAINBOW, players[rankplayer[i]].mo->color, GTC_CACHE);
}
else
{
colormap = R_GetTranslationColormap(players[rankplayer[i]].skin, players[rankplayer[i]].mo->color, GTC_CACHE);
}
if (rankplayer[i] != myplayer)
V_DrawSmallMappedPatch(FACE_X, Y, V_HUDTRANS|V_SNAPTOLEFT, faceprefix[players[rankplayer[i]].skin], colormap);
if (G_BattleGametype() && players[rankplayer[i]].kartstuff[k_bumper] > 0)
{
V_DrawSmallTranslucentMappedPatch(FACE_X, Y, V_HUDTRANS|V_SNAPTOLEFT, faceprefix[players[rankplayer[i]].skin], colormap);
if (G_BattleGametype() && players[rankplayer[i]].kartstuff[k_bumper] > 0)
for (j = 0; j < players[rankplayer[i]].kartstuff[k_bumper]; j++)
{
for (j = 0; j < players[rankplayer[i]].kartstuff[k_bumper]; j++)
{
V_DrawSmallTranslucentMappedPatch(bumperx, Y+10, V_HUDTRANS|V_SNAPTOLEFT, kp_rankbumper, colormap);
bumperx += 3;
}
}
}
else
{
V_DrawSmallMappedPatch(FACE_X, Y, V_HUDTRANS|V_SNAPTOLEFT, faceprefix[players[rankplayer[i]].skin], colormap);
if (G_BattleGametype() && players[rankplayer[i]].kartstuff[k_bumper] > 0)
{
for (j = 0; j < players[rankplayer[i]].kartstuff[k_bumper]; j++)
{
V_DrawSmallMappedPatch(bumperx, Y+10, V_HUDTRANS|V_SNAPTOLEFT, kp_rankbumper, colormap);
bumperx += 3;
}
V_DrawSmallMappedPatch(bumperx, Y+10, V_HUDTRANS|V_SNAPTOLEFT, kp_rankbumper, colormap);
bumperx += 3;
}
}
}
@ -4890,20 +4842,10 @@ static void K_drawKartPositionFaces(void)
default: break;
}
if (rankplayer[i] != myplayer)
{
if (G_BattleGametype() && players[rankplayer[i]].kartstuff[k_bumper] <= 0)
V_DrawSmallTranslucentPatch(FACE_X-2, Y, V_HUDTRANS|V_SNAPTOLEFT, kp_ranknobumpers);
else
V_DrawSmallTranslucentPatch(FACE_X, Y, V_HUDTRANS|V_SNAPTOLEFT, localpatch);
}
if (G_BattleGametype() && players[rankplayer[i]].kartstuff[k_bumper] <= 0)
V_DrawSmallScaledPatch(FACE_X-2, Y, V_HUDTRANS|V_SNAPTOLEFT, kp_ranknobumpers);
else
{
if (G_BattleGametype() && players[rankplayer[i]].kartstuff[k_bumper] <= 0)
V_DrawSmallScaledPatch(FACE_X-2, Y, V_HUDTRANS|V_SNAPTOLEFT, kp_ranknobumpers);
else
V_DrawSmallScaledPatch(FACE_X, Y, V_HUDTRANS|V_SNAPTOLEFT, localpatch);
}
V_DrawSmallScaledPatch(FACE_X, Y, V_HUDTRANS|V_SNAPTOLEFT, localpatch);
Y += 18;
}

View File

@ -1797,7 +1797,7 @@ static void P_HitDeathMessages(player_t *player, mobj_t *inflictor, mobj_t *sour
*/
void P_CheckTimeLimit(void)
{
INT32 i, k;
INT32 i;
if (!cv_timelimit.value)
return;
@ -1836,7 +1836,7 @@ void P_CheckTimeLimit(void)
}
//Optional tie-breaker for Match/CTF
else if (cv_overtime.value)
/*else if (cv_overtime.value)
{
INT32 playerarray[MAXPLAYERS];
INT32 tempplayer = 0;
@ -1896,7 +1896,7 @@ void P_CheckTimeLimit(void)
}
if (server)
SendNetXCmd(XD_EXITLEVEL, NULL, 0);
}
}*/
if (server)
SendNetXCmd(XD_EXITLEVEL, NULL, 0);

View File

@ -661,9 +661,6 @@ static void P_DeNightserizePlayer(player_t *player)
else if (player == &players[fourthdisplayplayer])
localaiming4 = 0;
// If you screwed up, kiss your score goodbye.
player->marescore = 0;
if (player->mo->tracer)
P_RemoveMobj(player->mo->tracer);
//P_SetPlayerMobjState(player->mo, S_PLAY_FALL1); // SRB2kart
@ -790,8 +787,6 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime)
G_AddTempNightsRecords(players[i].marescore, leveltime - player->marebegunat, players[i].mare + 1);*/
// transfer scores anyway
players[i].lastmarescore = players[i].marescore;
players[i].marescore = 0;
players[i].mo->health = players[i].health = 1;
P_DoPlayerExit(&players[i]);
@ -813,8 +808,6 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime)
G_AddTempNightsRecords(player->marescore, leveltime - player->marebegunat, (UINT8)(oldmare + 1));*/
// Starting a new mare, transfer scores
player->lastmarescore = player->marescore;
player->marescore = 0;
player->marebegunat = leveltime;
player->mo->health = player->health = 1;
@ -1078,10 +1071,10 @@ void P_AddPlayerScore(player_t *player, UINT32 amount)
//oldscore = player->score;
// Don't go above MAXSCORE.
if (player->score + amount < MAXSCORE)
player->score += amount;
if (player->marescore + amount < MAXSCORE)
player->marescore += amount;
else
player->score = MAXSCORE;
player->marescore = MAXSCORE;
// check for extra lives every 50000 pts
/*if (!ultimatemode && !modeattacking && player->score > oldscore && player->score % 50000 < amount && (gametype == GT_COMPETITION || gametype == GT_COOP))

View File

@ -60,7 +60,7 @@ typedef struct
typedef union
{
struct
/*struct
{
char passed1[21]; // KNUCKLES GOT / CRAWLA HONCHO
char passed2[16]; // THROUGH THE ACT / PASSED THE ACT
@ -104,7 +104,7 @@ typedef union
UINT8 *playercolor;
UINT8 gotlife; // Number of extra lives obtained
} spec;
} spec;*/
struct
{
@ -113,16 +113,16 @@ typedef union
INT32 *character[MAXPLAYERS]; // Winner's character #
INT32 num[MAXPLAYERS]; // Winner's player #
char *name[MAXPLAYERS]; // Winner's name
patch_t *result; // RESULT
INT32 numplayers; // Number of players being displayed
char levelstring[62]; // holds levelnames up to 32 characters
// SRB2kart
int increase[MAXPLAYERS]; //how much did the score increase by?
tic_t time[MAXPLAYERS]; //Tournament Time
UINT32 val[MAXPLAYERS]; //Gametype-specific value
UINT8 pos[MAXPLAYERS]; // player positions. used for ties
boolean rankingsmode; // rankings mode
} match;
struct
/*struct
{
UINT8 *color[MAXPLAYERS]; // Winner's color #
INT32 *character[MAXPLAYERS]; // Winner's character #
@ -136,7 +136,7 @@ typedef union
UINT32 points[MAXPLAYERS];
INT32 numplayers; // Number of players being displayed
char levelstring[40]; // holds levelnames up to 32 characters
} competition;
} competition;*/
} y_data;
@ -154,12 +154,14 @@ static INT32 timer;
static INT32 intertic;
static INT32 endtic = -1;
static INT32 sorttic = -1;
intertype_t intertype = int_none;
//static void Y_AwardCoopBonuses(void);
//static void Y_AwardSpecialStageBonus(void);
static void Y_CalculateTournamentPoints(void); // SRB2kart
static void Y_MakeRankingsTable(void); // SRB2Kart also
//static void Y_CalculateCompetitionWinners(void);
//static void Y_CalculateTimeRaceWinners(void);
@ -208,14 +210,14 @@ static patch_t *randomlvl = NULL;
static void Y_UnloadVoteData(void);
// Stuff copy+pasted from st_stuff.c
static INT32 SCX(INT32 x)
/*static INT32 SCX(INT32 x)
{
return FixedInt(FixedMul(x<<FRACBITS, vid.fdupx));
}
static INT32 SCY(INT32 z)
{
return FixedInt(FixedMul(z<<FRACBITS, vid.fdupy));
}
}*/
#define ST_DrawNumFromHud(h,n) V_DrawTallNum(SCX(hudinfo[h].x), SCY(hudinfo[h].y), V_NOSCALESTART, n)
#define ST_DrawPadNumFromHud(h,n,q) V_DrawPaddedTallNum(SCX(hudinfo[h].x), SCY(hudinfo[h].y), V_NOSCALESTART, n, q)
@ -230,8 +232,7 @@ static INT32 SCY(INT32 z)
void Y_IntermissionDrawer(void)
{
// Bonus loops
INT32 i;
INT32 hilicol = V_YELLOWMAP; // fallback
INT32 i, whiteplayer = MAXPLAYERS, x = 4, hilicol = V_YELLOWMAP; // fallback
if (intertype == int_none || rendermode == render_none)
return;
@ -262,8 +263,35 @@ void Y_IntermissionDrawer(void)
else
V_DrawPatchFill(bgtile);
if (!splitscreen)
whiteplayer = demoplayback ? displayplayer : consoleplayer;
if (cons_menuhighlight.value)
hilicol = cons_menuhighlight.value;
else if (modeattacking)
hilicol = V_ORANGEMAP;
else
hilicol = ((intertype == int_race) ? V_SKYMAP : V_REDMAP);
if (sorttic != -1 && intertic > sorttic)
{
INT32 count = (intertic - sorttic);
if (count < 8)
x -= ((count * vid.width) / (8 * vid.dupx));
else
{
if (!data.match.rankingsmode)
Y_MakeRankingsTable();
if (count == 8)
goto dotimer;
else if (count < 16)
x += (((16 - count) * vid.width) / (8 * vid.dupx));
}
}
// SRB2kart 290117 - compeltely replaced this block.
if (intertype == int_timeattack)
/*if (intertype == int_timeattack)
{
// draw time
ST_DrawPatchFromHud(HUD_TIME, sbotime);
@ -281,13 +309,13 @@ void Y_IntermissionDrawer(void)
ST_DrawPatchFromHud(HUD_TIMECOLON, sbocolon); // Colon
ST_DrawPadNumFromHud(HUD_SECONDS, seconds, 2); // Seconds
/* // SRB2kart - pulled from old coop block, just in case we need it
// SRB2kart - pulled from old coop block, just in case we need it
// we should show centiseconds on the intermission screen too, if the conditions are right.
if (modeattacking || cv_timetic.value == 2)
{
ST_DrawPatchFromHud(HUD_TIMETICCOLON, sboperiod); // Period
ST_DrawPadNumFromHud(HUD_TICS, tictrn, 2); // Tics
}*/
}
ST_DrawPatchFromHud(HUD_TIMETICCOLON, sboperiod); // Period
ST_DrawPadNumFromHud(HUD_TICS, tictrn, 2); // Tics
@ -303,19 +331,18 @@ void Y_IntermissionDrawer(void)
//if (gottimebonus && endtic != -1)
// V_DrawCenteredString(BASEVIDWIDTH/2, 172, V_YELLOWMAP, "TIME BONUS UNLOCKED!");
}
else if (intertype == int_race)
else*/ if (intertype == int_race || intertype == int_match)
{
INT32 x = 4;
INT32 y = 48;
char name[MAXPLAYERNAME+1];
hilicol = (cons_menuhighlight.value) ? cons_menuhighlight.value : V_SKYMAP;
const char *timeheader = (intertype == int_race) ? "TIME" : "HITS";
boolean completed[MAXPLAYERS];
memset(completed, 0, sizeof (completed));
// draw the level name
V_DrawCenteredString(BASEVIDWIDTH/2, 20, 0, data.match.levelstring);
V_DrawFill(4, 42, 312, 1, 0);
V_DrawCenteredString(-4 + x + BASEVIDWIDTH/2, 20, 0, data.match.levelstring);
V_DrawFill(x, 42, 312, 1, 0);
if (data.match.numplayers > 8)
{
@ -324,26 +351,27 @@ void Y_IntermissionDrawer(void)
V_DrawCenteredString(x+6+(BASEVIDWIDTH/2), 32, hilicol, "#");
V_DrawString(x+36+(BASEVIDWIDTH/2), 32, hilicol, "NAME");
V_DrawRightAlignedString(x+110, 32, hilicol, "TIME");
if (!data.match.rankingsmode)
{
V_DrawRightAlignedString(x+110, 32, hilicol, timeheader);
V_DrawRightAlignedString(x+(BASEVIDWIDTH/2)+110, 32, hilicol, timeheader);
}
V_DrawRightAlignedString(x+152, 32, hilicol, "SCORE");
}
else if (!data.match.rankingsmode)
V_DrawRightAlignedString(x+(BASEVIDWIDTH/2)+62, 32, hilicol, timeheader);
V_DrawCenteredString(x+6, 32, hilicol, "#");
V_DrawString(x+36, 32, hilicol, "NAME");
if (data.match.numplayers > 8)
V_DrawRightAlignedString(x+(BASEVIDWIDTH/2)+110, 32, hilicol, "TIME");
else
V_DrawRightAlignedString(x+(BASEVIDWIDTH/2)+62, 32, hilicol, "TIME");
V_DrawRightAlignedString(x+(BASEVIDWIDTH/2)+152, 32, hilicol, "SCORE");
for (i = 0; i < data.match.numplayers; i++)
{
V_DrawCenteredString(x+6, y, 0, va("%d", data.match.pos[i]));
if (playeringame[data.match.num[i]])
if (data.match.num[i] != MAXPLAYERS && playeringame[data.match.num[i]])
{
char strtime[10];
@ -355,74 +383,89 @@ void Y_IntermissionDrawer(void)
V_DrawSmallMappedPatch(x+16, y-4, 0,faceprefix[*data.match.character[i]], colormap);
}
if (data.match.numplayers > 8)
if (data.match.numplayers > 9)
strlcpy(name, data.match.name[i], 6);
else
STRBUFCPY(name, data.match.name[i]);
V_DrawString(x+36, y, V_ALLOWLOWERCASE, name);
V_DrawString(x+36, y,
((data.match.num[i] == whiteplayer)
? hilicol|V_ALLOWLOWERCASE
: V_ALLOWLOWERCASE),
name);
snprintf(strtime, sizeof strtime, "%d", data.match.scores[i]-data.match.increase[i]);
if (data.match.numplayers > 8)
V_DrawRightAlignedString(x+152, y, hilicol, strtime);
V_DrawRightAlignedString(x+152, y, 0, strtime);
else
V_DrawRightAlignedString(x+152+BASEVIDWIDTH/2, y, hilicol, strtime);
V_DrawRightAlignedString(x+152+BASEVIDWIDTH/2, y, 0, strtime);
if (data.match.time[i] == (tic_t)(UINT32_MAX-1))
if (!data.match.rankingsmode)
{
if (data.match.numplayers > 8)
V_DrawRightAlignedThinString(x+136, y-1, 0, "TIME OVER...");
else
V_DrawRightAlignedThinString(x+82+BASEVIDWIDTH/2, y-1, 0, "TIME OVER...");
}
else
{
if (data.match.numplayers <= 8) // Only draw this with less than 8 players, otherwise we won't be able to fit the times in
if (data.match.val[i] == (UINT32_MAX-1))
{
if (data.match.increase[i] > 9)
snprintf(strtime, sizeof strtime, "(+%02d)", data.match.increase[i]);
if (data.match.numplayers > 8)
V_DrawRightAlignedThinString(x+134, y-1, 0, "NO CONTEST");
else
snprintf(strtime, sizeof strtime, "(+ %d)", data.match.increase[i]);
V_DrawString(x+84+BASEVIDWIDTH/2, y, 0, strtime);
V_DrawRightAlignedThinString(x+80+BASEVIDWIDTH/2, y-1, 0, "NO CONTEST");
}
snprintf(strtime, sizeof strtime, "%i:%02i.%02i", G_TicsToMinutes(data.match.time[i], true),
G_TicsToSeconds(data.match.time[i]), G_TicsToCentiseconds(data.match.time[i]));
strtime[sizeof strtime - 1] = '\0';
if (data.match.numplayers > 8)
V_DrawRightAlignedString(x+134, y, 0, strtime);
else
V_DrawRightAlignedString(x+80+BASEVIDWIDTH/2, y, 0, strtime);
{
if (data.match.numplayers <= 8) // Only draw this with less than 8 players, otherwise we won't be able to fit the times in
{
if (data.match.increase[i] > 9)
snprintf(strtime, sizeof strtime, "(+%02d)", data.match.increase[i]);
else
snprintf(strtime, sizeof strtime, "(+ %d)", data.match.increase[i]);
V_DrawString(x+84+BASEVIDWIDTH/2, y, 0, strtime);
}
if (intertype == int_race)
{
snprintf(strtime, sizeof strtime, "%i:%02i.%02i", G_TicsToMinutes(data.match.val[i], true),
G_TicsToSeconds(data.match.val[i]), G_TicsToCentiseconds(data.match.val[i]));
strtime[sizeof strtime - 1] = '\0';
if (data.match.numplayers > 8)
V_DrawRightAlignedString(x+134, y, 0, strtime);
else
V_DrawRightAlignedString(x+80+BASEVIDWIDTH/2, y, 0, strtime);
}
else
{
if (data.match.numplayers > 8)
V_DrawRightAlignedString(x+110, y, 0, va("%i", data.match.val[i]));
else
V_DrawRightAlignedString(x+62+BASEVIDWIDTH/2, y, 0, va("%i", data.match.val[i]));
}
}
}
completed[i] = true;
}
else
data.match.num[i] = MAXPLAYERS;
y += 16;
if (y > 160)
if (y > 176)
{
y = 48;
x += BASEVIDWIDTH/2;
}
}
}
else if (intertype == int_match)
/*else if (intertype == int_match)
{
INT32 x = 4;
INT32 y = 48;
char name[MAXPLAYERNAME+1];
hilicol = (cons_menuhighlight.value) ? cons_menuhighlight.value : V_REDMAP;
// draw the header
V_DrawScaledPatch((BASEVIDWIDTH/2) - (SHORT(data.match.result->width) / 2), 2, 0, data.match.result);
// draw the level name
V_DrawCenteredString(BASEVIDWIDTH/2, 20, 0, data.match.levelstring);
V_DrawFill(4, 42, 312, 1, 0);
V_DrawCenteredString(-4 + x + BASEVIDWIDTH/2, 20, 0, data.match.levelstring);
V_DrawFill(x, 42, 312, 1, 0);
if (data.match.numplayers > 9)
{
@ -477,7 +520,7 @@ void Y_IntermissionDrawer(void)
x += BASEVIDWIDTH/2;
}
}
}
}*/
/*else if (intertype == int_ctf || intertype == int_teammatch)
{
INT32 x = 4, y = 0;
@ -636,6 +679,7 @@ void Y_IntermissionDrawer(void)
}
}*/
dotimer:
if (timer)
V_DrawCenteredString(BASEVIDWIDTH/2, 188, hilicol,
va("start in %d seconds", timer/TICRATE));
@ -820,13 +864,12 @@ void Y_Ticker(void)
--data.spec.gotlife;
}
}
*/
if (intertype == int_timeattack)
{
if (!intertic)
endtic = intertic + 10*TICRATE; // 10 second pause after end of tally
}
else if (intertype == int_race)
}*/
else if (intertype == int_race || intertype == int_match)
{
INT32 q=0,r=0;
boolean kaching = true;
@ -854,20 +897,25 @@ void Y_Ticker(void)
if (r)
S_StartSound(NULL, (kaching ? sfx_chchng : sfx_ptally));
else
{
if (modeattacking)
endtic = intertic + 10*TICRATE; // 10 second pause after end of tally
else
endtic = intertic + 3*TICRATE; // 3 second pause after end of tally
if (netgame || multiplayer)
sorttic = intertic + 5*TICRATE; // 5 second pause after end of tally
}
}
else if (intertype == int_match) //|| intertype == int_ctf || intertype == int_teammatch) // match
/*else if (intertype == int_match) //|| intertype == int_ctf || intertype == int_teammatch) // match
{
if (!intertic) // first time only
S_ChangeMusicInternal("racent", true); // loop it
// If a player has left or joined, recalculate scores.
if (data.match.numplayers != D_NumPlayers())
Y_CalculateMatchWinners();
}
//if (data.match.numplayers != D_NumPlayers())
//Y_CalculateMatchWinners();
}*/
/*else if (intertype == int_race || intertype == int_classicrace) // race
{
if (!intertic) // first time only
@ -960,8 +1008,6 @@ static void Y_UpdateRecordReplays(void)
//
void Y_StartIntermission(void)
{
INT32 i;
intertic = -1;
#ifdef PARANOIA
@ -1033,7 +1079,7 @@ void Y_StartIntermission(void)
switch (intertype)
{
case int_nights:
/*case int_nights:
// Can't fail
//G_SetNightsRecords();
@ -1046,7 +1092,6 @@ void Y_StartIntermission(void)
// fall back into the coop intermission for now
intertype = int_timeattack;
/* FALLTHRU */
case int_timeattack: // coop or single player, normal level // SRB2kart 230117 - replaced int_coop
{
// award time and ring bonuses
@ -1061,10 +1106,6 @@ void Y_StartIntermission(void)
mapvisited[gamemap-1] |= MV_BEATEN;
if (ALL7EMERALDS(emeralds))
mapvisited[gamemap-1] |= MV_ALLEMERALDS;
/*if (ultimatemode)
mapvisited[gamemap-1] |= MV_ULTIMATE;
if (data.coop.gotperfbonus)
mapvisited[gamemap-1] |= MV_PERFECT;*/
if (modeattacking == ATTACKING_RECORD)
Y_UpdateRecordReplays();
@ -1075,11 +1116,7 @@ void Y_StartIntermission(void)
data.coop.ptotal = W_CachePatchName("YB_TOTAL", PU_STATIC);
// get act number
/*if (mapheaderinfo[prevmap]->actnum)
data.coop.ttlnum = W_CachePatchName(va("TTL%.2d", mapheaderinfo[prevmap]->actnum),
PU_STATIC);
else*/
data.coop.ttlnum = W_CachePatchName("TTL01", PU_STATIC);
data.coop.ttlnum = W_CachePatchName("TTL01", PU_STATIC);
// get background patches
widebgpatch = W_CachePatchName("INTERSCW", PU_STATIC);
@ -1140,7 +1177,7 @@ void Y_StartIntermission(void)
break;
}
/* // SRB2kart 230117 - removed
// SRB2kart 230117 - removed
case int_nightsspec:
if (modeattacking && stagefailed)
{
@ -1263,54 +1300,13 @@ void Y_StartIntermission(void)
{
// Calculate who won
Y_CalculateMatchWinners();
// set up the levelstring
if (strlen(mapheaderinfo[prevmap]->zonttl) > 0)
{
if (strlen(mapheaderinfo[prevmap]->actnum) > 0)
snprintf(data.match.levelstring,
sizeof data.match.levelstring,
"%.32s %.32s * %s *",
mapheaderinfo[prevmap]->lvlttl, mapheaderinfo[prevmap]->zonttl, mapheaderinfo[prevmap]->actnum);
else
snprintf(data.match.levelstring,
sizeof data.match.levelstring,
"* %.32s %.32s *",
mapheaderinfo[prevmap]->lvlttl, mapheaderinfo[prevmap]->zonttl);
}
else
{
if (strlen(mapheaderinfo[prevmap]->actnum) > 0)
snprintf(data.match.levelstring,
sizeof data.match.levelstring,
"%.32s * %s *",
mapheaderinfo[prevmap]->lvlttl, mapheaderinfo[prevmap]->actnum);
else
snprintf(data.match.levelstring,
sizeof data.match.levelstring,
"* %.32s *",
mapheaderinfo[prevmap]->lvlttl);
}
data.match.levelstring[sizeof data.match.levelstring - 1] = '\0';
// get RESULT header
data.match.result =
W_CachePatchName("RESULT", PU_STATIC);
bgtile = W_CachePatchName("SRB2BACK", PU_STATIC);
usetile = true;
useinterpic = false;
S_ChangeMusicInternal("racent", true); // loop it
break;
}
case int_race: // (time-only race)
{
if ((!modifiedgame || savemoddata) && !multiplayer && !demoplayback) // remove this once we have a proper time attack screen
{
// setup time data
data.coop.tics = players[consoleplayer].realtime;
// Update visitation flags
mapvisited[gamemap-1] |= MV_BEATEN;
if (ALL7EMERALDS(emeralds))
@ -1326,43 +1322,6 @@ void Y_StartIntermission(void)
// Calculate who won
Y_CalculateTournamentPoints();
// set up the levelstring
if (strlen(mapheaderinfo[prevmap]->zonttl) > 0)
{
if (strlen(mapheaderinfo[prevmap]->actnum) > 0)
snprintf(data.match.levelstring,
sizeof data.match.levelstring,
"%.32s %.32s * %s *",
mapheaderinfo[prevmap]->lvlttl, mapheaderinfo[prevmap]->zonttl, mapheaderinfo[prevmap]->actnum);
else
snprintf(data.match.levelstring,
sizeof data.match.levelstring,
"* %.32s %.32s *",
mapheaderinfo[prevmap]->lvlttl, mapheaderinfo[prevmap]->zonttl);
}
else
{
if (strlen(mapheaderinfo[prevmap]->actnum) > 0)
snprintf(data.match.levelstring,
sizeof data.match.levelstring,
"%.32s * %s *",
mapheaderinfo[prevmap]->lvlttl, mapheaderinfo[prevmap]->actnum);
else
snprintf(data.match.levelstring,
sizeof data.match.levelstring,
"* %.32s *",
mapheaderinfo[prevmap]->lvlttl);
}
data.match.levelstring[sizeof data.match.levelstring - 1] = '\0';
// get RESULT header
//data.match.result = W_CachePatchName("RESULT", PU_STATIC);
bgtile = W_CachePatchName("SRB2BACK", PU_STATIC);
usetile = true;
useinterpic = false;
break;
}
@ -1433,63 +1392,42 @@ void Y_StartIntermission(void)
default:
break;
}
}
//
// Y_CalculateMatchWinners
//
static void Y_CalculateMatchWinners(void)
{
INT32 i, j;
boolean completed[MAXPLAYERS];
INT32 numplayersingame = 0;
// Initialize variables
for (j = 0; j < MAXPLAYERS; j++)
data.match.scores[j] = UINT32_MAX;
memset(data.match.color, 0, sizeof (data.match.color));
memset(data.match.character, 0, sizeof (data.match.character));
memset(completed, 0, sizeof (completed));
data.match.numplayers = 0;
i = j = 0;
for (i = 0; i < MAXPLAYERS; i++)
if (intertype == int_race || intertype == int_match)
{
if (!playeringame[i] || players[i].spectator)
continue;
numplayersingame++;
}
for (j = 0; j < numplayersingame; j++)
{
for (i = 0; i < MAXPLAYERS; i++)
// set up the levelstring
if (strlen(mapheaderinfo[prevmap]->zonttl) > 0)
{
if (!playeringame[i] || players[i].spectator || completed[i])
continue;
if (data.match.scores[data.match.numplayers] == UINT32_MAX || players[i].score > data.match.scores[data.match.numplayers])
{
data.match.scores[data.match.numplayers] = ((players[i].pflags & PF_TIMEOVER)
? 0 : players[i].score);
data.match.num[data.match.numplayers] = i;
}
if (strlen(mapheaderinfo[prevmap]->actnum) > 0)
snprintf(data.match.levelstring,
sizeof data.match.levelstring,
"* %.32s %.32s %s *",
mapheaderinfo[prevmap]->lvlttl, mapheaderinfo[prevmap]->zonttl, mapheaderinfo[prevmap]->actnum);
else
snprintf(data.match.levelstring,
sizeof data.match.levelstring,
"* %.32s %.32s *",
mapheaderinfo[prevmap]->lvlttl, mapheaderinfo[prevmap]->zonttl);
}
else
{
if (strlen(mapheaderinfo[prevmap]->actnum) > 0)
snprintf(data.match.levelstring,
sizeof data.match.levelstring,
"* %.32s %s *",
mapheaderinfo[prevmap]->lvlttl, mapheaderinfo[prevmap]->actnum);
else
snprintf(data.match.levelstring,
sizeof data.match.levelstring,
"* %.32s *",
mapheaderinfo[prevmap]->lvlttl);
}
i = data.match.num[data.match.numplayers];
data.match.levelstring[sizeof data.match.levelstring - 1] = '\0';
completed[i] = true;
data.match.color[data.match.numplayers] = &players[i].skincolor;
data.match.character[data.match.numplayers] = &players[i].skin;
data.match.name[data.match.numplayers] = player_names[i];
if (data.match.numplayers && (data.match.scores[data.match.numplayers] == data.match.scores[data.match.numplayers-1]))
data.match.pos[data.match.numplayers] = data.match.pos[data.match.numplayers-1];
else
data.match.pos[data.match.numplayers] = data.match.numplayers+1;
data.match.numplayers++;
bgtile = W_CachePatchName("SRB2BACK", PU_STATIC);
usetile = true;
useinterpic = false;
}
}
@ -1655,7 +1593,7 @@ static void Y_CalculateTimeRaceWinners(void)
completed[winner] = true;
data.competition.numplayers++;
}
}*/
}
// ============
// COOP BONUSES
@ -1683,7 +1621,8 @@ static void Y_SetTimeBonus(player_t *player, y_bonus_t *bstruct)
bstruct->display = true;
// calculate time bonus
secs = player->realtime / TICRATE;
secs = player->realtime / TICRATE;*/
#if 0
if (secs < 30) /* :30 */ bonus = 100000;
else if (secs < 45) /* :45 */ bonus = 50000;
else if (secs < 60) /* 1:00 */ bonus = 10000;
@ -1698,7 +1637,8 @@ static void Y_SetTimeBonus(player_t *player, y_bonus_t *bstruct)
else if (secs < 540) /* 9:00 */ bonus = 200;
else if (secs < 600) /* 10:00 */ bonus = 100;
else /* TIME TAKEN: TOO LONG */ bonus = 0;
bstruct->points = bonus;
#endif
/*bstruct->points = bonus;
}
//
@ -1714,14 +1654,14 @@ static void Y_SetRingBonus(player_t *player, y_bonus_t *bstruct)
//
// Y_SetLinkBonus
//
/*
static void Y_SetLinkBonus(player_t *player, y_bonus_t *bstruct) // SRB2kart - unused.
{
strncpy(bstruct->patch, "YB_LINK", sizeof(bstruct->patch));
bstruct->display = true;
bstruct->points = max(0, (player->maxlink - 1) * 100);
}
*/
//
// Y_SetGuardBonus
@ -1802,7 +1742,7 @@ bonus_f bonuses_list[4][4] = {
};
/* // SRB2kart 230117 - Replaced with Y_CalculateTournamentPoints
// SRB2kart 230117 - Replaced with Y_CalculateTournamentPoints
//
// Y_AwardCoopBonuses
//
@ -1908,8 +1848,9 @@ static void Y_CalculateTournamentPoints(void)
INT32 numplayersingame = 0;
// Initialize variables
data.match.rankingsmode = false;
for (j = 0; j < MAXPLAYERS; j++)
data.match.time[j] = (tic_t)UINT32_MAX;
data.match.val[j] = UINT32_MAX;
memset(data.match.color, 0, sizeof (data.match.color));
memset(data.match.character, 0, sizeof (data.match.character));
memset(data.match.increase, 0, sizeof (data.match.increase));
@ -1928,17 +1869,17 @@ static void Y_CalculateTournamentPoints(void)
{
for (i = 0; i < MAXPLAYERS; i++)
{
tic_t timeval;
UINT32 timeval;
if (!playeringame[i] || players[i].spectator || completed[i])
continue;
timeval = ((players[i].pflags & PF_TIMEOVER || players[i].realtime == (tic_t)UINT32_MAX)
? (tic_t)(UINT32_MAX-1) : players[i].realtime);
timeval = ((players[i].pflags & PF_TIMEOVER || players[i].realtime == UINT32_MAX)
? (UINT32_MAX-1) : players[i].realtime);
if (timeval < data.match.time[data.match.numplayers])
if (timeval < data.match.val[data.match.numplayers])
{
data.match.time[data.match.numplayers] = timeval;
data.match.val[data.match.numplayers] = timeval;
data.match.num[data.match.numplayers] = i;
}
}
@ -1951,12 +1892,12 @@ static void Y_CalculateTournamentPoints(void)
data.match.character[data.match.numplayers] = &players[i].skin;
data.match.name[data.match.numplayers] = player_names[i];
if (data.match.numplayers && (data.match.time[data.match.numplayers] == data.match.time[data.match.numplayers-1]))
if (data.match.numplayers && (data.match.val[data.match.numplayers] == data.match.val[data.match.numplayers-1]))
data.match.pos[data.match.numplayers] = data.match.pos[data.match.numplayers-1];
else
data.match.pos[data.match.numplayers] = data.match.numplayers+1;
if (data.match.time[data.match.numplayers] != (tic_t)(UINT32_MAX-1))
if (!(players[i].pflags & PF_TIMEOVER))
data.match.increase[data.match.numplayers] = numplayersingame - data.match.pos[data.match.numplayers];
players[i].score += data.match.increase[data.match.numplayers];
data.match.scores[data.match.numplayers] = players[i].score;
@ -1965,6 +1906,136 @@ static void Y_CalculateTournamentPoints(void)
}
}
//
// Y_CalculateMatchWinners
//
static void Y_CalculateMatchWinners(void)
{
INT32 i, j;
boolean completed[MAXPLAYERS];
INT32 numplayersingame = 0;
// Initialize variables
data.match.rankingsmode = false;
for (j = 0; j < MAXPLAYERS; j++)
data.match.val[j] = UINT32_MAX;
memset(data.match.color, 0, sizeof (data.match.color));
memset(data.match.character, 0, sizeof (data.match.character));
memset(data.match.increase, 0, sizeof (data.match.increase));
memset(completed, 0, sizeof (completed));
data.match.numplayers = 0;
for (i = 0; i < MAXPLAYERS; i++)
{
if (!playeringame[i] || players[i].spectator)
continue;
numplayersingame++;
}
for (j = 0; j < numplayersingame; j++)
{
for (i = 0; i < MAXPLAYERS; i++)
{
UINT32 marescoreval;
if (!playeringame[i] || players[i].spectator || completed[i])
continue;
marescoreval = ((players[i].pflags & PF_TIMEOVER)
? (UINT32_MAX-1) : players[i].marescore);
if (data.match.val[data.match.numplayers] == UINT32_MAX
|| (!(players[i].pflags & PF_TIMEOVER) && marescoreval > data.match.val[data.match.numplayers]))
{
data.match.val[data.match.numplayers] = marescoreval;
data.match.num[data.match.numplayers] = i;
}
}
i = data.match.num[data.match.numplayers];
completed[i] = true;
data.match.color[data.match.numplayers] = &players[i].skincolor;
data.match.character[data.match.numplayers] = &players[i].skin;
data.match.name[data.match.numplayers] = player_names[i];
if (data.match.numplayers && (data.match.val[data.match.numplayers] == data.match.val[data.match.numplayers-1]))
data.match.pos[data.match.numplayers] = data.match.pos[data.match.numplayers-1];
else
data.match.pos[data.match.numplayers] = data.match.numplayers+1;
if (!(players[i].pflags & PF_TIMEOVER))
data.match.increase[data.match.numplayers] = numplayersingame - data.match.pos[data.match.numplayers];
players[i].score += data.match.increase[data.match.numplayers];
data.match.scores[data.match.numplayers] = players[i].score;
data.match.numplayers++;
}
}
//
// Y_MakeRankingsTable
//
static void Y_MakeRankingsTable(void)
{
INT32 i, j;
boolean completed[MAXPLAYERS];
INT32 numplayersingame = 0;
// Initialize variables
data.match.rankingsmode = true;
for (j = 0; j < MAXPLAYERS; j++)
data.match.scores[j] = UINT32_MAX;
memset(data.match.color, 0, sizeof (data.match.color));
memset(data.match.character, 0, sizeof (data.match.character));
memset(completed, 0, sizeof (completed));
data.match.numplayers = 0;
for (i = 0; i < MAXPLAYERS; i++)
{
if (!playeringame[i] || players[i].spectator)
continue;
numplayersingame++;
}
for (j = 0; j < numplayersingame; j++)
{
for (i = 0; i < MAXPLAYERS; i++)
{
if (!playeringame[i] || players[i].spectator || completed[i])
continue;
if (data.match.scores[data.match.numplayers] == UINT32_MAX || players[i].score > data.match.scores[data.match.numplayers])
{
data.match.scores[data.match.numplayers] = players[i].score;
data.match.num[data.match.numplayers] = i;
}
}
i = data.match.num[data.match.numplayers];
completed[i] = true;
data.match.color[data.match.numplayers] = &players[i].skincolor;
data.match.character[data.match.numplayers] = &players[i].skin;
data.match.name[data.match.numplayers] = player_names[i];
if (data.match.numplayers && (data.match.scores[data.match.numplayers] == data.match.scores[data.match.numplayers-1]))
data.match.pos[data.match.numplayers] = data.match.pos[data.match.numplayers-1];
else
data.match.pos[data.match.numplayers] = data.match.numplayers+1;
data.match.numplayers++;
}
snprintf(data.match.levelstring,
sizeof data.match.levelstring,
"* Total Rankings *");
}
// ======
//
@ -1975,6 +2046,7 @@ void Y_EndIntermission(void)
Y_UnloadData();
endtic = -1;
sorttic = -1;
intertype = int_none;
usebuffer = false;
}
@ -2056,9 +2128,8 @@ static void Y_UnloadData(void)
UNLOAD(bgtile);
UNLOAD(interpic);
switch (intertype)
/*switch (intertype)
{
/*
case int_coop:
// unload the coop and single player patches
UNLOAD(data.coop.ttlnum);
@ -2076,17 +2147,14 @@ static void Y_UnloadData(void)
UNLOAD(data.spec.pscore);
UNLOAD(data.spec.pcontinues);
break;
*/
case int_match:
case int_race:
UNLOAD(data.match.result);
break;
default:
//without this default,
//int_none, int_tag, int_chaos, and int_classicrace
//are not handled
break;
}
}*/
}
// SRB2Kart: Voting!
@ -2317,7 +2385,7 @@ void Y_VoteDrawer(void)
SINT8 deferredlevel = 0;
static void Y_VoteStops(SINT8 pick, SINT8 level)
{
if (P_IsLocalPlayer(&players[pick]))
if (!splitscreen && pick == consoleplayer)
S_StartSound(NULL, sfx_yeeeah);
else
S_StartSound(NULL, sfx_kc48);