From 6f8f4c3293f7a9361281983b64d5313a03471816 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Thu, 7 Jan 2021 05:27:50 +0100 Subject: [PATCH] Unify another chunk of simple Hellfire code paths --- Source/drlg_l1.cpp | 9 +-- Source/effects.cpp | 6 +- Source/gamemenu.cpp | 6 -- Source/gamemenu.h | 6 -- Source/gendung.cpp | 9 ++- Source/gmenu.cpp | 9 ++- Source/help.cpp | 9 ++- Source/items.cpp | 87 ++------------------------ Source/mainmenu.cpp | 16 ++--- Source/misdat.cpp | 6 -- Source/missiles.cpp | 147 ++------------------------------------------ Source/monster.cpp | 118 ++++++++--------------------------- Source/monster.h | 12 ---- Source/msg.h | 2 - Source/multi.cpp | 5 -- Source/objdat.cpp | 6 +- Source/objects.cpp | 39 ++---------- Source/palette.cpp | 4 -- Source/pfile.cpp | 8 --- Source/player.cpp | 36 ----------- 20 files changed, 61 insertions(+), 479 deletions(-) diff --git a/Source/drlg_l1.cpp b/Source/drlg_l1.cpp index 0e8bb1859..a9dabec43 100644 --- a/Source/drlg_l1.cpp +++ b/Source/drlg_l1.cpp @@ -2689,7 +2689,6 @@ static void DRLG_L5(int entry) } } -#ifdef HELLFIRE if (currlevel < 21) { DRLG_L5Subs(); } else { @@ -2739,9 +2738,6 @@ static void DRLG_L5(int entry) break; } } -#else - DRLG_L5Subs(); -#endif if (currlevel < 21) { DRLG_L1Shadows(); @@ -2788,7 +2784,6 @@ void CreateL5Dungeon(DWORD rseed, int entry) DRLG_L1Pass3(); DRLG_FreeL1SP(); -#ifdef HELLFIRE if (currlevel < 17) DRLG_InitL1Vals(); else @@ -2796,6 +2791,7 @@ void CreateL5Dungeon(DWORD rseed, int entry) DRLG_SetPC(); +#ifdef HELLFIRE for (j = dminy; j < dmaxy; j++) { for (i = dminx; i < dmaxx; i++) { if (dPiece[i][j] == 290) { @@ -2808,9 +2804,6 @@ void CreateL5Dungeon(DWORD rseed, int entry) } } } -#else - DRLG_InitL1Vals(); - DRLG_SetPC(); #endif } diff --git a/Source/effects.cpp b/Source/effects.cpp index b4c7d2918..0fb5c7863 100644 --- a/Source/effects.cpp +++ b/Source/effects.cpp @@ -1262,10 +1262,8 @@ static int RndSFX(int psfx) nRand = 2; else if (psfx == PS_ROGUE69) nRand = 2; -#ifdef HELLFIRE else if (psfx == PS_MONK69) nRand = 2; -#endif else if (psfx == PS_SWING) nRand = 2; else if (psfx == LS_ACID) @@ -1353,11 +1351,9 @@ static void priv_sound_init(BYTE bLoadMask) continue; } -#ifndef HELLFIRE - if (sgSFX[i].bFlags & sfx_HELLFIRE) { + if (!gbIsHellfire && sgSFX[i].bFlags & sfx_HELLFIRE) { continue; } -#endif sgSFX[i].pSnd = sound_file_load(sgSFX[i].pszName); } diff --git a/Source/gamemenu.cpp b/Source/gamemenu.cpp index 2bf77770e..2ef2f4278 100644 --- a/Source/gamemenu.cpp +++ b/Source/gamemenu.cpp @@ -134,9 +134,7 @@ void gamemenu_new_game(BOOL bActivate) deathflag = FALSE; force_redraw = 255; scrollrt_draw_game_screen(TRUE); -#ifdef HELLFIRE CornerStone.activated = FALSE; -#endif gbRunGame = FALSE; gamemenu_off(); } @@ -157,9 +155,7 @@ void gamemenu_load_game(BOOL bActivate) DrawAndBlit(); LoadGame(FALSE); ClrDiabloMsg(); -#ifdef HELLFIRE CornerStone.activated = FALSE; -#endif PaletteFadeOut(8); deathflag = FALSE; force_redraw = 255; @@ -191,11 +187,9 @@ void gamemenu_save_game(BOOL bActivate) ClrDiabloMsg(); force_redraw = 255; SetCursor_(CURSOR_HAND); -#ifdef HELLFIRE if (CornerStone.activated) { items_427A72(); } -#endif interface_msg_pump(); SetWindowProc(saveProc); } diff --git a/Source/gamemenu.h b/Source/gamemenu.h index 9eb770383..63334fc4b 100644 --- a/Source/gamemenu.h +++ b/Source/gamemenu.h @@ -12,10 +12,8 @@ DEVILUTION_BEGIN_NAMESPACE extern "C" { #endif -#ifdef HELLFIRE extern char *jogging_title; extern BOOL jogging_opt; -#endif void gamemenu_on(); void gamemenu_off(); @@ -29,14 +27,10 @@ void gamemenu_restart_town(BOOL bActivate); void gamemenu_options(BOOL bActivate); void gamemenu_music_volume(BOOL bActivate); void gamemenu_sound_volume(BOOL bActivate); -#ifdef HELLFIRE void gamemenu_loadjog(BOOL bActivate); -#endif void gamemenu_gamma(BOOL bActivate); -#ifndef HELLFIRE void gamemenu_speed(BOOL bActivate); void gamemenu_color_cycling(BOOL bActivate); -#endif #ifdef __cplusplus } diff --git a/Source/gendung.cpp b/Source/gendung.cpp index 3a0c10d91..4a8212281 100644 --- a/Source/gendung.cpp +++ b/Source/gendung.cpp @@ -170,11 +170,10 @@ void FillSolidBlockTbls() switch (leveltype) { case DTYPE_TOWN: -#ifdef HELLFIRE - pSBFile = LoadFileInMem("NLevels\\TownData\\Town.SOL", &dwTiles); -#else - pSBFile = LoadFileInMem("Levels\\TownData\\Town.SOL", &dwTiles); -#endif + if (gbIsHellfire) + pSBFile = LoadFileInMem("NLevels\\TownData\\Town.SOL", &dwTiles); + else + pSBFile = LoadFileInMem("Levels\\TownData\\Town.SOL", &dwTiles); break; case DTYPE_CATHEDRAL: if (currlevel < 17) diff --git a/Source/gmenu.cpp b/Source/gmenu.cpp index c81bf624c..2ec4dc733 100644 --- a/Source/gmenu.cpp +++ b/Source/gmenu.cpp @@ -90,11 +90,10 @@ void gmenu_init_menu() gmenu_current_option = NULL; sgCurrentMenuIdx = 0; mouseNavigation = FALSE; -#ifdef HELLFIRE - sgpLogo = LoadFileInMem("Data\\hf_logo3.CEL", NULL); -#else - sgpLogo = LoadFileInMem("Data\\Diabsmal.CEL", NULL); -#endif + if (gbIsHellfire) + sgpLogo = LoadFileInMem("Data\\hf_logo3.CEL", NULL); + else + sgpLogo = LoadFileInMem("Data\\Diabsmal.CEL", NULL); BigTGold_cel = LoadFileInMem("Data\\BigTGold.CEL", NULL); PentSpin_cel = LoadFileInMem("Data\\PentSpin.CEL", NULL); option_cel = LoadFileInMem("Data\\option.CEL", NULL); diff --git a/Source/help.cpp b/Source/help.cpp index 0a25e06e4..96fcaa5ed 100644 --- a/Source/help.cpp +++ b/Source/help.cpp @@ -478,11 +478,10 @@ void DrawHelp() DrawSTextHelp(); DrawQTextBack(); -#ifdef HELLFIRE - PrintSString(0, 2, TRUE, "Hellfire Help", COL_GOLD, 0); -#else - PrintSString(0, 2, TRUE, "Diablo Help", COL_GOLD, 0); -#endif + if (gbIsHellfire) + PrintSString(0, 2, TRUE, "Hellfire Help", COL_GOLD, 0); + else + PrintSString(0, 2, TRUE, "Diablo Help", COL_GOLD, 0); DrawSLine(5); s = &gszHelpText[0]; diff --git a/Source/items.cpp b/Source/items.cpp index 240ae17eb..89b49cab8 100644 --- a/Source/items.cpp +++ b/Source/items.cpp @@ -3579,7 +3579,6 @@ void DoOil(int pnum, int cii) void PrintItemOil(char IDidx) { switch (IDidx) { -#ifdef HELLFIRE case IMISC_OILACC: strcpy(tempstr, "increases a weapon's"); AddPanelString(tempstr, TRUE); @@ -3658,7 +3657,6 @@ void PrintItemOil(char IDidx) strcpy(tempstr, "sets petrification trap"); AddPanelString(tempstr, TRUE); break; -#endif case IMISC_FULLHEAL: strcpy(tempstr, "fully recover life"); AddPanelString(tempstr, TRUE); @@ -3752,48 +3750,28 @@ void PrintItemPower(char plidx, ItemStruct *x) sprintf(tempstr, "armor class: %i", x->_iAC); break; case IPL_FIRERES: -#ifdef HELLFIRE case IPL_FIRERES_CURSE: -#endif if (x->_iPLFR < 75) sprintf(tempstr, "Resist Fire : %+i%%", x->_iPLFR); -#ifdef HELLFIRE else -#else - if (x->_iPLFR >= 75) -#endif sprintf(tempstr, "Resist Fire : 75%% MAX"); break; case IPL_LIGHTRES: -#ifdef HELLFIRE case IPL_LIGHTRES_CURSE: -#endif if (x->_iPLLR < 75) sprintf(tempstr, "Resist Lightning : %+i%%", x->_iPLLR); -#ifdef HELLFIRE else -#else - if (x->_iPLLR >= 75) -#endif sprintf(tempstr, "Resist Lightning : 75%% MAX"); break; case IPL_MAGICRES: -#ifdef HELLFIRE case IPL_MAGICRES_CURSE: -#endif if (x->_iPLMR < 75) sprintf(tempstr, "Resist Magic : %+i%%", x->_iPLMR); -#ifdef HELLFIRE else -#else - if (x->_iPLMR >= 75) -#endif sprintf(tempstr, "Resist Magic : 75%% MAX"); break; case IPL_ALLRES: -#ifdef HELLFIRE case IPL_ALLRES_CURSE: -#endif if (x->_iPLFR < 75) sprintf(tempstr, "Resist All : %+i%%", x->_iPLFR); if (x->_iPLFR >= 75) @@ -3802,22 +3780,14 @@ void PrintItemPower(char plidx, ItemStruct *x) case IPL_SPLLVLADD: if (x->_iSplLvlAdd == 1) strcpy(tempstr, "spells are increased 1 level"); -#ifdef HELLFIRE else if (x->_iSplLvlAdd > 1) sprintf(tempstr, "spells are increased %i levels", x->_iSplLvlAdd); else if (x->_iSplLvlAdd == -1) -#else - if (x->_iSplLvlAdd == 2) - strcpy(tempstr, "spells are increased 2 levels"); - if (x->_iSplLvlAdd < 1) -#endif strcpy(tempstr, "spells are decreased 1 level"); -#ifdef HELLFIRE else if (x->_iSplLvlAdd < -1) sprintf(tempstr, "spells are decreased %i levels", -x->_iSplLvlAdd); else if (x->_iSplLvlAdd == 0) strcpy(tempstr, "spell levels unchanged (?)"); -#endif break; case IPL_CHARGES: strcpy(tempstr, "Extra charges"); @@ -3826,19 +3796,15 @@ void PrintItemPower(char plidx, ItemStruct *x) sprintf(tempstr, "%i %s charges", x->_iMaxCharges, spelldata[x->_iSpell].sNameText); break; case IPL_FIREDAM: -#ifdef HELLFIRE if (x->_iFMinDam == x->_iFMaxDam) sprintf(tempstr, "Fire hit damage: %i", x->_iFMinDam); else -#endif sprintf(tempstr, "Fire hit damage: %i-%i", x->_iFMinDam, x->_iFMaxDam); break; case IPL_LIGHTDAM: -#ifdef HELLFIRE if (x->_iLMinDam == x->_iLMaxDam) sprintf(tempstr, "Lightning hit damage: %i", x->_iLMinDam); else -#endif sprintf(tempstr, "Lightning hit damage: %i-%i", x->_iLMinDam, x->_iLMaxDam); break; case IPL_STR: @@ -3888,35 +3854,27 @@ void PrintItemPower(char plidx, ItemStruct *x) case IPL_LIGHT_CURSE: sprintf(tempstr, "-%i%% light radius", -10 * x->_iPLLight); break; -#ifdef HELLFIRE case IPL_MULT_ARROWS: sprintf(tempstr, "multiple arrows per shot"); break; -#endif case IPL_FIRE_ARROWS: -#ifdef HELLFIRE if (x->_iFMinDam == x->_iFMaxDam) sprintf(tempstr, "fire arrows damage: %i", x->_iFMinDam); else -#endif sprintf(tempstr, "fire arrows damage: %i-%i", x->_iFMinDam, x->_iFMaxDam); break; case IPL_LIGHT_ARROWS: -#ifdef HELLFIRE if (x->_iLMinDam == x->_iLMaxDam) sprintf(tempstr, "lightning arrows damage %i", x->_iLMinDam); else -#endif sprintf(tempstr, "lightning arrows damage %i-%i", x->_iLMinDam, x->_iLMaxDam); break; -#ifdef HELLFIRE case IPL_FIREBALL: if (x->_iFMinDam == x->_iFMaxDam) sprintf(tempstr, "fireball damage: %i", x->_iFMinDam); else sprintf(tempstr, "fireball damage: %i-%i", x->_iFMinDam, x->_iFMaxDam); break; -#endif case IPL_THORNS: strcpy(tempstr, "attacker takes 1-3 damage"); break; @@ -4037,7 +3995,6 @@ void PrintItemPower(char plidx, ItemStruct *x) else if (x->_iPLFR >= 1) sprintf(tempstr, "Resist Fire : %+i%%", x->_iPLFR); break; -#ifdef HELLFIRE case IPL_DEVASTATION: strcpy(tempstr, "occasional triple damage"); break; @@ -4068,7 +4025,6 @@ void PrintItemPower(char plidx, ItemStruct *x) case IPL_LIFETOMANA: sprintf(tempstr, "40%% Health moved to Mana"); break; -#endif default: strcpy(tempstr, "Another ability (NW)"); break; @@ -4175,7 +4131,6 @@ void PrintItemMisc(ItemStruct *x) strcpy(tempstr, "Right-click to use"); AddPanelString(tempstr, TRUE); } -#ifdef HELLFIRE if (x->_iMiscId > IMISC_OILFIRST && x->_iMiscId < IMISC_OILLAST) { PrintItemOil(x->_iMiscId); strcpy(tempstr, "Right click to use"); @@ -4186,17 +4141,14 @@ void PrintItemMisc(ItemStruct *x) strcpy(tempstr, "Right click to use"); AddPanelString(tempstr, TRUE); } -#endif if (x->_iMiscId == IMISC_BOOK) { strcpy(tempstr, "Right-click to read"); AddPanelString(tempstr, TRUE); } -#ifdef HELLFIRE if (x->_iMiscId == IMISC_NOTE) { strcpy(tempstr, "Right click to read"); AddPanelString(tempstr, TRUE); } -#endif if (x->_iMiscId == IMISC_MAPOFDOOM) { strcpy(tempstr, "Right-click to view"); AddPanelString(tempstr, TRUE); @@ -4205,12 +4157,10 @@ void PrintItemMisc(ItemStruct *x) sprintf(tempstr, "Level : %i", x->_ivalue); AddPanelString(tempstr, TRUE); } -#ifdef HELLFIRE if (x->_iMiscId == IMISC_AURIC) { sprintf(tempstr, "Doubles gold capacity"); AddPanelString(tempstr, TRUE); } -#endif } void PrintItemDetails(ItemStruct *x) @@ -4413,11 +4363,7 @@ void UseItem(int p, int Mid, int spl) case IMISC_REJUV: j = plr[p]._pMaxHP >> 8; l = ((j >> 1) + random_(39, j)) << 6; -#ifdef HELLFIRE if (plr[p]._pClass == PC_WARRIOR || plr[p]._pClass == PC_BARBARIAN) -#else - if (plr[p]._pClass == PC_WARRIOR) -#endif l <<= 1; if (plr[p]._pClass == PC_ROGUE) l += l >> 1; @@ -4507,7 +4453,6 @@ void UseItem(int p, int Mid, int spl) case IMISC_MAPOFDOOM: doom_init(); break; -#ifdef HELLFIRE case IMISC_OILACC: case IMISC_OILMAST: case IMISC_OILSHARP: @@ -4530,14 +4475,12 @@ void UseItem(int p, int Mid, int spl) } NewCursor(CURSOR_OIL); break; -#endif case IMISC_SPECELIX: ModifyPlrStr(p, 3); ModifyPlrMag(p, 3); ModifyPlrDex(p, 3); ModifyPlrVit(p, 3); break; -#ifdef HELLFIRE case IMISC_RUNEF: plr[p]._pTSpell = SPL_RUNEFIRE; plr[p]._pTSplType = RSPLTYPE_INVALID; @@ -4568,7 +4511,6 @@ void UseItem(int p, int Mid, int spl) if (p == myplr) NewCursor(CURSOR_TELEPORT); break; -#endif } } @@ -4620,17 +4562,11 @@ int RndSmithItem(int lvl) ri = 0; for (i = 1; AllItemsList[i].iLoc != ILOC_INVALID; i++) { if (AllItemsList[i].iRnd != IDROP_NEVER && SmithItemOk(i) && lvl >= AllItemsList[i].iMinMLvl -#ifdef HELLFIRE - && ri < 512 -#endif - ) { + && ri < 512) { ril[ri] = i; ri++; if (AllItemsList[i].iRnd == IDROP_DOUBLE -#ifdef HELLFIRE - && ri < 512 -#endif - ) { + && ri < 512) { ril[ri] = i; ri++; } @@ -4745,11 +4681,7 @@ int RndPremiumItem(int minlvl, int maxlvl) for (i = 1; AllItemsList[i].iLoc != ILOC_INVALID; i++) { if (AllItemsList[i].iRnd != IDROP_NEVER) { if (PremiumItemOk(i)) { -#ifdef HELLFIRE if (AllItemsList[i].iMinMLvl >= minlvl && AllItemsList[i].iMinMLvl <= maxlvl && ri < 512) { -#else - if (AllItemsList[i].iMinMLvl >= minlvl && AllItemsList[i].iMinMLvl <= maxlvl) { -#endif ril[ri] = i; ri++; } @@ -4966,10 +4898,7 @@ int RndWitchItem(int lvl) ri = 0; for (i = 1; AllItemsList[i].iLoc != ILOC_INVALID; i++) { if (AllItemsList[i].iRnd != IDROP_NEVER && WitchItemOk(i) && lvl >= AllItemsList[i].iMinMLvl -#ifdef HELLFIRE - && ri < 512 -#endif - ) { + && ri < 512) { ril[ri] = i; ri++; @@ -5106,10 +5035,7 @@ int RndBoyItem(int lvl) ri = 0; for (i = 1; AllItemsList[i].iLoc != ILOC_INVALID; i++) { if (AllItemsList[i].iRnd != IDROP_NEVER && PremiumItemOk(i) && lvl >= AllItemsList[i].iMinMLvl -#ifdef HELLFIRE - && ri < 512 -#endif - ) { + && ri < 512) { ril[ri] = i; ri++; } @@ -5325,10 +5251,7 @@ int RndHealerItem(int lvl) ri = 0; for (i = 1; AllItemsList[i].iLoc != ILOC_INVALID; i++) { if (AllItemsList[i].iRnd != IDROP_NEVER && HealerItemOk(i) && lvl >= AllItemsList[i].iMinMLvl -#ifdef HELLFIRE - && ri < 512 -#endif - ) { + && ri < 512) { ril[ri] = i; ri++; } diff --git a/Source/mainmenu.cpp b/Source/mainmenu.cpp index b2f11e1e6..73268627d 100644 --- a/Source/mainmenu.cpp +++ b/Source/mainmenu.cpp @@ -70,11 +70,10 @@ static BOOL mainmenu_multi_player() static void mainmenu_play_intro() { music_stop(); -#ifdef HELLFIRE - play_movie("gendata\\Hellfire.smk", TRUE); -#else - play_movie("gendata\\diablo1.smk", TRUE); -#endif + if (gbIsHellfire) + play_movie("gendata\\Hellfire.smk", TRUE); + else + play_movie("gendata\\diablo1.smk", TRUE); mainmenu_refresh_music(); } void mainmenu_change_name(int arg1, int arg2, int arg3, int arg4, char *name_1, char *name_2) @@ -164,12 +163,9 @@ void mainmenu_loop() break; case MAINMENU_ATTRACT_MODE: case MAINMENU_REPLAY_INTRO: -#ifndef HELLFIRE - if (gbIsSpawn) + if (gbIsSpawn && !gbIsHellfire) done = FALSE; - else -#endif - if (gbActive) + else if (gbActive) mainmenu_play_intro(); break; case MAINMENU_SHOW_CREDITS: diff --git a/Source/misdat.cpp b/Source/misdat.cpp index 3eef59ae5..75c10e2df 100644 --- a/Source/misdat.cpp +++ b/Source/misdat.cpp @@ -24,11 +24,7 @@ MissileData missiledata[] = { { MIS_TOWN, &AddTown, &MI_Town, TRUE, 1, MISR_MAGIC, MFILE_PORTAL, LS_SENTINEL, LS_ELEMENTL }, { MIS_FLASH, &AddFlash, &MI_Flash, TRUE, 1, MISR_MAGIC, MFILE_BLUEXFR, LS_NOVA, LS_ELECIMP1 }, { MIS_FLASH2, &AddFlash2, &MI_Flash2, TRUE, 1, MISR_MAGIC, MFILE_BLUEXBK, -1, -1 }, -#ifdef HELLFIRE - { MIS_MANASHIELD, &AddManashield, &MI_SetManashield, TRUE, 1, MISR_MAGIC, MFILE_MANASHLD, LS_MSHIELD, -1 }, -#else { MIS_MANASHIELD, &AddManashield, &MI_SetManashield, FALSE, 1, MISR_MAGIC, MFILE_MANASHLD, LS_MSHIELD, -1 }, -#endif { MIS_FIREMOVE, &AddFiremove, &MI_Firemove, TRUE, 1, MISR_FIRE, MFILE_FIREWAL, -1, -1 }, { MIS_CHAIN, &AddChain, &MI_Chain, TRUE, 1, MISR_LIGHTNING, MFILE_LGHNING, LS_LNING1, LS_ELECIMP1 }, { MIS_SENTINAL, NULL, NULL, TRUE, 1, MISR_LIGHTNING, MFILE_LGHNING, -1, -1 }, @@ -83,7 +79,6 @@ MissileData missiledata[] = { { MIS_RPORTAL, &AddRportal, &MI_Rportal, TRUE, 2, MISR_NONE, MFILE_RPORTAL, LS_SENTINEL, LS_ELEMENTL }, { MIS_BOOM2, &AddBoom, &MI_Boom, TRUE, 2, MISR_NONE, MFILE_FIREPLAR, -1, -1 }, { MIS_DIABAPOCA, &AddDiabApoca, &MI_Dummy, FALSE, 2, MISR_NONE, MFILE_NONE, -1, -1 }, -#ifdef HELLFIRE { MIS_MANA, &missiles_rech_mana, &MI_Dummy, FALSE, 1, MISR_NONE, MFILE_NONE, -1, -1 }, { MIS_MAGI, &missiles_magi, &MI_Dummy, FALSE, 1, MISR_NONE, MFILE_NONE, -1, -1 }, { MIS_LIGHTWALL, &missiles_light_wall, &mi_light_wall, TRUE, 1, MISR_LIGHTNING, MFILE_LGHNING, LS_LMAG, LS_ELECIMP1 }, @@ -124,7 +119,6 @@ MissileData missiledata[] = { { MIS_EXBL2, &AddMisexp, &MI_Misexp, TRUE, 2, MISR_NONE, MFILE_EXBL2, LS_FIRIMP2, -1 }, { MIS_EXBL3, &AddMisexp, &MI_Misexp, TRUE, 2, MISR_NONE, MFILE_EXBL3, LS_FIRIMP2, -1 }, { MIS_EXORA1, &AddMisexp, &MI_Misexp, TRUE, 2, MISR_NONE, MFILE_EXORA1, LS_FIRIMP2, -1 }, -#endif // clang-format on }; diff --git a/Source/missiles.cpp b/Source/missiles.cpp index 72ac11ec9..7d483d01f 100644 --- a/Source/missiles.cpp +++ b/Source/missiles.cpp @@ -20,9 +20,7 @@ int numchains; int XDirAdd[8] = { 1, 0, -1, -1, -1, 0, 1, 1 }; /** Maps from direction to Y-offset. */ int YDirAdd[8] = { 1, 1, 1, 0, -1, -1, -1, 0 }; -#ifdef HELLFIRE int CrawlNum[19] = { 0, 3, 12, 45, 94, 159, 240, 337, 450, 579, 724, 885, 1062, 1255, 1464, 1689, 1930, 2187, 2460 }; -#endif void GetDamageAmt(int i, int *mind, int *maxd) { @@ -39,18 +37,9 @@ void GetDamageAmt(int i, int *mind, int *maxd) break; case SPL_HEAL: /// BUGFIX: healing calculation is unused *mind = plr[myplr]._pLevel + sl + 1; -#ifdef HELLFIRE if (plr[myplr]._pClass == PC_WARRIOR || plr[myplr]._pClass == PC_MONK || plr[myplr]._pClass == PC_BARBARIAN) { -#else - if (plr[myplr]._pClass == PC_WARRIOR) { -#endif *mind <<= 1; - } -#ifdef HELLFIRE - else if (plr[myplr]._pClass == PC_ROGUE || plr[myplr]._pClass == PC_BARD) { -#else - if (plr[myplr]._pClass == PC_ROGUE) { -#endif + } else if (plr[myplr]._pClass == PC_ROGUE || plr[myplr]._pClass == PC_BARD) { *mind += *mind >> 1; } *maxd = 10; @@ -60,18 +49,9 @@ void GetDamageAmt(int i, int *mind, int *maxd) for (k = 0; k < sl; k++) { *maxd += 6; } -#ifdef HELLFIRE if (plr[myplr]._pClass == PC_WARRIOR || plr[myplr]._pClass == PC_MONK || plr[myplr]._pClass == PC_BARBARIAN) { -#else - if (plr[myplr]._pClass == PC_WARRIOR) { -#endif *maxd <<= 1; - } -#ifdef HELLFIRE - else if (plr[myplr]._pClass == PC_ROGUE || plr[myplr]._pClass == PC_BARD) { -#else - if (plr[myplr]._pClass == PC_ROGUE) { -#endif + } else if (plr[myplr]._pClass == PC_ROGUE || plr[myplr]._pClass == PC_BARD) { *maxd += *maxd >> 1; } *mind = -1; @@ -107,13 +87,11 @@ void GetDamageAmt(int i, int *mind, int *maxd) case SPL_RESURRECT: case SPL_TELEKINESIS: case SPL_BONESPIRIT: -#ifdef HELLFIRE case SPL_WARP: case SPL_REFLECT: case SPL_BERSERK: case SPL_SEARCH: case SPL_RUNESTONE: -#endif *mind = -1; *maxd = -1; break; @@ -202,18 +180,10 @@ void GetDamageAmt(int i, int *mind, int *maxd) break; case SPL_HEALOTHER: /// BUGFIX: healing calculation is unused *mind = plr[myplr]._pLevel + sl + 1; -#ifdef HELLFIRE if (plr[myplr]._pClass == PC_WARRIOR || plr[myplr]._pClass == PC_MONK || plr[myplr]._pClass == PC_BARBARIAN) { -#else - if (plr[myplr]._pClass == PC_WARRIOR) { -#endif *mind <<= 1; } -#ifdef HELLFIRE if (plr[myplr]._pClass == PC_ROGUE || plr[myplr]._pClass == PC_BARD) { -#else - if (plr[myplr]._pClass == PC_ROGUE) { -#endif *mind += *mind >> 1; } *maxd = 10; @@ -223,18 +193,10 @@ void GetDamageAmt(int i, int *mind, int *maxd) for (k = 0; k < sl; k++) { *maxd += 6; } -#ifdef HELLFIRE if (plr[myplr]._pClass == PC_WARRIOR || plr[myplr]._pClass == PC_MONK || plr[myplr]._pClass == PC_BARBARIAN) { -#else - if (plr[myplr]._pClass == PC_WARRIOR) { -#endif *maxd <<= 1; } -#ifdef HELLFIRE if (plr[myplr]._pClass == PC_ROGUE || plr[myplr]._pClass == PC_BARD) { -#else - if (plr[myplr]._pClass == PC_ROGUE) { -#endif *maxd += *maxd >> 1; } *mind = -1; @@ -267,20 +229,13 @@ BOOL CheckBlock(int fx, int fy, int tx, int ty) int FindClosest(int sx, int sy, int rad) { int j, i, mid, tx, ty, cr; -#ifndef HELLFIRE - int CrawlNum[19] = { 0, 3, 12, 45, 94, 159, 240, 337, 450, 579, 724, 885, 1062, 1255, 1464, 1689, 1930, 2187, 2460 }; -#endif if (rad > 19) rad = 19; for (i = 1; i < rad; i++) { cr = CrawlNum[i] + 2; -#ifdef HELLFIRE - for (j = CrawlTable[CrawlNum[i]]; j > 0; j--) { // BUGFIX: should cast to BYTE or CrawlTable header will be wrong -#else for (j = (BYTE)CrawlTable[CrawlNum[i]]; j > 0; j--) { -#endif tx = sx + CrawlTable[cr - 1]; ty = sy + CrawlTable[cr]; if (tx > 0 && tx < MAXDUNX && ty > 0 && ty < MAXDUNY) { @@ -422,20 +377,16 @@ void GetMissileVel(int i, int sx, int sy, int dx, int dy, int v) { double dxp, dyp, dr; -#ifndef HELLFIRE if (dx != sx || dy != sy) { -#endif dxp = (dx + sy - sx - dy) * (1 << 21); dyp = (dy + dx - sx - sy) * (1 << 21); dr = sqrt(dxp * dxp + dyp * dyp); missile[i]._mixvel = (dxp * (v << 16)) / dr; missile[i]._miyvel = (dyp * (v << 15)) / dr; -#ifndef HELLFIRE } else { missile[i]._mixvel = 0; missile[i]._miyvel = 0; } -#endif } void PutMissile(int i) @@ -566,11 +517,7 @@ BOOL MonsterTrapHit(int m, int mindam, int maxdam, int dist, int t, BOOLEAN shif } hit = random_(68, 100); -#ifdef HELLFIRE - hper = 90 - (char)monster[m].mArmorClass - dist; -#else hper = 90 - (BYTE)monster[m].mArmorClass - dist; -#endif if (hper < 5) hper = 5; if (hper > 95) @@ -673,22 +620,14 @@ BOOL MonsterMHit(int pnum, int m, int mindam, int maxdam, int dist, int t, BOOLE hper += 50; if (plr[pnum]._pClass == PC_ROGUE) hper += 20; -#ifdef HELLFIRE if (plr[pnum]._pClass == PC_WARRIOR || plr[pnum]._pClass == PC_BARD) hper += 10; -#endif -#ifndef HELLFIRE - if (plr[pnum]._pClass == PC_WARRIOR) - hper += 10; -#endif } else { hper = plr[pnum]._pMagic - (monster[m].mLevel << 1) - dist + 50; if (plr[pnum]._pClass == PC_SORCERER) hper += 20; -#ifdef HELLFIRE else if (plr[pnum]._pClass == PC_BARD) hper += 10; -#endif } #ifdef HELLFIRE } else { @@ -1000,11 +939,7 @@ BOOL Plr2PlrMHit(int pnum, int p, int mindam, int maxdam, int dist, int mtype, B + plr[pnum]._pDexterity + 50; if (plr[pnum]._pClass == PC_ROGUE) hit += 20; -#ifdef HELLFIRE if (plr[pnum]._pClass == PC_WARRIOR || plr[pnum]._pClass == PC_BARD) -#else - if (plr[pnum]._pClass == PC_WARRIOR) -#endif hit += 10; } else { hit = plr[pnum]._pMagic @@ -1013,10 +948,8 @@ BOOL Plr2PlrMHit(int pnum, int p, int mindam, int maxdam, int dist, int mtype, B + 50; if (plr[pnum]._pClass == PC_SORCERER) hit += 20; -#ifdef HELLFIRE else if (plr[pnum]._pClass == PC_BARD) hit += 10; -#endif } if (hit < 5) hit = 5; @@ -1431,7 +1364,6 @@ void InitMissiles() #endif } -#ifdef HELLFIRE void missiles_hive_explosion(int mi, int sx, int sy, int dx, int dy, int midir, char mienemy, int id, int dam) { AddMissile(80, 62, 80, 62, midir, MIS_HIVEEXP, mienemy, id, dam, 0); @@ -2129,7 +2061,6 @@ void missiles_hbolt_arrow(int mi, int sx, int sy, int dx, int dy, int midir, cha missile[mi]._miVar2 = sy; missile[mi]._mlid = AddLight(sx, sy, 8); } -#endif void AddLArrow(int mi, int sx, int sy, int dx, int dy, int midir, char mienemy, int id, int dam) { @@ -2355,19 +2286,12 @@ void miss_null_33(int mi, int sx, int sy, int dx, int dy, int midir, char mienem void AddTeleport(int mi, int sx, int sy, int dx, int dy, int midir, char mienemy, int id, int dam) { int i, pn, k, j, tx, ty; -#ifndef HELLFIRE - int CrawlNum[6] = { 0, 3, 12, 45, 94, 159 }; -#endif missile[mi]._miDelFlag = TRUE; for (i = 0; i < 6; i++) { k = CrawlNum[i]; pn = k + 2; -#ifdef HELLFIRE - for (j = CrawlTable[k]; j > 0; j--) { // BUGFIX: should cast to BYTE or CrawlTable header will be wrong -#else for (j = (BYTE)CrawlTable[k]; j > 0; j--) { -#endif tx = dx + CrawlTable[pn - 1]; ty = dy + CrawlTable[pn]; if (0 < tx && tx < MAXDUNX && 0 < ty && ty < MAXDUNY) { @@ -2579,19 +2503,12 @@ BOOL CheckIfTrig(int x, int y) void AddTown(int mi, int sx, int sy, int dx, int dy, int midir, char mienemy, int id, int dam) { int i, j, k, mx, tx, ty, dp; -#ifndef HELLFIRE - int CrawlNum[6] = { 0, 3, 12, 45, 94, 159 }; -#endif if (currlevel != 0) { missile[mi]._miDelFlag = TRUE; for (j = 0; j < 6; j++) { k = CrawlNum[j] + 2; -#ifdef HELLFIRE - for (i = CrawlTable[CrawlNum[j]]; i > 0; i--) { // BUGFIX: should cast to BYTE or CrawlTable header will be wrong -#else for (i = (BYTE)CrawlTable[CrawlNum[j]]; i > 0; i--) { -#endif tx = dx + CrawlTable[k - 1]; ty = dy + CrawlTable[k]; if (tx > 0 && tx < MAXDUNX && ty > 0 && ty < MAXDUNY) { @@ -2712,9 +2629,6 @@ void AddFiremove(int mi, int sx, int sy, int dx, int dy, int midir, char mienemy void AddGuardian(int mi, int sx, int sy, int dx, int dy, int midir, char mienemy, int id, int dam) { int i, pn, k, j, tx, ty; -#ifndef HELLFIRE - int CrawlNum[6] = { 0, 3, 12, 45, 94, 159 }; -#endif missile[mi]._midam = random_(62, 10) + (plr[id]._pLevel >> 1) + 1; for (i = missile[mi]._mispllvl; i > 0; i--) { @@ -2725,11 +2639,7 @@ void AddGuardian(int mi, int sx, int sy, int dx, int dy, int midir, char mienemy for (i = 0; i < 6; i++) { pn = CrawlNum[i]; k = pn + 2; -#ifdef HELLFIRE - for (j = CrawlTable[pn]; j > 0; j--) { // BUGFIX: should cast to BYTE or CrawlTable header will be wrong -#else for (j = (BYTE)CrawlTable[pn]; j > 0; j--) { -#endif tx = dx + CrawlTable[k - 1]; ty = dy + CrawlTable[k]; pn = dPiece[tx][ty]; @@ -2948,29 +2858,18 @@ void AddAcidpud(int mi, int sx, int sy, int dx, int dy, int midir, char mienemy, void AddStone(int mi, int sx, int sy, int dx, int dy, int midir, char mienemy, int id, int dam) { int i, j, k, l, tx, ty, mid; -#ifndef HELLFIRE - int CrawlNum[6] = { 0, 3, 12, 45, 94, 159 }; -#endif missile[mi]._misource = id; for (i = 0; i < 6; i++) { k = CrawlNum[i]; l = k + 2; -#ifdef HELLFIRE - for (j = CrawlTable[k]; j > 0; j--) { // BUGFIX: should cast to BYTE or CrawlTable header will be wrong -#else for (j = (BYTE)CrawlTable[k]; j > 0; j--) { -#endif tx = dx + CrawlTable[l - 1]; ty = dy + CrawlTable[l]; if (tx > 0 && tx < MAXDUNX && ty > 0 && ty < MAXDUNY) { mid = dMonster[tx][ty]; mid = mid > 0 ? mid - 1 : -1 - mid; -#ifdef HELLFIRE if (mid > MAX_PLRS - 1 && monster[mid]._mAi != AI_DIABLO && monster[mid].MType->mtype != MT_NAKRUL) { -#else - if (mid > MAX_PLRS - 1 && monster[mid]._mAi != AI_DIABLO) { -#endif if (monster[mid]._mmode != MM_FADEIN && monster[mid]._mmode != MM_FADEOUT && monster[mid]._mmode != MM_CHARGE) { j = -99; i = 6; @@ -3088,19 +2987,10 @@ void AddHeal(int mi, int sx, int sy, int dx, int dy, int midir, char mienemy, in HealAmount += (random_(57, 6) + 1) << 6; } - if (plr[id]._pClass == PC_WARRIOR) - HealAmount <<= 1; -#ifdef HELLFIRE - else if (plr[id]._pClass == PC_BARBARIAN || plr[id]._pClass == PC_MONK) + if (plr[id]._pClass == PC_WARRIOR || plr[id]._pClass == PC_BARBARIAN || plr[id]._pClass == PC_MONK) HealAmount <<= 1; -#endif - - if (plr[id]._pClass == PC_ROGUE) - HealAmount += HealAmount >> 1; -#ifdef HELLFIRE - else if (plr[id]._pClass == PC_BARD) + else if (plr[id]._pClass == PC_ROGUE || plr[id]._pClass == PC_BARD) HealAmount += HealAmount >> 1; -#endif plr[id]._pHitPoints += HealAmount; if (plr[id]._pHitPoints > plr[id]._pMaxHP) @@ -3172,19 +3062,12 @@ void AddIdentify(int mi, int sx, int sy, int dx, int dy, int midir, char mienemy void AddFirewallC(int mi, int sx, int sy, int dx, int dy, int midir, char mienemy, int id, int dam) { int i, j, k, tx, ty, pn; -#ifndef HELLFIRE - int CrawlNum[6] = { 0, 3, 12, 45, 94, 159 }; -#endif missile[mi]._miDelFlag = TRUE; for (i = 0; i < 6; i++) { k = CrawlNum[i]; pn = k + 2; -#ifdef HELLFIRE - for (j = CrawlTable[k]; j > 0; j--) { // BUGFIX: should cast to BYTE or CrawlTable header will be wrong -#else for (j = (BYTE)CrawlTable[k]; j > 0; j--) { -#endif tx = dx + CrawlTable[pn - 1]; ty = dy + CrawlTable[pn]; if (0 < tx && tx < MAXDUNX && 0 < ty && ty < MAXDUNY) { @@ -3645,9 +3528,6 @@ void MI_Dummy(int i) void MI_Golem(int i) { -#ifndef HELLFIRE - int CrawlNum[6] = { 0, 3, 12, 45, 94, 159 }; -#endif int tx, ty, dp, l, m, src, k, tid; char *ct; @@ -3656,11 +3536,7 @@ void MI_Golem(int i) for (l = 0; l < 6; l++) { k = CrawlNum[l]; tid = k + 2; -#ifdef HELLFIRE - for (m = CrawlTable[k]; m > 0; m--) { // BUGFIX: should cast to BYTE or CrawlTable header will be wrong -#else for (m = (BYTE)CrawlTable[k]; m > 0; m--) { -#endif ct = &CrawlTable[tid]; tx = missile[i]._miVar4 + *(ct - 1); ty = missile[i]._miVar5 + *ct; @@ -3854,7 +3730,6 @@ void MI_Firebolt(int i) missile[i]._miDelFlag = FALSE; PutMissile(i); return; -#ifdef HELLFIRE case MIS_LICH: AddMissile(missile[i]._mix, missile[i]._miy, i, 0, missile[i]._mimfnum, MIS_EXORA1, missile[i]._micaster, missile[i]._misource, 0, 0); break; @@ -3870,7 +3745,6 @@ void MI_Firebolt(int i) case MIS_BONEDEMON: AddMissile(missile[i]._mix, missile[i]._miy, i, 0, missile[i]._mimfnum, MIS_EXBL3, missile[i]._micaster, missile[i]._misource, 0, 0); break; -#endif } if (missile[i]._mlid >= 0) AddUnLight(missile[i]._mlid); @@ -4061,7 +3935,6 @@ void MI_Fireball(int i) PutMissile(i); } -#ifdef HELLFIRE void missiles_4359A0(int i) { int t, j, k, tx, ty, dp; @@ -4610,7 +4483,6 @@ void mi_spec_arrow(int i) missile[i]._miDelFlag = TRUE; } -#endif void MI_Lightctrl(int i) { int pn, dam, p, mx, my; @@ -5038,9 +4910,6 @@ void MI_Guardian(int i) void MI_Chain(int i) { int sx, sy, id, l, n, m, k, rad, tx, ty, dir; -#ifndef HELLFIRE - int CrawlNum[19] = { 0, 3, 12, 45, 94, 159, 240, 337, 450, 579, 724, 885, 1062, 1255, 1464, 1689, 1930, 2187, 2460 }; -#endif id = missile[i]._misource; sx = missile[i]._mix; @@ -5053,11 +4922,7 @@ void MI_Chain(int i) for (m = 1; m < rad; m++) { k = CrawlNum[m]; l = k + 2; -#ifdef HELLFIRE - for (n = CrawlTable[k]; n > 0; n--) { // BUGFIX: should cast to BYTE or CrawlTable header will be wrong -#else for (n = (BYTE)CrawlTable[k]; n > 0; n--) { -#endif tx = sx + CrawlTable[l - 1]; ty = sy + CrawlTable[l]; if (tx > 0 && tx < MAXDUNX && ty > 0 && ty < MAXDUNY && dMonster[tx][ty] > 0) { @@ -5878,11 +5743,7 @@ void ProcessMissiles() i = 0; while (i < nummissiles) { -#ifdef HELLFIRE - if (missile[missileactive[i]]._miDelFlag == TRUE) { -#else if (missile[missileactive[i]]._miDelFlag) { -#endif DeleteMissile(missileactive[i], i); i = 0; } else { diff --git a/Source/monster.cpp b/Source/monster.cpp index 8911a88df..42c81bdee 100644 --- a/Source/monster.cpp +++ b/Source/monster.cpp @@ -20,11 +20,6 @@ BOOLEAN sgbSaveSoundOn; MonsterStruct monster[MAXMONSTERS]; int totalmonsters; CMonster Monsters[MAX_LVLMTYPES]; -#ifdef HELLFIRE -int GraphicTable[NUMLEVELS][MAX_LVLMTYPES]; -#else -BYTE GraphicTable[NUMLEVELS][MAX_LVLMTYPES]; -#endif int monstimgtot; int uniquetrans; int nummtypes; @@ -76,10 +71,8 @@ int offset_x[8] = { 1, 0, -1, -1, -1, 0, 1, 1 }; /** Maps from direction to delta Y-offset. */ int offset_y[8] = { 1, 1, 1, 0, -1, -1, -1, 0 }; -#ifdef HELLFIRE int HorkXAdd[8] = { 1, 0, -1, -1, -1, 0, 1, 1 }; // CODEFIX: same values as offset_x, remove it and use offset_x instead int HorkYAdd[8] = { 1, 1, 1, 0, -1, -1, -1, 0 }; // CODEFIX: same values as offset_y, remove it and use offset_y instead -#endif /** unused */ int rnd5[4] = { 5, 10, 15, 20 }; @@ -121,7 +114,6 @@ void (*AiProc[])(int i) = { &MAI_Lazhelp, &MAI_Lachdanan, &MAI_Warlord, -#ifdef HELLFIRE &mai_ranged_441680, &mai_ranged_44168B, &mai_horkdemon, @@ -130,7 +122,6 @@ void (*AiProc[])(int i) = { &mai_ranged_44165F, &mai_ranged_44166A, &mai_roundranged_441EA0 -#endif }; void InitMonsterTRN(int monst, BOOL special) @@ -234,7 +225,6 @@ void GetLevelMTypes() return; } -#ifdef HELLFIRE if (currlevel == 18) AddMonsterType(MT_HORKSPWN, PLACE_SCATTER); if (currlevel == 19) { @@ -247,7 +237,6 @@ void GetLevelMTypes() AddMonsterType(MT_ARCHLICH, PLACE_SCATTER); AddMonsterType(MT_NAKRUL, PLACE_SPECIAL); } -#endif if (!setlevel) { if (QuestStatus(Q_BUTCHER)) @@ -386,11 +375,11 @@ void InitMonsterGFX(int monst) LoadMissileGFX(MFILE_FLAREEXP); #endif } -#ifdef HELLFIRE if (mtype >= MT_INCIN && mtype <= MT_HELLBURN && !(MissileFileFlag & 8)) { MissileFileFlag |= 8; LoadMissileGFX(MFILE_KRULL); } +#ifdef HELLFIRE if ((mtype >= MT_NACID && mtype <= MT_XACID || mtype == MT_SPIDLORD) && !(MissileFileFlag & 0x10)) { MissileFileFlag |= 0x10; LoadMissileGFX(MFILE_ACIDBF); @@ -413,11 +402,11 @@ void InitMonsterGFX(int monst) LoadMissileGFX(MFILE_SCUBMISC); LoadMissileGFX(MFILE_SCBSEXPC); } -#ifndef HELLFIRE if (mtype >= MT_INCIN && mtype <= MT_HELLBURN && !(MissileFileFlag & 8)) { MissileFileFlag |= 8; LoadMissileGFX(MFILE_KRULL); } +#ifndef HELLFIRE if (mtype >= MT_NACID && mtype <= MT_XACID && !(MissileFileFlag & 0x10)) { MissileFileFlag |= 0x10; LoadMissileGFX(MFILE_ACIDBF); @@ -493,11 +482,7 @@ void InitMonster(int i, int rd, int mtype, int x, int y) monster[i]._mAnimFrame = random_(88, monster[i]._mAnimLen - 1) + 1; if (monst->mtype == MT_DIABLO) { -#ifdef HELLFIRE - monster[i]._mmaxhp = (random_(88, 1) + 3333) << 6; -#else - monster[i]._mmaxhp = (random_(88, 1) + 1666) << 6; -#endif + monster[i]._mmaxhp = (random_(88, 1) + (gbIsHellfire ? 3333 : 1666)) << 6; } else { monster[i]._mmaxhp = (monst->mMinHP + random_(88, monst->mMaxHP - monst->mMinHP + 1)) << 6; } @@ -521,9 +506,7 @@ void InitMonster(int i, int rd, int mtype, int x, int y) monster[i]._mDelFlag = FALSE; monster[i]._uniqtype = 0; monster[i]._msquelch = 0; -#ifdef HELLFIRE monster[i].mlid = 0; -#endif monster[i]._mRndSeed = GetRndSeed(); monster[i]._mAISeed = GetRndSeed(); monster[i].mWhoHit = 0; @@ -550,11 +533,11 @@ void InitMonster(int i, int rd, int mtype, int x, int y) } if (gnDifficulty == DIFF_NIGHTMARE) { -#ifdef HELLFIRE - monster[i]._mmaxhp = 3 * monster[i]._mmaxhp + ((gbMaxPlayers != 1 ? 100 : 50) << 6); -#else - monster[i]._mmaxhp = 3 * monster[i]._mmaxhp + 64; -#endif + monster[i]._mmaxhp = 3 * monster[i]._mmaxhp; + if (gbIsHellfire) + monster[i]._mmaxhp += (gbMaxPlayers != 1 ? 100 : 50) << 6; + else + monster[i]._mmaxhp += 64; monster[i]._mhitpoints = monster[i]._mmaxhp; monster[i].mLevel += 15; monster[i].mExp = 2 * (monster[i].mExp + 1000); @@ -565,17 +548,12 @@ void InitMonster(int i, int rd, int mtype, int x, int y) monster[i].mMinDamage2 = 2 * (monster[i].mMinDamage2 + 2); monster[i].mMaxDamage2 = 2 * (monster[i].mMaxDamage2 + 2); monster[i].mArmorClass += NIGHTMARE_AC_BONUS; - } - -#ifdef HELLFIRE - else -#endif - if (gnDifficulty == DIFF_HELL) { -#ifdef HELLFIRE - monster[i]._mmaxhp = 4 * monster[i]._mmaxhp + ((gbMaxPlayers != 1 ? 200 : 100) << 6); -#else - monster[i]._mmaxhp = 4 * monster[i]._mmaxhp + 192; -#endif + } else if (gnDifficulty == DIFF_HELL) { + monster[i]._mmaxhp = 4 * monster[i]._mmaxhp; + if (gbIsHellfire) + monster[i]._mmaxhp += (gbMaxPlayers != 1 ? 200 : 100) << 6; + else + monster[i]._mmaxhp += 192; monster[i]._mhitpoints = monster[i]._mmaxhp; monster[i].mLevel += 30; monster[i].mExp = 4 * (monster[i].mExp + 1000); @@ -670,7 +648,6 @@ void PlaceMonster(int i, int mtype, int x, int y) { int rd; -#ifdef HELLFIRE if (Monsters[mtype].mtype == MT_NAKRUL) { for (int j = 0; j < nummonsters; j++) { if (monster[j]._mMTidx == mtype) { @@ -681,7 +658,6 @@ void PlaceMonster(int i, int mtype, int x, int y) } } } -#endif dMonster[x][y] = i + 1; rd = random_(90, 8); @@ -795,7 +771,6 @@ void PlaceUniqueMonst(int uniqindex, int miniontype, int bosspacksize) } } -#ifdef HELLFIRE if (uniqindex == UMT_NAKRUL) { if (UberRow == 0 || UberCol == 0) { UberDiabloMonsterIndex = -1; @@ -805,7 +780,6 @@ void PlaceUniqueMonst(int uniqindex, int miniontype, int bosspacksize) yp = UberCol; UberDiabloMonsterIndex = nummonsters; } -#endif PlaceMonster(nummonsters, uniqtype, xp, yp); Monst->_uniqtype = uniqindex + 1; @@ -835,11 +809,9 @@ void PlaceUniqueMonst(int uniqindex, int miniontype, int bosspacksize) Monst->mMaxDamage2 = Uniq->mMaxDamage; Monst->mMagicRes = Uniq->mMagicRes; Monst->mtalkmsg = Uniq->mtalkmsg; -#ifdef HELLFIRE if (uniqindex == UMT_HORKDMN) Monst->mlid = 0; else -#endif Monst->mlid = AddLight(Monst->_mx, Monst->_my, 3); if (gbMaxPlayers != 1) { @@ -863,11 +835,11 @@ void PlaceUniqueMonst(int uniqindex, int miniontype, int bosspacksize) Monst->_mgoal = MGOAL_INQUIRING; if (gnDifficulty == DIFF_NIGHTMARE) { -#ifdef HELLFIRE - Monst->_mmaxhp = 3 * Monst->_mmaxhp + ((gbMaxPlayers != 1 ? 100 : 50) << 6); -#else - Monst->_mmaxhp = 3 * Monst->_mmaxhp + 64; -#endif + Monst->_mmaxhp = 3 * Monst->_mmaxhp; + if (gbIsHellfire) + Monst->_mmaxhp += (gbMaxPlayers != 1 ? 100 : 50) << 6; + else + Monst->_mmaxhp += 64; Monst->mLevel += 15; Monst->_mhitpoints = Monst->_mmaxhp; Monst->mExp = 2 * (Monst->mExp + 1000); @@ -875,18 +847,12 @@ void PlaceUniqueMonst(int uniqindex, int miniontype, int bosspacksize) Monst->mMaxDamage = 2 * (Monst->mMaxDamage + 2); Monst->mMinDamage2 = 2 * (Monst->mMinDamage2 + 2); Monst->mMaxDamage2 = 2 * (Monst->mMaxDamage2 + 2); - } - -#ifdef HELLFIRE - else if (gnDifficulty == DIFF_HELL) { -#else - if (gnDifficulty == DIFF_HELL) { -#endif -#ifdef HELLFIRE - Monst->_mmaxhp = 4 * Monst->_mmaxhp + ((gbMaxPlayers != 1 ? 200 : 100) << 6); -#else - Monst->_mmaxhp = 4 * Monst->_mmaxhp + 192; -#endif + } else if (gnDifficulty == DIFF_HELL) { + Monst->_mmaxhp = 4 * Monst->_mmaxhp; + if (gbIsHellfire) + Monst->_mmaxhp += (gbMaxPlayers != 1 ? 200 : 100) << 6; + else + Monst->_mmaxhp += 192; Monst->mLevel += 30; Monst->_mhitpoints = Monst->_mmaxhp; Monst->mExp = 4 * (Monst->mExp + 1000); @@ -1032,7 +998,6 @@ void PlaceQuestMonsters() SetMapMonsters(setp, 2 * setpc_x, 2 * setpc_y); mem_free_dbg(setp); } -#ifdef HELLFIRE if (currlevel == 24) { UberDiabloMonsterIndex = -1; @@ -1053,7 +1018,6 @@ void PlaceQuestMonsters() if (UberDiabloMonsterIndex == -1) PlaceUniqueMonst(UMT_NAKRUL, 0, 0); } -#endif } else if (setlvlnum == SL_SKELKING) { PlaceUniqueMonst(UMT_SKELKING, 0, 0); } @@ -1206,11 +1170,7 @@ void InitMonsters() mtype = scattertypes[random_(95, numscattypes)]; if (currlevel == 1 || random_(95, 2) == 0) na = 1; -#ifdef HELLFIRE else if (currlevel == 2 || currlevel >= 21 && currlevel <= 24) -#else - else if (currlevel == 2) -#endif na = random_(95, 2) + 2; else na = random_(95, 3) + 3; @@ -1288,7 +1248,6 @@ int AddMonster(int x, int y, int dir, int mtype, BOOL InMap) return -1; } -#ifdef HELLFIRE void monster_43C785(int i) { int x, y, d, j, oi, dir, mx, my; @@ -1320,7 +1279,6 @@ void monster_43C785(int i) } } } -#endif void NewMonsterAnim(int i, AnimStruct *anim, int md) { @@ -1793,7 +1751,6 @@ void M_DiabloDeath(int i, BOOL sendmsg) Monst->_mVar6 = (int)((Monst->_mVar4 - (Monst->_my << 16)) / (double)dist); } -#ifdef HELLFIRE void SpawnLoot(int i, BOOL sendmsg) { int nSFX; @@ -1830,7 +1787,6 @@ void SpawnLoot(int i, BOOL sendmsg) SpawnItem(i, Monst->_mx, Monst->_my, sendmsg); } } -#endif void M2MStartHit(int mid, int i, int dam) { @@ -1905,15 +1861,7 @@ void MonstStartKill(int i, int pnum, BOOL sendmsg) monstkills[Monst->MType->mtype]++; Monst->_mhitpoints = 0; SetRndSeed(Monst->_mRndSeed); -#ifdef HELLFIRE SpawnLoot(i, sendmsg); -#else - if (QuestStatus(Q_GARBUD) && Monst->mName == UniqMonst[UMT_GARBUD].mName) { - CreateTypeItem(Monst->_mx + 1, Monst->_my + 1, TRUE, ITYPE_MACE, IMISC_NONE, TRUE, FALSE); - } else if (i > MAX_PLRS - 1) { // Golems should not spawn items - SpawnItem(i, Monst->_mx, Monst->_my, sendmsg); - } -#endif if (Monst->MType->mtype == MT_DIABLO) M_DiabloDeath(i, TRUE); else @@ -1940,11 +1888,7 @@ void MonstStartKill(int i, int pnum, BOOL sendmsg) dMonster[Monst->_mx][Monst->_my] = i + 1; CheckQuestKill(i, sendmsg); M_FallenFear(Monst->_mx, Monst->_my); -#ifdef HELLFIRE if (Monst->MType->mtype >= MT_NACID && Monst->MType->mtype <= MT_XACID || Monst->MType->mtype == MT_SPIDLORD) -#else - if (Monst->MType->mtype >= MT_NACID && Monst->MType->mtype <= MT_XACID) -#endif AddMissile(Monst->_mx, Monst->_my, 0, 0, 0, MIS_ACIDPUD, TARGET_PLAYERS, i, Monst->_mint + 1, 0); } @@ -4155,7 +4099,6 @@ void MAI_Succ(int i) MAI_Ranged(i, MIS_FLARE, FALSE); } -#ifdef HELLFIRE void mai_ranged_441649(int i) { MAI_Ranged(i, MIS_LICH, FALSE); @@ -4175,14 +4118,12 @@ void mai_ranged_44166A(int i) { MAI_Ranged(i, MIS_NECROMORB, FALSE); } -#endif void MAI_AcidUniq(int i) { MAI_Ranged(i, MIS_ACID, TRUE); } -#ifdef HELLFIRE void mai_ranged_441680(int i) { MAI_Ranged(i, MIS_FIREBOLT, FALSE); @@ -4192,7 +4133,6 @@ void mai_ranged_44168B(int i) { MAI_Ranged(i, MIS_FIREBALL, FALSE); } -#endif void MAI_Scav(int i) { @@ -4404,12 +4344,10 @@ void MAI_Storm(int i) MAI_RoundRanged(i, MIS_LIGHTCTRL2, TRUE, 4, 0); } -#ifdef HELLFIRE void mai_roundranged_441EA0(int i) { MAI_RoundRanged(i, MIS_BONEDEMON, TRUE, 4, 0); } -#endif void MAI_Acid(int i) { @@ -4718,7 +4656,6 @@ void MAI_Rhino(int i) } } -#ifdef HELLFIRE void mai_horkdemon(int i) { MonsterStruct *Monst; @@ -4789,7 +4726,6 @@ void mai_horkdemon(int i) Monst->_mAnimData = Monst->MType->Anims[MA_STAND].Data[Monst->_mdir]; } } -#endif void MAI_Counselor(int i) { @@ -5229,7 +5165,6 @@ void ProcessMonsters() if (Monst->MType->mtype == MT_CLEAVER) { PlaySFX(USFX_CLEAVER); } -#ifdef HELLFIRE if (Monst->MType->mtype == MT_NAKRUL) { if (UseCowFarmer) { PlaySFX(USFX_NAKRUL6); @@ -5243,7 +5178,6 @@ void ProcessMonsters() if (Monst->MType->mtype == MT_DEFILER) PlaySFX(USFX_DEFILER8); M_Enemy(mi); -#endif } if (Monst->_mFlags & MFLAG_TARGETS_MONSTER) { @@ -5944,7 +5878,6 @@ BOOL PosOkMonst(int i, int x, int y) return ret; } -#ifdef HELLFIRE BOOLEAN monster_posok(int i, int x, int y) { int mi, j; @@ -5983,7 +5916,6 @@ BOOLEAN monster_posok(int i, int x, int y) } return ret; } -#endif BOOL PosOkMonst2(int i, int x, int y) { diff --git a/Source/monster.h b/Source/monster.h index e9df081bc..d09801abb 100644 --- a/Source/monster.h +++ b/Source/monster.h @@ -31,9 +31,7 @@ void InitMonsters(); void SetMapMonsters(BYTE *pMap, int startx, int starty); void DeleteMonster(int i); int AddMonster(int x, int y, int dir, int mtype, BOOL InMap); -#ifdef HELLFIRE void monster_43C785(int i); -#endif BOOL M_Talker(int i); void M_StartStand(int i, int md); void M_ClearSquares(int i); @@ -67,34 +65,26 @@ void MAI_GoatMc(int i); void MAI_Ranged(int i, int missile_type, BOOL special); void MAI_GoatBow(int i); void MAI_Succ(int i); -#ifdef HELLFIRE void mai_ranged_441649(int i); void mai_ranged_441654(int i); void mai_ranged_44165F(int i); void mai_ranged_44166A(int i); -#endif void MAI_AcidUniq(int i); -#ifdef HELLFIRE void mai_ranged_441680(int i); void mai_ranged_44168B(int i); -#endif void MAI_Scav(int i); void MAI_Garg(int i); void MAI_RoundRanged(int i, int missile_type, BOOL checkdoors, int dam, int lessmissiles); void MAI_Magma(int i); void MAI_Storm(int i); -#ifdef HELLFIRE void mai_roundranged_441EA0(int i); -#endif void MAI_Acid(int i); void MAI_Diablo(int i); void MAI_Mega(int i); void MAI_Golum(int i); void MAI_SkelKing(int i); void MAI_Rhino(int i); -#ifdef HELLFIRE void mai_horkdemon(int i); -#endif void MAI_Counselor(int i); void MAI_Garbud(int i); void MAI_Zhar(int i); @@ -118,9 +108,7 @@ void PrintMonstHistory(int mt); void PrintUniqueHistory(); void MissToMonst(int i, int x, int y); BOOL PosOkMonst(int i, int x, int y); -#ifdef HELLFIRE BOOLEAN monster_posok(int i, int x, int y); -#endif BOOL PosOkMonst2(int i, int x, int y); BOOL PosOkMonst3(int i, int x, int y); BOOL IsSkel(int mt); diff --git a/Source/msg.h b/Source/msg.h index 067323365..d426eba75 100644 --- a/Source/msg.h +++ b/Source/msg.h @@ -45,9 +45,7 @@ void NetSendCmdChItem(BOOL bHiPri, BYTE bLoc); void NetSendCmdDelItem(BOOL bHiPri, BYTE bLoc); void NetSendCmdDItem(BOOL bHiPri, int ii); void NetSendCmdDamage(BOOL bHiPri, BYTE bPlr, DWORD dwDam); -#ifdef HELLFIRE void NetSendCmdMonDmg(BOOL bHiPri, WORD bMon, DWORD dwDam); -#endif void NetSendCmdString(int pmask, const char *pszStr); void delta_close_portal(int pnum); DWORD ParseCmd(int pnum, TCmd *pCmd); diff --git a/Source/multi.cpp b/Source/multi.cpp index ebaf27ca1..ef1b26661 100644 --- a/Source/multi.cpp +++ b/Source/multi.cpp @@ -589,8 +589,6 @@ static int InitLevelType(int l) return DTYPE_CATACOMBS; if (l >= 9 && l <= 12) return DTYPE_CAVES; - -#ifdef HELLFIRE if (l >= 13 && l <= 16) return DTYPE_HELL; if (l >= 21 && l <= 24) @@ -599,9 +597,6 @@ static int InitLevelType(int l) return DTYPE_CAVES; // Hive return DTYPE_CATHEDRAL; -#else - return DTYPE_HELL; -#endif } static void SetupLocalCoords() diff --git a/Source/objdat.cpp b/Source/objdat.cpp index 1de6c54fe..92b3fcd25 100644 --- a/Source/objdat.cpp +++ b/Source/objdat.cpp @@ -240,11 +240,7 @@ ObjDataStruct AllObjects[] = { { 1, OFILE_ALTBOY, 0, 0, DTYPE_CATHEDRAL, THEME_NONE, Q_BETRAYER, 0, 1, 0, 128, TRUE, TRUE, TRUE, 0, 0, FALSE }, { 1, OFILE_MCIRL, 0, 0, DTYPE_CATHEDRAL, THEME_NONE, Q_BETRAYER, 0, 1, 0, 96, FALSE, TRUE, TRUE, 0, 0, FALSE }, { 1, OFILE_MCIRL, 0, 0, DTYPE_CATHEDRAL, THEME_NONE, Q_BETRAYER, 0, 1, 0, 96, FALSE, TRUE, TRUE, 0, 0, FALSE }, -#ifdef HELLFIRE - { 1, OFILE_BKSLBRNT, 1, 24, 0, THEME_NONE, -1, 0, 1, 0, 96, TRUE, TRUE, TRUE, 0, 3, FALSE }, // BUGFIX should only be loaded on level 1-12 (crypt masks as 1-4) -#else - { 1, OFILE_BKSLBRNT, 4, 12, 0, THEME_NONE, -1, 0, 1, 0, 96, TRUE, TRUE, TRUE, 0, 3, FALSE }, -#endif + { 1, OFILE_BKSLBRNT, 1, 12, 0, THEME_NONE, -1, 0, 1, 0, 96, TRUE, TRUE, TRUE, 0, 3, FALSE }, // BUGFIX should only be loaded on level 1-12 (crypt masks as 1-4) (fixed) { 1, OFILE_CANDLE2, 2, 12, 0, THEME_NONE, Q_BETRAYER, 1, 2, 4, 96, TRUE, TRUE, TRUE, 0, 0, FALSE }, { 1, OFILE_BOOK1, 13, 13, DTYPE_HELL, THEME_NONE, Q_WARLORD, 0, 4, 0, 96, TRUE, TRUE, TRUE, 0, 3, FALSE }, { 1, OFILE_ARMSTAND, 13, 13, 0, THEME_NONE, Q_WARLORD, 0, 1, 0, 96, TRUE, FALSE, TRUE, 0, 3, FALSE }, diff --git a/Source/objects.cpp b/Source/objects.cpp index 69d38dbc2..e08108057 100644 --- a/Source/objects.cpp +++ b/Source/objects.cpp @@ -26,7 +26,7 @@ int bxadd[8] = { -1, 0, 1, -1, 1, -1, 0, 1 }; /** Specifies the Y-coordinate delta between barrels. */ int byadd[8] = { -1, -1, -1, 0, 0, 1, 1, 1 }; /** Maps from shrine_id to shrine name. */ -const char *const shrinestrs[NUM_SHRINETYPE] = { +const char *const shrinestrs[] = { "Mysterious", "Hidden", "Gloomy", @@ -53,7 +53,6 @@ const char *const shrinestrs[NUM_SHRINETYPE] = { "Ornate", "Glimmering", "Tainted", -#ifdef HELLFIRE "Oily", "Glowing", "Mendicant's", @@ -62,10 +61,9 @@ const char *const shrinestrs[NUM_SHRINETYPE] = { "Shimmering", "Solar", "Murphy's", -#endif }; /** Specifies the minimum dungeon level on which each shrine will appear. */ -char shrinemin[NUM_SHRINETYPE] = { +char shrinemin[] = { 1, // Mysterious 1, // Hidden 1, // Gloomy @@ -92,7 +90,6 @@ char shrinemin[NUM_SHRINETYPE] = { 1, // Ornate 1, // Glimmering 1, // Tainted -#ifdef HELLFIRE 1, // Oily 1, // Glowing 1, // Mendicant's @@ -101,10 +98,9 @@ char shrinemin[NUM_SHRINETYPE] = { 1, // Shimmering 1, // Solar, 1, // Murphy's -#endif }; /** Specifies the maximum dungeon level on which each shrine will appear. */ -char shrinemax[NUM_SHRINETYPE] = { +char shrinemax[] = { MAX_LVLS, // Mysterious MAX_LVLS, // Hidden MAX_LVLS, // Gloomy @@ -131,7 +127,6 @@ char shrinemax[NUM_SHRINETYPE] = { MAX_LVLS, // Ornate MAX_LVLS, // Glimmering MAX_LVLS, // Tainted -#ifdef HELLFIRE MAX_LVLS, // Oily MAX_LVLS, // Glowing MAX_LVLS, // Mendicant's @@ -140,7 +135,6 @@ char shrinemax[NUM_SHRINETYPE] = { MAX_LVLS, // Shimmering MAX_LVLS, // Solar, MAX_LVLS, // Murphy's -#endif }; /** * Specifies the game type for which each shrine may appear. @@ -149,7 +143,7 @@ char shrinemax[NUM_SHRINETYPE] = { * SHRINETYPE_MULTI - 2 - mp only */ -BYTE shrineavail[NUM_SHRINETYPE] = { +BYTE shrineavail[] = { SHRINETYPE_ANY, // SHRINE_MYSTERIOUS SHRINETYPE_ANY, // SHRINE_HIDDEN SHRINETYPE_SINGLE, // SHRINE_GLOOMY @@ -176,7 +170,6 @@ BYTE shrineavail[NUM_SHRINETYPE] = { SHRINETYPE_ANY, // SHRINE_ORNATE SHRINETYPE_ANY, // SHRINE_GLIMMERING SHRINETYPE_MULTI, // SHRINE_TAINTED -#ifdef HELLFIRE SHRINETYPE_ANY, // SHRINE_OILY SHRINETYPE_ANY, // SHRINE_GLOWING SHRINETYPE_ANY, // SHRINE_MENDICANT @@ -185,7 +178,6 @@ BYTE shrineavail[NUM_SHRINETYPE] = { SHRINETYPE_ANY, // SHRINE_SHIMMERING SHRINETYPE_SINGLE, // SHRINE_SOLAR SHRINETYPE_ANY, // SHRINE_MURPHYS -#endif }; /** Maps from book_id to book name. */ const char *const StoryBookName[] = { @@ -769,7 +761,6 @@ void AddDiabObjs() mem_free_dbg(lpSetPiece); } -#ifdef HELLFIRE void objects_add_lv22(int s) { bool exit; @@ -843,7 +834,6 @@ void objects_454AF0(int a1, int a2, int a3) { objects_44D8C5(OBJ_STORYBOOK, a1, a2, a3); } -#endif void AddStoryBooks() { @@ -978,9 +968,7 @@ void InitObjects() BYTE *mem; ClrAllObjects(); -#ifdef HELLFIRE dword_6DE0E0 = 0; -#endif if (currlevel == 16) { AddDiabObjs(); } else { @@ -991,7 +979,6 @@ void InitObjects() if (currlevel == quests[Q_MUSHROOM]._qlevel && quests[Q_MUSHROOM]._qactive == QUEST_INIT) AddMushPatch(); -#ifdef HELLFIRE if (currlevel == 4 || currlevel == 8 || currlevel == 12) AddStoryBooks(); if (currlevel == 21) { @@ -1006,14 +993,6 @@ void InitObjects() if (currlevel == 24) { objects_add_lv24(); } -#else - if (currlevel == 4) - AddStoryBooks(); - if (currlevel == 8) - AddStoryBooks(); - if (currlevel == 12) - AddStoryBooks(); -#endif if (leveltype == DTYPE_CATHEDRAL) { if (QuestStatus(Q_BUTCHER)) AddTortures(); @@ -1593,7 +1572,6 @@ void AddSlainHero() AddObject(OBJ_SLAINHERO, x + 2, y + 2); } -#ifdef HELLFIRE void objects_44D8C5(int ot, int v2, int ox, int oy) { int oi; @@ -1679,7 +1657,6 @@ void objects_44DA68(int i, int a2) object[i]._oVar8 = 0; } } -#endif void AddObject(int ot, int ox, int oy) { @@ -4428,7 +4405,6 @@ void OperateStoryBook(int pnum, int i) if (object[i]._oSelFlag != 0 && !deltaload && !qtextflag && pnum == myplr) { object[i]._oAnimFrame = object[i]._oVar4; PlaySfxLoc(IS_ISCROL, object[i]._ox, object[i]._oy); -#ifdef HELLFIRE if (object[i]._oVar8 != 0 && currlevel == 24) { if (IsUberLeverActivated != 1 && quests[Q_NAKRUL]._qactive != 3 && objects_lv_24_454B04(object[i]._oVar8)) { NetSendCmd(FALSE, CMD_NAKRUL); @@ -4439,7 +4415,6 @@ void OperateStoryBook(int pnum, int i) quests[Q_NAKRUL]._qlog = 1; quests[Q_NAKRUL]._qmsg = object[i]._oVar2; } -#endif InitQTextMsg(object[i]._oVar2); NetSendCmdParam1(FALSE, CMD_OPERATEOBJ, i); } @@ -4880,10 +4855,8 @@ void SyncL1Doors(int i) object[i]._oMissFlag = FALSE; return; } -#ifdef HELLFIRE - else -#endif - object[i]._oMissFlag = TRUE; + + object[i]._oMissFlag = TRUE; x = object[i]._ox; y = object[i]._oy; diff --git a/Source/palette.cpp b/Source/palette.cpp index 3af200fd5..da1cf4719 100644 --- a/Source/palette.cpp +++ b/Source/palette.cpp @@ -49,9 +49,7 @@ void ApplyGamma(SDL_Color *dst, const SDL_Color *src, int n) void SaveGamma() { SRegSaveValue("Diablo", "Gamma Correction", 0, gamma_correction); -#ifndef HELLFIRE SRegSaveValue("Diablo", "Color Cycling", FALSE, color_cycling_enabled); -#endif } static void LoadGamma() @@ -69,11 +67,9 @@ static void LoadGamma() gamma_value = 100; } gamma_correction = gamma_value - gamma_value % 5; -#ifndef HELLFIRE if (!SRegLoadValue("Diablo", "Color Cycling", 0, &value)) value = 1; color_cycling_enabled = value; -#endif } void palette_init() diff --git a/Source/pfile.cpp b/Source/pfile.cpp index 723941dae..832f73b0f 100644 --- a/Source/pfile.cpp +++ b/Source/pfile.cpp @@ -301,20 +301,12 @@ BOOL pfile_ui_save_create(_uiheroinfo *heroinfo) PkPlayerStruct pkplr; save_num = pfile_get_save_num_from_name(heroinfo->name); -#ifdef HELLFIRE if (save_num >= MAX_CHARACTERS) { -#else - if (save_num == MAX_CHARACTERS) { -#endif for (save_num = 0; save_num < MAX_CHARACTERS; save_num++) { if (!hero_names[save_num][0]) break; } -#ifdef HELLFIRE if (save_num >= MAX_CHARACTERS) -#else - if (save_num == MAX_CHARACTERS) -#endif return FALSE; } if (!pfile_open_archive(FALSE, save_num)) diff --git a/Source/player.cpp b/Source/player.cpp index a88eca7be..a7761a7b0 100644 --- a/Source/player.cpp +++ b/Source/player.cpp @@ -1121,11 +1121,9 @@ void InitMultiView() BOOL SolidLoc(int x, int y) { -#ifndef HELLFIRE if (x < 0 || y < 0 || x >= MAXDUNX || y >= MAXDUNY) { return FALSE; } -#endif return nSolidTable[dPiece[x][y]]; } @@ -1923,10 +1921,8 @@ StartPlayerKill(int pnum, int earflag) ear._iCurs = ICURS_EAR_WARRIOR; } else if (plr[pnum]._pClass == PC_ROGUE) { ear._iCurs = ICURS_EAR_ROGUE; -#ifdef HELLFIRE } else if (plr[pnum]._pClass == PC_MONK || plr[pnum]._pClass == PC_BARD || plr[pnum]._pClass == PC_BARBARIAN) { ear._iCurs = ICURS_EAR_ROGUE; -#endif } ear._iCreateInfo = plr[pnum]._pName[0] << 8 | plr[pnum]._pName[1]; @@ -2311,11 +2307,7 @@ BOOL PM_DoWalk(int pnum) anim_len = AnimLenFromClass[plr[pnum]._pClass]; } -#ifndef HELLFIRE - if (plr[pnum]._pVar8 == anim_len) { -#else if (plr[pnum]._pVar8 >= anim_len) { -#endif dPlayer[plr[pnum]._px][plr[pnum]._py] = 0; plr[pnum]._px += plr[pnum]._pVar1; plr[pnum]._py += plr[pnum]._pVar2; @@ -2383,11 +2375,7 @@ BOOL PM_DoWalk2(int pnum) anim_len = AnimLenFromClass[plr[pnum]._pClass]; } -#ifndef HELLFIRE - if (plr[pnum]._pVar8 == anim_len) { -#else if (plr[pnum]._pVar8 >= anim_len) { -#endif dPlayer[plr[pnum]._pVar1][plr[pnum]._pVar2] = 0; if (leveltype != DTYPE_TOWN) { @@ -2451,11 +2439,7 @@ BOOL PM_DoWalk3(int pnum) anim_len = AnimLenFromClass[plr[pnum]._pClass]; } -#ifndef HELLFIRE - if (plr[pnum]._pVar8 == anim_len) { -#else if (plr[pnum]._pVar8 >= anim_len) { -#endif dPlayer[plr[pnum]._px][plr[pnum]._py] = 0; dFlags[plr[pnum]._pVar4][plr[pnum]._pVar5] &= ~BFLAG_PLAYERLR; plr[pnum]._px = plr[pnum]._pVar1; @@ -2536,11 +2520,7 @@ BOOL WeaponDur(int pnum, int durrnd) } plr[pnum].InvBody[INVLOC_HAND_LEFT]._iDurability--; -#ifdef HELLFIRE if (plr[pnum].InvBody[INVLOC_HAND_LEFT]._iDurability <= 0) { -#else - if (plr[pnum].InvBody[INVLOC_HAND_LEFT]._iDurability == 0) { -#endif NetSendCmdDelItem(TRUE, INVLOC_HAND_LEFT); plr[pnum].InvBody[INVLOC_HAND_LEFT]._itype = ITYPE_NONE; CalcPlrInv(pnum, TRUE); @@ -3700,7 +3680,6 @@ void ProcessPlayers() if (sfxdelay > 0) { sfxdelay--; if (sfxdelay == 0) { -#ifdef HELLFIRE switch (sfxdnum) { case USFX_DEFILER1: InitQTextMsg(286); @@ -3715,11 +3694,8 @@ void ProcessPlayers() InitQTextMsg(289); break; default: -#endif PlaySFX(sfxdnum); -#ifdef HELLFIRE } -#endif } } @@ -4175,7 +4151,6 @@ void CheckStats(int p) } else if (plr[p]._pClass == PC_SORCERER) { c = PC_SORCERER; } -#ifdef HELLFIRE else if (plr[p]._pClass == PC_MONK) { c = PC_MONK; } else if (plr[p]._pClass == PC_BARD) { @@ -4183,7 +4158,6 @@ void CheckStats(int p) } else if (plr[p]._pClass == PC_BARBARIAN) { c = PC_BARBARIAN; } -#endif for (i = 0; i < 4; i++) { switch (i) { @@ -4270,11 +4244,9 @@ void ModifyPlrMag(int p, int l) if (plr[p]._pClass == PC_SORCERER) { ms <<= 1; } -#ifdef HELLFIRE else if (plr[p]._pClass == PC_BARD) { ms += ms >> 1; } -#endif plr[p]._pMaxManaBase += ms; plr[p]._pMaxMana += ms; @@ -4337,10 +4309,8 @@ void ModifyPlrVit(int p, int l) ms = l << 6; if (plr[p]._pClass == PC_WARRIOR) { ms <<= 1; -#ifdef HELLFIRE } else if (plr[p]._pClass == PC_BARBARIAN) { ms <<= 1; -#endif } plr[p]._pHPBase += ms; @@ -4404,10 +4374,8 @@ void SetPlrMag(int p, int v) m = v << 6; if (plr[p]._pClass == PC_SORCERER) { m <<= 1; -#ifdef HELLFIRE } else if (plr[p]._pClass == PC_BARD) { m += m >> 1; -#endif } plr[p]._pMaxManaBase = m; @@ -4451,11 +4419,9 @@ void SetPlrVit(int p, int v) if (plr[p]._pClass == PC_WARRIOR) { hp <<= 1; } -#ifdef HELLFIRE else if (plr[p]._pClass == PC_BARBARIAN) { hp <<= 1; } -#endif plr[p]._pHPBase = hp; plr[p]._pMaxHPBase = hp; @@ -4469,9 +4435,7 @@ void InitDungMsgs(int pnum) } plr[pnum].pDungMsgs = 0; -#ifdef HELLFIRE plr[pnum].pDungMsgs2 = 0; -#endif } void PlayDungMsgs()