Tweak some HUD stuff, including a more consistent application of MAXSCORE.

This commit is contained in:
toasterbabe 2017-09-25 20:35:04 +01:00
parent f0ce22edb6
commit 9446fe6cd6
5 changed files with 25 additions and 13 deletions

View File

@ -28,7 +28,7 @@
#define VIEWHEIGHTS "41" #define VIEWHEIGHTS "41"
// Maximum player score. // Maximum player score.
#define MAXSCORE 999999990 #define MAXSCORE 99999990 // 999999990
// mapblocks are used to check movement // mapblocks are used to check movement
// against lines and things // against lines and things
@ -140,7 +140,7 @@ boolean P_IsObjectOnGround(mobj_t *mo);
boolean P_IsObjectOnGroundIn(mobj_t *mo, sector_t *sec); boolean P_IsObjectOnGroundIn(mobj_t *mo, sector_t *sec);
boolean P_InSpaceSector(mobj_t *mo); boolean P_InSpaceSector(mobj_t *mo);
boolean P_InQuicksand(mobj_t *mo); boolean P_InQuicksand(mobj_t *mo);
boolean P_PlayerHitFloor(player_t *player); boolean P_PlayerHitFloor(player_t *player, boolean dorollstuff);
void P_SetObjectMomZ(mobj_t *mo, fixed_t value, boolean relative); void P_SetObjectMomZ(mobj_t *mo, fixed_t value, boolean relative);
void P_RestoreMusic(player_t *player); void P_RestoreMusic(player_t *player);

View File

@ -1089,9 +1089,8 @@ void P_AddPlayerScore(player_t *player, UINT32 amount)
oldscore = player->score; oldscore = player->score;
// Don't go above MAXSCORE. // Don't go above MAXSCORE.
if (player->score + amount < MAXSCORE) player->score += amount;
player->score += amount; if (player->score > MAXSCORE)
else
player->score = MAXSCORE; player->score = MAXSCORE;
// check for extra lives every 50000 pts // check for extra lives every 50000 pts

View File

@ -132,22 +132,23 @@ hudinfo_t hudinfo[NUMHUDITEMS] =
{ 16, 42}, // HUD_RINGS { 16, 42}, // HUD_RINGS
{ 220, 10}, // HUD_RINGSSPLIT { 220, 10}, // HUD_RINGSSPLIT
{ 120, 42}, // HUD_RINGSNUM { 104, 42}, // HUD_RINGSNUM
{ 296, 10}, // HUD_RINGSNUMSPLIT { 296, 10}, // HUD_RINGSNUMSPLIT
{ 120, 42}, // HUD_RINGSNUMTICS
{ 16, 10}, // HUD_SCORE { 16, 10}, // HUD_SCORE
{ 120, 10}, // HUD_SCORENUM { 120, 10}, // HUD_SCORENUM
{ 16, 26}, // HUD_TIME { 16, 26}, // HUD_TIME
{ 128, 10}, // HUD_TIMESPLIT { 128, 10}, // HUD_TIMESPLIT
{ 96, 26}, // HUD_MINUTES { 72, 26}, // HUD_MINUTES
{ 188, 10}, // HUD_MINUTESSPLIT { 188, 10}, // HUD_MINUTESSPLIT
{ 96, 26}, // HUD_TIMECOLON { 72, 26}, // HUD_TIMECOLON
{ 188, 10}, // HUD_TIMECOLONSPLIT { 188, 10}, // HUD_TIMECOLONSPLIT
{ 120, 26}, // HUD_SECONDS { 96, 26}, // HUD_SECONDS
{ 212, 10}, // HUD_SECONDSSPLIT { 212, 10}, // HUD_SECONDSSPLIT
{ 120, 26}, // HUD_TIMETICCOLON { 96, 26}, // HUD_TIMETICCOLON
{ 144, 26}, // HUD_TICS { 120, 26}, // HUD_TICS
{ 120, 56}, // HUD_SS_TOTALRINGS { 120, 56}, // HUD_SS_TOTALRINGS
{ 296, 40}, // HUD_SS_TOTALRINGS_SPLIT { 296, 40}, // HUD_SS_TOTALRINGS_SPLIT
@ -663,7 +664,7 @@ static void ST_drawTime(void)
static inline void ST_drawRings(void) static inline void ST_drawRings(void)
{ {
INT32 ringnum = max(stplyr->rings, 0); INT32 ringnum;
ST_DrawPatchFromHudWS(HUD_RINGS, ((!stplyr->spectator && stplyr->rings <= 0 && leveltime/5 & 1) ? sboredrings : sborings), ((stplyr->spectator) ? V_HUDTRANSHALF : V_HUDTRANS)); ST_DrawPatchFromHudWS(HUD_RINGS, ((!stplyr->spectator && stplyr->rings <= 0 && leveltime/5 & 1) ? sboredrings : sborings), ((stplyr->spectator) ? V_HUDTRANSHALF : V_HUDTRANS));
@ -677,8 +678,13 @@ static inline void ST_drawRings(void)
if (playeringame[i] && players[i].mo && players[i].rings > 0) if (playeringame[i] && players[i].mo && players[i].rings > 0)
ringnum += players[i].rings; ringnum += players[i].rings;
} }
else
ringnum = max(stplyr->rings, 0);
ST_DrawNumFromHudWS(HUD_RINGSNUM, ringnum, ((stplyr->spectator) ? V_HUDTRANSHALF : V_HUDTRANS)); if (!splitscreen && (cv_timetic.value == 2 || modeattacking))
ST_DrawNumFromHud(HUD_RINGSNUMTICS, ringnum, ((stplyr->spectator) ? V_HUDTRANSHALF : V_HUDTRANS));
else
ST_DrawNumFromHudWS(HUD_RINGSNUM, ringnum, ((stplyr->spectator) ? V_HUDTRANSHALF : V_HUDTRANS));
} }
static void ST_drawLives(void) static void ST_drawLives(void)

