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_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 },
#ifndef HELLFIRE
{ -1, -1, -1, -1, -1, -1, -1 },
#else
{ SPL_LIGHTWALL, SPL_IMMOLAT, SPL_WARP, SPL_REFLECT, SPL_BERSERK, SPL_FIRERING, SPL_SEARCH },
#endif
{ -1, -1, -1, -1, -1, -1, -1 }
};
#define SPLICONLENGTH 56
#define SPLROWICONLS 10
#ifdef HELLFIRE
#define SPLICONLAST 52
#else
#define SPLICONLAST 43
#endif
#define SPLICONLAST (gbIsHellfire ? 52 : 43)
/**
* Draw spell cell onto the back buffer.
@ -348,7 +340,7 @@ void DrawSpellList()
y = PANEL_Y - 17;
ClearPanel();
int maxSpells = gbIsHellfire ? MAX_SPELLS : 37;
int maxSpells = gbIsHellfire ? MAX_SPELLS : 37;
for (i = 0; i < 4; i++) {
switch ((spell_type)i) {
@ -921,7 +913,7 @@ void DoSpeedBook()
X = xo - (BORDER_LEFT - 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) {
for (i = 0; i < 4; i++) {
@ -1891,12 +1883,10 @@ void DrawSpellBook()
unsigned __int64 spl;
CelDraw(RIGHT_PANEL_X, 351 + SCREEN_Y, pSpellBkCel, 1, SPANEL_WIDTH);
#ifdef HELLFIRE
if (sbooktab < 5)
if (gbIsHellfire && sbooktab < 5)
CelDraw(RIGHT_PANEL_X + 61 * sbooktab + 7, 348 + SCREEN_Y, pSBkBtnCel, sbooktab + 1, 61);
#else
CelDraw(RIGHT_PANEL_X + 76 * sbooktab + 7, 348 + SCREEN_Y, pSBkBtnCel, sbooktab + 1, 76);
#endif
else if (gbIsHellfire && sbooktab < 4)
CelDraw(RIGHT_PANEL_X + 76 * sbooktab + 7, 348 + SCREEN_Y, pSBkBtnCel, sbooktab + 1, 76);
spl = plr[myplr]._pMemSpells | plr[myplr]._pISpells | plr[myplr]._pAblSpells;
@ -2261,18 +2251,7 @@ static void control_press_enter()
BYTE talk_save;
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);
#endif
for (i = 0; i < 8; i++) {
if (!strcmp(sgszTalkSave[i], sgszTalkMsg))
break;

23
Source/drlg_l1.cpp

@ -2457,7 +2457,6 @@ static void DRLG_L5DirtFix()
{
int i, j;
#ifdef HELLFIRE
if (currlevel < 21) {
for (j = 0; j < DMAXY - 1; j++) {
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()
@ -2757,9 +2738,7 @@ static void DRLG_L5(int entry)
void CreateL5Dungeon(DWORD rseed, int entry)
{
#ifdef HELLFIRE
int i, j;
#endif
SetRndSeed(rseed);
@ -2791,7 +2770,6 @@ void CreateL5Dungeon(DWORD rseed, int entry)
DRLG_SetPC();
#ifdef HELLFIRE
for (j = dminy; j < dmaxy; j++) {
for (i = dminx; i < dmaxx; i++) {
if (dPiece[i][j] == 290) {
@ -2804,7 +2782,6 @@ void CreateL5Dungeon(DWORD rseed, int entry)
}
}
}
#endif
}
void drlg_l1_crypt_pattern1(int rndper)

37
Source/gmenu.cpp

@ -82,9 +82,7 @@ void FreeGMenu()
void gmenu_init_menu()
{
#ifdef HELLFIRE
LogoAnim_frame = 1;
#endif
sgpCurrentMenu = NULL;
sgpCurrItem = 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)
{
DWORD w, x, nSteps, step, pos, t;
#ifndef HELLFIRE
t = y - 2;
#endif
DWORD w, x, nSteps, step, pos;
w = gmenu_get_lfont(pItem);
if (pItem->dwFlags & GMENU_SLIDER) {
x = 16 + w / 2 + SCREEN_X;
#ifdef HELLFIRE
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;
nSteps = (pItem->dwFlags & 0xFFF000) >> 12;
if (nSteps < 2)
nSteps = 2;
pos = step * 256 / nSteps;
#ifdef HELLFIRE
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);
}
x = SCREEN_WIDTH / 2 - w / 2 + SCREEN_X;
@ -230,18 +217,18 @@ void gmenu_draw()
if (sgpCurrentMenu) {
if (gmenu_current_option)
gmenu_current_option(sgpCurrentMenu);
#ifdef HELLFIRE
ticks = SDL_GetTicks();
if ((int)(ticks - LogoAnim_tick) > 25) {
LogoAnim_frame++;
if (LogoAnim_frame > 16)
LogoAnim_frame = 1;
LogoAnim_tick = ticks;
if (gbIsHellfire) {
ticks = SDL_GetTicks();
if ((int)(ticks - LogoAnim_tick) > 25) {
LogoAnim_frame++;
if (LogoAnim_frame > 16)
LogoAnim_frame = 1;
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;
i = sgpCurrentMenu;
if (sgpCurrentMenu->fnMenu) {

51
Source/inv.cpp

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

7
Source/inv.h

@ -39,12 +39,7 @@ BOOL CanPut(int x, int y);
BOOL TryInvPut();
void DrawInvMsg(const char *msg);
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
#ifdef HELLFIRE
,
int to_hit, int max_dam, int min_str, int min_mag, int min_dex, int ac
#endif
);
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);
char CheckInvHLight();
void RemoveScroll(int pnum);
BOOL UseScroll();

310
Source/items.cpp

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

24
Source/lighting.cpp

@ -558,16 +558,12 @@ void DoLighting(int nXPos, int nYPos, int nRadius, int Lnum)
max_y = 15;
}
#ifdef HELLFIRE
if (currlevel < 17) {
#else
if (nXPos >= 0 && nXPos < MAXDUNX && nYPos >= 0 && nYPos < MAXDUNY) {
#endif
dLight[nXPos][nYPos] = 0;
#ifdef HELLFIRE
} else if (dLight[nXPos][nYPos] > lightradius[nRadius][0]) {
dLight[nXPos][nYPos] = lightradius[nRadius][0];
#endif
if (currlevel < 17) {
dLight[nXPos][nYPos] = 0;
} else if (dLight[nXPos][nYPos] > lightradius[nRadius][0]) {
dLight[nXPos][nYPos] = lightradius[nRadius][0];
}
}
mult = xoff + 8 * yoff;
@ -578,9 +574,7 @@ void DoLighting(int nXPos, int nYPos, int nRadius, int Lnum)
temp_x = nXPos + x;
temp_y = nYPos + y;
v = lightradius[nRadius][radius_block];
#ifndef HELLFIRE
if (temp_x >= 0 && temp_x < MAXDUNX && temp_y >= 0 && temp_y < MAXDUNY)
#endif
if (v < dLight[temp_x][temp_y])
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_y = nYPos - x;
v = lightradius[nRadius][radius_block];
#ifndef HELLFIRE
if (temp_x >= 0 && temp_x < MAXDUNX && temp_y >= 0 && temp_y < MAXDUNY)
#endif
if (v < dLight[temp_x][temp_y])
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_y = nYPos - y;
v = lightradius[nRadius][radius_block];
#ifndef HELLFIRE
if (temp_x >= 0 && temp_x < MAXDUNX && temp_y >= 0 && temp_y < MAXDUNY)
#endif
if (v < dLight[temp_x][temp_y])
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_y = nYPos + x;
v = lightradius[nRadius][radius_block];
#ifndef HELLFIRE
if (temp_x >= 0 && temp_x < MAXDUNX && temp_y >= 0 && temp_y < MAXDUNY)
#endif
if (v < dLight[temp_x][temp_y])
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 (x = min_x; x < max_x; x++) {
#ifndef HELLFIRE
if (x >= 0 && x < MAXDUNX && y >= 0 && y < MAXDUNY)
#endif
dLight[x][y] = dPreLight[x][y];
}
}

2
Source/mainmenu.cpp

@ -171,11 +171,9 @@ void mainmenu_loop()
case MAINMENU_SHOW_CREDITS:
UiCreditsDialog(16);
break;
#ifdef HELLFIRE
case MAINMENU_SHOW_SUPPORT:
//UiSupportDialog(16);
break;
#endif
case MAINMENU_EXIT_DIABLO:
done = TRUE;
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 },
{ 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 },
#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 },
#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, 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 },
@ -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 },
#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 },
{ 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
{ 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
{ 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 },
{ 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 },

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 (p->bPnum == myplr) {
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
#ifdef HELLFIRE
,
p->wToHit, p->wMaxDam, p->bMinStr, p->bMinMag, p->bMinDex, p->bAC
#endif
);
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);
if (ii != -1)
InvGetItem(myplr, ii);
} else
@ -1540,12 +1535,7 @@ static DWORD On_AGETITEM(TCmd *pCmd, int pnum)
if ((currlevel == p->bLevel || p->bPnum == myplr) && p->bMaster != myplr) {
if (p->bPnum == myplr) {
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
#ifdef HELLFIRE
,
p->wToHit, p->wMaxDam, p->bMinStr, p->bMinMag, p->bMinDex, p->bAC
#endif
);
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);
if (ii != -1)
AutoGetItem(myplr, ii);
} else
@ -1586,12 +1576,7 @@ static DWORD On_PUTITEM(TCmd *pCmd, int pnum)
if (pnum == myplr)
ii = InvPutItem(pnum, p->x, p->y);
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
#ifdef HELLFIRE
,
p->wToHit, p->wMaxDam, p->bMinStr, p->bMinMag, p->bMinDex, p->bAC
#endif
);
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);
if (ii != -1) {
PutItemRecord(p->dwSeed, p->wCI, p->wIndx);
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)
msg_send_packet(pnum, p, sizeof(*p));
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
#ifdef HELLFIRE
,
p->wToHit, p->wMaxDam, p->bMinStr, p->bMinMag, p->bMinDex, p->bAC
#endif
);
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);
if (ii != -1) {
PutItemRecord(p->dwSeed, p->wCI, p->wIndx);
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));
else {
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
#ifdef HELLFIRE
,
p->wToHit, p->wMaxDam, p->bMinStr, p->bMinMag, p->bMinDex, p->bAC
#endif
);
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);
}
PutItemRecord(p->dwSeed, p->wCI, p->wIndx);
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) {
object[oi]._oVar4 = random_(0, 2);
} else {
#ifdef HELLFIRE
object[oi]._oVar4 = random_(0, 6);
#else
object[oi]._oVar4 = random_(0, 3);
#endif
if (gbIsHellfire)
object[oi]._oVar4 = random_(0, 6);
else
object[oi]._oVar4 = random_(0, 3);
}
}
}
@ -2434,15 +2433,7 @@ void OperateL1RDoor(int pnum, int oi, bool sendflag)
if (!deltaload)
PlaySfxLoc(IS_CRCLOS, xp, object[oi]._oy);
}
#ifdef HELLFIRE
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 (!deltaload && dDead[xp][yp] == 0 && dMonster[xp][yp] == 0 && dItem[xp][yp] == 0) {
if (pnum == myplr && sendflag)
NetSendCmdParam1(TRUE, CMD_CLOSEDOOR, oi);
object[oi]._oVar4 = 0;
@ -2524,14 +2515,7 @@ void OperateL1LDoor(int pnum, int oi, bool sendflag)
if (!deltaload)
PlaySfxLoc(IS_CRCLOS, xp, object[oi]._oy);
}
#ifdef HELLFIRE
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 (dDead[xp][yp] == 0 && dMonster[xp][yp] == 0 && dItem[xp][yp] == 0) {
if (pnum == myplr && sendflag)
NetSendCmdParam1(TRUE, CMD_CLOSEDOOR, oi);
object[oi]._oVar4 = 0;
@ -3317,11 +3301,9 @@ void TryDisarm(int pnum, int i)
object[i]._oTrapFlag = FALSE;
}
}
#ifndef HELLFIRE
oti = object[i]._otype;
if (oti >= OBJ_TCHEST1 && oti <= OBJ_TCHEST3)
object[i]._oTrapFlag = FALSE;
#endif
}
}
}
@ -3420,10 +3402,8 @@ void OperateShrine(int pnum, int i, int sType)
cnt = 0;
for (j = 0; j < NUM_INVLOC; j++) {
if (plr[pnum].InvBody[j]._itype != ITYPE_NONE)
#ifndef HELLFIRE
if (plr[pnum].InvBody[j]._iMaxDur != DUR_INDESTRUCTIBLE
&& plr[pnum].InvBody[j]._iMaxDur != 0)
#endif
cnt++;
}
if (cnt == 0)
@ -3936,7 +3916,6 @@ void OperateShrine(int pnum, int i, int sType)
CheckStats(myplr);
}
break;
#ifdef HELLFIRE
case SHRINE_OILY:
if (deltaload)
return;
@ -4105,7 +4084,6 @@ void OperateShrine(int pnum, int i, int sType)
TakePlrsMoney(plr[myplr]._pGold / 3);
}
break;
#endif
}
CalcPlrInv(pnum, TRUE);

7
Source/player.cpp

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

14
Source/spells.cpp

@ -43,17 +43,11 @@ int GetManaAmount(int id, int sn)
ma = 0;
ma <<= 6;
#ifdef HELLFIRE
if (plr[id]._pClass == PC_SORCERER) {
ma >>= 1;
} else if (plr[id]._pClass == PC_ROGUE || plr[id]._pClass == PC_MONK || plr[id]._pClass == PC_BARD) {
ma -= ma >> 2;
}
#else
if (plr[id]._pClass == PC_ROGUE) {
ma -= ma >> 2;
}
#endif
if (spelldata[sn].sMinMana > ma >> 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;
dir = plr[id]._pdir;
#ifdef HELLFIRE
if (spl == SPL_FIREWALL || spl == SPL_LIGHTWALL) {
#else
if (spl == SPL_FIREWALL) {
#endif
dir = plr[id]._pVar3;
}
break;
@ -305,16 +295,12 @@ void DoResurrect(int pnum, int rid)
ClrPlrPath(rid);
plr[rid].destAction = ACTION_NONE;
plr[rid]._pInvincible = FALSE;
#ifndef HELLFIRE
PlacePlayer(rid);
#endif
hp = 10 << 6;
#ifndef HELLFIRE
if (plr[rid]._pMaxHPBase < (10 << 6)) {
hp = plr[rid]._pMaxHPBase;
}
#endif
SetPlayerHitPoints(rid, hp);
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;
numtrigs++;
if (!gbIsSpawn && gbMaxPlayers == MAX_PLRS) {
for (i = 0; i < sizeof(townwarps) / sizeof(townwarps[0]); i++) {
townwarps[i] = TRUE;
bool isMultiplayer = gbMaxPlayers == MAX_PLRS;
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;
trigs[numtrigs]._ty = 21;
trigs[numtrigs]._tmsg = WM_DIABTOWNWARP;
trigs[numtrigs]._tlvl = 5;
numtrigs++;
trigs[numtrigs]._tx = 17;
trigs[numtrigs]._ty = 69;
trigs[numtrigs]._tmsg = WM_DIABTOWNWARP;
trigs[numtrigs]._tlvl = 9;
numtrigs++;
trigs[numtrigs]._tx = 41;
trigs[numtrigs]._ty = 80;
trigs[numtrigs]._tmsg = WM_DIABTOWNWARP;
trigs[numtrigs]._tlvl = 13;
numtrigs++;
#ifdef HELLFIRE
trigs[numtrigs]._tx = 36;
trigs[numtrigs]._ty = 24;
trigs[numtrigs]._tmsg = WM_DIABTOWNWARP;
trigs[numtrigs]._tlvl = 21;
numtrigs++;
if (isMultiplayer || plr[myplr].pTownWarps & 2 || (gbIsHellfire && plr[myplr]._pLevel >= 15)) {
townwarps[1] = TRUE;
trigs[numtrigs]._tx = 17;
trigs[numtrigs]._ty = 69;
trigs[numtrigs]._tmsg = WM_DIABTOWNWARP;
trigs[numtrigs]._tlvl = 9;
numtrigs++;
}
if (isMultiplayer || plr[myplr].pTownWarps & 4 || (gbIsHellfire && plr[myplr]._pLevel >= 20)) {
townwarps[2] = TRUE;
trigs[numtrigs]._tx = 41;
trigs[numtrigs]._ty = 80;
trigs[numtrigs]._tmsg = WM_DIABTOWNWARP;
trigs[numtrigs]._tlvl = 13;
numtrigs++;
}
}
if (gbIsHellfire) {
trigs[numtrigs]._tx = 80;
trigs[numtrigs]._ty = 62;
trigs[numtrigs]._tmsg = WM_DIABTOWNWARP;
trigs[numtrigs]._tlvl = 17;
numtrigs++;
#endif
} 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) {
if (isMultiplayer || quests[Q_GRAVE]._qactive == 3) {
trigs[numtrigs]._tx = 36;
trigs[numtrigs]._ty = 24;
trigs[numtrigs]._tmsg = WM_DIABTOWNWARP;
trigs[numtrigs]._tlvl = 21;
numtrigs++;
}
#ifdef HELLFIRE
trigs[numtrigs]._tx = 80;
trigs[numtrigs]._ty = 62;
trigs[numtrigs]._tmsg = WM_DIABTOWNWARP;
trigs[numtrigs]._tlvl = 17;
numtrigs++;
#endif
}
trigflag = FALSE;
@ -386,25 +343,6 @@ BOOL ForceTownTrig()
{
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++) {
if (dPiece[cursmx][cursmy] == TownDownList[i]) {
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;
}

34
SourceX/controls/plrctrls.cpp

@ -197,8 +197,8 @@ bool CanTargetMonster(int mi)
void FindRangedTarget()
{
int rotations = 0;
int distance = 0;
int rotations = 0;
int distance = 0;
bool canTalk = false;
// The first MAX_PLRS monsters are reserved for players' golems.
@ -310,9 +310,9 @@ void CheckMonstersNearby()
void CheckPlayerNearby()
{
int newDdistance;
int rotations = 0;
int distance = 0;
int newDdistance;
int rotations = 0;
int distance = 0;
if (pcursmonst != -1)
return;
@ -368,8 +368,8 @@ int pcursquest;
void FindTrigger()
{
int rotations;
int distance = 0;
int rotations;
int distance = 0;
if (pcursitem != -1 || pcursobj != -1)
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);
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;
x = InvRect[slot].X + PANEL_LEFT + (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);
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;
x = InvRect[slot].X + PANEL_LEFT + (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++) {
if (x >= speedspellscoords[r].x - SPLICONLENGTH / 2
&& x < speedspellscoords[r].x + SPLICONLENGTH / 2
&& y >= speedspellscoords[r].y - SPLICONLENGTH / 2
&& y < speedspellscoords[r].y + SPLICONLENGTH / 2
) {
&& x < speedspellscoords[r].x + SPLICONLENGTH / 2
&& y >= speedspellscoords[r].y - SPLICONLENGTH / 2
&& y < speedspellscoords[r].y + SPLICONLENGTH / 2) {
return true;
}
}
@ -705,10 +704,9 @@ void HotSpellMove(MoveDirection dir)
int spbslot = plr[myplr]._pRSpell;
for (int r = 0; r < speedspellcount; r++) {
if (MouseX >= speedspellscoords[r].x - SPLICONLENGTH / 2
&& MouseX < speedspellscoords[r].x + SPLICONLENGTH / 2
&& MouseY >= speedspellscoords[r].y - SPLICONLENGTH / 2
&& MouseY < speedspellscoords[r].y + SPLICONLENGTH / 2
) {
&& MouseX < speedspellscoords[r].x + SPLICONLENGTH / 2
&& MouseY >= speedspellscoords[r].y - SPLICONLENGTH / 2
&& MouseY < speedspellscoords[r].y + SPLICONLENGTH / 2) {
spbslot = r;
break;
}
@ -761,7 +759,7 @@ void SpellBookMove(MoveDirection dir)
if (sbooktab > 0)
sbooktab--;
} else if (dir.x == MoveDirectionX_RIGHT) {
if (sbooktab < 3)
if ((gbIsHellfire && sbooktab < 4) || (!gbIsHellfire && sbooktab < 3))
sbooktab++;
}
}

Loading…
Cancel
Save