mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-03-24 19:52:08 +00:00
Tweak some HUD stuff, including a more consistent application of MAXSCORE.
This commit is contained in:
parent
f0ce22edb6
commit
9446fe6cd6
5 changed files with 25 additions and 13 deletions
|
@ -28,7 +28,7 @@
|
|||
#define VIEWHEIGHTS "41"
|
||||
|
||||
// Maximum player score.
|
||||
#define MAXSCORE 999999990
|
||||
#define MAXSCORE 99999990 // 999999990
|
||||
|
||||
// mapblocks are used to check movement
|
||||
// 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_InSpaceSector(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_RestoreMusic(player_t *player);
|
||||
|
|
|
@ -1089,9 +1089,8 @@ void P_AddPlayerScore(player_t *player, UINT32 amount)
|
|||
oldscore = player->score;
|
||||
|
||||
// Don't go above MAXSCORE.
|
||||
if (player->score + amount < MAXSCORE)
|
||||
player->score += amount;
|
||||
else
|
||||
player->score += amount;
|
||||
if (player->score > MAXSCORE)
|
||||
player->score = MAXSCORE;
|
||||
|
||||
// check for extra lives every 50000 pts
|
||||
|
|
|
@ -132,22 +132,23 @@ hudinfo_t hudinfo[NUMHUDITEMS] =
|
|||
|
||||
{ 16, 42}, // HUD_RINGS
|
||||
{ 220, 10}, // HUD_RINGSSPLIT
|
||||
{ 120, 42}, // HUD_RINGSNUM
|
||||
{ 104, 42}, // HUD_RINGSNUM
|
||||
{ 296, 10}, // HUD_RINGSNUMSPLIT
|
||||
{ 120, 42}, // HUD_RINGSNUMTICS
|
||||
|
||||
{ 16, 10}, // HUD_SCORE
|
||||
{ 120, 10}, // HUD_SCORENUM
|
||||
|
||||
{ 16, 26}, // HUD_TIME
|
||||
{ 128, 10}, // HUD_TIMESPLIT
|
||||
{ 96, 26}, // HUD_MINUTES
|
||||
{ 72, 26}, // HUD_MINUTES
|
||||
{ 188, 10}, // HUD_MINUTESSPLIT
|
||||
{ 96, 26}, // HUD_TIMECOLON
|
||||
{ 72, 26}, // HUD_TIMECOLON
|
||||
{ 188, 10}, // HUD_TIMECOLONSPLIT
|
||||
{ 120, 26}, // HUD_SECONDS
|
||||
{ 96, 26}, // HUD_SECONDS
|
||||
{ 212, 10}, // HUD_SECONDSSPLIT
|
||||
{ 120, 26}, // HUD_TIMETICCOLON
|
||||
{ 144, 26}, // HUD_TICS
|
||||
{ 96, 26}, // HUD_TIMETICCOLON
|
||||
{ 120, 26}, // HUD_TICS
|
||||
|
||||
{ 120, 56}, // HUD_SS_TOTALRINGS
|
||||
{ 296, 40}, // HUD_SS_TOTALRINGS_SPLIT
|
||||
|
@ -663,7 +664,7 @@ static void ST_drawTime(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));
|
||||
|
||||
|
@ -677,8 +678,13 @@ static inline void ST_drawRings(void)
|
|||
if (playeringame[i] && players[i].mo && players[i].rings > 0)
|
||||
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)
|
||||
|
|
|
@ -86,6 +86,7 @@ typedef enum
|
|||
HUD_RINGSSPLIT,
|
||||
HUD_RINGSNUM,
|
||||
HUD_RINGSNUMSPLIT,
|
||||
HUD_RINGSNUMTICS,
|
||||
|
||||
HUD_SCORE,
|
||||
HUD_SCORENUM,
|
||||
|
|
|
@ -764,6 +764,8 @@ void Y_Ticker(void)
|
|||
data.coop.total += data.coop.bonuses[i].points;
|
||||
data.coop.bonuses[i].points = 0;
|
||||
}
|
||||
if (data.coop.score > MAXSCORE)
|
||||
data.coop.score = MAXSCORE;
|
||||
if (data.coop.bonuses[i].points > 0)
|
||||
anybonuses = true;
|
||||
}
|
||||
|
@ -1763,6 +1765,8 @@ static void Y_AwardCoopBonuses(void)
|
|||
{
|
||||
(bonuses_list[bonusnum][j])(&players[i], &localbonuses[j]);
|
||||
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;
|
||||
|
@ -1805,6 +1809,8 @@ static void Y_AwardSpecialStageBonus(void)
|
|||
else
|
||||
Y_SetRingBonus(&players[i], &localbonus);
|
||||
players[i].score += localbonus.points;
|
||||
if (players[i].score > MAXSCORE)
|
||||
players[i].score = MAXSCORE;
|
||||
|
||||
// grant extra lives right away since tally is faked
|
||||
ptlives = (!ultimatemode && !modeattacking) ? max((players[i].score/50000) - (oldscore/50000), 0) : 0;
|
||||
|
|
Loading…
Reference in a new issue