Browse Source

Unify majorty of monster.cpp

pull/978/head
Anders Jenbo 5 years ago
parent
commit
00e3ff08ae
  1. 4
      Source/control.cpp
  2. 8
      Source/diablo.cpp
  3. 4
      Source/inv.cpp
  4. 51
      Source/itemdat.cpp
  5. 65
      Source/items.cpp
  6. 2
      Source/missiles.cpp
  7. 1006
      Source/monster.cpp
  8. 2
      Source/player.cpp
  9. 3
      Source/player.h
  10. 6
      defs.h

4
Source/control.cpp

@ -1345,7 +1345,7 @@ void DrawInfoBox()
infoclr = COL_GOLD;
strcpy(infostr, plr[pcursplr]._pName);
ClearPanel();
sprintf(tempstr, "%s, Level : %i", ClassStrTbl[plr[pcursplr]._pClass], plr[pcursplr]._pLevel);
sprintf(tempstr, "%s, Level : %i", ClassStrTblOld[plr[pcursplr]._pClass], plr[pcursplr]._pLevel);
AddPanelString(tempstr, TRUE);
sprintf(tempstr, "Hit Points %i of %i", plr[pcursplr]._pHitPoints >> 6, plr[pcursplr]._pMaxHP >> 6);
AddPanelString(tempstr, TRUE);
@ -1421,7 +1421,7 @@ void DrawChr()
CelDraw(SCREEN_X, 351 + SCREEN_Y, pChrPanel, 1, SPANEL_WIDTH);
ADD_PlrStringXY(20, 32, 151, plr[myplr]._pName, COL_WHITE);
ADD_PlrStringXY(168, 32, 299, ClassStrTbl[plr[myplr]._pClass], COL_WHITE);
ADD_PlrStringXY(168, 32, 299, ClassStrTblOld[plr[myplr]._pClass], COL_WHITE);
sprintf(chrstr, "%i", plr[myplr]._pLevel);
ADD_PlrStringXY(66, 69, 109, chrstr, COL_WHITE);

8
Source/diablo.cpp

