* If cv_playersforexit != "One", add a count of the number of players required to exit to the end tally.

* Make the default value of cv_playersforexit "All".
* Correct the greying out of the lives counter for cv_cooplives == "Single pool" to only be when you can't respawn.
This commit is contained in:
toasterbabe 2017-07-04 14:58:58 +01:00
parent 0bf676498a
commit f809923f69
2 changed files with 38 additions and 4 deletions

View File

@ -360,7 +360,7 @@ consvar_t cv_cooplives = {"cooplives", "Avoid Game Over", CV_NETVAR|CV_CALL|CV_C
static CV_PossibleValue_t advancemap_cons_t[] = {{0, "Off"}, {1, "Next"}, {2, "Random"}, {0, NULL}};
consvar_t cv_advancemap = {"advancemap", "Next", CV_NETVAR, advancemap_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
static CV_PossibleValue_t playersforexit_cons_t[] = {{0, "One"}, {1, "1/4"}, {2, "Half"}, {3, "3/4"}, {4, "All"}, {0, NULL}};
consvar_t cv_playersforexit = {"playersforexit", "One", CV_NETVAR, playersforexit_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_playersforexit = {"playersforexit", "All", CV_NETVAR, playersforexit_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_runscripts = {"runscripts", "Yes", 0, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};

View File

@ -742,6 +742,7 @@ static void ST_drawLives(void)
case 3:
{
INT32 i, sum = 0;
boolean canrespawn = (stplyr->lives > 0);
for (i = 0; i < MAXPLAYERS; i++)
{
if (!playeringame[i])
@ -750,11 +751,14 @@ static void ST_drawLives(void)
if (players[i].lives < 1)
continue;
if (players[i].lives > 1)
canrespawn = true;
sum += (players[i].lives);
}
V_DrawRightAlignedString(hudinfo[HUD_LIVESNUM].x, hudinfo[HUD_LIVESNUM].y + (v_splitflag ? -4 : 0),
V_SNAPTOLEFT|V_SNAPTOBOTTOM|((stplyr->lives > 0) ? V_HUDTRANS : V_HUDTRANSHALF)|v_splitflag,
va("%d",(sum)));
V_SNAPTOLEFT|V_SNAPTOBOTTOM|(canrespawn ? V_HUDTRANS : V_HUDTRANSHALF)|v_splitflag,
va("%d",sum));
return;
}
case 2:
@ -1993,7 +1997,37 @@ static void ST_overlayDrawer(void)
if (!hu_showscores && (netgame || multiplayer) && displayplayer == consoleplayer)
{
if (!splitscreen && ((stplyr->exiting && (gametype != GT_COOP || cv_playersforexit.value)) || (gametype != GT_COOP && G_GametypeUsesLives() && stplyr->lives <= 0)) && countdown != 1)
if (stplyr->exiting && cv_playersforexit.value && gametype == GT_COOP)
{
INT32 i, total = 0, exiting = 0;
for (i = 0; i < MAXPLAYERS; i++)
{
if (!playeringame[i] || players[i].spectator)
continue;
if (players[i].lives <= 0)
continue;
total++;
if (players[i].exiting)
exiting++;
}
total *= cv_playersforexit.value;
if (total % 4) total += 4; // round up
total /= 4;
if (exiting >= total)
;
else
{
total -= exiting;
V_DrawCenteredString(BASEVIDWIDTH/2, STRINGY(124), 0, va(M_GetText("%d more player%s required to exit."), total, ((total == 1) ? "" : "s")));
if (!splitscreen)
V_DrawCenteredString(BASEVIDWIDTH/2, 132, 0, M_GetText("Press F12 to watch another player."));
}
}
else if (!splitscreen && gametype != GT_COOP && (stplyr->exiting || (G_GametypeUsesLives() && stplyr->lives <= 0 && countdown != 1)))
V_DrawCenteredString(BASEVIDWIDTH/2, 132, 0, M_GetText("Press F12 to watch another player."));
else if (gametype == GT_HIDEANDSEEK &&
(!stplyr->spectator && !(stplyr->pflags & PF_TAGIT)) && (leveltime > hidetime * TICRATE))