Merge branch 'hud-cleaning' into 'master'

Hud cleaning

See merge request STJr/SRB2Internal!170
This commit is contained in:
Monster Iestyn 2018-08-29 16:22:48 -04:00
commit 28bbe71c57
9 changed files with 175 additions and 136 deletions

View file

@ -382,7 +382,7 @@ typedef struct player_s
fixed_t height; // Bounding box changes. fixed_t height; // Bounding box changes.
fixed_t spinheight; fixed_t spinheight;
SINT8 lives; SINT8 lives; // number of lives - if == INFLIVES, the player has infinite lives
SINT8 continues; // continues that player has acquired SINT8 continues; // continues that player has acquired
SINT8 xtralife; // Ring Extra Life counter SINT8 xtralife; // Ring Extra Life counter
@ -500,4 +500,7 @@ typedef struct player_s
#endif #endif
} player_t; } player_t;
// Value for infinite lives
#define INFLIVES 0x7F
#endif #endif

View file

@ -7614,6 +7614,9 @@ struct {
{"WEP_RAIL",WEP_RAIL}, {"WEP_RAIL",WEP_RAIL},
{"NUM_WEAPONS",NUM_WEAPONS}, {"NUM_WEAPONS",NUM_WEAPONS},
// Value for infinite lives
{"INFLIVES", INFLIVES},
// Got Flags, for player->gotflag! // Got Flags, for player->gotflag!
// Used to be MF_ for some stupid reason, now they're GF_ to stop them looking like mobjflags // Used to be MF_ for some stupid reason, now they're GF_ to stop them looking like mobjflags
{"GF_REDFLAG",GF_REDFLAG}, {"GF_REDFLAG",GF_REDFLAG},

View file

@ -1275,7 +1275,7 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I
} }
} }
if (G_GametypeUsesLives() && !(gametype == GT_COOP && (cv_cooplives.value == 0 || cv_cooplives.value == 3)) && (players[tab[i].num].lives != 0x7f)) //show lives if (G_GametypeUsesLives() && !(gametype == GT_COOP && (cv_cooplives.value == 0 || cv_cooplives.value == 3)) && (players[tab[i].num].lives != INFLIVES)) //show lives
V_DrawRightAlignedString(x, y+4, V_ALLOWLOWERCASE|(greycheck ? V_60TRANS : 0), va("%dx", players[tab[i].num].lives)); V_DrawRightAlignedString(x, y+4, V_ALLOWLOWERCASE|(greycheck ? V_60TRANS : 0), va("%dx", players[tab[i].num].lives));
else if (G_TagGametype() && players[tab[i].num].pflags & PF_TAGIT) else if (G_TagGametype() && players[tab[i].num].pflags & PF_TAGIT)
{ {
@ -1413,7 +1413,7 @@ void HU_DrawDualTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scoreline
| (greycheck ? V_TRANSLUCENT : 0) | (greycheck ? V_TRANSLUCENT : 0)
| V_ALLOWLOWERCASE, name); | V_ALLOWLOWERCASE, name);
if (G_GametypeUsesLives() && !(gametype == GT_COOP && (cv_cooplives.value == 0 || cv_cooplives.value == 3)) && (players[tab[i].num].lives != 0x7f)) //show lives if (G_GametypeUsesLives() && !(gametype == GT_COOP && (cv_cooplives.value == 0 || cv_cooplives.value == 3)) && (players[tab[i].num].lives != INFLIVES)) //show lives
V_DrawRightAlignedString(x, y+4, V_ALLOWLOWERCASE, va("%dx", players[tab[i].num].lives)); V_DrawRightAlignedString(x, y+4, V_ALLOWLOWERCASE, va("%dx", players[tab[i].num].lives));
else if (G_TagGametype() && players[tab[i].num].pflags & PF_TAGIT) else if (G_TagGametype() && players[tab[i].num].pflags & PF_TAGIT)
V_DrawSmallScaledPatch(x-28, y-4, 0, tagico); V_DrawSmallScaledPatch(x-28, y-4, 0, tagico);

View file

