From eb590910b2ee7f1678c4699235d5f1076d5764a1 Mon Sep 17 00:00:00 2001 From: mazmazz Date: Sun, 9 Sep 2018 01:13:02 -0400 Subject: [PATCH] Added NIGHTSLINK bonus type for the 2.1 Link Bonus --- src/dehacked.c | 3 ++- src/y_inter.c | 10 +++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 70a19eadc..1f56210ac 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -1197,8 +1197,9 @@ 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; - if (i >= -1 && i <= 3) // -1 for no bonus. Max is 3. + if (i >= -1 && i <= 4) // -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); diff --git a/src/y_inter.c b/src/y_inter.c index 3fdf5f7a9..2c77a577a 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -1774,7 +1774,6 @@ static void Y_SetLapBonus(player_t *player, y_bonus_t *bstruct) bstruct->points = max(0, player->totalmarebonuslap * 1000); } -#if 0 // // Y_SetLinkBonus // @@ -1784,7 +1783,6 @@ static void Y_SetLinkBonus(player_t *player, y_bonus_t *bstruct) bstruct->display = true; bstruct->points = max(0, (player->maxlink - 1) * 100); } -#endif // // Y_SetGuardBonus @@ -1837,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[5][4] = { +bonus_f bonuses_list[6][4] = { { Y_SetNullBonus, Y_SetNullBonus, @@ -1868,6 +1866,12 @@ bonus_f bonuses_list[5][4] = { Y_SetLapBonus, Y_SetNullBonus, }, + { + Y_SetNullBonus, + Y_SetLinkBonus, + Y_SetLapBonus, + Y_SetNullBonus, + }, };