From cb3381916ea39d0b4b4b8e3e44377a5936347122 Mon Sep 17 00:00:00 2001 From: qndel Date: Mon, 12 Oct 2020 02:44:31 +0200 Subject: [PATCH 01/14] [hellfire] RightMouseDown bin exact --- Source/diablo.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Source/diablo.cpp b/Source/diablo.cpp index 20dd128fc..a7a471eab 100644 --- a/Source/diablo.cpp +++ b/Source/diablo.cpp @@ -1100,10 +1100,14 @@ void RightMouseDown() } else if (stextflag == STORE_NONE) { if (spselflag) { SetSpell(); +#ifdef HELLFIRE + } else if ((!sbookflag || MouseX <= RIGHT_PANEL) && (MouseY >= SPANEL_HEIGHT || (!TryIconCurs() && (pcursinvitem == -1 || !UseInvItem(myplr, pcursinvitem))))) { +#else } else if (MouseY >= SPANEL_HEIGHT || (!sbookflag || MouseX <= RIGHT_PANEL) && !TryIconCurs() && (pcursinvitem == -1 || !UseInvItem(myplr, pcursinvitem))) { +#endif if (pcurs == CURSOR_HAND) { if (pcursinvitem == -1 || !UseInvItem(myplr, pcursinvitem)) CheckPlrSpell(); From bec59ba793b1e6662e4f5e5d2ceee7ba2fc5a6fb Mon Sep 17 00:00:00 2001 From: qndel Date: Mon, 12 Oct 2020 02:49:49 +0200 Subject: [PATCH 02/14] [hellfire] AddMisexp bin exact --- Source/missiles.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Source/missiles.cpp b/Source/missiles.cpp index ff11bb050..6f9e1270b 100644 --- a/Source/missiles.cpp +++ b/Source/missiles.cpp @@ -2356,6 +2356,7 @@ void AddMisexp(int mi, int sx, int sy, int dx, int dy, int midir, char mienemy, if (mienemy && id > 0) { mon = monster[id].MType; +#ifndef HELLFIRE if (mon->mtype == MT_SUCCUBUS) SetMissAnim(mi, MFILE_FLAREEXP); if (mon->mtype == MT_SNOWWICH) @@ -2364,6 +2365,22 @@ void AddMisexp(int mi, int sx, int sy, int dx, int dy, int midir, char mienemy, SetMissAnim(mi, MFILE_SCBSEXPD); if (mon->mtype == MT_SOLBRNR) SetMissAnim(mi, MFILE_SCBSEXPC); +#else + switch (mon->mtype) { + case MT_SUCCUBUS: + SetMissAnim(mi, MFILE_FLAREEXP); + break; + case MT_SNOWWICH: + SetMissAnim(mi, MFILE_SCBSEXPB); + break; + case MT_HLSPWN: + SetMissAnim(mi, MFILE_SCBSEXPD); + break; + case MT_SOLBRNR: + SetMissAnim(mi, MFILE_SCBSEXPC); + break; + } +#endif } missile[mi]._mix = missile[dx]._mix; From 77c64b99d5d362bdecf158b6765f0fbc45e5be28 Mon Sep 17 00:00:00 2001 From: qndel Date: Mon, 12 Oct 2020 03:02:32 +0200 Subject: [PATCH 03/14] path_get_node1 cleanup --- Source/path.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Source/path.cpp b/Source/path.cpp index 39906fe5f..70970c4f4 100644 --- a/Source/path.cpp +++ b/Source/path.cpp @@ -269,9 +269,12 @@ BOOL path_parent_path(PATHNODE *pPath, int dx, int dy, int sx, int sy) PATHNODE *path_get_node1(int dx, int dy) { PATHNODE *result = path_2_nodes->NextNode; - while (result != NULL && (result->x != dx || result->y != dy)) + while (result != NULL) { + if (result->x == dx && result->y == dy) + return result; result = result->NextNode; - return result; + } + return NULL; } /** From 83f8fc5a90c5b5260d9be65aa10153ce26cd6afd Mon Sep 17 00:00:00 2001 From: qndel Date: Mon, 12 Oct 2020 03:06:01 +0200 Subject: [PATCH 04/14] path_get_node2 cleanup --- Source/path.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Source/path.cpp b/Source/path.cpp index 70970c4f4..996910ad8 100644 --- a/Source/path.cpp +++ b/Source/path.cpp @@ -283,9 +283,12 @@ PATHNODE *path_get_node1(int dx, int dy) PATHNODE *path_get_node2(int dx, int dy) { PATHNODE *result = pnode_ptr->NextNode; - while (result != NULL && (result->x != dx || result->y != dy)) + while (result != NULL) { + if (result->x == dx && result->y == dy) + return result; result = result->NextNode; - return result; + } + return NULL; } /** From 7c2ee3333fcbb7738356bf9c45a3469bddf87e57 Mon Sep 17 00:00:00 2001 From: qndel Date: Mon, 12 Oct 2020 03:13:00 +0200 Subject: [PATCH 05/14] Theme_MonstPit cleanup --- Source/themes.cpp | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/Source/themes.cpp b/Source/themes.cpp index 044fa4c58..a90a7be02 100644 --- a/Source/themes.cpp +++ b/Source/themes.cpp @@ -582,21 +582,18 @@ void Theme_MonstPit(int t) r = random_(0, 100) + 1; ixp = 0; iyp = 0; - if (r > 0) { - while (TRUE) { - if (dTransVal[ixp][iyp] == themes[t].ttval && !nSolidTable[dPiece[ixp][iyp]]) { - --r; - } - if (r <= 0) { - break; - } - ixp++; - if (ixp == MAXDUNX) { - ixp = 0; - iyp++; - if (iyp == MAXDUNY) { - iyp = 0; - } + while (r > 0) { + if (dTransVal[ixp][iyp] == themes[t].ttval && !nSolidTable[dPiece[ixp][iyp]]) { + --r; + } + if (r <= 0) + continue; + ixp++; + if (ixp == MAXDUNX) { + ixp = 0; + iyp++; + if (iyp == MAXDUNY) { + iyp = 0; } } } From 5d7eeddcc9fe562cd22c09b21ca2b3ead1fdb560 Mon Sep 17 00:00:00 2001 From: qndel Date: Mon, 12 Oct 2020 05:13:46 +0200 Subject: [PATCH 06/14] [hellfire] DrawChr bin exact --- Source/control.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Source/control.cpp b/Source/control.cpp index d8254b685..2cfda84bf 100644 --- a/Source/control.cpp +++ b/Source/control.cpp @@ -1902,6 +1902,9 @@ void DrawChr() CelDraw(SCREEN_X, 351 + SCREEN_Y, pChrPanel, 1, 320); ADD_PlrStringXY(20, 32, 151, plr[myplr]._pName, COL_WHITE); +#ifdef HELLFIRE + ADD_PlrStringXY(168, 32, 299, ClassStrTbl[plr[myplr]._pClass], COL_WHITE); +#else if (plr[myplr]._pClass == PC_WARRIOR) { ADD_PlrStringXY(168, 32, 299, "Warrior", COL_WHITE); #ifndef SPAWN @@ -1911,6 +1914,7 @@ void DrawChr() ADD_PlrStringXY(168, 32, 299, "Sorceror", COL_WHITE); #endif } +#endif sprintf(chrstr, "%i", plr[myplr]._pLevel); ADD_PlrStringXY(66, 69, 109, chrstr, COL_WHITE); From 41fc140628fe74e1fd2e5ab2c97ef665101f473e Mon Sep 17 00:00:00 2001 From: qndel Date: Mon, 12 Oct 2020 03:20:48 +0200 Subject: [PATCH 07/14] GetErrorStr cleanup --- Source/appfat.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Source/appfat.cpp b/Source/appfat.cpp index 68aa843e6..c0a193e45 100644 --- a/Source/appfat.cpp +++ b/Source/appfat.cpp @@ -78,8 +78,7 @@ char *GetErrorStr(DWORD error_code) size = strlen(sz_error_buf); chr = &sz_error_buf[size - 1]; - while (size > 0) { - size--; + while (size-- > 0) { chr--; if (*chr != '\r' && *chr != '\n') From 7d0dc08d6ca135c61540d02b1d96258b2862de49 Mon Sep 17 00:00:00 2001 From: qndel Date: Mon, 12 Oct 2020 04:59:32 +0200 Subject: [PATCH 08/14] AddFirewall cleanup --- Source/missiles.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Source/missiles.cpp b/Source/missiles.cpp index 6f9e1270b..16a535344 100644 --- a/Source/missiles.cpp +++ b/Source/missiles.cpp @@ -2274,13 +2274,15 @@ void AddFirewall(int mi, int sx, int sy, int dx, int dy, int midir, char mienemy { int i; - missile[mi]._midam = 16 * (random_(53, 10) + random_(53, 10) + plr[id]._pLevel + 2) >> 1; + missile[mi]._midam = (random_(53, 10) + random_(53, 10) + plr[id]._pLevel + 2) << 4; + missile[mi]._midam >>= 1; GetMissileVel(mi, sx, sy, dx, dy, 16); missile[mi]._mirange = 10; i = missile[mi]._mispllvl; if (i > 0) missile[mi]._mirange = 10 * (i + 1); - missile[mi]._mirange = ((missile[mi]._mirange * plr[id]._pISplDur >> 3) & 0xFFFFFFF0) + 16 * missile[mi]._mirange; + missile[mi]._mirange += (plr[id]._pISplDur * missile[mi]._mirange) >> 7; + missile[mi]._mirange <<= 4; missile[mi]._miVar1 = missile[mi]._mirange - missile[mi]._miAnimLen; missile[mi]._miVar2 = 0; } From ed11e3bde594fea118e7757191e2cb68a36cefd4 Mon Sep 17 00:00:00 2001 From: qndel Date: Mon, 12 Oct 2020 06:54:05 +0200 Subject: [PATCH 09/14] [hellfire] DrawSpellList bin exact --- Source/control.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Source/control.cpp b/Source/control.cpp index 2cfda84bf..9c5e99340 100644 --- a/Source/control.cpp +++ b/Source/control.cpp @@ -508,22 +508,22 @@ void DrawSpellList() switch ((spell_type)i) { case RSPLTYPE_SKILL: SetSpellTrans(RSPLTYPE_SKILL); - c = SPLICONLAST + 3; mask = plr[myplr]._pAblSpells; + c = SPLICONLAST + 3; break; case RSPLTYPE_SPELL: - c = SPLICONLAST + 4; mask = plr[myplr]._pMemSpells; + c = SPLICONLAST + 4; break; case RSPLTYPE_SCROLL: SetSpellTrans(RSPLTYPE_SCROLL); - c = SPLICONLAST + 1; mask = plr[myplr]._pScrlSpells; + c = SPLICONLAST + 1; break; case RSPLTYPE_CHARGES: SetSpellTrans(RSPLTYPE_CHARGES); - c = SPLICONLAST + 2; mask = plr[myplr]._pISpells; + c = SPLICONLAST + 2; break; } for (spl = 1, j = 1; j < MAX_SPELLS; spl <<= 1, j++) { @@ -549,10 +549,14 @@ void DrawSpellList() pSplType = i; #ifdef HELLFIRE if (plr[myplr]._pClass == PC_MONK && j == SPL_SEARCH) - i = RSPLTYPE_SKILL; + pSplType = RSPLTYPE_SKILL; #endif DrawSpellCel(x, y, pSpellCels, c, SPLICONLENGTH); +#ifdef HELLFIRE + switch (pSplType) { +#else switch (i) { +#endif case RSPLTYPE_SKILL: sprintf(infostr, "%s Skill", spelldata[pSpell].sSkillText); break; From 33a81f09210182e4e6915bc2e7f133eff494e7ce Mon Sep 17 00:00:00 2001 From: qndel Date: Mon, 12 Oct 2020 06:59:42 +0200 Subject: [PATCH 10/14] [hellfire] mainmenu_play_intro --- Source/mainmenu.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Source/mainmenu.cpp b/Source/mainmenu.cpp index fc6fe4cbc..d8edd9300 100644 --- a/Source/mainmenu.cpp +++ b/Source/mainmenu.cpp @@ -165,7 +165,11 @@ BOOL mainmenu_multi_player() void mainmenu_play_intro() { music_stop(); +#ifdef HELLFIRE + play_movie("gendata\\Hellfire.smk", TRUE); +#else play_movie("gendata\\diablo1.smk", TRUE); +#endif mainmenu_refresh_music(); } #endif From 02ddab6a3112062e9d1c4fb52d18d068e0e212a4 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Mon, 12 Oct 2020 09:08:42 +0200 Subject: [PATCH 11/14] Apply SPLICONLENGTH --- Source/control.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/control.cpp b/Source/control.cpp index 9c5e99340..71880bd11 100644 --- a/Source/control.cpp +++ b/Source/control.cpp @@ -489,9 +489,9 @@ void DrawSpell() st = RSPLTYPE_INVALID; SetSpellTrans(st); if (spl != SPL_INVALID) - DrawSpellCel(PANEL_X + 565, PANEL_Y + 119, pSpellCels, SpellITbl[spl], 56); + DrawSpellCel(PANEL_X + 565, PANEL_Y + 119, pSpellCels, SpellITbl[spl], SPLICONLENGTH); else - DrawSpellCel(PANEL_X + 565, PANEL_Y + 119, pSpellCels, 27, 56); + DrawSpellCel(PANEL_X + 565, PANEL_Y + 119, pSpellCels, 27, SPLICONLENGTH); } void DrawSpellList() From 9ce5149535bb9525860ee5ee15dcdd6ed1e6eb17 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Mon, 12 Oct 2020 09:09:37 +0200 Subject: [PATCH 12/14] Correct size of sprite --- Source/doom.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/doom.cpp b/Source/doom.cpp index 844c2c550..b7250830b 100644 --- a/Source/doom.cpp +++ b/Source/doom.cpp @@ -143,5 +143,5 @@ void doom_draw() } #endif - CelDraw(SCREEN_X, PANEL_Y - 1, pDoomCel, 1, SCREEN_WIDTH); + CelDraw(SCREEN_X, PANEL_Y - 1, pDoomCel, 1, 640); } From e837130a988de9469374f3288ce7412fb8768c5f Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Mon, 12 Oct 2020 09:13:26 +0200 Subject: [PATCH 13/14] Add missing book names (#2113) --- Source/objects.cpp | 67 ++++++++++++++++++++++++++-------------------- Source/objects.h | 2 +- 2 files changed, 39 insertions(+), 30 deletions(-) diff --git a/Source/objects.cpp b/Source/objects.cpp index dea941f0e..5e648d1b9 100644 --- a/Source/objects.cpp +++ b/Source/objects.cpp @@ -74,35 +74,35 @@ char shrinemax[NUM_SHRINETYPE] = { */ BYTE shrineavail[NUM_SHRINETYPE] = { - SHRINETYPE_ANY, // SHRINE_MYSTERIOUS - SHRINETYPE_ANY, // SHRINE_HIDDEN - SHRINETYPE_SINGLE, // SHRINE_GLOOMY - SHRINETYPE_SINGLE, // SHRINE_WEIRD - SHRINETYPE_ANY, // SHRINE_MAGICAL - SHRINETYPE_ANY, // SHRINE_STONE - SHRINETYPE_ANY, // SHRINE_RELIGIOUS - SHRINETYPE_ANY, // SHRINE_ENCHANTED - SHRINETYPE_SINGLE, // SHRINE_THAUMATURGIC - SHRINETYPE_ANY, // SHRINE_FASCINATING - SHRINETYPE_ANY, // SHRINE_CRYPTIC - SHRINETYPE_ANY, // SHRINE_MAGICAL2 - SHRINETYPE_ANY, // SHRINE_ELDRITCH - SHRINETYPE_ANY, // SHRINE_EERIE - SHRINETYPE_ANY, // SHRINE_DIVINE - SHRINETYPE_ANY, // SHRINE_HOLY - SHRINETYPE_ANY, // SHRINE_SACRED - SHRINETYPE_ANY, // SHRINE_SPIRITUAL - SHRINETYPE_MULTI, // SHRINE_SPOOKY - SHRINETYPE_ANY, // SHRINE_ABANDONED - SHRINETYPE_ANY, // SHRINE_CREEPY - SHRINETYPE_ANY, // SHRINE_QUIET - SHRINETYPE_ANY, // SHRINE_SECLUDED - SHRINETYPE_ANY, // SHRINE_ORNATE - SHRINETYPE_ANY, // SHRINE_GLIMMERING - SHRINETYPE_MULTI // SHRINE_TAINTED - }; + SHRINETYPE_ANY, // SHRINE_MYSTERIOUS + SHRINETYPE_ANY, // SHRINE_HIDDEN + SHRINETYPE_SINGLE, // SHRINE_GLOOMY + SHRINETYPE_SINGLE, // SHRINE_WEIRD + SHRINETYPE_ANY, // SHRINE_MAGICAL + SHRINETYPE_ANY, // SHRINE_STONE + SHRINETYPE_ANY, // SHRINE_RELIGIOUS + SHRINETYPE_ANY, // SHRINE_ENCHANTED + SHRINETYPE_SINGLE, // SHRINE_THAUMATURGIC + SHRINETYPE_ANY, // SHRINE_FASCINATING + SHRINETYPE_ANY, // SHRINE_CRYPTIC + SHRINETYPE_ANY, // SHRINE_MAGICAL2 + SHRINETYPE_ANY, // SHRINE_ELDRITCH + SHRINETYPE_ANY, // SHRINE_EERIE + SHRINETYPE_ANY, // SHRINE_DIVINE + SHRINETYPE_ANY, // SHRINE_HOLY + SHRINETYPE_ANY, // SHRINE_SACRED + SHRINETYPE_ANY, // SHRINE_SPIRITUAL + SHRINETYPE_MULTI, // SHRINE_SPOOKY + SHRINETYPE_ANY, // SHRINE_ABANDONED + SHRINETYPE_ANY, // SHRINE_CREEPY + SHRINETYPE_ANY, // SHRINE_QUIET + SHRINETYPE_ANY, // SHRINE_SECLUDED + SHRINETYPE_ANY, // SHRINE_ORNATE + SHRINETYPE_ANY, // SHRINE_GLIMMERING + SHRINETYPE_MULTI // SHRINE_TAINTED +}; /** Maps from book_id to book name. */ -char *StoryBookName[9] = { +char *StoryBookName[] = { "The Great Conflict", "The Wages of Sin are War", "The Tale of the Horadrim", @@ -111,7 +111,16 @@ char *StoryBookName[9] = { "The Binding of the Three", "The Realms Beyond", "Tale of the Three", - "The Black King" + "The Black King", +#ifdef HELLFIRE + "Journal: The Ensorcellment", + "Journal: The Meeting", + "Journal: The Tirade", + "Journal: His Power Grows", + "Journal: NA-KRUL", + "Journal: The End", + "A Spellbook", +#endif }; /** Specifies the speech IDs of each dungeon type narrator book, for each player class. */ int StoryText[3][3] = { diff --git a/Source/objects.h b/Source/objects.h index 862c8d338..c9b56871c 100644 --- a/Source/objects.h +++ b/Source/objects.h @@ -182,7 +182,7 @@ extern char *shrinestrs[NUM_SHRINETYPE]; extern char shrinemin[NUM_SHRINETYPE]; extern char shrinemax[NUM_SHRINETYPE]; extern BYTE shrineavail[NUM_SHRINETYPE]; -extern char *StoryBookName[9]; +extern char *StoryBookName[]; extern int StoryText[3][3]; #endif /* __OBJECTS_H__ */ From ef822ae7c44c48af22007ccef7809d4071c56197 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Mon, 12 Oct 2020 09:18:59 +0200 Subject: [PATCH 14/14] Fix crazy strobe effect in Hellfire --- Source/palette.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/palette.cpp b/Source/palette.cpp index 3a9a3239b..a9ead6852 100644 --- a/Source/palette.cpp +++ b/Source/palette.cpp @@ -296,7 +296,7 @@ void palette_update_crypt() if (dword_6E2D58 > 1) { col = system_palette[15]; - for (i = 15; i > 0; i--) { + for (i = 15; i > 1; i--) { system_palette[i].peRed = system_palette[i - 1].peRed; system_palette[i].peGreen = system_palette[i - 1].peGreen; system_palette[i].peBlue = system_palette[i - 1].peBlue; @@ -337,7 +337,7 @@ void palette_update_hive() if (dword_6E2D60 == 2) { col = system_palette[8]; - for (i = 8; i > 0; i--) { + for (i = 8; i > 1; i--) { system_palette[i].peRed = system_palette[i - 1].peRed; system_palette[i].peGreen = system_palette[i - 1].peGreen; system_palette[i].peBlue = system_palette[i - 1].peBlue;