From 955b50c45ae08fc0626045da771612a02bb83dee Mon Sep 17 00:00:00 2001 From: qndel Date: Thu, 5 Sep 2019 15:59:12 +0200 Subject: [PATCH 1/4] [hellfire] AddRndTeleport bin exact --- Source/missiles.cpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/Source/missiles.cpp b/Source/missiles.cpp index 70929224b..f1edd1d46 100644 --- a/Source/missiles.cpp +++ b/Source/missiles.cpp @@ -1295,13 +1295,28 @@ void AddRndTeleport(int mi, int sx, int sy, int dx, int dy, int midir, char mien if (random(58, 2) == 1) r2 = -r2; - } while (nSolidTable[dPiece[r1 + sx][sy + r2]] || dObject[r1 + sx][sy + r2] || dMonster[r1 + sx][sy + r2]); +#ifdef HELLFIRE + r1 += sx; + r2 += sy; + if (r1 <= MAXDUNX && r1 >= 0 && r2 <= MAXDUNY && r2 >= 0) { ///BUGFIX: < MAXDUNX / < MAXDUNY + pn = dPiece[r1][r2]; + } + } while (nSolidTable[pn] || dObject[r1][r2] || dMonster[r1][r2]); +#else + pn = dPiece[r1 + sx][sy + r2]; + } while (nSolidTable[pn] || dObject[r1 + sx][sy + r2] || dMonster[r1 + sx][sy + r2]); +#endif - missile[mi]._miVar1 = 0; missile[mi]._mirange = 2; + missile[mi]._miVar1 = 0; if (!setlevel || setlvlnum != SL_VILEBETRAYER) { +#ifdef HELLFIRE + missile[mi]._mix = r1; + missile[mi]._miy = r2; +#else missile[mi]._mix = sx + r1; missile[mi]._miy = sy + r2; +#endif if (!mienemy) UseMana(id, SPL_RNDTELEPORT); } else { From 96ff78e9e0881fee081d21a1d38c6e69711a9dfc Mon Sep 17 00:00:00 2001 From: qndel Date: Sun, 15 Sep 2019 03:33:25 +0200 Subject: [PATCH 2/4] [hellfire] WitchItemOk bin exact --- Source/items.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Source/items.cpp b/Source/items.cpp index cbec8f07d..b1f4bec8d 100644 --- a/Source/items.cpp +++ b/Source/items.cpp @@ -3701,6 +3701,20 @@ BOOL WitchItemOk(int i) BOOL rv; rv = FALSE; +#ifdef HELLFIRE + if (AllItemsList[i].itype == ITYPE_MISC || AllItemsList[i].itype == ITYPE_STAFF) + rv = TRUE; + if (AllItemsList[i].iMiscId == IMISC_MANA || AllItemsList[i].iMiscId == IMISC_FULLMANA) + rv = FALSE; + if (AllItemsList[i].iSpell == SPL_TOWN) + rv = FALSE; + if (AllItemsList[i].iMiscId == IMISC_FULLHEAL || AllItemsList[i].iMiscId == IMISC_HEAL) + rv = FALSE; + if (AllItemsList[i].iMiscId > IMISC_OILFIRST && AllItemsList[i].iMiscId < IMISC_OILLAST) + rv = FALSE; + if ((AllItemsList[i].iSpell == SPL_RESURRECT && gbMaxPlayers == 1) || (AllItemsList[i].iSpell == SPL_HEALOTHER && gbMaxPlayers == 1)) + rv = FALSE; +#else if (AllItemsList[i].itype == ITYPE_MISC) rv = TRUE; if (AllItemsList[i].itype == ITYPE_STAFF) @@ -3719,6 +3733,7 @@ BOOL WitchItemOk(int i) rv = FALSE; if (AllItemsList[i].iSpell == SPL_HEALOTHER && gbMaxPlayers == 1) rv = FALSE; +#endif return rv; } From 5d7e0d04f6e7a01b92803f38c9fb75bc5fd420f0 Mon Sep 17 00:00:00 2001 From: qndel Date: Mon, 7 Oct 2019 23:10:51 +0200 Subject: [PATCH 3/4] [hellfire] GetDamageAmt bin exact --- Source/missiles.cpp | 47 +++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 43 insertions(+), 4 deletions(-) diff --git a/Source/missiles.cpp b/Source/missiles.cpp index b7d6b8f37..a26c30a04 100644 --- a/Source/missiles.cpp +++ b/Source/missiles.cpp @@ -30,10 +30,18 @@ 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) { - *mind *= 2; +#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 *mind += *mind >> 1; } *maxd = 10; @@ -43,10 +51,18 @@ 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) { - *maxd *= 2; +#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 *maxd += *maxd >> 1; } *mind = -1; @@ -82,6 +98,13 @@ 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; @@ -170,10 +193,18 @@ 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) { - *mind *= 2; +#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; @@ -183,10 +214,18 @@ 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) { - *maxd *= 2; +#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; From 7fd66b103b773f1c3e45c20f4e99c6198199a5a9 Mon Sep 17 00:00:00 2001 From: qndel Date: Mon, 7 Oct 2019 23:45:00 +0200 Subject: [PATCH 4/4] [hellfire] game_2_ui_class / pfile_get_player_class bin exact (#1792) --- Source/pfile.cpp | 16 ++++++++++++++++ enums.h | 7 ++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/Source/pfile.cpp b/Source/pfile.cpp index e3f964c0c..cf8790ec3 100644 --- a/Source/pfile.cpp +++ b/Source/pfile.cpp @@ -235,6 +235,14 @@ BYTE game_2_ui_class(const PlayerStruct *p) uiclass = UI_WARRIOR; else if (p->_pClass == PC_ROGUE) uiclass = UI_ROGUE; +#ifdef HELLFIRE + else if (p->_pClass == PC_MONK) + uiclass = UI_MONK; + else if (p->_pClass == PC_BARD) + uiclass = UI_BARD; + else if (p->_pClass == PC_BARBARIAN) + uiclass = UI_BARBARIAN; +#endif else uiclass = UI_SORCERER; @@ -431,6 +439,14 @@ char pfile_get_player_class(unsigned int player_class_nr) pc_class = PC_WARRIOR; else if (player_class_nr == UI_ROGUE) pc_class = PC_ROGUE; +#ifdef HELLFIRE + else if (player_class_nr == 3) + pc_class = PC_MONK; + else if (player_class_nr == 4) + pc_class = PC_BARD; + else if (player_class_nr == 5) + pc_class = PC_BARBARIAN; +#endif else pc_class = PC_SORCERER; return pc_class; diff --git a/enums.h b/enums.h index 9beab5b42..548aa69f9 100644 --- a/enums.h +++ b/enums.h @@ -3102,7 +3102,12 @@ typedef enum _ui_classes { UI_WARRIOR = 0x0, UI_ROGUE = 0x1, UI_SORCERER = 0x2, - UI_NUM_CLASSES = 0x3, +#ifdef HELLFIRE + UI_MONK = 0x3, + UI_BARD = 0x4, + UI_BARBARIAN = 0x5, +#endif + UI_NUM_CLASSES, } _ui_classes; typedef enum _walk_path {