mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-18 15:32:33 +00:00
MaxBonusLives level header option for # of lives in score tally
This commit is contained in:
parent
f19b7bfacf
commit
d8c565407c
5 changed files with 12 additions and 2 deletions
|
@ -1203,6 +1203,8 @@ static void readlevelheader(MYFILE *f, INT32 num)
|
|||
deh_warning("Level header %d: invalid bonus type number %d", num, i);
|
||||
}
|
||||
|
||||
else if (fastcmp(word, "MAXBONUSLIVES"))
|
||||
mapheaderinfo[num-1]->maxbonuslives = (SINT8)i;
|
||||
else if (fastcmp(word, "LEVELFLAGS"))
|
||||
mapheaderinfo[num-1]->levelflags = (UINT8)i;
|
||||
else if (fastcmp(word, "MENUFLAGS"))
|
||||
|
|
|
@ -244,6 +244,7 @@ typedef struct
|
|||
SINT8 unlockrequired; ///< Is an unlockable required to play this level? -1 if no.
|
||||
UINT8 levelselect; ///< Is this map available in the level select? If so, which map list is it available in?
|
||||
SINT8 bonustype; ///< What type of bonus does this level have? (-1 for null.)
|
||||
SINT8 maxbonuslives; ///< How many bonus lives to award at Intermission? (-1 for unlimited.)
|
||||
|
||||
UINT8 levelflags; ///< LF_flags: merged eight booleans into one UINT8 for space, see below
|
||||
UINT8 menuflags; ///< LF2_flags: options that affect record attack / nights mode menus
|
||||
|
|
|
@ -1784,6 +1784,8 @@ static int mapheaderinfo_get(lua_State *L)
|
|||
lua_pushinteger(L, header->levelselect);
|
||||
else if (fastcmp(field,"bonustype"))
|
||||
lua_pushinteger(L, header->bonustype);
|
||||
else if (fastcmp(field,"maxbonuslives"))
|
||||
lua_pushinteger(L, header->maxbonuslives);
|
||||
else if (fastcmp(field,"levelflags"))
|
||||
lua_pushinteger(L, header->levelflags);
|
||||
else if (fastcmp(field,"menuflags"))
|
||||
|
|
|
@ -225,6 +225,7 @@ static void P_ClearSingleMapHeaderInfo(INT16 i)
|
|||
mapheaderinfo[num]->unlockrequired = -1;
|
||||
mapheaderinfo[num]->levelselect = 0;
|
||||
mapheaderinfo[num]->bonustype = 0;
|
||||
mapheaderinfo[num]->maxbonuslives = -1;
|
||||
mapheaderinfo[num]->levelflags = 0;
|
||||
mapheaderinfo[num]->menuflags = 0;
|
||||
#if 1 // equivalent to "FlickyList = DEMO"
|
||||
|
|
|
@ -1874,7 +1874,9 @@ static void Y_AwardCoopBonuses(void)
|
|||
players[i].score = MAXSCORE;
|
||||
}
|
||||
|
||||
ptlives = (!ultimatemode && !modeattacking && players[i].lives != 0x7f) ? max((players[i].score/50000) - (oldscore/50000), 0) : 0;
|
||||
ptlives = min(
|
||||
((!ultimatemode && !modeattacking && players[i].lives != 0x7f) ? max((players[i].score/50000) - (oldscore/50000), 0) : 0),
|
||||
(mapheaderinfo[prevmap]->maxbonuslives < 0 ? INT32_MAX : mapheaderinfo[prevmap]->maxbonuslives));
|
||||
if (ptlives)
|
||||
P_GivePlayerLives(&players[i], ptlives);
|
||||
|
||||
|
@ -1918,7 +1920,9 @@ static void Y_AwardSpecialStageBonus(void)
|
|||
players[i].score = MAXSCORE;
|
||||
|
||||
// grant extra lives right away since tally is faked
|
||||
ptlives = (!ultimatemode && !modeattacking && players[i].lives != 0x7f) ? max((players[i].score/50000) - (oldscore/50000), 0) : 0;
|
||||
ptlives = min(
|
||||
((!ultimatemode && !modeattacking && players[i].lives != 0x7f) ? max((players[i].score/50000) - (oldscore/50000), 0) : 0),
|
||||
(mapheaderinfo[prevmap]->maxbonuslives < 0 ? INT32_MAX : mapheaderinfo[prevmap]->maxbonuslives));
|
||||
if (ptlives)
|
||||
P_GivePlayerLives(&players[i], ptlives);
|
||||
|
||||
|
|
Loading…
Reference in a new issue