@ -111,15 +111,13 @@ static void print_help_and_exit()
printf(" %-20s %-30s\n", "-f", "Display frames per second");
printf(" %-20s %-30s\n", "-x", "Run in windowed mode");
printf(" %-20s %-30s\n", "--spawn", "Force spawn mode even if diabdat.mpq is found");
#ifdef HELLFIRE
printf(" %-20s %-30s\n", "--bardtest", "Enable the Bard class");
printf(" %-20s %-30s\n", "--barbariantest", "Enable the Barbarian class");
printf("\nHellfire options:\n");
printf(" %-20s %-30s\n", "--diablo", "Force diablo mode even if hellfire.mpq is found");
printf(" %-20s %-30s\n", "--theoquest", "Enable the Theo quest");
printf(" %-20s %-30s\n", "--cowquest", "Enable the Cow quest");
printf(" %-20s %-30s\n", "--nestart", "Use alternate nest palette");
printf(" %-20s %-30s\n", "--bardtest", "Enable the Bard class");
printf(" %-20s %-30s\n", "--barbariantest", "Enable the Barbarian class");
#endif
#ifdef _DEBUG
printf("\nDebug options:\n");
printf(" %-20s %-30s\n", "-d", "Increaased item drops");
@ -163,7 +161,6 @@ static void diablo_parse_flags(int argc, char **argv)
fullscreen = FALSE;
} else if (strcasecmp("--spawn", argv[i]) == 0) {
forceSpawn = TRUE;
#ifdef HELLFIRE
} else if (strcasecmp("--diablo", argv[i]) == 0) {
forceDiablo = TRUE;
} else if (strcasecmp("--theoquest", argv[i]) == 0) {
@ -176,7 +173,6 @@ static void diablo_parse_flags(int argc, char **argv)
UseBardTest = TRUE;
} else if (strcasecmp("--barbariantest", argv[i]) == 0) {
UseBarbarianTest = TRUE;
#endif
#ifdef _DEBUG
} else if (strcasecmp("-^", argv[i]) == 0) {
debug_mode_key_inverted_v = TRUE;

4
Source/inv.cpp

@ -713,11 +713,7 @@ BOOL GoldAutoPlace(int pnum)
for (int i = 0; i < plr[pnum]._pNumInv && !done; i++) {
if (plr[pnum].InvList[i]._itype == ITYPE_GOLD) {
int gold = plr[pnum].InvList[i]._ivalue + plr[pnum].HoldItem._ivalue;
#ifdef HELLFIRE
if (gold <= MaxGold) {
#else
if (plr[pnum].HoldItem._ivalue + plr[pnum].InvList[i]._ivalue <= GOLD_MAX_LIMIT) {
#endif
plr[pnum].InvList[i]._ivalue = gold;
if (gold >= GOLD_MEDIUM_LIMIT)
plr[pnum].InvList[i]._iCurs = ICURS_GOLD_LARGE;

51
Source/itemdat.cpp

@ -198,7 +198,6 @@ const PLStruct PL_Prefix[] = {
{ "Meteoric", IPL_TOHIT, 61, 80, 23, PLT_WEAP | PLT_BOW , GOE_ANY, TRUE, TRUE, 6100, 10000, 15 },
{ "Weird", IPL_TOHIT, 81, 100, 35, PLT_WEAP | PLT_BOW , GOE_ANY, TRUE, TRUE, 10100, 14000, 17 },
{ "Strange", IPL_TOHIT, 101, 150, 60, PLT_WEAP | PLT_BOW , GOE_ANY, TRUE, TRUE, 14100, 20000, 20 },
#ifdef HELLFIRE
{ "Useless", IPL_DAMP_CURSE, 100, 100, 5, PLT_WEAP | PLT_STAFF | PLT_BOW , GOE_ANY, TRUE, FALSE, 0, 0, -8 },
{ "Bent", IPL_DAMP_CURSE, 50, 75, 3, PLT_WEAP | PLT_STAFF | PLT_BOW , GOE_ANY, TRUE, FALSE, 0, 0, -4 },
{ "Weak", IPL_DAMP_CURSE, 25, 45, 1, PLT_WEAP | PLT_STAFF | PLT_BOW , GOE_ANY, TRUE, FALSE, 0, 0, -3 },
@ -208,17 +207,6 @@ const PLStruct PL_Prefix[] = {
{ "Vicious", IPL_DAMP, 66, 80, 12, PLT_WEAP | PLT_STAFF | PLT_BOW , GOE_EVIL, TRUE, TRUE, 1000, 1450, 8 },
{ "Brutal", IPL_DAMP, 81, 95, 16, PLT_WEAP | PLT_STAFF | PLT_BOW , GOE_ANY, TRUE, TRUE, 1500, 1950, 10 },
{ "Massive", IPL_DAMP, 96, 110, 20, PLT_WEAP | PLT_STAFF | PLT_BOW , GOE_ANY, TRUE, TRUE, 2000, 2450, 13 },
#else
{ "Useless", IPL_DAMP_CURSE, 100, 100, 5, PLT_WEAP | PLT_BOW , GOE_ANY, TRUE, FALSE, 0, 0, -8 },
{ "Bent", IPL_DAMP_CURSE, 50, 75, 3, PLT_WEAP | PLT_BOW , GOE_ANY, TRUE, FALSE, 0, 0, -4 },
{ "Weak", IPL_DAMP_CURSE, 25, 45, 1, PLT_WEAP | PLT_BOW , GOE_ANY, TRUE, FALSE, 0, 0, -3 },
{ "Jagged", IPL_DAMP, 20, 35, 4, PLT_WEAP | PLT_BOW , GOE_ANY, TRUE, TRUE, 250, 450, 3 },
{ "Deadly", IPL_DAMP, 36, 50, 6, PLT_WEAP | PLT_BOW , GOE_ANY, TRUE, TRUE, 500, 700, 4 },
{ "Heavy", IPL_DAMP, 51, 65, 9, PLT_WEAP | PLT_BOW , GOE_ANY, TRUE, TRUE, 750, 950, 5 },
{ "Vicious", IPL_DAMP, 66, 80, 12, PLT_WEAP | PLT_BOW , GOE_EVIL, TRUE, TRUE, 1000, 1450, 8 },
{ "Brutal", IPL_DAMP, 81, 95, 16, PLT_WEAP | PLT_BOW , GOE_ANY, TRUE, TRUE, 1500, 1950, 10 },
{ "Massive", IPL_DAMP, 96, 110, 20, PLT_WEAP | PLT_BOW , GOE_ANY, TRUE, TRUE, 2000, 2450, 13 },
#endif
{ "Savage", IPL_DAMP, 111, 125, 23, PLT_WEAP | PLT_BOW , GOE_ANY, TRUE, TRUE, 2500, 3000, 15 },
{ "Ruthless", IPL_DAMP, 126, 150, 35, PLT_WEAP | PLT_BOW , GOE_ANY, TRUE, TRUE, 10100, 15000, 17 },
{ "Merciless", IPL_DAMP, 151, 175, 60, PLT_WEAP | PLT_BOW , GOE_ANY, TRUE, TRUE, 15000, 20000, 20 },
@ -281,11 +269,9 @@ const PLStruct PL_Prefix[] = {
{ "Bountiful", IPL_CHARGES, 3, 3, 9, PLT_STAFF , GOE_ANY, FALSE, TRUE, 3000, 3000, 3 },
{ "Flaming", IPL_FIREDAM, 1, 10, 7, PLT_WEAP | PLT_STAFF , GOE_ANY, FALSE, TRUE, 5000, 5000, 2 },
{ "Lightning", IPL_LIGHTDAM, 2, 20, 18, PLT_WEAP | PLT_STAFF , GOE_ANY, FALSE, TRUE, 10000, 10000, 2 },
#ifdef HELLFIRE
{ "Jester's", IPL_JESTERS, 1, 1, 7, PLT_WEAP , GOE_ANY, FALSE, TRUE, 1200, 1200, 3 },
{ "Crystalline", IPL_CRYSTALLINE, 30, 70, 5, PLT_WEAP , GOE_ANY, FALSE, TRUE, 1000, 3000, 3 },
{ "Doppelganger's", IPL_DOPPELGANGER, 81, 95, 11, PLT_WEAP | PLT_STAFF , GOE_ANY, FALSE, TRUE, 2000, 2400, 10 },
#endif
{ "", IPL_INVALID, 0, 0, 0, 0 , GOE_ANY, FALSE, FALSE, 0, 0, 0 },
// clang-format on
};
@ -294,13 +280,8 @@ const PLStruct PL_Prefix[] = {
const PLStruct PL_Suffix[] = {
// clang-format off
// PLName, PLPower, PLParam1, PLParam2, PLMinLvl, PLIType, PLGOE, PLDouble, PLOk, PLMinVal, PLMaxVal, PLMultVal
#ifdef HELLFIRE
{ "quality", IPL_DAMMOD, 1, 2, 2, PLT_WEAP | PLT_STAFF | PLT_BOW , GOE_ANY, FALSE, TRUE, 100, 200, 2 },
{ "maiming", IPL_DAMMOD, 3, 5, 7, PLT_WEAP | PLT_STAFF | PLT_BOW , GOE_ANY, FALSE, TRUE, 1300, 1500, 3 },
#else
{ "quality", IPL_DAMMOD, 1, 2, 2, PLT_WEAP | PLT_BOW , GOE_ANY, FALSE, TRUE, 100, 200, 2 },
{ "maiming", IPL_DAMMOD, 3, 5, 7, PLT_WEAP | PLT_BOW , GOE_ANY, FALSE, TRUE, 1300, 1500, 3 },
#endif
{ "slaying", IPL_DAMMOD, 6, 8, 15, PLT_WEAP , GOE_ANY, FALSE, TRUE, 2600, 3000, 5 },
{ "gore", IPL_DAMMOD, 9, 12, 25, PLT_WEAP , GOE_ANY, FALSE, TRUE, 4100, 5000, 8 },
{ "carnage", IPL_DAMMOD, 13, 16, 35, PLT_WEAP , GOE_ANY, FALSE, TRUE, 5100, 10000, 10 },
@ -313,25 +294,15 @@ const PLStruct PL_Suffix[] = {
{ "deflection", IPL_GETHIT, 4, 4, 20, PLT_ARMO , GOE_GOOD, FALSE, TRUE, 2500, 6500, 15 },
{ "osmosis", IPL_GETHIT, 5, 6, 50, PLT_ARMO , GOE_GOOD, FALSE, TRUE, 7500, 10000, 20 },
{ "frailty", IPL_STR_CURSE, 6, 10, 3, PLT_ARMO | PLT_SHLD | PLT_WEAP | PLT_BOW | PLT_MISC, GOE_EVIL, FALSE, FALSE, 0, 0, -3 },
#ifdef HELLFIRE
{ "weakness", IPL_STR_CURSE, 1, 5, 1, PLT_ARMO | PLT_SHLD | PLT_WEAP | PLT_STAFF | PLT_BOW | PLT_MISC, GOE_EVIL, FALSE, FALSE, 0, 0, -2 },
{ "strength", IPL_STR, 1, 5, 1, PLT_ARMO | PLT_SHLD | PLT_WEAP | PLT_STAFF | PLT_BOW | PLT_MISC, GOE_ANY, FALSE, TRUE, 200, 1000, 2 },
#else
{ "weakness", IPL_STR_CURSE, 1, 5, 1, PLT_ARMO | PLT_SHLD | PLT_WEAP | PLT_BOW | PLT_MISC, GOE_EVIL, FALSE, FALSE, 0, 0, -2 },
{ "strength", IPL_STR, 1, 5, 1, PLT_ARMO | PLT_SHLD | PLT_WEAP | PLT_BOW | PLT_MISC, GOE_ANY, FALSE, TRUE, 200, 1000, 2 },
#endif
{ "might", IPL_STR, 6, 10, 5, PLT_ARMO | PLT_SHLD | PLT_WEAP | PLT_BOW | PLT_MISC, GOE_ANY, FALSE, TRUE, 1200, 2000, 3 },
{ "power", IPL_STR, 11, 15, 11, PLT_ARMO | PLT_SHLD | PLT_WEAP | PLT_BOW | PLT_MISC, GOE_ANY, FALSE, TRUE, 2200, 3000, 4 },
{ "giants", IPL_STR, 16, 20, 17, PLT_ARMO | PLT_WEAP | PLT_BOW | PLT_MISC, GOE_ANY, FALSE, TRUE, 3200, 5000, 7 },
{ "titans", IPL_STR, 21, 30, 23, PLT_WEAP | PLT_MISC, GOE_ANY, FALSE, TRUE, 5200, 10000, 10 },
{ "paralysis", IPL_DEX_CURSE, 6, 10, 3, PLT_ARMO | PLT_SHLD | PLT_WEAP | PLT_BOW | PLT_MISC, GOE_EVIL, FALSE, FALSE, 0, 0, -3 },
#ifdef HELLFIRE
{ "atrophy", IPL_DEX_CURSE, 1, 5, 1, PLT_ARMO | PLT_SHLD | PLT_WEAP | PLT_STAFF | PLT_BOW | PLT_MISC, GOE_EVIL, FALSE, FALSE, 0, 0, -2 },
{ "dexterity", IPL_DEX, 1, 5, 1, PLT_ARMO | PLT_SHLD | PLT_WEAP | PLT_STAFF | PLT_BOW | PLT_MISC, GOE_ANY, FALSE, TRUE, 200, 1000, 2 },
#else
{ "atrophy", IPL_DEX_CURSE, 1, 5, 1, PLT_ARMO | PLT_SHLD | PLT_WEAP | PLT_BOW | PLT_MISC, GOE_EVIL, FALSE, FALSE, 0, 0, -2 },
{ "dexterity", IPL_DEX, 1, 5, 1, PLT_ARMO | PLT_SHLD | PLT_WEAP | PLT_BOW | PLT_MISC, GOE_ANY, FALSE, TRUE, 200, 1000, 2 },
#endif
{ "skill", IPL_DEX, 6, 10, 5, PLT_ARMO | PLT_SHLD | PLT_WEAP | PLT_BOW | PLT_MISC, GOE_ANY, FALSE, TRUE, 1200, 2000, 3 },
{ "accuracy", IPL_DEX, 11, 15, 11, PLT_ARMO | PLT_SHLD | PLT_WEAP | PLT_BOW | PLT_MISC, GOE_ANY, FALSE, TRUE, 2200, 3000, 4 },
{ "precision", IPL_DEX, 16, 20, 17, PLT_ARMO | PLT_WEAP | PLT_BOW | PLT_MISC, GOE_ANY, FALSE, TRUE, 3200, 5000, 7 },
@ -343,30 +314,17 @@ const PLStruct PL_Suffix[] = {
{ "brilliance", IPL_MAG, 11, 15, 11, PLT_ARMO | PLT_SHLD | PLT_WEAP | PLT_STAFF | PLT_BOW | PLT_MISC, GOE_ANY, FALSE, TRUE, 2200, 3000, 4 },
{ "sorcery", IPL_MAG, 16, 20, 17, PLT_ARMO | PLT_WEAP | PLT_STAFF | PLT_BOW | PLT_MISC, GOE_ANY, FALSE, TRUE, 3200, 5000, 7 },
{ "wizardry", IPL_MAG, 21, 30, 23, PLT_STAFF | PLT_MISC, GOE_ANY, FALSE, TRUE, 5200, 10000, 10 },
#ifdef HELLFIRE
{ "illness", IPL_VIT_CURSE, 6, 10, 3, PLT_ARMO | PLT_SHLD | PLT_WEAP | PLT_STAFF | PLT_BOW | PLT_MISC, GOE_EVIL, FALSE, FALSE, 0, 0, -3 },
{ "disease", IPL_VIT_CURSE, 1, 5, 1, PLT_ARMO | PLT_SHLD | PLT_WEAP | PLT_STAFF | PLT_BOW | PLT_MISC, GOE_EVIL, FALSE, FALSE, 0, 0, -2 },
{ "vitality", IPL_VIT, 1, 5, 1, PLT_ARMO | PLT_SHLD | PLT_WEAP | PLT_STAFF | PLT_BOW | PLT_MISC, GOE_GOOD, FALSE, TRUE, 200, 1000, 2 },
#else
{ "illness", IPL_VIT_CURSE, 6, 10, 3, PLT_ARMO | PLT_SHLD | PLT_WEAP | PLT_BOW | PLT_MISC, GOE_EVIL, FALSE, FALSE, 0, 0, -3 },
{ "disease", IPL_VIT_CURSE, 1, 5, 1, PLT_ARMO | PLT_SHLD | PLT_WEAP | PLT_BOW | PLT_MISC, GOE_EVIL, FALSE, FALSE, 0, 0, -2 },
{ "vitality", IPL_VIT, 1, 5, 1, PLT_ARMO | PLT_SHLD | PLT_WEAP | PLT_BOW | PLT_MISC, GOE_GOOD, FALSE, TRUE, 200, 1000, 2 },
#endif
{ "zest", IPL_VIT, 6, 10, 5, PLT_ARMO | PLT_SHLD | PLT_WEAP | PLT_BOW | PLT_MISC, GOE_GOOD, FALSE, TRUE, 1200, 2000, 3 },
{ "vim", IPL_VIT, 11, 15, 11, PLT_ARMO | PLT_SHLD | PLT_WEAP | PLT_BOW | PLT_MISC, GOE_GOOD, FALSE, TRUE, 2200, 3000, 4 },
{ "vigor", IPL_VIT, 16, 20, 17, PLT_ARMO | PLT_WEAP | PLT_BOW | PLT_MISC, GOE_GOOD, FALSE, TRUE, 3200, 5000, 7 },
{ "life", IPL_VIT, 21, 30, 23, PLT_MISC, GOE_GOOD, FALSE, TRUE, 5200, 10000, 10 },
#ifdef HELLFIRE
{ "trouble", IPL_ATTRIBS_CURSE, 6, 10, 12, PLT_ARMO | PLT_SHLD | PLT_WEAP | PLT_STAFF | PLT_BOW | PLT_MISC, GOE_EVIL, FALSE, FALSE, 0, 0, -10 },
{ "the pit", IPL_ATTRIBS_CURSE, 1, 5, 5, PLT_ARMO | PLT_SHLD | PLT_WEAP | PLT_STAFF | PLT_BOW | PLT_MISC, GOE_EVIL, FALSE, FALSE, 0, 0, -5 },
{ "the sky", IPL_ATTRIBS, 1, 3, 5, PLT_ARMO | PLT_SHLD | PLT_WEAP | PLT_STAFF | PLT_BOW | PLT_MISC, GOE_ANY, FALSE, TRUE, 800, 4000, 5 },
{ "the moon", IPL_ATTRIBS, 4, 7, 11, PLT_ARMO | PLT_SHLD | PLT_WEAP | PLT_STAFF | PLT_BOW | PLT_MISC, GOE_ANY, FALSE, TRUE, 4800, 8000, 10 },
#else
{ "trouble", IPL_ATTRIBS_CURSE, 6, 10, 12, PLT_ARMO | PLT_SHLD | PLT_WEAP | PLT_BOW | PLT_MISC, GOE_EVIL, FALSE, FALSE, 0, 0, -10 },
{ "the pit", IPL_ATTRIBS_CURSE, 1, 5, 5, PLT_ARMO | PLT_SHLD | PLT_WEAP | PLT_BOW | PLT_MISC, GOE_EVIL, FALSE, FALSE, 0, 0, -5 },
{ "the sky", IPL_ATTRIBS, 1, 3, 5, PLT_ARMO | PLT_SHLD | PLT_WEAP | PLT_BOW | PLT_MISC, GOE_ANY, FALSE, TRUE, 800, 4000, 5 },
{ "the moon", IPL_ATTRIBS, 4, 7, 11, PLT_ARMO | PLT_SHLD | PLT_WEAP | PLT_BOW | PLT_MISC, GOE_ANY, FALSE, TRUE, 4800, 8000, 10 },
#endif
{ "the stars", IPL_ATTRIBS, 8, 11, 17, PLT_ARMO | PLT_WEAP | PLT_BOW | PLT_MISC, GOE_ANY, FALSE, TRUE, 8800, 12000, 15 },
{ "the heavens", IPL_ATTRIBS, 12, 15, 25, PLT_WEAP | PLT_BOW | PLT_MISC, GOE_ANY, FALSE, TRUE, 12800, 20000, 20 },
{ "the zodiac", IPL_ATTRIBS, 16, 20, 30, PLT_MISC, GOE_ANY, FALSE, TRUE, 20800, 40000, 30 },
@ -382,17 +340,10 @@ const PLStruct PL_Suffix[] = {
{ "the whale", IPL_LIFE, 81, 100, 60, PLT_ARMO , GOE_ANY, FALSE, TRUE, 19100, 30000, 13 },
{ "fragility", IPL_DUR_CURSE, 100, 100, 3, PLT_ARMO | PLT_SHLD | PLT_WEAP , GOE_EVIL, FALSE, FALSE, 0, 0, -4 },
{ "brittleness", IPL_DUR_CURSE, 26, 75, 1, PLT_ARMO | PLT_SHLD | PLT_WEAP , GOE_EVIL, FALSE, FALSE, 0, 0, -2 },
#ifdef HELLFIRE
{ "sturdiness", IPL_DUR, 26, 75, 1, PLT_ARMO | PLT_SHLD | PLT_WEAP | PLT_STAFF , GOE_ANY, FALSE, TRUE, 100, 100, 2 },
{ "craftsmanship", IPL_DUR, 51, 100, 6, PLT_ARMO | PLT_SHLD | PLT_WEAP | PLT_STAFF , GOE_ANY, FALSE, TRUE, 200, 200, 2 },
{ "structure", IPL_DUR, 101, 200, 12, PLT_ARMO | PLT_SHLD | PLT_WEAP | PLT_STAFF , GOE_ANY, FALSE, TRUE, 300, 300, 2 },
{ "the ages", IPL_INDESTRUCTIBLE, 0, 0, 25, PLT_ARMO | PLT_SHLD | PLT_WEAP | PLT_STAFF , GOE_ANY, FALSE, TRUE, 600, 600, 5 },
#else
{ "sturdiness", IPL_DUR, 26, 75, 1, PLT_ARMO | PLT_SHLD | PLT_WEAP , GOE_ANY, FALSE, TRUE, 100, 100, 2 },
{ "craftsmanship", IPL_DUR, 51, 100, 6, PLT_ARMO | PLT_SHLD | PLT_WEAP , GOE_ANY, FALSE, TRUE, 200, 200, 2 },
{ "structure", IPL_DUR, 101, 200, 12, PLT_ARMO | PLT_SHLD | PLT_WEAP , GOE_ANY, FALSE, TRUE, 300, 300, 2 },
{ "the ages", IPL_INDESTRUCTIBLE, 0, 0, 25, PLT_ARMO | PLT_SHLD | PLT_WEAP , GOE_ANY, FALSE, TRUE, 600, 600, 5 },
#endif
{ "the dark", IPL_LIGHT_CURSE, 4, 4, 6, PLT_ARMO | PLT_WEAP | PLT_MISC, GOE_EVIL, FALSE, FALSE, 0, 0, -3 },
{ "the night", IPL_LIGHT_CURSE, 2, 2, 3, PLT_ARMO | PLT_WEAP | PLT_MISC, GOE_EVIL, FALSE, FALSE, 0, 0, -2 },
{ "light", IPL_LIGHT, 2, 2, 4, PLT_ARMO | PLT_WEAP | PLT_MISC, GOE_GOOD, FALSE, TRUE, 750, 750, 2 },
@ -430,11 +381,9 @@ const PLStruct PL_Suffix[] = {
{ "stability", IPL_FASTRECOVER, 2, 2, 10, PLT_ARMO | PLT_MISC, GOE_ANY, FALSE, TRUE, 4000, 4000, 4 },
{ "harmony", IPL_FASTRECOVER, 3, 3, 20, PLT_ARMO | PLT_MISC, GOE_ANY, FALSE, TRUE, 8000, 8000, 8 },
{ "blocking", IPL_FASTBLOCK, 1, 1, 5, PLT_SHLD , GOE_ANY, FALSE, TRUE, 4000, 4000, 4 },
#ifdef HELLFIRE
{ "devastation", IPL_DEVASTATION, 1, 1, 1, PLT_WEAP | PLT_STAFF | PLT_BOW , GOE_ANY, FALSE, TRUE, 1200, 1200, 3 },
{ "decay", IPL_DECAY, 150, 250, 1, PLT_WEAP | PLT_STAFF | PLT_BOW , GOE_ANY, FALSE, TRUE, 200, 200, 2 },
{ "peril", IPL_PERIL, 1, 1, 5, PLT_WEAP | PLT_STAFF | PLT_BOW , GOE_ANY, FALSE, TRUE, 500, 500, 1 },
#endif
{ "", IPL_INVALID, 0, 0, 0, 0 , GOE_ANY, FALSE, FALSE, 0, 0, 0 },
// clang-format on
};

65
Source/items.cpp

@ -56,25 +56,6 @@ int MaxGold = GOLD_MAX_LIMIT;
/** Maps from item_cursor_graphic to in-memory item type. */
BYTE ItemCAnimTbl[] = {
#ifndef HELLFIRE
20, 16, 16, 16, 4, 4, 4, 12, 12, 12,
12, 12, 12, 12, 12, 21, 21, 25, 12, 28,
28, 28, 0, 0, 0, 32, 0, 0, 0, 24,
24, 26, 2, 25, 22, 23, 24, 25, 27, 27,
29, 0, 0, 0, 12, 12, 12, 12, 12, 0,
8, 8, 0, 8, 8, 8, 8, 8, 8, 6,
8, 8, 8, 6, 8, 8, 6, 8, 8, 6,
6, 6, 8, 8, 8, 5, 9, 13, 13, 13,
5, 5, 5, 15, 5, 5, 18, 18, 18, 30,
5, 5, 14, 5, 14, 13, 16, 18, 5, 5,
7, 1, 3, 17, 1, 15, 10, 14, 3, 11,
8, 0, 1, 7, 0, 7, 15, 7, 3, 3,
3, 6, 6, 11, 11, 11, 31, 14, 14, 14,
6, 6, 7, 3, 8, 14, 0, 14, 14, 0,
33, 1, 1, 1, 1, 1, 7, 7, 7, 14,
14, 17, 17, 17, 0, 34, 1, 0, 3, 17,
8, 8, 6, 1, 3, 3, 11, 3, 4
#else
20, 16, 16, 16, 4, 4, 4, 12, 12, 12,
12, 12, 12, 12, 12, 21, 21, 25, 12, 28,
28, 28, 38, 38, 38, 32, 38, 38, 38, 24,
@ -98,7 +79,6 @@ BYTE ItemCAnimTbl[] = {
8, 8, 8, 17, 0, 6, 8, 11, 11, 3,
3, 1, 6, 6, 6, 1, 8, 6, 11, 3,
6, 8, 1, 6, 6, 17, 40, 0, 0
#endif
};
/** Map of item type .cel file names. */
const char *const ItemDropNames[] = {
@ -331,6 +311,35 @@ bool ShouldSkipItem(int i)
return false;
}
static bool IsPrefixValidForItemType(int i, int flgs)
{
int PLIType = PL_Prefix[i].PLIType;
if (!gbIsHellfire) {
if (i >= 12 && i <= 20)
PLIType &= ~PLT_STAFF;
}
return flgs & PLIType != 0;
}
static bool IsSuffixValidForItemType(int i, int flgs)
{
int PLIType = PL_Suffix[i].PLIType;
if (!gbIsHellfire) {
if ((i >= 0 && i <= 1)
|| (i >= 14 && i <= 15)
|| (i >= 21 && i <= 22)
|| (i >= 34 && i <= 36)
|| (i >= 41 && i <= 44)
|| (i >= 60 && i <= 63))
PLIType &= ~PLT_STAFF;
}
return flgs & PLIType != 0;
}
int get_ring_max_value(int i)
{
int j, res;
@ -763,7 +772,6 @@ void CalcPlrItemVals(int p, BOOL Loadgfx)
}
}
#ifdef HELLFIRE
if ((plr[p]._pSpellFlags & 2) == 2) {
sadd += 2 * plr[p]._pLevel;
dadd += plr[p]._pLevel + plr[p]._pLevel / 2;
@ -774,7 +782,6 @@ void CalcPlrItemVals(int p, BOOL Loadgfx)
dadd -= plr[p]._pLevel + plr[p]._pLevel / 2;
vadd -= 2 * plr[p]._pLevel;
}
#endif
plr[p]._pIMinDam = mind;
plr[p]._pIMaxDam = maxd;
@ -884,13 +891,11 @@ void CalcPlrItemVals(int p, BOOL Loadgfx)
lr += plr[p]._pLevel;
}
#ifdef HELLFIRE
if ((plr[p]._pSpellFlags & 4) == 4) {
mr -= plr[p]._pLevel;
fr -= plr[p]._pLevel;
lr -= plr[p]._pLevel;
}
#endif
if (iflgs & ISPL_ALLRESZERO) {
// reset resistances to zero if the respective special effect is active
@ -1674,7 +1679,9 @@ void GetStaffPower(int i, int lvl, int bs, BOOL onlygood)
if (tmp == 0 || onlygood) {
nl = 0;
for (j = 0; PL_Prefix[j].PLPower != -1; j++) {
if (PL_Prefix[j].PLIType & PLT_STAFF && PL_Prefix[j].PLMinLvl <= lvl) {
if (!gbIsHellfire && j >= 83)
break;
if (IsPrefixValidForItemType(j, PLT_STAFF) && PL_Prefix[j].PLMinLvl <= lvl) {
addok = TRUE;
if (onlygood && !PL_Prefix[j].PLOk)
addok = FALSE;
@ -2334,7 +2341,9 @@ void GetItemPower(int i, int minlvl, int maxlvl, int flgs, BOOL onlygood)
if (pre == 0) {
nt = 0;
for (j = 0; PL_Prefix[j].PLPower != -1; j++) {
if (flgs & PL_Prefix[j].PLIType) {
if (!gbIsHellfire && j >= 83)
break;
if (IsPrefixValidForItemType(j, flgs)) {
if (PL_Prefix[j].PLMinLvl >= minlvl && PL_Prefix[j].PLMinLvl <= maxlvl && (!onlygood || PL_Prefix[j].PLOk) && (flgs != PLT_STAFF || PL_Prefix[j].PLPower != IPL_CHARGES)) {
l[nt] = j;
nt++;
@ -2365,7 +2374,9 @@ void GetItemPower(int i, int minlvl, int maxlvl, int flgs, BOOL onlygood)
if (post != 0) {
nl = 0;
for (j = 0; PL_Suffix[j].PLPower != -1; j++) {
if (PL_Suffix[j].PLIType & flgs
if (!gbIsHellfire && j >= 94)
break;
if (IsSuffixValidForItemType(j, flgs)
&& PL_Suffix[j].PLMinLvl >= minlvl && PL_Suffix[j].PLMinLvl <= maxlvl
&& (goe | PL_Suffix[j].PLGOE) != (GOE_GOOD | GOE_EVIL)
&& (!onlygood || PL_Suffix[j].PLOk)) {

2
Source/missiles.cpp

@ -1323,7 +1323,6 @@ void InitMissiles()
}
}
#ifdef HELLFIRE
if ((plr[myplr]._pSpellFlags & 2) == 2 || (plr[myplr]._pSpellFlags & 4) == 4) {
plr[myplr]._pSpellFlags &= ~0x2;
plr[myplr]._pSpellFlags &= ~0x4;
@ -1341,7 +1340,6 @@ void InitMissiles()
}
}
}
#endif
nummissiles = 0;
for (i = 0; i < MAXMISSILES; i++) {

1006
Source/monster.cpp

File diff suppressed because it is too large Load Diff

2
Source/player.cpp

@ -204,7 +204,7 @@ int ExpLvlsTbl[MAXCHARLEVEL] = {
1310707109,
1583495809
};
const char *const ClassStrTbl[NUM_CLASSES] = {
const char *const ClassStrTbl[] = {
"Warrior",
"Rogue",
"Sorceror",

3
Source/player.h

@ -86,7 +86,8 @@ extern int MagicTbl[NUM_CLASSES];
extern int DexterityTbl[NUM_CLASSES];
extern int VitalityTbl[NUM_CLASSES];
extern int MaxStats[NUM_CLASSES][4];
extern const char *const ClassStrTbl[NUM_CLASSES];
extern const char *const ClassStrTblOld[];
extern const char *const ClassStrTbl[];
#ifdef __cplusplus
}

6
defs.h

@ -180,9 +180,13 @@
#undef assert
#ifndef _DEBUG
#define assert(exp) ((void)0)
#define assert(exp)
#define assurance(exp, value) if (exp) return
#define commitment(exp, value) if (exp) return false
#else
#define assert(exp) (void)((exp) || (assert_fail(__LINE__, __FILE__, #exp), 0))
#define assurance(exp, value) (void)((exp) || (app_fatal("%s: %s was %i", __func__, #exp, value), 0))
#define commitment(exp, value) (void)((exp) || (app_fatal("%s: %s was %i", __func__, #exp, value), 0))
#endif
#define ERR_DLG(title, text) ErrDlg(title, text, __FILE__, __LINE__)

Loading…
Cancel
Save