Merge from nights-score and use Lap Bonus instead of Link Bonus

* One BONUSTYPE = NIGHTS option instead of several
* Use NiGHTS Bonus for special stages, not Link Bonus
This commit is contained in:
mazmazz 2018-08-12 20:56:25 -04:00
commit d3001db9dc
2 changed files with 3 additions and 31 deletions

View file

@ -1197,12 +1197,8 @@ static void readlevelheader(MYFILE *f, INT32 num)
else if (fastcmp(word2, "BOSS")) i = 1;
else if (fastcmp(word2, "ERZ3")) i = 2;
else if (fastcmp(word2, "NIGHTS")) i = 3;
else if (fastcmp(word2, "NIGHTSLINK")) i = 4;
else if (fastcmp(word2, "NIGHTSLAP")) i = 5;
else if (fastcmp(word2, "NIGHTSLINKLAP")) i = 6;
else if (fastcmp(word2, "NIGHTSALL")) i = 7;
if (i >= -1 && i <= 7) // -1 for no bonus. Max is 2.
if (i >= -1 && i <= 3) // -1 for no bonus. Max is 3.
mapheaderinfo[num-1]->bonustype = (SINT8)i;
else
deh_warning("Level header %d: invalid bonus type number %d", num, i);

View file

@ -1835,7 +1835,7 @@ static void Y_SetPerfectBonus(player_t *player, y_bonus_t *bstruct)
// This list can be extended in the future with SOC/Lua, perhaps.
typedef void (*bonus_f)(player_t *, y_bonus_t *);
bonus_f bonuses_list[9][4] = {
bonus_f bonuses_list[5][4] = {
{
Y_SetNullBonus,
Y_SetNullBonus,
@ -1861,35 +1861,11 @@ bonus_f bonuses_list[9][4] = {
Y_SetPerfectBonus,
},
{
Y_SetNullBonus,
Y_SetNullBonus,
Y_SetNightsBonus,
Y_SetNullBonus,
},
{
Y_SetNullBonus,
Y_SetNullBonus,
Y_SetLinkBonus,
Y_SetNullBonus,
},
{
Y_SetNullBonus,
Y_SetNullBonus,
Y_SetLapBonus,
Y_SetNullBonus,
},
{
Y_SetNullBonus,
Y_SetLinkBonus,
Y_SetLapBonus,
Y_SetNullBonus,
},
{
Y_SetNullBonus,
Y_SetNightsBonus,
Y_SetLinkBonus,
Y_SetLapBonus,
},
};
@ -1964,7 +1940,7 @@ static void Y_AwardSpecialStageBonus(void)
if (!playeringame[i] || players[i].lives < 1) // not active or game over
Y_SetNullBonus(&players[i], &localbonus);
else if (maptol & TOL_NIGHTS) // Link instead of Rings
Y_SetLinkBonus(&players[i], &localbonus);
Y_SetNightsBonus(&players[i], &localbonus);
else
Y_SetRingBonus(&players[i], &localbonus);
players[i].score += localbonus.points;