@ -909,7 +909,7 @@ void Command_Setlives_f(void)
{ {
SINT8 lives = atoi(COM_Argv(1)); SINT8 lives = atoi(COM_Argv(1));
if (lives == -1) if (lives == -1)
players[consoleplayer].lives = 0x7f; // infinity! players[consoleplayer].lives = INFLIVES; // infinity!
else else
{ {
// P_GivePlayerLives does value clamping // P_GivePlayerLives does value clamping

View file

@ -5277,7 +5277,7 @@ static void M_PandorasBox(INT32 choice)
CV_StealthSetValue(&cv_dummyrings, max(players[consoleplayer].spheres, 0)); CV_StealthSetValue(&cv_dummyrings, max(players[consoleplayer].spheres, 0));
else else
CV_StealthSetValue(&cv_dummyrings, max(players[consoleplayer].rings, 0)); CV_StealthSetValue(&cv_dummyrings, max(players[consoleplayer].rings, 0));
if (players[consoleplayer].lives == 0x7f) if (players[consoleplayer].lives == INFLIVES)
CV_StealthSetValue(&cv_dummylives, -1); CV_StealthSetValue(&cv_dummylives, -1);
else else
CV_StealthSetValue(&cv_dummylives, players[consoleplayer].lives); CV_StealthSetValue(&cv_dummylives, players[consoleplayer].lives);
@ -6334,7 +6334,7 @@ skipsign:
y += 25; y += 25;
tempx = x + 10; tempx = x + 10;
if (savegameinfo[savetodraw].lives != 0x7f if (savegameinfo[savetodraw].lives != INFLIVES
&& savegameinfo[savetodraw].lives > 9) && savegameinfo[savetodraw].lives > 9)
tempx -= 4; tempx -= 4;
@ -6361,7 +6361,7 @@ skiplife:
V_DrawScaledPatch(tempx + 9, y + 2, 0, patch); V_DrawScaledPatch(tempx + 9, y + 2, 0, patch);
tempx += 16; tempx += 16;
if (savegameinfo[savetodraw].lives == 0x7f) if (savegameinfo[savetodraw].lives == INFLIVES)
V_DrawCharacter(tempx, y + 1, '\x16', false); V_DrawCharacter(tempx, y + 1, '\x16', false);
else else
V_DrawString(tempx, y, 0, va("%d", savegameinfo[savetodraw].lives)); V_DrawString(tempx, y, 0, va("%d", savegameinfo[savetodraw].lives));

View file

@ -2249,7 +2249,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget
if ((target->player->lives <= 1) && (netgame || multiplayer) && (gametype == GT_COOP) && (cv_cooplives.value == 0)) if ((target->player->lives <= 1) && (netgame || multiplayer) && (gametype == GT_COOP) && (cv_cooplives.value == 0))
; ;
else if (!target->player->bot && !target->player->spectator && !G_IsSpecialStage(gamemap) && (target->player->lives != 0x7f) else if (!target->player->bot && !target->player->spectator && !G_IsSpecialStage(gamemap) && (target->player->lives != INFLIVES)
&& G_GametypeUsesLives()) && G_GametypeUsesLives())
{ {
target->player->lives -= 1; // Lose a life Tails 03-11-2000 target->player->lives -= 1; // Lose a life Tails 03-11-2000

View file

@ -952,7 +952,7 @@ void P_GivePlayerRings(player_t *player, INT32 num_rings)
player->rings = 0; player->rings = 0;
// Now extra life bonuses are handled here instead of in P_MovePlayer, since why not? // Now extra life bonuses are handled here instead of in P_MovePlayer, since why not?
if (!ultimatemode && !modeattacking && !G_IsSpecialStage(gamemap) && G_GametypeUsesLives() && player->lives != 0x7f) if (!ultimatemode && !modeattacking && !G_IsSpecialStage(gamemap) && G_GametypeUsesLives() && player->lives != INFLIVES)
{ {
INT32 gainlives = 0; INT32 gainlives = 0;
@ -1011,7 +1011,7 @@ void P_GivePlayerLives(player_t *player, INT32 numlives)
if (gamestate == GS_LEVEL) if (gamestate == GS_LEVEL)
{ {
if (player->lives == 0x7f || (gametype != GT_COOP && gametype != GT_COMPETITION)) if (player->lives == INFLIVES || (gametype != GT_COOP && gametype != GT_COMPETITION))
{ {
P_GivePlayerRings(player, 100*numlives); P_GivePlayerRings(player, 100*numlives);
return; return;
@ -8401,7 +8401,7 @@ boolean P_GetLives(player_t *player)
if (!(netgame || multiplayer) if (!(netgame || multiplayer)
|| (gametype != GT_COOP) || (gametype != GT_COOP)
|| (cv_cooplives.value == 1) || (cv_cooplives.value == 1)
|| (player->lives == 0x7f)) || (player->lives == INFLIVES))
return true; return true;
if ((cv_cooplives.value == 2 || cv_cooplives.value == 0) && player->lives > 0) if ((cv_cooplives.value == 2 || cv_cooplives.value == 0) && player->lives > 0)
@ -8428,7 +8428,7 @@ boolean P_GetLives(player_t *player)
{ {
if (cv_cooplives.value == 2 && (P_IsLocalPlayer(player) || P_IsLocalPlayer(&players[maxlivesplayer]))) if (cv_cooplives.value == 2 && (P_IsLocalPlayer(player) || P_IsLocalPlayer(&players[maxlivesplayer])))
S_StartSound(NULL, sfx_jshard); // placeholder S_StartSound(NULL, sfx_jshard); // placeholder
if (players[maxlivesplayer].lives != 0x7f) if (players[maxlivesplayer].lives != INFLIVES)
players[maxlivesplayer].lives--; players[maxlivesplayer].lives--;
player->lives++; player->lives++;
if (player->lives < 1) if (player->lives < 1)

View file

@ -807,7 +807,7 @@ static void ST_drawLivesArea(void)
// lives number // lives number
if (gametype == GT_RACE) if (gametype == GT_RACE)
{ {
livescount = 0x7f; livescount = INFLIVES;
notgreyedout = true; notgreyedout = true;
} }
else if ((netgame || multiplayer) && gametype == GT_COOP && cv_cooplives.value == 3) else if ((netgame || multiplayer) && gametype == GT_COOP && cv_cooplives.value == 3)
@ -826,9 +826,9 @@ static void ST_drawLivesArea(void)
if (players[i].lives > 1) if (players[i].lives > 1)
notgreyedout = true; notgreyedout = true;
if (players[i].lives == 0x7f) if (players[i].lives == INFLIVES)
{ {
livescount = 0x7f; livescount = INFLIVES;
break; break;
} }
else if (livescount < 99) else if (livescount < 99)
@ -837,11 +837,11 @@ static void ST_drawLivesArea(void)
} }
else else
{ {
livescount = (((netgame || multiplayer) && gametype == GT_COOP && cv_cooplives.value == 0) ? 0x7f : stplyr->lives); livescount = (((netgame || multiplayer) && gametype == GT_COOP && cv_cooplives.value == 0) ? INFLIVES : stplyr->lives);
notgreyedout = true; notgreyedout = true;
} }
if (livescount == 0x7f) if (livescount == INFLIVES)
V_DrawCharacter(hudinfo[HUD_LIVES].x+50, hudinfo[HUD_LIVES].y+8, V_DrawCharacter(hudinfo[HUD_LIVES].x+50, hudinfo[HUD_LIVES].y+8,
'\x16' | 0x80 | hudinfo[HUD_LIVES].f|V_PERPLAYER|V_HUDTRANS, false); '\x16' | 0x80 | hudinfo[HUD_LIVES].f|V_PERPLAYER|V_HUDTRANS, false);
else else
@ -1205,6 +1205,10 @@ static void ST_drawPowerupHUD(void)
if (stplyr->spectator || stplyr->playerstate != PST_LIVE) if (stplyr->spectator || stplyr->playerstate != PST_LIVE)
return; return;
// -------
// Shields
// -------
// Graue 06-18-2004: no V_NOSCALESTART, no SCX, no SCY, snap to right // Graue 06-18-2004: no V_NOSCALESTART, no SCX, no SCY, snap to right
if (stplyr->powers[pw_shield] & SH_NOSTACK) if (stplyr->powers[pw_shield] & SH_NOSTACK)
{ {
@ -1247,6 +1251,10 @@ static void ST_drawPowerupHUD(void)
offs -= shieldoffs[q]; offs -= shieldoffs[q];
// ---------
// CTF flags
// ---------
// YOU have a flag. Display a monitor-like icon for it. // YOU have a flag. Display a monitor-like icon for it.
if (stplyr->gotflag) if (stplyr->gotflag)
{ {
@ -1264,11 +1272,20 @@ static void ST_drawPowerupHUD(void)
offs -= flagoffs[q]; offs -= flagoffs[q];
// --------------------
// Timer-based powerups
// --------------------
#define DRAWTIMERICON(patch, timer) \
V_DrawSmallScaledPatch(offs, hudinfo[HUD_POWERUPS].y, V_PERPLAYER|hudinfo[HUD_POWERUPS].f|V_HUDTRANS, patch); \
V_DrawRightAlignedThinString(offs + 16, hudinfo[HUD_POWERUPS].y + 8, V_PERPLAYER|hudinfo[HUD_POWERUPS].f, va("%d", timer/TICRATE));
// Invincibility, both from monitor and after being hit
invulntime = stplyr->powers[pw_flashing] ? stplyr->powers[pw_flashing] : stplyr->powers[pw_invulnerability]; invulntime = stplyr->powers[pw_flashing] ? stplyr->powers[pw_flashing] : stplyr->powers[pw_invulnerability];
// Note: pw_flashing always makes the icon flicker regardless of time, unlike pw_invulnerability
if (stplyr->powers[pw_invulnerability] > 3*TICRATE || (invulntime && leveltime & 1)) if (stplyr->powers[pw_invulnerability] > 3*TICRATE || (invulntime && leveltime & 1))
{ {
V_DrawSmallScaledPatch(offs, hudinfo[HUD_POWERUPS].y, V_PERPLAYER|hudinfo[HUD_POWERUPS].f|V_HUDTRANS, invincibility); DRAWTIMERICON(invincibility, invulntime)
V_DrawRightAlignedThinString(offs + 16, hudinfo[HUD_POWERUPS].y + 8, V_PERPLAYER|hudinfo[HUD_POWERUPS].f, va("%d", invulntime/TICRATE));
} }
if (invulntime > 7) if (invulntime > 7)
@ -1281,10 +1298,10 @@ static void ST_drawPowerupHUD(void)
offs -= a; offs -= a;
} }
// Super Sneakers
if (stplyr->powers[pw_sneakers] > 3*TICRATE || (stplyr->powers[pw_sneakers] && leveltime & 1)) if (stplyr->powers[pw_sneakers] > 3*TICRATE || (stplyr->powers[pw_sneakers] && leveltime & 1))
{ {
V_DrawSmallScaledPatch(offs, hudinfo[HUD_POWERUPS].y, V_PERPLAYER|hudinfo[HUD_POWERUPS].f|V_HUDTRANS, sneakers); DRAWTIMERICON(sneakers, stplyr->powers[pw_sneakers])
V_DrawRightAlignedThinString(offs + 16, hudinfo[HUD_POWERUPS].y + 8, V_PERPLAYER|hudinfo[HUD_POWERUPS].f, va("%d", stplyr->powers[pw_sneakers]/TICRATE));
} }
if (stplyr->powers[pw_sneakers] > 7) if (stplyr->powers[pw_sneakers] > 7)
@ -1297,12 +1314,13 @@ static void ST_drawPowerupHUD(void)
offs -= a; offs -= a;
} }
// Gravity Boots
if (stplyr->powers[pw_gravityboots] > 3*TICRATE || (stplyr->powers[pw_gravityboots] && leveltime & 1)) if (stplyr->powers[pw_gravityboots] > 3*TICRATE || (stplyr->powers[pw_gravityboots] && leveltime & 1))
{ {
V_DrawSmallScaledPatch(offs, hudinfo[HUD_POWERUPS].y, V_PERPLAYER|hudinfo[HUD_POWERUPS].f|V_HUDTRANS, gravboots); DRAWTIMERICON(gravboots, stplyr->powers[pw_gravityboots])
V_DrawRightAlignedThinString(offs + 16, hudinfo[HUD_POWERUPS].y + 8, V_PERPLAYER|hudinfo[HUD_POWERUPS].f, va("%d", stplyr->powers[pw_gravityboots]/TICRATE));
} }
#undef DRAWTIMERICON
#undef ICONSEP #undef ICONSEP
} }
@ -1361,60 +1379,64 @@ static void ST_drawNightsRecords(void)
if (stplyr->texttimer < TICRATE/2) if (stplyr->texttimer < TICRATE/2)
aflag |= (9 - 9*stplyr->texttimer/(TICRATE/2)) << V_ALPHASHIFT; aflag |= (9 - 9*stplyr->texttimer/(TICRATE/2)) << V_ALPHASHIFT;
// A "Bonus Time Start" by any other name... switch (stplyr->textvar)
if (stplyr->textvar == 1)
{ {
V_DrawCenteredString(BASEVIDWIDTH/2, 52, V_GREENMAP|aflag, M_GetText("GET TO THE GOAL!")); case 1: // A "Bonus Time Start" by any other name...
V_DrawCenteredString(BASEVIDWIDTH/2, 60, aflag, M_GetText("SCORE MULTIPLIER START!"));
if (stplyr->finishedtime)
{ {
V_DrawString(BASEVIDWIDTH/2 - 48, 140, aflag, "TIME:"); V_DrawCenteredString(BASEVIDWIDTH/2, 52, V_GREENMAP|aflag, M_GetText("GET TO THE GOAL!"));
V_DrawString(BASEVIDWIDTH/2 - 48, 148, aflag, "BONUS:"); V_DrawCenteredString(BASEVIDWIDTH/2, 60, aflag, M_GetText("SCORE MULTIPLIER START!"));
V_DrawRightAlignedString(BASEVIDWIDTH/2 + 48, 140, V_ORANGEMAP|aflag, va("%d", (stplyr->startedtime - stplyr->finishedtime)/TICRATE));
V_DrawRightAlignedString(BASEVIDWIDTH/2 + 48, 148, V_ORANGEMAP|aflag, va("%d", (stplyr->finishedtime/TICRATE) * 100)); if (stplyr->finishedtime)
{
V_DrawString(BASEVIDWIDTH/2 - 48, 140, aflag, "TIME:");
V_DrawString(BASEVIDWIDTH/2 - 48, 148, aflag, "BONUS:");
V_DrawRightAlignedString(BASEVIDWIDTH/2 + 48, 140, V_ORANGEMAP|aflag, va("%d", (stplyr->startedtime - stplyr->finishedtime)/TICRATE));
V_DrawRightAlignedString(BASEVIDWIDTH/2 + 48, 148, V_ORANGEMAP|aflag, va("%d", (stplyr->finishedtime/TICRATE) * 100));
}
break;
} }
} case 2: // Get n Spheres
case 3: // Get n more Spheres
// Get n [more] Spheres
else if (stplyr->textvar <= 3 && stplyr->textvar >= 2)
{
if (!stplyr->capsule)
return;
// Yes, this string is an abomination.
V_DrawCenteredString(BASEVIDWIDTH/2, 60, aflag,
va(M_GetText("\x80GET\x82 %d\x80 %s%s%s!"), stplyr->capsule->health,
(stplyr->textvar == 3) ? M_GetText("MORE ") : "",
(G_IsSpecialStage(gamemap)) ? "SPHERE" : "CHIP",
(stplyr->capsule->health > 1) ? "S" : ""));
}
// End Bonus
else if (stplyr->textvar == 4)
{
V_DrawString(BASEVIDWIDTH/2 - 56, 140, aflag, (G_IsSpecialStage(gamemap)) ? "SPHERES:" : "CHIPS:");
V_DrawString(BASEVIDWIDTH/2 - 56, 148, aflag, "BONUS:");
V_DrawRightAlignedString(BASEVIDWIDTH/2 + 56, 140, V_ORANGEMAP|aflag, va("%d", stplyr->finishedspheres));
V_DrawRightAlignedString(BASEVIDWIDTH/2 + 56, 148, V_ORANGEMAP|aflag, va("%d", stplyr->finishedspheres * 50));
ST_DrawNightsOverlayNum((BASEVIDWIDTH/2 + 56)<<FRACBITS, 160<<FRACBITS, FRACUNIT, aflag, stplyr->lastmarescore, nightsnum, SKINCOLOR_AZURE);
// If new record, say so!
if (!(netgame || multiplayer) && G_GetBestNightsScore(gamemap, stplyr->lastmare + 1) <= stplyr->lastmarescore)
{ {
if (stplyr->texttimer & 16) if (!stplyr->capsule)
V_DrawCenteredString(BASEVIDWIDTH/2, 184, V_YELLOWMAP|aflag, "* NEW RECORD *"); return;
}
if (P_HasGrades(gamemap, stplyr->lastmare + 1)) // Yes, this string is an abomination.
{ V_DrawCenteredString(BASEVIDWIDTH/2, 60, aflag,
if (aflag) va(M_GetText("\x80GET\x82 %d\x80 %s%s%s!"), stplyr->capsule->health,
V_DrawTranslucentPatch(BASEVIDWIDTH/2 + 60, 160, aflag, (stplyr->textvar == 3) ? M_GetText("MORE ") : "",
ngradeletters[P_GetGrade(stplyr->lastmarescore, gamemap, stplyr->lastmare)]); (G_IsSpecialStage(gamemap)) ? "SPHERE" : "CHIP",
else (stplyr->capsule->health > 1) ? "S" : ""));
V_DrawScaledPatch(BASEVIDWIDTH/2 + 60, 160, 0, break;
ngradeletters[P_GetGrade(stplyr->lastmarescore, gamemap, stplyr->lastmare)]);
} }
case 4: // End Bonus
{
V_DrawString(BASEVIDWIDTH/2 - 56, 140, aflag, (G_IsSpecialStage(gamemap)) ? "SPHERES:" : "CHIPS:");
V_DrawString(BASEVIDWIDTH/2 - 56, 148, aflag, "BONUS:");
V_DrawRightAlignedString(BASEVIDWIDTH/2 + 56, 140, V_ORANGEMAP|aflag, va("%d", stplyr->finishedspheres));
V_DrawRightAlignedString(BASEVIDWIDTH/2 + 56, 148, V_ORANGEMAP|aflag, va("%d", stplyr->finishedspheres * 50));
ST_DrawNightsOverlayNum((BASEVIDWIDTH/2 + 56)<<FRACBITS, 160<<FRACBITS, FRACUNIT, aflag, stplyr->lastmarescore, nightsnum, SKINCOLOR_AZURE);
// If new record, say so!
if (!(netgame || multiplayer) && G_GetBestNightsScore(gamemap, stplyr->lastmare + 1) <= stplyr->lastmarescore)
{
if (stplyr->texttimer & 16)
V_DrawCenteredString(BASEVIDWIDTH/2, 184, V_YELLOWMAP|aflag, "* NEW RECORD *");
}
if (P_HasGrades(gamemap, stplyr->lastmare + 1))
{
if (aflag)
V_DrawTranslucentPatch(BASEVIDWIDTH/2 + 60, 160, aflag,
ngradeletters[P_GetGrade(stplyr->lastmarescore, gamemap, stplyr->lastmare)]);
else
V_DrawScaledPatch(BASEVIDWIDTH/2 + 60, 160, 0,
ngradeletters[P_GetGrade(stplyr->lastmarescore, gamemap, stplyr->lastmare)]);
}
break;
}
default:
break;
} }
} }
@ -1450,20 +1472,60 @@ static skincolors_t linkColor[2][NUMLINKCOLORS] = {
{SKINCOLOR_SEAFOAM, SKINCOLOR_CYAN, SKINCOLOR_WAVE, SKINCOLOR_SAPPHIRE, SKINCOLOR_VAPOR, SKINCOLOR_BUBBLEGUM, {SKINCOLOR_SEAFOAM, SKINCOLOR_CYAN, SKINCOLOR_WAVE, SKINCOLOR_SAPPHIRE, SKINCOLOR_VAPOR, SKINCOLOR_BUBBLEGUM,
SKINCOLOR_VIOLET, SKINCOLOR_RUBY, SKINCOLOR_FLAME, SKINCOLOR_SUNSET, SKINCOLOR_SANDY, SKINCOLOR_LIME}}; SKINCOLOR_VIOLET, SKINCOLOR_RUBY, SKINCOLOR_FLAME, SKINCOLOR_SUNSET, SKINCOLOR_SANDY, SKINCOLOR_LIME}};
static void ST_drawNiGHTSLink(void)
{
static INT32 prevsel[2] = {0, 0}, prevtime[2] = {0, 0};
const UINT8 q = ((splitscreen && stplyr == &players[secondarydisplayplayer]) ? 1 : 0);
INT32 sel = ((stplyr->linkcount-1) / 5) % NUMLINKCOLORS, aflag = V_PERPLAYER, mag = ((stplyr->linkcount-1 >= 300) ? 1 : 0);
skincolors_t colornum;
fixed_t x, y, scale;
if (sel != prevsel[q])
{
prevsel[q] = sel;
prevtime[q] = 2 + mag;
}
if (stplyr->powers[pw_nights_linkfreeze] && (!(stplyr->powers[pw_nights_linkfreeze] & 2) || (stplyr->powers[pw_nights_linkfreeze] > flashingtics)))
colornum = SKINCOLOR_ICY;
else
colornum = linkColor[mag][sel];
aflag |= ((stplyr->linktimer < 2*TICRATE/3)
? (9 - 9*stplyr->linktimer/(2*TICRATE/3)) << V_ALPHASHIFT
: 0);
y = (160+11)<<FRACBITS;
aflag |= V_SNAPTOBOTTOM;
x = (160+4)<<FRACBITS;
if (prevtime[q])
{
scale = ((32 + prevtime[q])<<FRACBITS)/32;
prevtime[q]--;
}
else
scale = FRACUNIT;
y -= (11*scale);
ST_DrawNightsOverlayNum(x-(4*scale), y, scale, aflag, (stplyr->linkcount-1), nightsnum, colornum);
V_DrawFixedPatch(x+(4*scale), y, scale, aflag, nightslink,
colornum == 0 ? colormaps : R_GetTranslationColormap(TC_DEFAULT, colornum, GTC_CACHE));
// Show remaining link time left in debug
if (cv_debug & DBG_NIGHTSBASIC)
V_DrawCenteredString(BASEVIDWIDTH/2, 180, V_SNAPTOBOTTOM, va("End in %d.%02d", stplyr->linktimer/TICRATE, G_TicsToCentiseconds(stplyr->linktimer)));
}
static void ST_drawNiGHTSHUD(void) static void ST_drawNiGHTSHUD(void)
{ {
INT32 origamount; INT32 origamount;
INT32 minlink = 1;
INT32 total_spherecount; INT32 total_spherecount;
const boolean oldspecialstage = (G_IsSpecialStage(gamemap) && !(maptol & TOL_NIGHTS)); const boolean oldspecialstage = (G_IsSpecialStage(gamemap) && !(maptol & TOL_NIGHTS));
// Cheap hack: don't display when the score is showing (it popping up for a split second when exiting a map is intentional)
if (oldspecialstage || (stplyr->texttimer && stplyr->textvar == 4))
minlink = INT32_MAX;
// When debugging, show "0 Link".
else if (cv_debug & DBG_NIGHTSBASIC)
minlink = 0;
// Drill meter // Drill meter
if ( if (
#ifdef HAVE_BLUA #ifdef HAVE_BLUA
@ -1508,55 +1570,15 @@ static void ST_drawNiGHTSHUD(void)
}*/ }*/
// Link drawing // Link drawing
if ( if (!oldspecialstage
// Don't display when the score is showing (it popping up for a split second when exiting a map is intentional)
&& !(stplyr->texttimer && stplyr->textvar == 4)
#ifdef HAVE_BLUA #ifdef HAVE_BLUA
LUA_HudEnabled(hud_nightslink) && && LUA_HudEnabled(hud_nightslink)
#endif #endif
stplyr->linkcount > minlink) && ((cv_debug & DBG_NIGHTSBASIC) || stplyr->linkcount > 1)) // When debugging, show "0 Link".
{ {
static INT32 prevsel[2] = {0, 0}, prevtime[2] = {0, 0}; ST_drawNiGHTSLink();
const UINT8 q = ((splitscreen && stplyr == &players[secondarydisplayplayer]) ? 1 : 0);
INT32 sel = ((stplyr->linkcount-1) / 5) % NUMLINKCOLORS, aflag = V_PERPLAYER, mag = ((stplyr->linkcount-1 >= 300) ? 1 : 0);
skincolors_t colornum;
fixed_t x, y, scale;
if (sel != prevsel[q])
{
prevsel[q] = sel;
prevtime[q] = 2 + mag;
}
if (stplyr->powers[pw_nights_linkfreeze] && (!(stplyr->powers[pw_nights_linkfreeze] & 2) || (stplyr->powers[pw_nights_linkfreeze] > flashingtics)))
colornum = SKINCOLOR_ICY;
else
colornum = linkColor[mag][sel];
aflag |= ((stplyr->linktimer < 2*TICRATE/3)
? (9 - 9*stplyr->linktimer/(2*TICRATE/3)) << V_ALPHASHIFT
: 0);
y = (160+11)<<FRACBITS;
aflag |= V_SNAPTOBOTTOM;
x = (160+4)<<FRACBITS;
if (prevtime[q])
{
scale = ((32 + prevtime[q])<<FRACBITS)/32;
prevtime[q]--;
}
else
scale = FRACUNIT;
y -= (11*scale);
ST_DrawNightsOverlayNum(x-(4*scale), y, scale, aflag, (stplyr->linkcount-1), nightsnum, colornum);
V_DrawFixedPatch(x+(4*scale), y, scale, aflag, nightslink,
colornum == 0 ? colormaps : R_GetTranslationColormap(TC_DEFAULT, colornum, GTC_CACHE));
// Show remaining link time left in debug
if (cv_debug & DBG_NIGHTSBASIC)
V_DrawCenteredString(BASEVIDWIDTH/2, 180, V_SNAPTOBOTTOM, va("End in %d.%02d", stplyr->linktimer/TICRATE, G_TicsToCentiseconds(stplyr->linktimer)));
} }
if (gametype == GT_RACE || gametype == GT_COMPETITION) if (gametype == GT_RACE || gametype == GT_COMPETITION)
@ -2448,15 +2470,26 @@ void ST_Drawer(void)
#ifdef SEENAMES #ifdef SEENAMES
if (cv_seenames.value && cv_allowseenames.value && displayplayer == consoleplayer && seenplayer && seenplayer->mo) if (cv_seenames.value && cv_allowseenames.value && displayplayer == consoleplayer && seenplayer && seenplayer->mo)
{ {
if (cv_seenames.value == 1) INT32 c = 0;
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT/2 + 15, V_HUDTRANSHALF, player_names[seenplayer-players]); switch (cv_seenames.value)
else if (cv_seenames.value == 2) {
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT/2 + 15, V_HUDTRANSHALF, case 1: // Colorless
va("%s%s", G_GametypeHasTeams() ? ((seenplayer->ctfteam == 1) ? "\x85" : "\x84") : "", player_names[seenplayer-players])); break;
else //if (cv_seenames.value == 3) case 2: // Team
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT/2 + 15, V_HUDTRANSHALF, if (G_GametypeHasTeams())
va("%s%s", !G_RingSlingerGametype() || (G_GametypeHasTeams() && players[consoleplayer].ctfteam == seenplayer->ctfteam) c = (seenplayer->ctfteam == 1) ? V_REDMAP : V_BLUEMAP;
? "\x83" : "\x85", player_names[seenplayer-players])); break;
case 3: // Ally/Foe
default:
// Green = Ally, Red = Foe
if (G_GametypeHasTeams())
c = (players[consoleplayer].ctfteam == seenplayer->ctfteam) ? V_GREENMAP : V_REDMAP;
else // Everyone is an ally, or everyone is a foe!
c = (G_RingSlingerGametype()) ? V_REDMAP : V_GREENMAP;
break;
}
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT/2 + 15, V_HUDTRANSHALF|c, player_names[seenplayer-players]);
} }
#endif #endif

View file

@ -1875,7 +1875,7 @@ static void Y_AwardCoopBonuses(void)
} }
ptlives = min( ptlives = min(
((!ultimatemode && !modeattacking && players[i].lives != 0x7f) ? max((players[i].score/50000) - (oldscore/50000), 0) : 0), ((!ultimatemode && !modeattacking && players[i].lives != INFLIVES) ? max((players[i].score/50000) - (oldscore/50000), 0) : 0),
(mapheaderinfo[prevmap]->maxbonuslives < 0 ? INT32_MAX : mapheaderinfo[prevmap]->maxbonuslives)); (mapheaderinfo[prevmap]->maxbonuslives < 0 ? INT32_MAX : mapheaderinfo[prevmap]->maxbonuslives));
if (ptlives) if (ptlives)
P_GivePlayerLives(&players[i], ptlives); P_GivePlayerLives(&players[i], ptlives);
@ -1921,7 +1921,7 @@ static void Y_AwardSpecialStageBonus(void)
// grant extra lives right away since tally is faked // grant extra lives right away since tally is faked
ptlives = min( ptlives = min(
((!ultimatemode && !modeattacking && players[i].lives != 0x7f) ? max((players[i].score/50000) - (oldscore/50000), 0) : 0), ((!ultimatemode && !modeattacking && players[i].lives != INFLIVES) ? max((players[i].score/50000) - (oldscore/50000), 0) : 0),
(mapheaderinfo[prevmap]->maxbonuslives < 0 ? INT32_MAX : mapheaderinfo[prevmap]->maxbonuslives)); (mapheaderinfo[prevmap]->maxbonuslives < 0 ? INT32_MAX : mapheaderinfo[prevmap]->maxbonuslives));
if (ptlives) if (ptlives)
P_GivePlayerLives(&players[i], ptlives); P_GivePlayerLives(&players[i], ptlives);