Browse Source

Merge remaning clean Hellfire code paths

pull/973/head
Anders Jenbo 5 years ago
parent
commit
8c261d0966
  1. 33
      Source/control.cpp
  2. 23
      Source/drlg_l1.cpp
  3. 37
      Source/gmenu.cpp
  4. 51
      Source/inv.cpp
  5. 7
      Source/inv.h
  6. 310
      Source/items.cpp
  7. 24
      Source/lighting.cpp
  8. 2
      Source/mainmenu.cpp
  9. 7
      Source/monstdat.cpp
  10. 35
      Source/msg.cpp
  11. 34
      Source/objects.cpp
  12. 7
      Source/player.cpp
  13. 14
      Source/spells.cpp
  14. 145
      Source/trigs.cpp
  15. 34
      SourceX/controls/plrctrls.cpp

33
Source/control.cpp

@ -221,21 +221,13 @@ int SpellPages[6][7] = {
{ SPL_RESURRECT, SPL_FIREWALL, SPL_TELEKINESIS, SPL_LIGHTNING, SPL_TOWN, SPL_FLASH, SPL_STONE }, { SPL_RESURRECT, SPL_FIREWALL, SPL_TELEKINESIS, SPL_LIGHTNING, SPL_TOWN, SPL_FLASH, SPL_STONE },
{ SPL_RNDTELEPORT, SPL_MANASHIELD, SPL_ELEMENT, SPL_FIREBALL, SPL_WAVE, SPL_CHAIN, SPL_GUARDIAN }, { SPL_RNDTELEPORT, SPL_MANASHIELD, SPL_ELEMENT, SPL_FIREBALL, SPL_WAVE, SPL_CHAIN, SPL_GUARDIAN },
{ SPL_NOVA, SPL_GOLEM, SPL_TELEPORT, SPL_APOCA, SPL_BONESPIRIT, SPL_FLARE, SPL_ETHEREALIZE }, { SPL_NOVA, SPL_GOLEM, SPL_TELEPORT, SPL_APOCA, SPL_BONESPIRIT, SPL_FLARE, SPL_ETHEREALIZE },
#ifndef HELLFIRE
{ -1, -1, -1, -1, -1, -1, -1 },
#else
{ SPL_LIGHTWALL, SPL_IMMOLAT, SPL_WARP, SPL_REFLECT, SPL_BERSERK, SPL_FIRERING, SPL_SEARCH }, { SPL_LIGHTWALL, SPL_IMMOLAT, SPL_WARP, SPL_REFLECT, SPL_BERSERK, SPL_FIRERING, SPL_SEARCH },
#endif
{ -1, -1, -1, -1, -1, -1, -1 } { -1, -1, -1, -1, -1, -1, -1 }
}; };
#define SPLICONLENGTH 56 #define SPLICONLENGTH 56
#define SPLROWICONLS 10 #define SPLROWICONLS 10
#ifdef HELLFIRE #define SPLICONLAST (gbIsHellfire ? 52 : 43)
#define SPLICONLAST 52
#else
#define SPLICONLAST 43
#endif
/** /**
* Draw spell cell onto the back buffer. * Draw spell cell onto the back buffer.
@ -348,7 +340,7 @@ void DrawSpellList()
y = PANEL_Y - 17; y = PANEL_Y - 17;
ClearPanel(); ClearPanel();
int maxSpells = gbIsHellfire ? MAX_SPELLS : 37; int maxSpells = gbIsHellfire ? MAX_SPELLS : 37;
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
switch ((spell_type)i) { switch ((spell_type)i) {
@ -921,7 +913,7 @@ void DoSpeedBook()
X = xo - (BORDER_LEFT - SPLICONLENGTH / 2); X = xo - (BORDER_LEFT - SPLICONLENGTH / 2);
Y = yo - (BORDER_TOP + SPLICONLENGTH / 2); Y = yo - (BORDER_TOP + SPLICONLENGTH / 2);
int maxSpells = gbIsHellfire ? MAX_SPELLS : 37; int maxSpells = gbIsHellfire ? MAX_SPELLS : 37;
if (plr[myplr]._pRSpell != SPL_INVALID) { if (plr[myplr]._pRSpell != SPL_INVALID) {
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
@ -1891,12 +1883,10 @@ void DrawSpellBook()
unsigned __int64 spl; unsigned __int64 spl;
CelDraw(RIGHT_PANEL_X, 351 + SCREEN_Y, pSpellBkCel, 1, SPANEL_WIDTH); CelDraw(RIGHT_PANEL_X, 351 + SCREEN_Y, pSpellBkCel, 1, SPANEL_WIDTH);
#ifdef HELLFIRE if (gbIsHellfire && sbooktab < 5)
if (sbooktab < 5)
CelDraw(RIGHT_PANEL_X + 61 * sbooktab + 7, 348 + SCREEN_Y, pSBkBtnCel, sbooktab + 1, 61); CelDraw(RIGHT_PANEL_X + 61 * sbooktab + 7, 348 + SCREEN_Y, pSBkBtnCel, sbooktab + 1, 61);
#else else if (gbIsHellfire && sbooktab < 4)
CelDraw(RIGHT_PANEL_X + 76 * sbooktab + 7, 348 + SCREEN_Y, pSBkBtnCel, sbooktab + 1, 76); CelDraw(RIGHT_PANEL_X + 76 * sbooktab + 7, 348 + SCREEN_Y, pSBkBtnCel, sbooktab + 1, 76);
#endif
spl = plr[myplr]._pMemSpells | plr[myplr]._pISpells | plr[myplr]._pAblSpells; spl = plr[myplr]._pMemSpells | plr[myplr]._pISpells | plr[myplr]._pAblSpells;
@ -2261,18 +2251,7 @@ static void control_press_enter()
BYTE talk_save; BYTE talk_save;
if (sgszTalkMsg[0] != 0) { if (sgszTalkMsg[0] != 0) {
#ifdef HELLFIRE
int pmask;
pmask = 0;
for (i = 0; i < MAX_PLRS; i++) {
if (whisper[i])
pmask |= 1 << i;
}
NetSendCmdString(pmask, sgszTalkMsg);
#else
control_reset_talk_msg(sgszTalkMsg); control_reset_talk_msg(sgszTalkMsg);
#endif
for (i = 0; i < 8; i++) { for (i = 0; i < 8; i++) {
if (!strcmp(sgszTalkSave[i], sgszTalkMsg)) if (!strcmp(sgszTalkSave[i], sgszTalkMsg))
break; break;

23
Source/drlg_l1.cpp

@ -2457,7 +2457,6 @@ static void DRLG_L5DirtFix()
{ {
int i, j; int i, j;
#ifdef HELLFIRE
if (currlevel < 21) { if (currlevel < 21) {
for (j = 0; j < DMAXY - 1; j++) { for (j = 0; j < DMAXY - 1; j++) {
for (i = 0; i < DMAXX - 1; i++) { for (i = 0; i < DMAXX - 1; i++) {
@ -2491,24 +2490,6 @@ static void DRLG_L5DirtFix()
} }
} }
} }
#else
for (j = 0; j < DMAXY; j++) {
for (i = 0; i < DMAXX; i++) {
if (dungeon[i][j] == 21 && dungeon[i + 1][j] != 19)
dungeon[i][j] = 202;
if (dungeon[i][j] == 19 && dungeon[i + 1][j] != 19)
dungeon[i][j] = 200;
if (dungeon[i][j] == 24 && dungeon[i + 1][j] != 19)
dungeon[i][j] = 205;
if (dungeon[i][j] == 18 && dungeon[i][j + 1] != 18)
dungeon[i][j] = 199;
if (dungeon[i][j] == 21 && dungeon[i][j + 1] != 18)
dungeon[i][j] = 202;
if (dungeon[i][j] == 23 && dungeon[i][j + 1] != 18)
dungeon[i][j] = 204;
}
}
#endif
} }
static void DRLG_L5CornerFix() static void DRLG_L5CornerFix()
@ -2757,9 +2738,7 @@ static void DRLG_L5(int entry)
void CreateL5Dungeon(DWORD rseed, int entry) void CreateL5Dungeon(DWORD rseed, int entry)
{ {
#ifdef HELLFIRE
int i, j; int i, j;
#endif
SetRndSeed(rseed); SetRndSeed(rseed);
@ -2791,7 +2770,6 @@ void CreateL5Dungeon(DWORD rseed, int entry)
DRLG_SetPC(); DRLG_SetPC();
#ifdef HELLFIRE
for (j = dminy; j < dmaxy; j++) { for (j = dminy; j < dmaxy; j++) {
for (i = dminx; i < dmaxx; i++) { for (i = dminx; i < dmaxx; i++) {
if (dPiece[i][j] == 290) { if (dPiece[i][j] == 290) {
@ -2804,7 +2782,6 @@ void CreateL5Dungeon(DWORD rseed, int entry)
} }
} }
} }
#endif
} }
void drlg_l1_crypt_pattern1(int rndper) void drlg_l1_crypt_pattern1(int rndper)

37
Source/gmenu.cpp

@ -82,9 +82,7 @@ void FreeGMenu()
void gmenu_init_menu() void gmenu_init_menu()
{ {
#ifdef HELLFIRE
LogoAnim_frame = 1; LogoAnim_frame = 1;
#endif
sgpCurrentMenu = NULL; sgpCurrentMenu = NULL;
sgpCurrItem = NULL; sgpCurrItem = NULL;
gmenu_current_option = NULL; gmenu_current_option = NULL;
@ -188,28 +186,17 @@ static int gmenu_get_lfont(TMenuItem *pItem)
static void gmenu_draw_menu_item(TMenuItem *pItem, int y) static void gmenu_draw_menu_item(TMenuItem *pItem, int y)
{ {
DWORD w, x, nSteps, step, pos, t; DWORD w, x, nSteps, step, pos;
#ifndef HELLFIRE
t = y - 2;
#endif
w = gmenu_get_lfont(pItem); w = gmenu_get_lfont(pItem);
if (pItem->dwFlags & GMENU_SLIDER) { if (pItem->dwFlags & GMENU_SLIDER) {
x = 16 + w / 2 + SCREEN_X; x = 16 + w / 2 + SCREEN_X;
#ifdef HELLFIRE
CelDraw(x + PANEL_LEFT, y - 10, optbar_cel, 1, 287); CelDraw(x + PANEL_LEFT, y - 10, optbar_cel, 1, 287);
#else
CelDraw(x + PANEL_LEFT, t - 8, optbar_cel, 1, 287);
#endif
step = pItem->dwFlags & 0xFFF; step = pItem->dwFlags & 0xFFF;
nSteps = (pItem->dwFlags & 0xFFF000) >> 12; nSteps = (pItem->dwFlags & 0xFFF000) >> 12;
if (nSteps < 2) if (nSteps < 2)
nSteps = 2; nSteps = 2;
pos = step * 256 / nSteps; pos = step * 256 / nSteps;
#ifdef HELLFIRE
gmenu_clear_buffer(x + 2 + PANEL_LEFT, y - 12, pos + 13, 28); gmenu_clear_buffer(x + 2 + PANEL_LEFT, y - 12, pos + 13, 28);
#else
gmenu_clear_buffer(x + 2 + PANEL_LEFT, t - 10, pos + 13, 28);
#endif
CelDraw(x + 2 + pos + PANEL_LEFT, y - 12, option_cel, 1, 27); CelDraw(x + 2 + pos + PANEL_LEFT, y - 12, option_cel, 1, 27);
} }
x = SCREEN_WIDTH / 2 - w / 2 + SCREEN_X; x = SCREEN_WIDTH / 2 - w / 2 + SCREEN_X;
@ -230,18 +217,18 @@ void gmenu_draw()
if (sgpCurrentMenu) { if (sgpCurrentMenu) {
if (gmenu_current_option) if (gmenu_current_option)
gmenu_current_option(sgpCurrentMenu); gmenu_current_option(sgpCurrentMenu);
#ifdef HELLFIRE if (gbIsHellfire) {
ticks = SDL_GetTicks(); ticks = SDL_GetTicks();
if ((int)(ticks - LogoAnim_tick) > 25) { if ((int)(ticks - LogoAnim_tick) > 25) {
LogoAnim_frame++; LogoAnim_frame++;
if (LogoAnim_frame > 16) if (LogoAnim_frame > 16)
LogoAnim_frame = 1; LogoAnim_frame = 1;
LogoAnim_tick = ticks; LogoAnim_tick = ticks;
}
CelDraw((SCREEN_WIDTH - 430) / 2 + SCREEN_X, 102 + SCREEN_Y + UI_OFFSET_Y, sgpLogo, LogoAnim_frame, 430);
} else {
CelDraw((SCREEN_WIDTH - 296) / 2 + SCREEN_X, 102 + SCREEN_Y + UI_OFFSET_Y, sgpLogo, 1, 296);
} }
CelDraw((SCREEN_WIDTH - 430) / 2 + SCREEN_X, 102 + SCREEN_Y + UI_OFFSET_Y, sgpLogo, LogoAnim_frame, 430);
#else
CelDraw((SCREEN_WIDTH - 296) / 2 + SCREEN_X, 102 + SCREEN_Y + UI_OFFSET_Y, sgpLogo, 1, 296);
#endif
y = 160 + SCREEN_Y + UI_OFFSET_Y; y = 160 + SCREEN_Y + UI_OFFSET_Y;
i = sgpCurrentMenu; i = sgpCurrentMenu;
if (sgpCurrentMenu->fnMenu) { if (sgpCurrentMenu->fnMenu) {

51
Source/inv.cpp

@ -358,11 +358,9 @@ void DrawInv()
} }
if (plr[myplr].InvBody[INVLOC_HAND_LEFT]._iLoc == ILOC_TWOHAND) { if (plr[myplr].InvBody[INVLOC_HAND_LEFT]._iLoc == ILOC_TWOHAND) {
#ifdef HELLFIRE
if (plr[myplr]._pClass != PC_BARBARIAN if (plr[myplr]._pClass != PC_BARBARIAN
|| plr[myplr].InvBody[INVLOC_HAND_LEFT]._itype != ITYPE_SWORD || plr[myplr].InvBody[INVLOC_HAND_LEFT]._itype != ITYPE_SWORD
&& plr[myplr].InvBody[INVLOC_HAND_LEFT]._itype != ITYPE_MACE) { && plr[myplr].InvBody[INVLOC_HAND_LEFT]._itype != ITYPE_MACE) {
#endif
InvDrawSlotBack(RIGHT_PANEL_X + 248, 160 + SCREEN_Y, 2 * INV_SLOT_SIZE_PX, 3 * INV_SLOT_SIZE_PX); InvDrawSlotBack(RIGHT_PANEL_X + 248, 160 + SCREEN_Y, 2 * INV_SLOT_SIZE_PX, 3 * INV_SLOT_SIZE_PX);
light_table_index = 0; light_table_index = 0;
cel_transparency_active = TRUE; cel_transparency_active = TRUE;
@ -377,9 +375,7 @@ void DrawInv()
} }
cel_transparency_active = FALSE; cel_transparency_active = FALSE;
#ifdef HELLFIRE
} }
#endif
} }
} }
if (plr[myplr].InvBody[INVLOC_HAND_RIGHT]._itype != ITYPE_NONE) { if (plr[myplr].InvBody[INVLOC_HAND_RIGHT]._itype != ITYPE_NONE) {
@ -1074,10 +1070,7 @@ void CheckInvPaste(int pnum, int mx, int my)
if (r <= SLOTXY_HAND_LEFT_LAST) { if (r <= SLOTXY_HAND_LEFT_LAST) {
if (plr[pnum].InvBody[INVLOC_HAND_LEFT]._itype == ITYPE_NONE) { if (plr[pnum].InvBody[INVLOC_HAND_LEFT]._itype == ITYPE_NONE) {
if ((plr[pnum].InvBody[INVLOC_HAND_RIGHT]._itype == ITYPE_NONE || plr[pnum].InvBody[INVLOC_HAND_RIGHT]._iClass != plr[pnum].HoldItem._iClass) if ((plr[pnum].InvBody[INVLOC_HAND_RIGHT]._itype == ITYPE_NONE || plr[pnum].InvBody[INVLOC_HAND_RIGHT]._iClass != plr[pnum].HoldItem._iClass)
#ifdef HELLFIRE || (plr[pnum]._pClass == PC_BARD && plr[pnum].InvBody[INVLOC_HAND_RIGHT]._iClass == ICLASS_WEAPON && plr[pnum].HoldItem._iClass == ICLASS_WEAPON)) {
|| (plr[pnum]._pClass == PC_BARD && plr[pnum].InvBody[INVLOC_HAND_RIGHT]._iClass == ICLASS_WEAPON && plr[pnum].HoldItem._iClass == ICLASS_WEAPON)
#endif
) {
NetSendCmdChItem(FALSE, INVLOC_HAND_LEFT); NetSendCmdChItem(FALSE, INVLOC_HAND_LEFT);
plr[pnum].InvBody[INVLOC_HAND_LEFT] = plr[pnum].HoldItem; plr[pnum].InvBody[INVLOC_HAND_LEFT] = plr[pnum].HoldItem;
} else { } else {
@ -1087,10 +1080,7 @@ void CheckInvPaste(int pnum, int mx, int my)
break; break;
} }
if ((plr[pnum].InvBody[INVLOC_HAND_RIGHT]._itype == ITYPE_NONE || plr[pnum].InvBody[INVLOC_HAND_RIGHT]._iClass != plr[pnum].HoldItem._iClass) if ((plr[pnum].InvBody[INVLOC_HAND_RIGHT]._itype == ITYPE_NONE || plr[pnum].InvBody[INVLOC_HAND_RIGHT]._iClass != plr[pnum].HoldItem._iClass)
#ifdef HELLFIRE || (plr[pnum]._pClass == PC_BARD && plr[pnum].InvBody[INVLOC_HAND_RIGHT]._iClass == ICLASS_WEAPON && plr[pnum].HoldItem._iClass == ICLASS_WEAPON)) {
|| (plr[pnum]._pClass == PC_BARD && plr[pnum].InvBody[INVLOC_HAND_RIGHT]._iClass == ICLASS_WEAPON && plr[pnum].HoldItem._iClass == ICLASS_WEAPON)
#endif
) {
NetSendCmdChItem(FALSE, INVLOC_HAND_LEFT); NetSendCmdChItem(FALSE, INVLOC_HAND_LEFT);
cn = SwapItem(&plr[pnum].InvBody[INVLOC_HAND_LEFT], &plr[pnum].HoldItem); cn = SwapItem(&plr[pnum].InvBody[INVLOC_HAND_LEFT], &plr[pnum].HoldItem);
break; break;
@ -1125,10 +1115,7 @@ void CheckInvPaste(int pnum, int mx, int my)
} }
if ((plr[pnum].InvBody[INVLOC_HAND_LEFT]._itype != ITYPE_NONE && plr[pnum].InvBody[INVLOC_HAND_LEFT]._iClass == plr[pnum].HoldItem._iClass) if ((plr[pnum].InvBody[INVLOC_HAND_LEFT]._itype != ITYPE_NONE && plr[pnum].InvBody[INVLOC_HAND_LEFT]._iClass == plr[pnum].HoldItem._iClass)
#ifdef HELLFIRE && !(plr[pnum]._pClass == PC_BARD && plr[pnum].InvBody[INVLOC_HAND_LEFT]._iClass == ICLASS_WEAPON && plr[pnum].HoldItem._iClass == ICLASS_WEAPON)) {
&& !(plr[pnum]._pClass == PC_BARD && plr[pnum].InvBody[INVLOC_HAND_LEFT]._iClass == ICLASS_WEAPON && plr[pnum].HoldItem._iClass == ICLASS_WEAPON)
#endif
) {
NetSendCmdChItem(FALSE, INVLOC_HAND_LEFT); NetSendCmdChItem(FALSE, INVLOC_HAND_LEFT);
cn = SwapItem(&plr[pnum].InvBody[INVLOC_HAND_LEFT], &plr[pnum].HoldItem); cn = SwapItem(&plr[pnum].InvBody[INVLOC_HAND_LEFT], &plr[pnum].HoldItem);
break; break;
@ -1800,9 +1787,7 @@ void CheckQuestItem(int pnum)
void InvGetItem(int pnum, int ii) void InvGetItem(int pnum, int ii)
{ {
int i; int i;
#ifdef HELLFIRE
BOOL cursor_updated; BOOL cursor_updated;
#endif
if (dropGoldFlag) { if (dropGoldFlag) {
dropGoldFlag = FALSE; dropGoldFlag = FALSE;
@ -1820,13 +1805,12 @@ void InvGetItem(int pnum, int ii)
CheckQuestItem(pnum); CheckQuestItem(pnum);
CheckBookLevel(pnum); CheckBookLevel(pnum);
CheckItemStats(pnum); CheckItemStats(pnum);
#ifdef HELLFIRE
cursor_updated = FALSE; cursor_updated = FALSE;
#ifdef HELLFIRE
if (plr[pnum].HoldItem._itype == ITYPE_GOLD && GoldAutoPlace(pnum)) if (plr[pnum].HoldItem._itype == ITYPE_GOLD && GoldAutoPlace(pnum))
cursor_updated = TRUE; cursor_updated = TRUE;
#endif #endif
dItem[item[ii]._ix][item[ii]._iy] = 0; dItem[item[ii]._ix][item[ii]._iy] = 0;
#ifdef HELLFIRE
if (currlevel == 21 && item[ii]._ix == CornerStone.x && item[ii]._iy == CornerStone.y) { if (currlevel == 21 && item[ii]._ix == CornerStone.x && item[ii]._iy == CornerStone.y) {
CornerStone.item.IDidx = -1; CornerStone.item.IDidx = -1;
CornerStone.item._itype = ITYPE_MISC; CornerStone.item._itype = ITYPE_MISC;
@ -1837,7 +1821,6 @@ void InvGetItem(int pnum, int ii)
CornerStone.item._iIdentified = FALSE; CornerStone.item._iIdentified = FALSE;
CornerStone.item._iPostDraw = FALSE; CornerStone.item._iPostDraw = FALSE;
} }
#endif
i = 0; i = 0;
while (i < numitems) { while (i < numitems) {
if (itemactive[i] == ii) { if (itemactive[i] == ii) {
@ -1848,9 +1831,7 @@ void InvGetItem(int pnum, int ii)
} }
} }
pcursitem = -1; pcursitem = -1;
#ifdef HELLFIRE
if (!cursor_updated) if (!cursor_updated)
#endif
SetCursor_(plr[pnum].HoldItem._iCurs + CURSOR_FIRSTITEM); SetCursor_(plr[pnum].HoldItem._iCurs + CURSOR_FIRSTITEM);
} }
} }
@ -1892,11 +1873,9 @@ void AutoGetItem(int pnum, int ii)
#endif #endif
} else { } else {
done = FALSE; done = FALSE;
if (((plr[pnum]._pgfxnum & 0xF) == ANIM_ID_UNARMED || (plr[pnum]._pgfxnum & 0xF) == ANIM_ID_UNARMED_SHIELD if (((plr[pnum]._pgfxnum & 0xF) == ANIM_ID_UNARMED
#ifdef HELLFIRE || (plr[pnum]._pgfxnum & 0xF) == ANIM_ID_UNARMED_SHIELD
|| plr[pnum]._pClass == PC_BARD && ((plr[pnum]._pgfxnum & 0xF) == ANIM_ID_MACE || (plr[pnum]._pgfxnum & 0xF) == ANIM_ID_SWORD) || plr[pnum]._pClass == PC_BARD && ((plr[pnum]._pgfxnum & 0xF) == ANIM_ID_MACE || (plr[pnum]._pgfxnum & 0xF) == ANIM_ID_SWORD))
#endif
)
&& plr[pnum]._pmode <= PM_WALK3) { && plr[pnum]._pmode <= PM_WALK3) {
if (plr[pnum].HoldItem._iStatFlag) { if (plr[pnum].HoldItem._iStatFlag) {
if (plr[pnum].HoldItem._iClass == ICLASS_WEAPON) { if (plr[pnum].HoldItem._iClass == ICLASS_WEAPON) {
@ -2077,10 +2056,7 @@ void SyncGetItem(int x, int y, int idx, WORD ci, int iseed)
if (itemactive[i] == ii) { if (itemactive[i] == ii) {
DeleteItem(itemactive[i], i); DeleteItem(itemactive[i], i);
FindGetItem(idx, ci, iseed); FindGetItem(idx, ci, iseed);
#ifndef HELLFIRE assert(FindGetItem(idx, ci, iseed) == -1);
/// ASSERT: assert(FindGetItem(idx,ci,iseed) == -1);
FindGetItem(idx, ci, iseed); /* todo: replace with above */
#endif
i = 0; i = 0;
} else { } else {
i++; i++;
@ -2262,12 +2238,7 @@ int InvPutItem(int pnum, int x, int y)
return ii; return ii;
} }
int SyncPutItem(int pnum, int x, int y, int idx, WORD icreateinfo, int iseed, int Id, int dur, int mdur, int ch, int mch, int ivalue, DWORD ibuff int SyncPutItem(int pnum, int x, int y, int idx, WORD icreateinfo, int iseed, int Id, int dur, int mdur, int ch, int mch, int ivalue, DWORD ibuff, int to_hit, int max_dam, int min_str, int min_mag, int min_dex, int ac)
#ifdef HELLFIRE
,
int to_hit, int max_dam, int min_str, int min_mag, int min_dex, int ac
#endif
)
{ {
BOOL done; BOOL done;
int d, ii; int d, ii;
@ -2407,12 +2378,8 @@ char CheckInvHLight()
pi = &p->InvBody[rv]; pi = &p->InvBody[rv];
} else if (r >= SLOTXY_HAND_RIGHT_FIRST && r <= SLOTXY_HAND_RIGHT_LAST) { } else if (r >= SLOTXY_HAND_RIGHT_FIRST && r <= SLOTXY_HAND_RIGHT_LAST) {
pi = &p->InvBody[INVLOC_HAND_LEFT]; pi = &p->InvBody[INVLOC_HAND_LEFT];
#ifdef HELLFIRE
if (pi->_itype == ITYPE_NONE || pi->_iLoc != ILOC_TWOHAND if (pi->_itype == ITYPE_NONE || pi->_iLoc != ILOC_TWOHAND
|| (p->_pClass == PC_BARBARIAN && (p->InvBody[INVLOC_HAND_LEFT]._itype == ITYPE_SWORD || p->InvBody[INVLOC_HAND_LEFT]._itype == ITYPE_MACE))) { || (p->_pClass == PC_BARBARIAN && (p->InvBody[INVLOC_HAND_LEFT]._itype == ITYPE_SWORD || p->InvBody[INVLOC_HAND_LEFT]._itype == ITYPE_MACE))) {
#else
if (pi->_itype == ITYPE_NONE || pi->_iLoc != ILOC_TWOHAND) {
#endif
rv = INVLOC_HAND_RIGHT; rv = INVLOC_HAND_RIGHT;
pi = &p->InvBody[rv]; pi = &p->InvBody[rv];
} else { } else {

7
Source/inv.h

@ -39,12 +39,7 @@ BOOL CanPut(int x, int y);
BOOL TryInvPut(); BOOL TryInvPut();
void DrawInvMsg(const char *msg); void DrawInvMsg(const char *msg);
int InvPutItem(int pnum, int x, int y); int InvPutItem(int pnum, int x, int y);
int SyncPutItem(int pnum, int x, int y, int idx, WORD icreateinfo, int iseed, int Id, int dur, int mdur, int ch, int mch, int ivalue, DWORD ibuff int SyncPutItem(int pnum, int x, int y, int idx, WORD icreateinfo, int iseed, int Id, int dur, int mdur, int ch, int mch, int ivalue, DWORD ibuff, int to_hit, int max_dam, int min_str, int min_mag, int min_dex, int ac);
#ifdef HELLFIRE
,
int to_hit, int max_dam, int min_str, int min_mag, int min_dex, int ac
#endif
);
char CheckInvHLight(); char CheckInvHLight();
void RemoveScroll(int pnum); void RemoveScroll(int pnum);
BOOL UseScroll(); BOOL UseScroll();

310
Source/items.cpp

@ -1056,7 +1056,6 @@ void CalcPlrItemVals(int p, BOOL Loadgfx)
break; break;
} }
} }
#ifdef HELLFIRE
if (plr[p].InvBody[INVLOC_AMULET]._itype == ITYPE_NONE || plr[p].InvBody[INVLOC_AMULET].IDidx != IDI_AURIC) { if (plr[p].InvBody[INVLOC_AMULET]._itype == ITYPE_NONE || plr[p].InvBody[INVLOC_AMULET].IDidx != IDI_AURIC) {
int half = MaxGold; int half = MaxGold;
MaxGold = auricGold / 2; MaxGold = auricGold / 2;
@ -1066,7 +1065,6 @@ void CalcPlrItemVals(int p, BOOL Loadgfx)
} else { } else {
MaxGold = auricGold; MaxGold = auricGold;
} }
#endif
drawmanaflag = TRUE; drawmanaflag = TRUE;
drawhpflag = TRUE; drawhpflag = TRUE;
@ -1198,9 +1196,7 @@ void CalcPlrBookVals(int p)
if (currlevel == 0) { if (currlevel == 0) {
for (i = 1; witchitem[i]._itype != ITYPE_NONE; i++) { for (i = 1; witchitem[i]._itype != ITYPE_NONE; i++) {
WitchBookLevel(i); WitchBookLevel(i);
#ifndef HELLFIRE
witchitem[i]._iStatFlag = StoreStatOk(&witchitem[i]); witchitem[i]._iStatFlag = StoreStatOk(&witchitem[i]);
#endif
} }
} }
@ -1259,11 +1255,7 @@ void SetPlrHandItem(ItemStruct *h, int idata)
h->_iSpell = pAllItem->iSpell; h->_iSpell = pAllItem->iSpell;
if (pAllItem->iMiscId == IMISC_STAFF) { if (pAllItem->iMiscId == IMISC_STAFF) {
#ifdef HELLFIRE h->_iCharges = gbIsHellfire ? 18 : 40;
h->_iCharges = 18;
#else
h->_iCharges = 40;
#endif
} }
h->_iMaxCharges = h->_iCharges; h->_iMaxCharges = h->_iCharges;
@ -1720,14 +1712,10 @@ void GetStaffSpell(int i, int lvl, BOOL onlygood)
int l, rv, s, minc, maxc, v, bs; int l, rv, s, minc, maxc, v, bs;
char istr[64]; char istr[64];
int maxSpells = gbIsHellfire ? MAX_SPELLS : 37; if (!gbIsHellfire && random_(17, 4) == 0) {
#ifndef HELLFIRE
if (random_(17, 4) == 0) {
GetItemPower(i, lvl >> 1, lvl, PLT_STAFF, onlygood); GetItemPower(i, lvl >> 1, lvl, PLT_STAFF, onlygood);
} else } else {
#endif int maxSpells = gbIsHellfire ? MAX_SPELLS : 37;
{
l = lvl >> 1; l = lvl >> 1;
if (l == 0) if (l == 0)
l = 1; l = 1;
@ -1803,9 +1791,7 @@ void GetOilType(int i, int max_lvl)
void GetItemAttrs(int i, int idata, int lvl) void GetItemAttrs(int i, int idata, int lvl)
{ {
int rndv; int rndv;
#ifdef HELLFIRE
int itemlevel; int itemlevel;
#endif
item[i]._itype = AllItemsList[idata].itype; item[i]._itype = AllItemsList[idata].itype;
item[i]._iCurs = AllItemsList[idata].iCurs; item[i]._iCurs = AllItemsList[idata].iCurs;
@ -1818,6 +1804,8 @@ void GetItemAttrs(int i, int idata, int lvl)
item[i]._iAC = AllItemsList[idata].iMinAC + random_(20, AllItemsList[idata].iMaxAC - AllItemsList[idata].iMinAC + 1); item[i]._iAC = AllItemsList[idata].iMinAC + random_(20, AllItemsList[idata].iMaxAC - AllItemsList[idata].iMinAC + 1);
#ifndef HELLFIRE #ifndef HELLFIRE
item[i]._iFlags = AllItemsList[idata].iFlags; item[i]._iFlags = AllItemsList[idata].iFlags;
#else
item[i]._iFlags = 0;
#endif #endif
item[i]._iMiscId = AllItemsList[idata].iMiscId; item[i]._iMiscId = AllItemsList[idata].iMiscId;
item[i]._iSpell = AllItemsList[idata].iSpell; item[i]._iSpell = AllItemsList[idata].iSpell;
@ -1862,35 +1850,20 @@ void GetItemAttrs(int i, int idata, int lvl)
item[i]._iSufPower = -1; item[i]._iSufPower = -1;
item[i]._iDamAcFlags = 0; item[i]._iDamAcFlags = 0;
#ifndef HELLFIRE
if (item[i]._iMiscId == IMISC_BOOK)
GetBookSpell(i, lvl);
if (item[i]._itype == ITYPE_GOLD) {
if (gnDifficulty == DIFF_NORMAL)
rndv = 5 * currlevel + random_(21, 10 * currlevel);
if (gnDifficulty == DIFF_NIGHTMARE)
rndv = 5 * (currlevel + 16) + random_(21, 10 * (currlevel + 16));
if (gnDifficulty == DIFF_HELL)
rndv = 5 * (currlevel + 32) + random_(21, 10 * (currlevel + 32));
#else
item[i]._iFlags = 0;
if (item[i]._iMiscId == IMISC_BOOK) if (item[i]._iMiscId == IMISC_BOOK)
GetBookSpell(i, lvl); GetBookSpell(i, lvl);
if (item[i]._iMiscId == IMISC_OILOF) if (gbIsHellfire && item[i]._iMiscId == IMISC_OILOF)
GetOilType(i, lvl); GetOilType(i, lvl);
itemlevel = items_get_currlevel();
if (item[i]._itype == ITYPE_GOLD) { if (item[i]._itype == ITYPE_GOLD) {
itemlevel = items_get_currlevel();
if (gnDifficulty == DIFF_NORMAL) if (gnDifficulty == DIFF_NORMAL)
rndv = 5 * itemlevel + random_(21, 10 * itemlevel); rndv = 5 * itemlevel + random_(21, 10 * itemlevel);
else if (gnDifficulty == DIFF_NIGHTMARE) else if (gnDifficulty == DIFF_NIGHTMARE)
rndv = 5 * (itemlevel + 16) + random_(21, 10 * (itemlevel + 16)); rndv = 5 * (itemlevel + 16) + random_(21, 10 * (itemlevel + 16));
else if (gnDifficulty == DIFF_HELL) else if (gnDifficulty == DIFF_HELL)
rndv = 5 * (itemlevel + 32) + random_(21, 10 * (itemlevel + 32)); rndv = 5 * (itemlevel + 32) + random_(21, 10 * (itemlevel + 32));
#endif
if (leveltype == DTYPE_HELL) if (leveltype == DTYPE_HELL)
rndv += rndv >> 3; rndv += rndv >> 3;
if (rndv > GOLD_MAX_LIMIT) if (rndv > GOLD_MAX_LIMIT)
@ -2012,11 +1985,7 @@ void SaveItemPower(int i, int power, int param1, int param2, int minval, int max
break; break;
case IPL_SPELL: case IPL_SPELL:
item[i]._iSpell = param1; item[i]._iSpell = param1;
#ifdef HELLFIRE
item[i]._iCharges = param2; item[i]._iCharges = param2;
#else
item[i]._iCharges = param1; // BUGFIX: should be param2. This code was correct in v1.04, and the bug was introduced between 1.04 and 1.09b.
#endif
item[i]._iMaxCharges = param2; item[i]._iMaxCharges = param2;
break; break;
case IPL_FIREDAM: case IPL_FIREDAM:
@ -2150,7 +2119,6 @@ void SaveItemPower(int i, int power, int param1, int param2, int minval, int max
item[i]._iFMaxDam = 0; item[i]._iFMaxDam = 0;
#endif #endif
break; break;
#ifdef HELLFIRE
case IPL_FIREBALL: case IPL_FIREBALL:
item[i]._iFlags |= (ISPL_LIGHT_ARROWS | ISPL_FIRE_ARROWS); item[i]._iFlags |= (ISPL_LIGHT_ARROWS | ISPL_FIRE_ARROWS);
item[i]._iFMinDam = param1; item[i]._iFMinDam = param1;
@ -2158,7 +2126,6 @@ void SaveItemPower(int i, int power, int param1, int param2, int minval, int max
item[i]._iLMinDam = 0; item[i]._iLMinDam = 0;
item[i]._iLMaxDam = 0; item[i]._iLMaxDam = 0;
break; break;
#endif
case IPL_THORNS: case IPL_THORNS:
item[i]._iFlags |= ISPL_THORNS; item[i]._iFlags |= ISPL_THORNS;
break; break;
@ -2262,26 +2229,18 @@ void SaveItemPower(int i, int power, int param1, int param2, int minval, int max
item[i]._iCurs = param1; item[i]._iCurs = param1;
break; break;
case IPL_ADDACLIFE: case IPL_ADDACLIFE:
#ifdef HELLFIRE
item[i]._iFlags |= (ISPL_LIGHT_ARROWS | ISPL_FIRE_ARROWS); item[i]._iFlags |= (ISPL_LIGHT_ARROWS | ISPL_FIRE_ARROWS);
item[i]._iFMinDam = param1; item[i]._iFMinDam = param1;
item[i]._iFMaxDam = param2; item[i]._iFMaxDam = param2;
item[i]._iLMinDam = 1; item[i]._iLMinDam = 1;
item[i]._iLMaxDam = 0; item[i]._iLMaxDam = 0;
#else
item[i]._iPLHP = (plr[myplr]._pIBonusAC + plr[myplr]._pIAC + plr[myplr]._pDexterity / 5) << 6;
#endif
break; break;
case IPL_ADDMANAAC: case IPL_ADDMANAAC:
#ifdef HELLFIRE
item[i]._iFlags |= (ISPL_LIGHTDAM | ISPL_FIREDAM); item[i]._iFlags |= (ISPL_LIGHTDAM | ISPL_FIREDAM);
item[i]._iFMinDam = param1; item[i]._iFMinDam = param1;
item[i]._iFMaxDam = param2; item[i]._iFMaxDam = param2;
item[i]._iLMinDam = 2; item[i]._iLMinDam = 2;
item[i]._iLMaxDam = 0; item[i]._iLMaxDam = 0;
#else
item[i]._iAC += (plr[myplr]._pMaxManaBase >> 6) / 10;
#endif
break; break;
case IPL_FIRERESCLVL: case IPL_FIRERESCLVL:
item[i]._iPLFR = 30 - plr[myplr]._pLevel; item[i]._iPLFR = 30 - plr[myplr]._pLevel;
@ -2520,18 +2479,12 @@ int RndItem(int m)
ri = 0; ri = 0;
for (i = 0; AllItemsList[i].iLoc != ILOC_INVALID; i++) { for (i = 0; AllItemsList[i].iLoc != ILOC_INVALID; i++) {
if (AllItemsList[i].iRnd == IDROP_DOUBLE && monster[m].mLevel >= AllItemsList[i].iMinMLvl if (AllItemsList[i].iRnd == IDROP_DOUBLE && monster[m].mLevel >= AllItemsList[i].iMinMLvl
#ifdef HELLFIRE && ri < 512) {
&& ri < 512
#endif
) {
ril[ri] = i; ril[ri] = i;
ri++; ri++;
} }
if (AllItemsList[i].iRnd != IDROP_NEVER && monster[m].mLevel >= AllItemsList[i].iMinMLvl if (AllItemsList[i].iRnd != IDROP_NEVER && monster[m].mLevel >= AllItemsList[i].iMinMLvl
#ifdef HELLFIRE && ri < 512) {
&& ri < 512
#endif
) {
ril[ri] = i; ril[ri] = i;
ri++; ri++;
} }
@ -2579,11 +2532,7 @@ int RndUItem(int m)
okflag = FALSE; okflag = FALSE;
if (AllItemsList[i].iSpell == SPL_HEALOTHER && gbMaxPlayers == 1) if (AllItemsList[i].iSpell == SPL_HEALOTHER && gbMaxPlayers == 1)
okflag = FALSE; okflag = FALSE;
#ifdef HELLFIRE
if (okflag && ri < 512) { if (okflag && ri < 512) {
#else
if (okflag) {
#endif
ril[ri] = i; ril[ri] = i;
ri++; ri++;
} }
@ -2895,43 +2844,40 @@ void SetupAllUseful(int ii, int iseed, int lvl)
item[ii]._iSeed = iseed; item[ii]._iSeed = iseed;
SetRndSeed(iseed); SetRndSeed(iseed);
#ifdef HELLFIRE if (gbIsHellfire) {
idx = random_(34, 7); idx = random_(34, 7);
switch (idx) { switch (idx) {
case 0: case 0:
idx = IDI_PORTAL; idx = IDI_PORTAL;
if ((lvl <= 1)) if ((lvl <= 1))
idx = IDI_HEAL;
break;
case 1:
case 2:
idx = IDI_HEAL; idx = IDI_HEAL;
break; break;
case 1: case 3:
case 2: idx = IDI_PORTAL;
idx = IDI_HEAL; if ((lvl <= 1))
break; idx = IDI_MANA;
case 3: break;
idx = IDI_PORTAL; case 4:
if ((lvl <= 1)) case 5:
idx = IDI_MANA;
break;
default:
idx = IDI_OIL;
break;
}
} else {
if (random_(34, 2) != 0)
idx = IDI_HEAL;
else
idx = IDI_MANA; idx = IDI_MANA;
break;
case 4:
case 5:
idx = IDI_MANA;
break;
case 6:
idx = IDI_OIL;
break;
default:
idx = IDI_OIL;
break;
}
#else
if (random_(34, 2) != 0)
idx = IDI_HEAL;
else
idx = IDI_MANA;
if (lvl > 1 && random_(34, 3) == 0) if (lvl > 1 && random_(34, 3) == 0)
idx = IDI_PORTAL; idx = IDI_PORTAL;
#endif }
GetItemAttrs(ii, idx, lvl); GetItemAttrs(ii, idx, lvl);
item[ii]._iCreateInfo = lvl + CF_USEFUL; item[ii]._iCreateInfo = lvl + CF_USEFUL;
@ -3972,21 +3918,13 @@ void PrintItemPower(char plidx, ItemStruct *x)
strcpy(tempstr, " "); strcpy(tempstr, " ");
break; break;
case IPL_ADDACLIFE: case IPL_ADDACLIFE:
#ifdef HELLFIRE
if (x->_iFMinDam == x->_iFMaxDam) if (x->_iFMinDam == x->_iFMaxDam)
sprintf(tempstr, "lightning damage: %i", x->_iFMinDam); sprintf(tempstr, "lightning damage: %i", x->_iFMinDam);
else else
sprintf(tempstr, "lightning damage: %i-%i", x->_iFMinDam, x->_iFMaxDam); sprintf(tempstr, "lightning damage: %i-%i", x->_iFMinDam, x->_iFMaxDam);
#else
strcpy(tempstr, "Armor class added to life");
#endif
break; break;
case IPL_ADDMANAAC: case IPL_ADDMANAAC:
#ifdef HELLFIRE
strcpy(tempstr, "charged bolts on hits"); strcpy(tempstr, "charged bolts on hits");
#else
strcpy(tempstr, "10% of mana added to armor");
#endif
break; break;
case IPL_FIRERESCLVL: case IPL_FIRERESCLVL:
if (x->_iPLFR <= 0) if (x->_iPLFR <= 0)
@ -4168,18 +4106,17 @@ void PrintItemDetails(ItemStruct *x)
BYTE mag; BYTE mag;
if (x->_iClass == ICLASS_WEAPON) { if (x->_iClass == ICLASS_WEAPON) {
#ifdef HELLFIRE
if (x->_iMinDam == x->_iMaxDam) { if (x->_iMinDam == x->_iMaxDam) {
if (x->_iMaxDur == 255) if (x->_iMaxDur == 255)
sprintf(tempstr, "damage: %i Indestructible", x->_iMinDam); sprintf(tempstr, "damage: %i Indestructible", x->_iMinDam);
else else
sprintf(tempstr, "damage: %i Dur: %i/%i", x->_iMinDam, x->_iDurability, x->_iMaxDur); sprintf(tempstr, "damage: %i Dur: %i/%i", x->_iMinDam, x->_iDurability, x->_iMaxDur);
} else } else {
#endif if (x->_iMaxDur == DUR_INDESTRUCTIBLE)
if (x->_iMaxDur == DUR_INDESTRUCTIBLE) sprintf(tempstr, "damage: %i-%i Indestructible", x->_iMinDam, x->_iMaxDam);
sprintf(tempstr, "damage: %i-%i Indestructible", x->_iMinDam, x->_iMaxDam); else
else sprintf(tempstr, "damage: %i-%i Dur: %i/%i", x->_iMinDam, x->_iMaxDam, x->_iDurability, x->_iMaxDur);
sprintf(tempstr, "damage: %i-%i Dur: %i/%i", x->_iMinDam, x->_iMaxDam, x->_iDurability, x->_iMaxDur); }
AddPanelString(tempstr, TRUE); AddPanelString(tempstr, TRUE);
} }
if (x->_iClass == ICLASS_ARMOR) { if (x->_iClass == ICLASS_ARMOR) {
@ -4190,11 +4127,9 @@ void PrintItemDetails(ItemStruct *x)
AddPanelString(tempstr, TRUE); AddPanelString(tempstr, TRUE);
} }
if (x->_iMiscId == IMISC_STAFF && x->_iMaxCharges) { if (x->_iMiscId == IMISC_STAFF && x->_iMaxCharges) {
#ifdef HELLFIRE
if (x->_iMinDam == x->_iMaxDam) if (x->_iMinDam == x->_iMaxDam)
sprintf(tempstr, "dam: %i Dur: %i/%i", x->_iMinDam, x->_iDurability, x->_iMaxDur); sprintf(tempstr, "dam: %i Dur: %i/%i", x->_iMinDam, x->_iDurability, x->_iMaxDur);
else else
#endif
sprintf(tempstr, "dam: %i-%i Dur: %i/%i", x->_iMinDam, x->_iMaxDam, x->_iDurability, x->_iMaxDur); sprintf(tempstr, "dam: %i-%i Dur: %i/%i", x->_iMinDam, x->_iMaxDam, x->_iDurability, x->_iMaxDur);
sprintf(tempstr, "Charges: %i/%i", x->_iCharges, x->_iMaxCharges); sprintf(tempstr, "Charges: %i/%i", x->_iCharges, x->_iMaxCharges);
AddPanelString(tempstr, TRUE); AddPanelString(tempstr, TRUE);
@ -4235,18 +4170,17 @@ void PrintItemDur(ItemStruct *x)
BYTE mag; BYTE mag;
if (x->_iClass == ICLASS_WEAPON) { if (x->_iClass == ICLASS_WEAPON) {
#ifdef HELLFIRE
if (x->_iMinDam == x->_iMaxDam) { if (x->_iMinDam == x->_iMaxDam) {
if (x->_iMaxDur == 255) if (x->_iMaxDur == 255)
sprintf(tempstr, "damage: %i Indestructible", x->_iMinDam); sprintf(tempstr, "damage: %i Indestructible", x->_iMinDam);
else else
sprintf(tempstr, "damage: %i Dur: %i/%i", x->_iMinDam, x->_iDurability, x->_iMaxDur); sprintf(tempstr, "damage: %i Dur: %i/%i", x->_iMinDam, x->_iDurability, x->_iMaxDur);
} else } else {
#endif if (x->_iMaxDur == DUR_INDESTRUCTIBLE)
if (x->_iMaxDur == DUR_INDESTRUCTIBLE) sprintf(tempstr, "damage: %i-%i Indestructible", x->_iMinDam, x->_iMaxDam);
sprintf(tempstr, "damage: %i-%i Indestructible", x->_iMinDam, x->_iMaxDam); else
else sprintf(tempstr, "damage: %i-%i Dur: %i/%i", x->_iMinDam, x->_iMaxDam, x->_iDurability, x->_iMaxDur);
sprintf(tempstr, "damage: %i-%i Dur: %i/%i", x->_iMinDam, x->_iMaxDam, x->_iDurability, x->_iMaxDur); }
AddPanelString(tempstr, TRUE); AddPanelString(tempstr, TRUE);
if (x->_iMiscId == IMISC_STAFF && x->_iMaxCharges) { if (x->_iMiscId == IMISC_STAFF && x->_iMaxCharges) {
sprintf(tempstr, "Charges: %i/%i", x->_iCharges, x->_iMaxCharges); sprintf(tempstr, "Charges: %i/%i", x->_iCharges, x->_iMaxCharges);
@ -4539,11 +4473,7 @@ BOOL SmithItemOk(int i)
rv = FALSE; rv = FALSE;
if (AllItemsList[i].itype == ITYPE_MEAT) if (AllItemsList[i].itype == ITYPE_MEAT)
rv = FALSE; rv = FALSE;
#ifdef HELLFIRE if (AllItemsList[i].itype == ITYPE_STAFF && (!gbIsHellfire || AllItemsList[i].iSpell))
if (AllItemsList[i].itype == ITYPE_STAFF && AllItemsList[i].iSpell)
#else
if (AllItemsList[i].itype == ITYPE_STAFF)
#endif
rv = FALSE; rv = FALSE;
if (AllItemsList[i].itype == ITYPE_RING) if (AllItemsList[i].itype == ITYPE_RING)
rv = FALSE; rv = FALSE;
@ -4702,7 +4632,6 @@ static void SpawnOnePremium(int i, int plvl, int myplr)
holditem = item[0]; holditem = item[0];
#ifdef HELLFIRE
int ivalue; int ivalue;
int count = 0; int count = 0;
@ -4724,7 +4653,6 @@ static void SpawnOnePremium(int i, int plvl, int myplr)
magic = plr[myplr]._pMagic; magic = plr[myplr]._pMagic;
} }
magic *= 1.2; magic *= 1.2;
#endif
if (plvl > 30) if (plvl > 30)
plvl = 30; plvl = 30;
@ -4740,7 +4668,12 @@ static void SpawnOnePremium(int i, int plvl, int myplr)
GetItemAttrs(0, itype, plvl); GetItemAttrs(0, itype, plvl);
GetItemBonus(0, itype, plvl >> 1, plvl, TRUE, FALSE); GetItemBonus(0, itype, plvl >> 1, plvl, TRUE, FALSE);
#ifdef HELLFIRE if (!gbIsHellfire) {
if (item[0]._iIvalue > maxValue)
continue;
break;
}
ivalue = 0; ivalue = 0;
switch (item[0]._itype) { switch (item[0]._itype) {
case ITYPE_LARMOR: case ITYPE_LARMOR:
@ -4785,9 +4718,6 @@ static void SpawnOnePremium(int i, int plvl, int myplr)
|| item[0]._iMinDex > dexterity || item[0]._iMinDex > dexterity
|| item[0]._iIvalue < ivalue) || item[0]._iIvalue < ivalue)
&& count < 150); && count < 150);
#else
} while (item[0]._iIvalue > maxValue);
#endif
premiumitem[i] = item[0]; premiumitem[i] = item[0];
premiumitem[i]._iCreateInfo = plvl | CF_SMITHPREMIUM; premiumitem[i]._iCreateInfo = plvl | CF_SMITHPREMIUM;
premiumitem[i]._iIdentified = TRUE; premiumitem[i]._iIdentified = TRUE;
@ -4812,30 +4742,30 @@ void SpawnPremium(int pnum)
} }
while (premiumlevel < lvl) { while (premiumlevel < lvl) {
premiumlevel++; premiumlevel++;
#ifdef HELLFIRE if (gbIsHellfire) {
premiumitem[0] = premiumitem[3]; premiumitem[0] = premiumitem[3];
premiumitem[1] = premiumitem[4]; premiumitem[1] = premiumitem[4];
premiumitem[2] = premiumitem[5]; premiumitem[2] = premiumitem[5];
premiumitem[3] = premiumitem[6]; premiumitem[3] = premiumitem[6];
premiumitem[4] = premiumitem[7]; premiumitem[4] = premiumitem[7];
premiumitem[5] = premiumitem[8]; premiumitem[5] = premiumitem[8];
premiumitem[6] = premiumitem[9]; premiumitem[6] = premiumitem[9];
premiumitem[7] = premiumitem[10]; premiumitem[7] = premiumitem[10];
premiumitem[8] = premiumitem[11]; premiumitem[8] = premiumitem[11];
premiumitem[9] = premiumitem[12]; premiumitem[9] = premiumitem[12];
SpawnOnePremium(10, premiumlevel + premiumLvlAddHellfire[10], pnum); SpawnOnePremium(10, premiumlevel + premiumLvlAddHellfire[10], pnum);
premiumitem[11] = premiumitem[13]; premiumitem[11] = premiumitem[13];
SpawnOnePremium(12, premiumlevel + premiumLvlAddHellfire[12], pnum); SpawnOnePremium(12, premiumlevel + premiumLvlAddHellfire[12], pnum);
premiumitem[13] = premiumitem[14]; premiumitem[13] = premiumitem[14];
SpawnOnePremium(14, premiumlevel + premiumLvlAddHellfire[14], pnum); SpawnOnePremium(14, premiumlevel + premiumLvlAddHellfire[14], pnum);
#else } else {
premiumitem[0] = premiumitem[2]; premiumitem[0] = premiumitem[2];
premiumitem[1] = premiumitem[3]; premiumitem[1] = premiumitem[3];
premiumitem[2] = premiumitem[4]; premiumitem[2] = premiumitem[4];
SpawnOnePremium(3, premiumlevel + premiumlvladd[3], pnum); SpawnOnePremium(3, premiumlevel + premiumlvladd[3], pnum);
premiumitem[4] = premiumitem[5]; premiumitem[4] = premiumitem[5];
SpawnOnePremium(5, premiumlevel + premiumlvladd[5], pnum); SpawnOnePremium(5, premiumlevel + premiumlvladd[5], pnum);
#endif }
} }
} }
@ -4844,24 +4774,6 @@ BOOL WitchItemOk(int i)
BOOL rv; BOOL rv;
rv = FALSE; 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)
rv = TRUE;
if (AllItemsList[i].iMiscId == IMISC_MANA) if (AllItemsList[i].iMiscId == IMISC_MANA)
rv = FALSE; rv = FALSE;
if (AllItemsList[i].iMiscId == IMISC_FULLMANA) if (AllItemsList[i].iMiscId == IMISC_FULLMANA)
@ -4872,11 +4784,12 @@ BOOL WitchItemOk(int i)
rv = FALSE; rv = FALSE;
if (AllItemsList[i].iMiscId == IMISC_HEAL) if (AllItemsList[i].iMiscId == IMISC_HEAL)
rv = FALSE; rv = FALSE;
if (AllItemsList[i].iMiscId > IMISC_OILFIRST && AllItemsList[i].iMiscId < IMISC_OILLAST)
rv = FALSE;
if (AllItemsList[i].iSpell == SPL_RESURRECT && gbMaxPlayers == 1) if (AllItemsList[i].iSpell == SPL_RESURRECT && gbMaxPlayers == 1)
rv = FALSE; rv = FALSE;
if (AllItemsList[i].iSpell == SPL_HEALOTHER && gbMaxPlayers == 1) if (AllItemsList[i].iSpell == SPL_HEALOTHER && gbMaxPlayers == 1)
rv = FALSE; rv = FALSE;
#endif
return rv; return rv;
} }
@ -4943,13 +4856,9 @@ void WitchBookLevel(int ii)
void SpawnWitch(int lvl) void SpawnWitch(int lvl)
{ {
int i, j, iCnt; int i, j, iCnt;
int idata, maxlvl; int idata, maxlvl, maxValue;
j = 3; j = 3;
#ifdef HELLFIRE
iCnt = random_(51, 15) + 10;
int books = random_(3, 4);
#endif
GetItemAttrs(0, IDI_MANA, 1); GetItemAttrs(0, IDI_MANA, 1);
witchitem[0] = item[0]; witchitem[0] = item[0];
@ -4964,30 +4873,33 @@ void SpawnWitch(int lvl)
witchitem[2]._iCreateInfo = lvl; witchitem[2]._iCreateInfo = lvl;
witchitem[2]._iStatFlag = TRUE; witchitem[2]._iStatFlag = TRUE;
#ifdef HELLFIRE if (gbIsHellfire) {
int bCnt; iCnt = random_(51, 15) + 10;
for (i = 114, bCnt = 0; i <= 117 && bCnt < books; ++i) { maxValue = 200000;
if (WitchItemOk(i)
&& lvl >= AllItemsList[i].iMinMLvl) {
item[0]._iSeed = GetRndSeed();
SetRndSeed(item[0]._iSeed);
volatile int junk = random_(0, 1);
GetItemAttrs(0, i, lvl); int bCnt;
witchitem[j] = item[0]; int books = random_(3, 4);
witchitem[j]._iCreateInfo = lvl | CF_WITCH; for (i = 114, bCnt = 0; i <= 117 && bCnt < books; ++i) {
witchitem[j]._iIdentified = TRUE; if (WitchItemOk(i)
WitchBookLevel(j); && lvl >= AllItemsList[i].iMinMLvl) {
witchitem[j]._iStatFlag = StoreStatOk(&witchitem[j]); item[0]._iSeed = GetRndSeed();
j++; SetRndSeed(item[0]._iSeed);
bCnt++; volatile int junk = random_(0, 1);
GetItemAttrs(0, i, lvl);
witchitem[j] = item[0];
witchitem[j]._iCreateInfo = lvl | CF_WITCH;
witchitem[j]._iIdentified = TRUE;
WitchBookLevel(j);
witchitem[j]._iStatFlag = StoreStatOk(&witchitem[j]);
j++;
bCnt++;
}
} }
} else {
iCnt = random_(51, 8) + 10;
maxValue = 140000;
} }
#else
iCnt = random_(51, 8) + 10;
#endif
int maxValue = gbIsHellfire ? 200000 : 140000;
for (i = j; i < iCnt; i++) { for (i = j; i < iCnt; i++) {
do { do {

24
Source/lighting.cpp

@ -558,16 +558,12 @@ void DoLighting(int nXPos, int nYPos, int nRadius, int Lnum)
max_y = 15; max_y = 15;
} }
#ifdef HELLFIRE
if (currlevel < 17) {
#else
if (nXPos >= 0 && nXPos < MAXDUNX && nYPos >= 0 && nYPos < MAXDUNY) { if (nXPos >= 0 && nXPos < MAXDUNX && nYPos >= 0 && nYPos < MAXDUNY) {
#endif if (currlevel < 17) {
dLight[nXPos][nYPos] = 0; dLight[nXPos][nYPos] = 0;
#ifdef HELLFIRE } else if (dLight[nXPos][nYPos] > lightradius[nRadius][0]) {
} else if (dLight[nXPos][nYPos] > lightradius[nRadius][0]) { dLight[nXPos][nYPos] = lightradius[nRadius][0];
dLight[nXPos][nYPos] = lightradius[nRadius][0]; }
#endif
} }
mult = xoff + 8 * yoff; mult = xoff + 8 * yoff;
@ -578,9 +574,7 @@ void DoLighting(int nXPos, int nYPos, int nRadius, int Lnum)
temp_x = nXPos + x; temp_x = nXPos + x;
temp_y = nYPos + y; temp_y = nYPos + y;
v = lightradius[nRadius][radius_block]; v = lightradius[nRadius][radius_block];
#ifndef HELLFIRE
if (temp_x >= 0 && temp_x < MAXDUNX && temp_y >= 0 && temp_y < MAXDUNY) if (temp_x >= 0 && temp_x < MAXDUNX && temp_y >= 0 && temp_y < MAXDUNY)
#endif
if (v < dLight[temp_x][temp_y]) if (v < dLight[temp_x][temp_y])
dLight[temp_x][temp_y] = v; dLight[temp_x][temp_y] = v;
} }
@ -595,9 +589,7 @@ void DoLighting(int nXPos, int nYPos, int nRadius, int Lnum)
temp_x = nXPos + y; temp_x = nXPos + y;
temp_y = nYPos - x; temp_y = nYPos - x;
v = lightradius[nRadius][radius_block]; v = lightradius[nRadius][radius_block];
#ifndef HELLFIRE
if (temp_x >= 0 && temp_x < MAXDUNX && temp_y >= 0 && temp_y < MAXDUNY) if (temp_x >= 0 && temp_x < MAXDUNX && temp_y >= 0 && temp_y < MAXDUNY)
#endif
if (v < dLight[temp_x][temp_y]) if (v < dLight[temp_x][temp_y])
dLight[temp_x][temp_y] = v; dLight[temp_x][temp_y] = v;
} }
@ -612,9 +604,7 @@ void DoLighting(int nXPos, int nYPos, int nRadius, int Lnum)
temp_x = nXPos - x; temp_x = nXPos - x;
temp_y = nYPos - y; temp_y = nYPos - y;
v = lightradius[nRadius][radius_block]; v = lightradius[nRadius][radius_block];
#ifndef HELLFIRE
if (temp_x >= 0 && temp_x < MAXDUNX && temp_y >= 0 && temp_y < MAXDUNY) if (temp_x >= 0 && temp_x < MAXDUNX && temp_y >= 0 && temp_y < MAXDUNY)
#endif
if (v < dLight[temp_x][temp_y]) if (v < dLight[temp_x][temp_y])
dLight[temp_x][temp_y] = v; dLight[temp_x][temp_y] = v;
} }
@ -629,9 +619,7 @@ void DoLighting(int nXPos, int nYPos, int nRadius, int Lnum)
temp_x = nXPos - y; temp_x = nXPos - y;
temp_y = nYPos + x; temp_y = nYPos + x;
v = lightradius[nRadius][radius_block]; v = lightradius[nRadius][radius_block];
#ifndef HELLFIRE
if (temp_x >= 0 && temp_x < MAXDUNX && temp_y >= 0 && temp_y < MAXDUNY) if (temp_x >= 0 && temp_x < MAXDUNX && temp_y >= 0 && temp_y < MAXDUNY)
#endif
if (v < dLight[temp_x][temp_y]) if (v < dLight[temp_x][temp_y])
dLight[temp_x][temp_y] = v; dLight[temp_x][temp_y] = v;
} }
@ -664,9 +652,7 @@ void DoUnLight(int nXPos, int nYPos, int nRadius)
for (y = min_y; y < max_y; y++) { for (y = min_y; y < max_y; y++) {
for (x = min_x; x < max_x; x++) { for (x = min_x; x < max_x; x++) {
#ifndef HELLFIRE
if (x >= 0 && x < MAXDUNX && y >= 0 && y < MAXDUNY) if (x >= 0 && x < MAXDUNX && y >= 0 && y < MAXDUNY)
#endif
dLight[x][y] = dPreLight[x][y]; dLight[x][y] = dPreLight[x][y];
} }
} }

2
Source/mainmenu.cpp

@ -171,11 +171,9 @@ void mainmenu_loop()
case MAINMENU_SHOW_CREDITS: case MAINMENU_SHOW_CREDITS:
UiCreditsDialog(16); UiCreditsDialog(16);
break; break;
#ifdef HELLFIRE
case MAINMENU_SHOW_SUPPORT: case MAINMENU_SHOW_SUPPORT:
//UiSupportDialog(16); //UiSupportDialog(16);
break; break;
#endif
case MAINMENU_EXIT_DIABLO: case MAINMENU_EXIT_DIABLO:
done = TRUE; done = TRUE;
break; break;

7
Source/monstdat.cpp

@ -114,11 +114,7 @@ MonsterData monsterdata[] = {
{ 96, 484, "Monsters\\Unrav\\Unrav%c.CL2", FALSE, "Monsters\\Acid\\Acid%c%i.WAV", FALSE, FALSE, NULL, { 10, 10, 12, 5, 16, 0 }, { 0, 0, 0, 0, 0, 0 }, "Reality Weaver", 38, 39, 30, 135, 240, AI_SKELSD, 0 , 3, 85, 7, 20, 35, 0, 0, 0, 0, 85, MC_UNDEAD, RESIST_MAGIC | IMMUNE_FIRE | IMMUNE_LIGHTNING | IMMUNE_NULL_40, RESIST_MAGIC | IMMUNE_FIRE | IMMUNE_LIGHTNING | IMMUNE_NULL_40, 0, 3, 5925 }, { 96, 484, "Monsters\\Unrav\\Unrav%c.CL2", FALSE, "Monsters\\Acid\\Acid%c%i.WAV", FALSE, FALSE, NULL, { 10, 10, 12, 5, 16, 0 }, { 0, 0, 0, 0, 0, 0 }, "Reality Weaver", 38, 39, 30, 135, 240, AI_SKELSD, 0 , 3, 85, 7, 20, 35, 0, 0, 0, 0, 85, MC_UNDEAD, RESIST_MAGIC | IMMUNE_FIRE | IMMUNE_LIGHTNING | IMMUNE_NULL_40, RESIST_MAGIC | IMMUNE_FIRE | IMMUNE_LIGHTNING | IMMUNE_NULL_40, 0, 3, 5925 },
{ 128, 980, "Monsters\\Succ\\Scbs%c.CL2", FALSE, "Monsters\\Succ\\Scbs%c%i.WAV", FALSE, FALSE, NULL, { 14, 8, 16, 7, 24, 0 }, { 0, 0, 0, 0, 0, 0 }, "Succubus", 22, 26, 24, 120, 150, AI_SUCC, MFLAG_CAN_OPEN_DOOR, 0, 100, 10, 1, 20, 0, 0, 0, 0, 60, MC_DEMON, RESIST_MAGIC , IMMUNE_MAGIC | RESIST_FIRE , 0, 3, 3696 }, { 128, 980, "Monsters\\Succ\\Scbs%c.CL2", FALSE, "Monsters\\Succ\\Scbs%c%i.WAV", FALSE, FALSE, NULL, { 14, 8, 16, 7, 24, 0 }, { 0, 0, 0, 0, 0, 0 }, "Succubus", 22, 26, 24, 120, 150, AI_SUCC, MFLAG_CAN_OPEN_DOOR, 0, 100, 10, 1, 20, 0, 0, 0, 0, 60, MC_DEMON, RESIST_MAGIC , IMMUNE_MAGIC | RESIST_FIRE , 0, 3, 3696 },
{ 128, 980, "Monsters\\Succ\\Scbs%c.CL2", FALSE, "Monsters\\Succ\\Scbs%c%i.WAV", FALSE, TRUE, "Monsters\\Succ\\Succb.TRN", { 14, 8, 16, 7, 24, 0 }, { 0, 0, 0, 0, 0, 0 }, "Snow Witch", 25, 28, 26, 135, 175, AI_SUCC, MFLAG_CAN_OPEN_DOOR, 1, 110, 10, 1, 24, 0, 0, 0, 0, 65, MC_DEMON, RESIST_LIGHTNING | IMMUNE_NULL_40, IMMUNE_MAGIC | RESIST_LIGHTNING | IMMUNE_NULL_40, 0, 3, 4084 }, { 128, 980, "Monsters\\Succ\\Scbs%c.CL2", FALSE, "Monsters\\Succ\\Scbs%c%i.WAV", FALSE, TRUE, "Monsters\\Succ\\Succb.TRN", { 14, 8, 16, 7, 24, 0 }, { 0, 0, 0, 0, 0, 0 }, "Snow Witch", 25, 28, 26, 135, 175, AI_SUCC, MFLAG_CAN_OPEN_DOOR, 1, 110, 10, 1, 24, 0, 0, 0, 0, 65, MC_DEMON, RESIST_LIGHTNING | IMMUNE_NULL_40, IMMUNE_MAGIC | RESIST_LIGHTNING | IMMUNE_NULL_40, 0, 3, 4084 },
#ifdef HELLFIRE
{ 128, 980, "Monsters\\Succ\\Scbs%c.CL2", FALSE, "Monsters\\Succ\\Scbs%c%i.WAV", FALSE, TRUE, "Monsters\\Succ\\Succrw.TRN", { 14, 8, 16, 7, 24, 0 }, { 0, 0, 0, 0, 0, 0 }, "Hell Spawn", 27, 30, 28, 150, 200, AI_SUCC, MFLAG_SEARCH | MFLAG_CAN_OPEN_DOOR, 2, 115, 10, 1, 30, 0, 0, 0, 0, 75, MC_ANIMAL, RESIST_MAGIC | IMMUNE_LIGHTNING , IMMUNE_MAGIC | IMMUNE_FIRE | RESIST_LIGHTNING , 0, 3, 4480 },
#else
{ 128, 980, "Monsters\\Succ\\Scbs%c.CL2", FALSE, "Monsters\\Succ\\Scbs%c%i.WAV", FALSE, TRUE, "Monsters\\Succ\\Succrw.TRN", { 14, 8, 16, 7, 24, 0 }, { 0, 0, 0, 0, 0, 0 }, "Hell Spawn", 27, 30, 28, 150, 200, AI_SUCC, MFLAG_SEARCH | MFLAG_CAN_OPEN_DOOR, 2, 115, 10, 1, 30, 0, 0, 0, 0, 75, MC_DEMON, RESIST_MAGIC | IMMUNE_LIGHTNING , IMMUNE_MAGIC | IMMUNE_FIRE | RESIST_LIGHTNING , 0, 3, 4480 }, { 128, 980, "Monsters\\Succ\\Scbs%c.CL2", FALSE, "Monsters\\Succ\\Scbs%c%i.WAV", FALSE, TRUE, "Monsters\\Succ\\Succrw.TRN", { 14, 8, 16, 7, 24, 0 }, { 0, 0, 0, 0, 0, 0 }, "Hell Spawn", 27, 30, 28, 150, 200, AI_SUCC, MFLAG_SEARCH | MFLAG_CAN_OPEN_DOOR, 2, 115, 10, 1, 30, 0, 0, 0, 0, 75, MC_DEMON, RESIST_MAGIC | IMMUNE_LIGHTNING , IMMUNE_MAGIC | IMMUNE_FIRE | RESIST_LIGHTNING , 0, 3, 4480 },
#endif
{ 128, 980, "Monsters\\Succ\\Scbs%c.CL2", FALSE, "Monsters\\Succ\\Scbs%c%i.WAV", FALSE, TRUE, "Monsters\\Succ\\Succbw.TRN", { 14, 8, 16, 7, 24, 0 }, { 0, 0, 0, 0, 0, 0 }, "Soul Burner", 28, 30, 30, 140, 225, AI_SUCC, MFLAG_SEARCH | MFLAG_CAN_OPEN_DOOR, 3, 120, 10, 1, 35, 0, 0, 0, 0, 85, MC_DEMON, RESIST_MAGIC | IMMUNE_FIRE | RESIST_LIGHTNING , IMMUNE_MAGIC | IMMUNE_FIRE | IMMUNE_LIGHTNING , 0, 3, 4644 }, { 128, 980, "Monsters\\Succ\\Scbs%c.CL2", FALSE, "Monsters\\Succ\\Scbs%c%i.WAV", FALSE, TRUE, "Monsters\\Succ\\Succbw.TRN", { 14, 8, 16, 7, 24, 0 }, { 0, 0, 0, 0, 0, 0 }, "Soul Burner", 28, 30, 30, 140, 225, AI_SUCC, MFLAG_SEARCH | MFLAG_CAN_OPEN_DOOR, 3, 120, 10, 1, 35, 0, 0, 0, 0, 85, MC_DEMON, RESIST_MAGIC | IMMUNE_FIRE | RESIST_LIGHTNING , IMMUNE_MAGIC | IMMUNE_FIRE | IMMUNE_LIGHTNING , 0, 3, 4644 },
{ 128, 2000, "Monsters\\Mage\\Mage%c.CL2", TRUE, "Monsters\\Mage\\Mage%c%i.WAV", FALSE, FALSE, NULL, { 12, 1, 20, 8, 28, 20 }, { 0, 0, 0, 0, 0, 0 }, "Counselor", 24, 26, 25, 70, 70, AI_COUNSLR, MFLAG_CAN_OPEN_DOOR, 0, 90, 8, 8, 20, 0, 0, 0, 0, 0, MC_DEMON, RESIST_MAGIC | RESIST_FIRE | RESIST_LIGHTNING , RESIST_MAGIC | RESIST_FIRE | RESIST_LIGHTNING , 0, 7, 4070 }, { 128, 2000, "Monsters\\Mage\\Mage%c.CL2", TRUE, "Monsters\\Mage\\Mage%c%i.WAV", FALSE, FALSE, NULL, { 12, 1, 20, 8, 28, 20 }, { 0, 0, 0, 0, 0, 0 }, "Counselor", 24, 26, 25, 70, 70, AI_COUNSLR, MFLAG_CAN_OPEN_DOOR, 0, 90, 8, 8, 20, 0, 0, 0, 0, 0, MC_DEMON, RESIST_MAGIC | RESIST_FIRE | RESIST_LIGHTNING , RESIST_MAGIC | RESIST_FIRE | RESIST_LIGHTNING , 0, 7, 4070 },
{ 128, 2000, "Monsters\\Mage\\Mage%c.CL2", TRUE, "Monsters\\Mage\\Mage%c%i.WAV", FALSE, TRUE, "Monsters\\Mage\\Cnselg.TRN", { 12, 1, 20, 8, 28, 20 }, { 0, 0, 0, 0, 0, 0 }, "Magistrate", 26, 28, 27, 85, 85, AI_COUNSLR, MFLAG_CAN_OPEN_DOOR, 1, 100, 8, 10, 24, 0, 0, 0, 0, 0, MC_DEMON, RESIST_MAGIC | IMMUNE_FIRE | RESIST_LIGHTNING | IMMUNE_NULL_40, IMMUNE_MAGIC | IMMUNE_FIRE | RESIST_LIGHTNING | IMMUNE_NULL_40, 0, 7, 4478 }, { 128, 2000, "Monsters\\Mage\\Mage%c.CL2", TRUE, "Monsters\\Mage\\Mage%c%i.WAV", FALSE, TRUE, "Monsters\\Mage\\Cnselg.TRN", { 12, 1, 20, 8, 28, 20 }, { 0, 0, 0, 0, 0, 0 }, "Magistrate", 26, 28, 27, 85, 85, AI_COUNSLR, MFLAG_CAN_OPEN_DOOR, 1, 100, 8, 10, 24, 0, 0, 0, 0, 0, MC_DEMON, RESIST_MAGIC | IMMUNE_FIRE | RESIST_LIGHTNING | IMMUNE_NULL_40, IMMUNE_MAGIC | IMMUNE_FIRE | RESIST_LIGHTNING | IMMUNE_NULL_40, 0, 7, 4478 },
@ -127,11 +123,10 @@ MonsterData monsterdata[] = {
{ 96, 386, "Monsters\\Golem\\Golem%c.CL2", TRUE, "Monsters\\Golem\\Golm%c%i.WAV", FALSE, FALSE, NULL, { 0, 16, 12, 0, 12, 20 }, { 0, 0, 0, 0, 0, 0 }, "Golem", 0, 0, 12, 1, 1, AI_GOLUM, MFLAG_CAN_OPEN_DOOR, 0, 0, 7, 1, 1, 0, 0, 0, 0, 1, MC_DEMON, 0 , 0 , 0, 0, 0 }, { 96, 386, "Monsters\\Golem\\Golem%c.CL2", TRUE, "Monsters\\Golem\\Golm%c%i.WAV", FALSE, FALSE, NULL, { 0, 16, 12, 0, 12, 20 }, { 0, 0, 0, 0, 0, 0 }, "Golem", 0, 0, 12, 1, 1, AI_GOLUM, MFLAG_CAN_OPEN_DOOR, 0, 0, 7, 1, 1, 0, 0, 0, 0, 1, MC_DEMON, 0 , 0 , 0, 0, 0 },
#ifdef HELLFIRE #ifdef HELLFIRE
{ 160, 2000, "Monsters\\Diablo\\Diablo%c.CL2", TRUE, "Monsters\\Diablo\\Diablo%c%i.WAV", TRUE, FALSE, NULL, { 16, 6, 16, 2, 16, 16 }, { 0, 0, 0, 0, 0, 0 }, "The Dark Lord", 50, 50, 45, 3333, 3333, AI_DIABLO, MFLAG_KNOCKBACK | MFLAG_SEARCH | MFLAG_CAN_OPEN_DOOR, 3, 220, 4, 30, 60, 0, 11, 0, 0, 90, MC_DEMON, IMMUNE_MAGIC | RESIST_FIRE | RESIST_LIGHTNING | IMMUNE_NULL_40, IMMUNE_MAGIC | RESIST_FIRE | RESIST_LIGHTNING | IMMUNE_NULL_40, 0, 7, 1666 }, { 160, 2000, "Monsters\\Diablo\\Diablo%c.CL2", TRUE, "Monsters\\Diablo\\Diablo%c%i.WAV", TRUE, FALSE, NULL, { 16, 6, 16, 2, 16, 16 }, { 0, 0, 0, 0, 0, 0 }, "The Dark Lord", 50, 50, 45, 3333, 3333, AI_DIABLO, MFLAG_KNOCKBACK | MFLAG_SEARCH | MFLAG_CAN_OPEN_DOOR, 3, 220, 4, 30, 60, 0, 11, 0, 0, 90, MC_DEMON, IMMUNE_MAGIC | RESIST_FIRE | RESIST_LIGHTNING | IMMUNE_NULL_40, IMMUNE_MAGIC | RESIST_FIRE | RESIST_LIGHTNING | IMMUNE_NULL_40, 0, 7, 1666 },
{ 128, 1060, "Monsters\\DarkMage\\Dmage%c.CL2", TRUE, "Monsters\\DarkMage\\Dmag%c%i.WAV", FALSE, FALSE, NULL, { 6, 1, 21, 6, 23, 18 }, { 0, 0, 0, 0, 0, 0 }, "The Arch-Litch Malignus", 40, 41, 30, 160, 160, AI_COUNSLR, MFLAG_CAN_OPEN_DOOR, 3, 120, 8, 20, 40, 0, 0, 0, 0, 70, MC_DEMON, RESIST_MAGIC | RESIST_FIRE | RESIST_LIGHTNING | IMMUNE_NULL_40, IMMUNE_MAGIC | IMMUNE_FIRE | IMMUNE_LIGHTNING | IMMUNE_NULL_40, 0, 7, 4968 },
#else #else
{ 160, 2000, "Monsters\\Diablo\\Diablo%c.CL2", TRUE, "Monsters\\Diablo\\Diablo%c%i.WAV", TRUE, FALSE, NULL, { 16, 6, 16, 6, 16, 16 }, { 0, 0, 0, 0, 0, 0 }, "The Dark Lord", 50, 50, 30, 1666, 1666, AI_DIABLO, MFLAG_KNOCKBACK | MFLAG_SEARCH | MFLAG_CAN_OPEN_DOOR, 3, 220, 4, 30, 60, 0, 11, 0, 0, 90, MC_DEMON, IMMUNE_MAGIC | RESIST_FIRE | RESIST_LIGHTNING | IMMUNE_NULL_40, IMMUNE_MAGIC | RESIST_FIRE | RESIST_LIGHTNING | IMMUNE_NULL_40, 0, 7, 31666 }, { 160, 2000, "Monsters\\Diablo\\Diablo%c.CL2", TRUE, "Monsters\\Diablo\\Diablo%c%i.WAV", TRUE, FALSE, NULL, { 16, 6, 16, 6, 16, 16 }, { 0, 0, 0, 0, 0, 0 }, "The Dark Lord", 50, 50, 30, 1666, 1666, AI_DIABLO, MFLAG_KNOCKBACK | MFLAG_SEARCH | MFLAG_CAN_OPEN_DOOR, 3, 220, 4, 30, 60, 0, 11, 0, 0, 90, MC_DEMON, IMMUNE_MAGIC | RESIST_FIRE | RESIST_LIGHTNING | IMMUNE_NULL_40, IMMUNE_MAGIC | RESIST_FIRE | RESIST_LIGHTNING | IMMUNE_NULL_40, 0, 7, 31666 },
{ 128, 1060, "Monsters\\DarkMage\\Dmage%c.CL2", TRUE, "Monsters\\DarkMage\\Dmag%c%i.WAV", FALSE, FALSE, NULL, { 6, 1, 21, 6, 23, 18 }, { 0, 0, 0, 0, 0, 0 }, "The Arch-Litch Malignus", 30, 30, 30, 160, 160, AI_COUNSLR, MFLAG_CAN_OPEN_DOOR, 3, 120, 8, 20, 40, 0, 0, 0, 0, 70, MC_DEMON, RESIST_MAGIC | RESIST_FIRE | RESIST_LIGHTNING | IMMUNE_NULL_40, IMMUNE_MAGIC | IMMUNE_FIRE | IMMUNE_LIGHTNING | IMMUNE_NULL_40, 0, 7, 4968 },
#endif #endif
{ 128, 1060, "Monsters\\DarkMage\\Dmage%c.CL2", TRUE, "Monsters\\DarkMage\\Dmag%c%i.WAV", FALSE, FALSE, NULL, { 6, 1, 21, 6, 23, 18 }, { 0, 0, 0, 0, 0, 0 }, "The Arch-Litch Malignus", 40, 41, 30, 160, 160, AI_COUNSLR, MFLAG_CAN_OPEN_DOOR, 3, 120, 8, 20, 40, 0, 0, 0, 0, 70, MC_DEMON, RESIST_MAGIC | RESIST_FIRE | RESIST_LIGHTNING | IMMUNE_NULL_40, IMMUNE_MAGIC | IMMUNE_FIRE | IMMUNE_LIGHTNING | IMMUNE_NULL_40, 0, 7, 4968 },
{ 188, 800, "Monsters\\Fork\\Fork%c.CL2", FALSE, "Monsters\\newsfx\\HBoar%c%i.WAV", FALSE, FALSE, NULL, { 10, 10, 15, 6, 16, 0 }, { 2, 0, 0, 0, 0, 0 }, "Hellboar", 32, 35, 23, 80, 100, AI_SKELSD, MFLAG_KNOCKBACK | MFLAG_SEARCH , 2, 70, 7, 16, 24, 0, 0, 0, 0, 60, MC_DEMON, 0 , RESIST_FIRE | RESIST_LIGHTNING , 0, 3, 750 }, { 188, 800, "Monsters\\Fork\\Fork%c.CL2", FALSE, "Monsters\\newsfx\\HBoar%c%i.WAV", FALSE, FALSE, NULL, { 10, 10, 15, 6, 16, 0 }, { 2, 0, 0, 0, 0, 0 }, "Hellboar", 32, 35, 23, 80, 100, AI_SKELSD, MFLAG_KNOCKBACK | MFLAG_SEARCH , 2, 70, 7, 16, 24, 0, 0, 0, 0, 60, MC_DEMON, 0 , RESIST_FIRE | RESIST_LIGHTNING , 0, 3, 750 },
{ 64, 305, "Monsters\\Scorp\\Scorp%c.CL2", FALSE, "Monsters\\newsfx\\Stingr%c%i.WAV", FALSE, FALSE, NULL, { 10, 10, 12, 6, 15, 0 }, { 2, 0, 0, 0, 0, 0 }, "Stinger", 32, 35, 22, 30, 40, AI_SKELSD, 0 , 3, 85, 8, 1, 20, 0, 0, 0, 0, 50, MC_ANIMAL, 0 , RESIST_LIGHTNING , 0, 1, 500 }, { 64, 305, "Monsters\\Scorp\\Scorp%c.CL2", FALSE, "Monsters\\newsfx\\Stingr%c%i.WAV", FALSE, FALSE, NULL, { 10, 10, 12, 6, 15, 0 }, { 2, 0, 0, 0, 0, 0 }, "Stinger", 32, 35, 22, 30, 40, AI_SKELSD, 0 , 3, 85, 8, 1, 20, 0, 0, 0, 0, 50, MC_ANIMAL, 0 , RESIST_LIGHTNING , 0, 1, 500 },
{ 156, 800, "Monsters\\Eye\\Eye%c.CL2", FALSE, "Monsters\\newsfx\\psyco%c%i.WAV", FALSE, FALSE, NULL, { 12, 13, 13, 7, 21, 0 }, { 2, 0, 0, 0, 0, 0 }, "Psychorb", 32, 35, 22, 20, 30, AI_PSYCHORB, 0 , 3, 80, 8, 10, 10, 0, 0, 0, 0, 40, MC_ANIMAL, 0 , RESIST_FIRE , 0, 6, 450 }, { 156, 800, "Monsters\\Eye\\Eye%c.CL2", FALSE, "Monsters\\newsfx\\psyco%c%i.WAV", FALSE, FALSE, NULL, { 12, 13, 13, 7, 21, 0 }, { 2, 0, 0, 0, 0, 0 }, "Psychorb", 32, 35, 22, 20, 30, AI_PSYCHORB, 0 , 3, 80, 8, 10, 10, 0, 0, 0, 0, 40, MC_ANIMAL, 0 , RESIST_FIRE , 0, 6, 450 },

35
Source/msg.cpp

@ -1473,12 +1473,7 @@ static DWORD On_GETITEM(TCmd *pCmd, int pnum)
if ((currlevel == p->bLevel || p->bPnum == myplr) && p->bMaster != myplr) { if ((currlevel == p->bLevel || p->bPnum == myplr) && p->bMaster != myplr) {
if (p->bPnum == myplr) { if (p->bPnum == myplr) {
if (currlevel != p->bLevel) { if (currlevel != p->bLevel) {
ii = SyncPutItem(myplr, plr[myplr]._px, plr[myplr]._py, p->wIndx, p->wCI, p->dwSeed, p->bId, p->bDur, p->bMDur, p->bCh, p->bMCh, p->wValue, p->dwBuff ii = SyncPutItem(myplr, plr[myplr]._px, plr[myplr]._py, p->wIndx, p->wCI, p->dwSeed, p->bId, p->bDur, p->bMDur, p->bCh, p->bMCh, p->wValue, p->dwBuff, p->wToHit, p->wMaxDam, p->bMinStr, p->bMinMag, p->bMinDex, p->bAC);
#ifdef HELLFIRE
,
p->wToHit, p->wMaxDam, p->bMinStr, p->bMinMag, p->bMinDex, p->bAC
#endif
);
if (ii != -1) if (ii != -1)
InvGetItem(myplr, ii); InvGetItem(myplr, ii);
} else } else
@ -1540,12 +1535,7 @@ static DWORD On_AGETITEM(TCmd *pCmd, int pnum)
if ((currlevel == p->bLevel || p->bPnum == myplr) && p->bMaster != myplr) { if ((currlevel == p->bLevel || p->bPnum == myplr) && p->bMaster != myplr) {
if (p->bPnum == myplr) { if (p->bPnum == myplr) {
if (currlevel != p->bLevel) { if (currlevel != p->bLevel) {
int ii = SyncPutItem(myplr, plr[myplr]._px, plr[myplr]._py, p->wIndx, p->wCI, p->dwSeed, p->bId, p->bDur, p->bMDur, p->bCh, p->bMCh, p->wValue, p->dwBuff int ii = SyncPutItem(myplr, plr[myplr]._px, plr[myplr]._py, p->wIndx, p->wCI, p->dwSeed, p->bId, p->bDur, p->bMDur, p->bCh, p->bMCh, p->wValue, p->dwBuff, p->wToHit, p->wMaxDam, p->bMinStr, p->bMinMag, p->bMinDex, p->bAC);
#ifdef HELLFIRE
,
p->wToHit, p->wMaxDam, p->bMinStr, p->bMinMag, p->bMinDex, p->bAC
#endif
);
if (ii != -1) if (ii != -1)
AutoGetItem(myplr, ii); AutoGetItem(myplr, ii);
} else } else
@ -1586,12 +1576,7 @@ static DWORD On_PUTITEM(TCmd *pCmd, int pnum)
if (pnum == myplr) if (pnum == myplr)
ii = InvPutItem(pnum, p->x, p->y); ii = InvPutItem(pnum, p->x, p->y);
else else
ii = SyncPutItem(pnum, p->x, p->y, p->wIndx, p->wCI, p->dwSeed, p->bId, p->bDur, p->bMDur, p->bCh, p->bMCh, p->wValue, p->dwBuff ii = SyncPutItem(pnum, p->x, p->y, p->wIndx, p->wCI, p->dwSeed, p->bId, p->bDur, p->bMDur, p->bCh, p->bMCh, p->wValue, p->dwBuff, p->wToHit, p->wMaxDam, p->bMinStr, p->bMinMag, p->bMinDex, p->bAC);
#ifdef HELLFIRE
,
p->wToHit, p->wMaxDam, p->bMinStr, p->bMinMag, p->bMinDex, p->bAC
#endif
);
if (ii != -1) { if (ii != -1) {
PutItemRecord(p->dwSeed, p->wCI, p->wIndx); PutItemRecord(p->dwSeed, p->wCI, p->wIndx);
delta_put_item(p, item[ii]._ix, item[ii]._iy, plr[pnum].plrlevel); delta_put_item(p, item[ii]._ix, item[ii]._iy, plr[pnum].plrlevel);
@ -1614,12 +1599,7 @@ static DWORD On_SYNCPUTITEM(TCmd *pCmd, int pnum)
if (gbBufferMsgs == 1) if (gbBufferMsgs == 1)
msg_send_packet(pnum, p, sizeof(*p)); msg_send_packet(pnum, p, sizeof(*p));
else if (currlevel == plr[pnum].plrlevel) { else if (currlevel == plr[pnum].plrlevel) {
int ii = SyncPutItem(pnum, p->x, p->y, p->wIndx, p->wCI, p->dwSeed, p->bId, p->bDur, p->bMDur, p->bCh, p->bMCh, p->wValue, p->dwBuff int ii = SyncPutItem(pnum, p->x, p->y, p->wIndx, p->wCI, p->dwSeed, p->bId, p->bDur, p->bMDur, p->bCh, p->bMCh, p->wValue, p->dwBuff, p->wToHit, p->wMaxDam, p->bMinStr, p->bMinMag, p->bMinDex, p->bAC);
#ifdef HELLFIRE
,
p->wToHit, p->wMaxDam, p->bMinStr, p->bMinMag, p->bMinDex, p->bAC
#endif
);
if (ii != -1) { if (ii != -1) {
PutItemRecord(p->dwSeed, p->wCI, p->wIndx); PutItemRecord(p->dwSeed, p->wCI, p->wIndx);
delta_put_item(p, item[ii]._ix, item[ii]._iy, plr[pnum].plrlevel); delta_put_item(p, item[ii]._ix, item[ii]._iy, plr[pnum].plrlevel);
@ -1643,12 +1623,7 @@ static DWORD On_RESPAWNITEM(TCmd *pCmd, int pnum)
msg_send_packet(pnum, p, sizeof(*p)); msg_send_packet(pnum, p, sizeof(*p));
else { else {
if (currlevel == plr[pnum].plrlevel && pnum != myplr) { if (currlevel == plr[pnum].plrlevel && pnum != myplr) {
SyncPutItem(pnum, p->x, p->y, p->wIndx, p->wCI, p->dwSeed, p->bId, p->bDur, p->bMDur, p->bCh, p->bMCh, p->wValue, p->dwBuff SyncPutItem(pnum, p->x, p->y, p->wIndx, p->wCI, p->dwSeed, p->bId, p->bDur, p->bMDur, p->bCh, p->bMCh, p->wValue, p->dwBuff, p->wToHit, p->wMaxDam, p->bMinStr, p->bMinMag, p->bMinDex, p->bAC);
#ifdef HELLFIRE
,
p->wToHit, p->wMaxDam, p->bMinStr, p->bMinMag, p->bMinDex, p->bAC
#endif
);
} }
PutItemRecord(p->dwSeed, p->wCI, p->wIndx); PutItemRecord(p->dwSeed, p->wCI, p->wIndx);
delta_put_item(p, p->x, p->y, plr[pnum].plrlevel); delta_put_item(p, p->x, p->y, plr[pnum].plrlevel);

34
Source/objects.cpp

@ -673,11 +673,10 @@ void AddChestTraps()
if (leveltype == DTYPE_CATACOMBS) { if (leveltype == DTYPE_CATACOMBS) {
object[oi]._oVar4 = random_(0, 2); object[oi]._oVar4 = random_(0, 2);
} else { } else {
#ifdef HELLFIRE if (gbIsHellfire)
object[oi]._oVar4 = random_(0, 6); object[oi]._oVar4 = random_(0, 6);
#else else
object[oi]._oVar4 = random_(0, 3); object[oi]._oVar4 = random_(0, 3);
#endif
} }
} }
} }
@ -2434,15 +2433,7 @@ void OperateL1RDoor(int pnum, int oi, bool sendflag)
if (!deltaload) if (!deltaload)
PlaySfxLoc(IS_CRCLOS, xp, object[oi]._oy); PlaySfxLoc(IS_CRCLOS, xp, object[oi]._oy);
} }
#ifdef HELLFIRE if (!deltaload && dDead[xp][yp] == 0 && dMonster[xp][yp] == 0 && dItem[xp][yp] == 0) {
BOOLEAN dok = dMonster[xp][yp] == 0;
dok = dok && dItem[xp][yp] == 0;
dok = dok && dDead[xp][yp] == 0;
if (dok) {
#else
if (!deltaload)
if (((dDead[xp][yp] != 0 ? 0 : 1) & (dMonster[xp][yp] != 0 ? 0 : 1) & (dItem[xp][yp] != 0 ? 0 : 1)) != 0) {
#endif
if (pnum == myplr && sendflag) if (pnum == myplr && sendflag)
NetSendCmdParam1(TRUE, CMD_CLOSEDOOR, oi); NetSendCmdParam1(TRUE, CMD_CLOSEDOOR, oi);
object[oi]._oVar4 = 0; object[oi]._oVar4 = 0;
@ -2524,14 +2515,7 @@ void OperateL1LDoor(int pnum, int oi, bool sendflag)
if (!deltaload) if (!deltaload)
PlaySfxLoc(IS_CRCLOS, xp, object[oi]._oy); PlaySfxLoc(IS_CRCLOS, xp, object[oi]._oy);
} }
#ifdef HELLFIRE if (dDead[xp][yp] == 0 && dMonster[xp][yp] == 0 && dItem[xp][yp] == 0) {
BOOLEAN dok = dMonster[xp][yp] == 0;
dok = dok && dItem[xp][yp] == 0;
dok = dok && dDead[xp][yp] == 0;
if (dok) {
#else
if (((dDead[xp][yp] != 0 ? 0 : 1) & (dMonster[xp][yp] != 0 ? 0 : 1) & (dItem[xp][yp] != 0 ? 0 : 1)) != 0) {
#endif
if (pnum == myplr && sendflag) if (pnum == myplr && sendflag)
NetSendCmdParam1(TRUE, CMD_CLOSEDOOR, oi); NetSendCmdParam1(TRUE, CMD_CLOSEDOOR, oi);
object[oi]._oVar4 = 0; object[oi]._oVar4 = 0;
@ -3317,11 +3301,9 @@ void TryDisarm(int pnum, int i)
object[i]._oTrapFlag = FALSE; object[i]._oTrapFlag = FALSE;
} }
} }
#ifndef HELLFIRE
oti = object[i]._otype; oti = object[i]._otype;
if (oti >= OBJ_TCHEST1 && oti <= OBJ_TCHEST3) if (oti >= OBJ_TCHEST1 && oti <= OBJ_TCHEST3)
object[i]._oTrapFlag = FALSE; object[i]._oTrapFlag = FALSE;
#endif
} }
} }
} }
@ -3420,10 +3402,8 @@ void OperateShrine(int pnum, int i, int sType)
cnt = 0; cnt = 0;
for (j = 0; j < NUM_INVLOC; j++) { for (j = 0; j < NUM_INVLOC; j++) {
if (plr[pnum].InvBody[j]._itype != ITYPE_NONE) if (plr[pnum].InvBody[j]._itype != ITYPE_NONE)
#ifndef HELLFIRE
if (plr[pnum].InvBody[j]._iMaxDur != DUR_INDESTRUCTIBLE if (plr[pnum].InvBody[j]._iMaxDur != DUR_INDESTRUCTIBLE
&& plr[pnum].InvBody[j]._iMaxDur != 0) && plr[pnum].InvBody[j]._iMaxDur != 0)
#endif
cnt++; cnt++;
} }
if (cnt == 0) if (cnt == 0)
@ -3936,7 +3916,6 @@ void OperateShrine(int pnum, int i, int sType)
CheckStats(myplr); CheckStats(myplr);
} }
break; break;
#ifdef HELLFIRE
case SHRINE_OILY: case SHRINE_OILY:
if (deltaload) if (deltaload)
return; return;
@ -4105,7 +4084,6 @@ void OperateShrine(int pnum, int i, int sType)
TakePlrsMoney(plr[myplr]._pGold / 3); TakePlrsMoney(plr[myplr]._pGold / 3);
} }
break; break;
#endif
} }
CalcPlrInv(pnum, TRUE); CalcPlrInv(pnum, TRUE);

7
Source/player.cpp

@ -1962,12 +1962,7 @@ void DropHalfPlayersGold(int pnum)
hGold = plr[pnum]._pGold >> 1; hGold = plr[pnum]._pGold >> 1;
for (i = 0; i < MAXBELTITEMS && hGold > 0; i++) { for (i = 0; i < MAXBELTITEMS && hGold > 0; i++) {
if (plr[pnum].SpdList[i]._itype == ITYPE_GOLD && if (plr[pnum].SpdList[i]._itype == ITYPE_GOLD && plr[pnum].SpdList[i]._ivalue != MaxGold) {
#ifndef HELLFIRE
plr[pnum].SpdList[i]._ivalue != GOLD_MAX_LIMIT) {
#else
plr[pnum].SpdList[i]._ivalue != MaxGold) {
#endif
if (hGold < plr[pnum].SpdList[i]._ivalue) { if (hGold < plr[pnum].SpdList[i]._ivalue) {
plr[pnum].SpdList[i]._ivalue -= hGold; plr[pnum].SpdList[i]._ivalue -= hGold;
SetSpdbarGoldCurs(pnum, i); SetSpdbarGoldCurs(pnum, i);

14
Source/spells.cpp

@ -43,17 +43,11 @@ int GetManaAmount(int id, int sn)
ma = 0; ma = 0;
ma <<= 6; ma <<= 6;
#ifdef HELLFIRE
if (plr[id]._pClass == PC_SORCERER) { if (plr[id]._pClass == PC_SORCERER) {
ma >>= 1; ma >>= 1;
} else if (plr[id]._pClass == PC_ROGUE || plr[id]._pClass == PC_MONK || plr[id]._pClass == PC_BARD) { } else if (plr[id]._pClass == PC_ROGUE || plr[id]._pClass == PC_MONK || plr[id]._pClass == PC_BARD) {
ma -= ma >> 2; ma -= ma >> 2;
} }
#else
if (plr[id]._pClass == PC_ROGUE) {
ma -= ma >> 2;
}
#endif
if (spelldata[sn].sMinMana > ma >> 6) { if (spelldata[sn].sMinMana > ma >> 6) {
ma = spelldata[sn].sMinMana << 6; ma = spelldata[sn].sMinMana << 6;
@ -206,11 +200,7 @@ void CastSpell(int id, int spl, int sx, int sy, int dx, int dy, int caster, int
caster = TARGET_MONSTERS; caster = TARGET_MONSTERS;
dir = plr[id]._pdir; dir = plr[id]._pdir;
#ifdef HELLFIRE
if (spl == SPL_FIREWALL || spl == SPL_LIGHTWALL) { if (spl == SPL_FIREWALL || spl == SPL_LIGHTWALL) {
#else
if (spl == SPL_FIREWALL) {
#endif
dir = plr[id]._pVar3; dir = plr[id]._pVar3;
} }
break; break;
@ -305,16 +295,12 @@ void DoResurrect(int pnum, int rid)
ClrPlrPath(rid); ClrPlrPath(rid);
plr[rid].destAction = ACTION_NONE; plr[rid].destAction = ACTION_NONE;
plr[rid]._pInvincible = FALSE; plr[rid]._pInvincible = FALSE;
#ifndef HELLFIRE
PlacePlayer(rid); PlacePlayer(rid);
#endif
hp = 10 << 6; hp = 10 << 6;
#ifndef HELLFIRE
if (plr[rid]._pMaxHPBase < (10 << 6)) { if (plr[rid]._pMaxHPBase < (10 << 6)) {
hp = plr[rid]._pMaxHPBase; hp = plr[rid]._pMaxHPBase;
} }
#endif
SetPlayerHitPoints(rid, hp); SetPlayerHitPoints(rid, hp);
plr[rid]._pHPBase = plr[rid]._pHitPoints + (plr[rid]._pMaxHPBase - plr[rid]._pMaxHP); plr[rid]._pHPBase = plr[rid]._pHitPoints + (plr[rid]._pMaxHPBase - plr[rid]._pMaxHP);

145
Source/trigs.cpp

@ -67,93 +67,50 @@ void InitTownTriggers()
trigs[numtrigs]._tmsg = WM_DIABNEXTLVL; trigs[numtrigs]._tmsg = WM_DIABNEXTLVL;
numtrigs++; numtrigs++;
if (!gbIsSpawn && gbMaxPlayers == MAX_PLRS) { bool isMultiplayer = gbMaxPlayers == MAX_PLRS;
for (i = 0; i < sizeof(townwarps) / sizeof(townwarps[0]); i++) {
townwarps[i] = TRUE; for (i = 0; i < sizeof(townwarps) / sizeof(townwarps[0]); i++) {
townwarps[i] = isMultiplayer && !gbIsSpawn;
}
if (!gbIsSpawn) {
if (isMultiplayer || plr[myplr].pTownWarps & 1 || (gbIsHellfire && plr[myplr]._pLevel >= 10)) {
townwarps[0] = TRUE;
trigs[numtrigs]._tx = 49;
trigs[numtrigs]._ty = 21;
trigs[numtrigs]._tmsg = WM_DIABTOWNWARP;
trigs[numtrigs]._tlvl = 5;
numtrigs++;
} }
trigs[numtrigs]._tx = 49; if (isMultiplayer || plr[myplr].pTownWarps & 2 || (gbIsHellfire && plr[myplr]._pLevel >= 15)) {
trigs[numtrigs]._ty = 21; townwarps[1] = TRUE;
trigs[numtrigs]._tmsg = WM_DIABTOWNWARP; trigs[numtrigs]._tx = 17;
trigs[numtrigs]._tlvl = 5; trigs[numtrigs]._ty = 69;
numtrigs++; trigs[numtrigs]._tmsg = WM_DIABTOWNWARP;
trigs[numtrigs]._tx = 17; trigs[numtrigs]._tlvl = 9;
trigs[numtrigs]._ty = 69; numtrigs++;
trigs[numtrigs]._tmsg = WM_DIABTOWNWARP; }
trigs[numtrigs]._tlvl = 9; if (isMultiplayer || plr[myplr].pTownWarps & 4 || (gbIsHellfire && plr[myplr]._pLevel >= 20)) {
numtrigs++; townwarps[2] = TRUE;
trigs[numtrigs]._tx = 41; trigs[numtrigs]._tx = 41;
trigs[numtrigs]._ty = 80; trigs[numtrigs]._ty = 80;
trigs[numtrigs]._tmsg = WM_DIABTOWNWARP; trigs[numtrigs]._tmsg = WM_DIABTOWNWARP;
trigs[numtrigs]._tlvl = 13; trigs[numtrigs]._tlvl = 13;
numtrigs++; numtrigs++;
#ifdef HELLFIRE }
trigs[numtrigs]._tx = 36; }
trigs[numtrigs]._ty = 24; if (gbIsHellfire) {
trigs[numtrigs]._tmsg = WM_DIABTOWNWARP;
trigs[numtrigs]._tlvl = 21;
numtrigs++;
trigs[numtrigs]._tx = 80; trigs[numtrigs]._tx = 80;
trigs[numtrigs]._ty = 62; trigs[numtrigs]._ty = 62;
trigs[numtrigs]._tmsg = WM_DIABTOWNWARP; trigs[numtrigs]._tmsg = WM_DIABTOWNWARP;
trigs[numtrigs]._tlvl = 17; trigs[numtrigs]._tlvl = 17;
numtrigs++; numtrigs++;
#endif if (isMultiplayer || quests[Q_GRAVE]._qactive == 3) {
} else {
for (i = 0; i < sizeof(townwarps) / sizeof(townwarps[0]); i++) {
townwarps[i] = FALSE;
}
if (!gbIsSpawn) {
#ifdef HELLFIRE
if (plr[myplr].pTownWarps & 1 || plr[myplr]._pLevel >= 10) {
#else
if (plr[myplr].pTownWarps & 1) {
#endif
trigs[numtrigs]._tx = 49;
trigs[numtrigs]._ty = 21;
trigs[numtrigs]._tmsg = WM_DIABTOWNWARP;
trigs[numtrigs]._tlvl = 5;
numtrigs++;
townwarps[0] = TRUE;
}
#ifdef HELLFIRE
if (plr[myplr].pTownWarps & 2 || plr[myplr]._pLevel >= 15) {
#else
if (plr[myplr].pTownWarps & 2) {
#endif
townwarps[1] = TRUE;
trigs[numtrigs]._tx = 17;
trigs[numtrigs]._ty = 69;
trigs[numtrigs]._tmsg = WM_DIABTOWNWARP;
trigs[numtrigs]._tlvl = 9;
numtrigs++;
}
#ifdef HELLFIRE
if (plr[myplr].pTownWarps & 4 || plr[myplr]._pLevel >= 20) {
#else
if (plr[myplr].pTownWarps & 4) {
#endif
townwarps[2] = TRUE;
trigs[numtrigs]._tx = 41;
trigs[numtrigs]._ty = 80;
trigs[numtrigs]._tmsg = WM_DIABTOWNWARP;
trigs[numtrigs]._tlvl = 13;
numtrigs++;
}
}
if (quests[Q_GRAVE]._qactive == 3) {
trigs[numtrigs]._tx = 36; trigs[numtrigs]._tx = 36;
trigs[numtrigs]._ty = 24; trigs[numtrigs]._ty = 24;
trigs[numtrigs]._tmsg = WM_DIABTOWNWARP; trigs[numtrigs]._tmsg = WM_DIABTOWNWARP;
trigs[numtrigs]._tlvl = 21; trigs[numtrigs]._tlvl = 21;
numtrigs++; numtrigs++;
} }
#ifdef HELLFIRE
trigs[numtrigs]._tx = 80;
trigs[numtrigs]._ty = 62;
trigs[numtrigs]._tmsg = WM_DIABTOWNWARP;
trigs[numtrigs]._tlvl = 17;
numtrigs++;
#endif
} }
trigflag = FALSE; trigflag = FALSE;
@ -386,25 +343,6 @@ BOOL ForceTownTrig()
{ {
int i, j, k, l; int i, j, k, l;
#ifdef HELLFIRE
for (i = 0; TownCryptList[i] != -1; i++) {
if (dPiece[cursmx][cursmy] == TownCryptList[i]) {
strcpy(infostr, "Down to Crypt");
cursmx = 36;
cursmy = 24;
return TRUE;
}
}
for (i = 0; TownHiveList[i] != -1; i++) {
if (dPiece[cursmx][cursmy] == TownHiveList[i]) {
strcpy(infostr, "Down to Hive");
cursmx = 80;
cursmy = 62;
return TRUE;
}
}
#endif
for (i = 0; TownDownList[i] != -1; i++) { for (i = 0; TownDownList[i] != -1; i++) {
if (dPiece[cursmx][cursmy] == TownDownList[i]) { if (dPiece[cursmx][cursmy] == TownDownList[i]) {
strcpy(infostr, "Down to dungeon"); strcpy(infostr, "Down to dungeon");
@ -447,6 +385,25 @@ BOOL ForceTownTrig()
} }
} }
if (gbIsHellfire) {
for (i = 0; TownCryptList[i] != -1; i++) {
if (dPiece[cursmx][cursmy] == TownCryptList[i]) {
strcpy(infostr, "Down to Crypt");
cursmx = 36;
cursmy = 24;
return TRUE;
}
}
for (i = 0; TownHiveList[i] != -1; i++) {
if (dPiece[cursmx][cursmy] == TownHiveList[i]) {
strcpy(infostr, "Down to Hive");
cursmx = 80;
cursmy = 62;
return TRUE;
}
}
}
return FALSE; return FALSE;
} }

34
SourceX/controls/plrctrls.cpp

@ -197,8 +197,8 @@ bool CanTargetMonster(int mi)
void FindRangedTarget() void FindRangedTarget()
{ {
int rotations = 0; int rotations = 0;
int distance = 0; int distance = 0;
bool canTalk = false; bool canTalk = false;
// The first MAX_PLRS monsters are reserved for players' golems. // The first MAX_PLRS monsters are reserved for players' golems.
@ -310,9 +310,9 @@ void CheckMonstersNearby()
void CheckPlayerNearby() void CheckPlayerNearby()
{ {
int newDdistance; int newDdistance;
int rotations = 0; int rotations = 0;
int distance = 0; int distance = 0;
if (pcursmonst != -1) if (pcursmonst != -1)
return; return;
@ -368,8 +368,8 @@ int pcursquest;
void FindTrigger() void FindTrigger()
{ {
int rotations; int rotations;
int distance = 0; int distance = 0;
if (pcursitem != -1 || pcursobj != -1) if (pcursitem != -1 || pcursobj != -1)
return; // Prefer showing items/objects over triggers (use of cursm* conflicts) return; // Prefer showing items/objects over triggers (use of cursm* conflicts)
@ -556,7 +556,7 @@ void InvMove(MoveDirection dir)
x = InvRect[slot].X + RIGHT_PANEL + (INV_SLOT_SIZE_PX / 2); x = InvRect[slot].X + RIGHT_PANEL + (INV_SLOT_SIZE_PX / 2);
y = InvRect[slot].Y - (INV_SLOT_SIZE_PX / 2); y = InvRect[slot].Y - (INV_SLOT_SIZE_PX / 2);
} }
} else if (slot > SLOTXY_BELT_FIRST && slot <= SLOTXY_BELT_LAST) { // belt } else if (slot > SLOTXY_BELT_FIRST && slot <= SLOTXY_BELT_LAST) { // belt
slot -= 1; slot -= 1;
x = InvRect[slot].X + PANEL_LEFT + (INV_SLOT_SIZE_PX / 2); x = InvRect[slot].X + PANEL_LEFT + (INV_SLOT_SIZE_PX / 2);
y = InvRect[slot].Y + PANEL_TOP - (INV_SLOT_SIZE_PX / 2); y = InvRect[slot].Y + PANEL_TOP - (INV_SLOT_SIZE_PX / 2);
@ -586,7 +586,7 @@ void InvMove(MoveDirection dir)
x = InvRect[slot].X + RIGHT_PANEL + (INV_SLOT_SIZE_PX / 2); x = InvRect[slot].X + RIGHT_PANEL + (INV_SLOT_SIZE_PX / 2);
y = InvRect[slot].Y - (INV_SLOT_SIZE_PX / 2); y = InvRect[slot].Y - (INV_SLOT_SIZE_PX / 2);
} }
} else if (slot >= SLOTXY_BELT_FIRST && slot < SLOTXY_BELT_LAST) { // belt } else if (slot >= SLOTXY_BELT_FIRST && slot < SLOTXY_BELT_LAST) { // belt
slot += 1; slot += 1;
x = InvRect[slot].X + PANEL_LEFT + (INV_SLOT_SIZE_PX / 2); x = InvRect[slot].X + PANEL_LEFT + (INV_SLOT_SIZE_PX / 2);
y = InvRect[slot].Y + PANEL_TOP - (INV_SLOT_SIZE_PX / 2); y = InvRect[slot].Y + PANEL_TOP - (INV_SLOT_SIZE_PX / 2);
@ -679,10 +679,9 @@ bool HSExists(int x, int y)
{ {
for (int r = 0; r < speedspellcount; r++) { for (int r = 0; r < speedspellcount; r++) {
if (x >= speedspellscoords[r].x - SPLICONLENGTH / 2 if (x >= speedspellscoords[r].x - SPLICONLENGTH / 2
&& x < speedspellscoords[r].x + SPLICONLENGTH / 2 && x < speedspellscoords[r].x + SPLICONLENGTH / 2
&& y >= speedspellscoords[r].y - SPLICONLENGTH / 2 && y >= speedspellscoords[r].y - SPLICONLENGTH / 2
&& y < speedspellscoords[r].y + SPLICONLENGTH / 2 && y < speedspellscoords[r].y + SPLICONLENGTH / 2) {
) {
return true; return true;
} }
} }
@ -705,10 +704,9 @@ void HotSpellMove(MoveDirection dir)
int spbslot = plr[myplr]._pRSpell; int spbslot = plr[myplr]._pRSpell;
for (int r = 0; r < speedspellcount; r++) { for (int r = 0; r < speedspellcount; r++) {
if (MouseX >= speedspellscoords[r].x - SPLICONLENGTH / 2 if (MouseX >= speedspellscoords[r].x - SPLICONLENGTH / 2
&& MouseX < speedspellscoords[r].x + SPLICONLENGTH / 2 && MouseX < speedspellscoords[r].x + SPLICONLENGTH / 2
&& MouseY >= speedspellscoords[r].y - SPLICONLENGTH / 2 && MouseY >= speedspellscoords[r].y - SPLICONLENGTH / 2
&& MouseY < speedspellscoords[r].y + SPLICONLENGTH / 2 && MouseY < speedspellscoords[r].y + SPLICONLENGTH / 2) {
) {
spbslot = r; spbslot = r;
break; break;
} }
@ -761,7 +759,7 @@ void SpellBookMove(MoveDirection dir)
if (sbooktab > 0) if (sbooktab > 0)
sbooktab--; sbooktab--;
} else if (dir.x == MoveDirectionX_RIGHT) { } else if (dir.x == MoveDirectionX_RIGHT) {
if (sbooktab < 3) if ((gbIsHellfire && sbooktab < 4) || (!gbIsHellfire && sbooktab < 3))
sbooktab++; sbooktab++;
} }
} }

Loading…
Cancel
Save