View File

@ -86,6 +86,7 @@ typedef enum
HUD_RINGSSPLIT, HUD_RINGSSPLIT,
HUD_RINGSNUM, HUD_RINGSNUM,
HUD_RINGSNUMSPLIT, HUD_RINGSNUMSPLIT,
HUD_RINGSNUMTICS,
HUD_SCORE, HUD_SCORE,
HUD_SCORENUM, HUD_SCORENUM,

View File

@ -764,6 +764,8 @@ void Y_Ticker(void)
data.coop.total += data.coop.bonuses[i].points; data.coop.total += data.coop.bonuses[i].points;
data.coop.bonuses[i].points = 0; data.coop.bonuses[i].points = 0;
} }
if (data.coop.score > MAXSCORE)
data.coop.score = MAXSCORE;
if (data.coop.bonuses[i].points > 0) if (data.coop.bonuses[i].points > 0)
anybonuses = true; anybonuses = true;
} }
@ -1763,6 +1765,8 @@ static void Y_AwardCoopBonuses(void)
{ {
(bonuses_list[bonusnum][j])(&players[i], &localbonuses[j]); (bonuses_list[bonusnum][j])(&players[i], &localbonuses[j]);
players[i].score += localbonuses[j].points; players[i].score += localbonuses[j].points;
if (players[i].score > MAXSCORE)
players[i].score = MAXSCORE;
} }
ptlives = (!ultimatemode && !modeattacking) ? max((players[i].score/50000) - (oldscore/50000), 0) : 0; ptlives = (!ultimatemode && !modeattacking) ? max((players[i].score/50000) - (oldscore/50000), 0) : 0;
@ -1805,6 +1809,8 @@ static void Y_AwardSpecialStageBonus(void)
else else
Y_SetRingBonus(&players[i], &localbonus); Y_SetRingBonus(&players[i], &localbonus);
players[i].score += localbonus.points; players[i].score += localbonus.points;
if (players[i].score > MAXSCORE)
players[i].score = MAXSCORE;
// grant extra lives right away since tally is faked // grant extra lives right away since tally is faked
ptlives = (!ultimatemode && !modeattacking) ? max((players[i].score/50000) - (oldscore/50000), 0) : 0; ptlives = (!ultimatemode && !modeattacking) ? max((players[i].score/50000) - (oldscore/50000), 0) : 0;