Browse Source

Clean up Hellfire special cases

pull/1053/head
Anders Jenbo 5 years ago
parent
commit
70ca20b59f
  1. 29
      Source/control.cpp
  2. 2
      Source/inv.cpp
  3. 6
      Source/items.cpp
  4. 2
      Source/monstdat.cpp
  5. 4
      Source/monster.cpp
  6. 3
      Source/multi.cpp
  7. 18
      Source/objects.cpp
  8. 19
      Source/player.cpp
  9. 2
      Source/quests.cpp

29
Source/control.cpp

@ -338,8 +338,6 @@ void DrawSpellList()
y = PANEL_Y - 17;
ClearPanel();
int maxSpells = gbIsHellfire ? MAX_SPELLS : 37;
for (i = 0; i < 4; i++) {
switch ((spell_type)i) {
case RSPLTYPE_SKILL:
@ -362,7 +360,7 @@ void DrawSpellList()
c = SPLICONLAST + 2;
break;
}
for (spl = 1, j = 1; j < maxSpells; spl <<= 1, j++) {
for (spl = 1, j = 1; j < MAX_SPELLS; spl <<= 1, j++) {
if (!(mask & spl))
continue;
if (i == RSPLTYPE_SPELL) {
@ -912,8 +910,6 @@ void DoSpeedBook()
X = xo - (BORDER_LEFT - SPLICONLENGTH / 2);
Y = yo - (BORDER_TOP + SPLICONLENGTH / 2);
int maxSpells = gbIsHellfire ? MAX_SPELLS : 37;
if (plr[myplr]._pRSpell != SPL_INVALID) {
for (i = 0; i < 4; i++) {
switch (i) {
@ -931,7 +927,7 @@ void DoSpeedBook()
break;
}
spell = (__int64)1;
for (j = 1; j < maxSpells; j++) {
for (j = 1; j < MAX_SPELLS; j++) {
if (spell & spells) {
if (j == plr[myplr]._pRSpell && i == plr[myplr]._pRSplType) {
X = xo - (BORDER_LEFT - SPLICONLENGTH / 2);
@ -1883,19 +1879,16 @@ void DrawSpellBook()
unsigned __int64 spl;
CelDraw(RIGHT_PANEL_X, 351 + SCREEN_Y, pSpellBkCel, 1, SPANEL_WIDTH);
if (gbIsHellfire && sbooktab < 5)
if (gbIsHellfire && sbooktab < 5) {
CelDraw(RIGHT_PANEL_X + 61 * sbooktab + 7, 348 + SCREEN_Y, pSBkBtnCel, sbooktab + 1, 61);
else if (gbIsHellfire && sbooktab < 4)
// BUGFIX: rendering of page 3 and page 4 buttons are both off-by-one pixel.
// The fix would look as follows:
//
// int sx = RIGHT_PANEL_X + 76 * sbooktab + 7;
// if (sbooktab == 2 || sbooktab == 3) {
// sx++;
// }
// CelDraw(sx, 348 + SCREEN_Y, pSBkBtnCel, sbooktab + 1, 76);
CelDraw(RIGHT_PANEL_X + 76 * sbooktab + 7, 348 + SCREEN_Y, pSBkBtnCel, sbooktab + 1, 76);
} else {
// BUGFIX: rendering of page 3 and page 4 buttons are both off-by-one pixel (fixed).
int sx = RIGHT_PANEL_X + 76 * sbooktab + 7;
if (sbooktab == 2 || sbooktab == 3) {
sx++;
}
CelDraw(sx, 348 + SCREEN_Y, pSBkBtnCel, sbooktab + 1, 76);
}
spl = plr[myplr]._pMemSpells | plr[myplr]._pISpells | plr[myplr]._pAblSpells;
yp = 55 + SCREEN_Y;

2
Source/inv.cpp

@ -2040,7 +2040,7 @@ int InvPutItem(int pnum, int x, int y)
}
}
if (gbIsHellfire && currlevel == 0) {
if (currlevel == 0) {
yp = cursmy;
xp = cursmx;
if (plr[pnum].HoldItem._iCurs == ICURS_RUNE_BOMB && xp >= 79 && xp <= 82 && yp >= 61 && yp <= 64) {

6
Source/items.cpp

@ -2442,7 +2442,7 @@ void GetItemBonus(int i, int idata, int minlvl, int maxlvl, BOOL onlygood, BOOLE
GetItemPower(i, minlvl, maxlvl, PLT_ARMO, onlygood);
break;
case ITYPE_STAFF:
if (!gbIsHellfire || allowspells)
if (allowspells)
GetStaffSpell(i, maxlvl, onlygood);
else
GetItemPower(i, minlvl, maxlvl, PLT_STAFF, onlygood);
@ -4709,7 +4709,7 @@ static void SpawnOnePremium(int i, int plvl, int myplr)
SetRndSeed(item[0]._iSeed);
itype = RndPremiumItem(plvl >> 2, plvl) - 1;
GetItemAttrs(0, itype, plvl);
GetItemBonus(0, itype, plvl >> 1, plvl, TRUE, FALSE);
GetItemBonus(0, itype, plvl >> 1, plvl, TRUE, !gbIsHellfire);
if (!gbIsHellfire) {
if (item[0]._iIvalue > 140000)
@ -5263,7 +5263,7 @@ void RecreatePremiumItem(int ii, int idx, int plvl, int iseed)
SetRndSeed(iseed);
itype = RndPremiumItem(plvl >> 2, plvl) - 1;
GetItemAttrs(ii, itype, plvl);
GetItemBonus(ii, itype, plvl >> 1, plvl, TRUE, FALSE);
GetItemBonus(ii, itype, plvl >> 1, plvl, TRUE, !gbIsHellfire);
item[ii]._iSeed = iseed;
item[ii]._iCreateInfo = plvl | CF_SMITHPREMIUM;

2
Source/monstdat.cpp

@ -121,7 +121,7 @@ const MonsterData monsterdata[] = {
{ 128, 2000, "Monsters\\Mage\\Mage%c.CL2", TRUE, "Monsters\\Mage\\Mage%c%i.WAV", FALSE, TRUE, "Monsters\\Mage\\Cnselgd.TRN", { 12, 1, 20, 8, 28, 20 }, { 0, 0, 0, 0, 0, 0 }, "Cabalist", 28, 30, 29, 120, 120, AI_COUNSLR, MFLAG_CAN_OPEN_DOOR, 2, 110, 8, 14, 30, 0, 0, 0, 0, 0, MC_DEMON, RESIST_MAGIC | RESIST_FIRE | IMMUNE_LIGHTNING | IMMUNE_NULL_40, IMMUNE_MAGIC | RESIST_FIRE | IMMUNE_LIGHTNING | IMMUNE_NULL_40, 0, 7, 4929 },
{ 128, 2000, "Monsters\\Mage\\Mage%c.CL2", TRUE, "Monsters\\Mage\\Mage%c%i.WAV", FALSE, TRUE, "Monsters\\Mage\\Cnselbk.TRN", { 12, 1, 20, 8, 28, 20 }, { 0, 0, 0, 0, 0, 0 }, "Advocate", 30, 30, 30, 145, 145, AI_COUNSLR, MFLAG_CAN_OPEN_DOOR, 3, 120, 8, 15, 25, 0, 0, 0, 0, 0, MC_DEMON, IMMUNE_MAGIC | RESIST_FIRE | IMMUNE_LIGHTNING | IMMUNE_NULL_40, IMMUNE_MAGIC | IMMUNE_FIRE | IMMUNE_LIGHTNING | IMMUNE_NULL_40, 0, 7, 4968 },
{ 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 },
{ 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, 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, 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, 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", 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 },

4
Source/monster.cpp

@ -320,8 +320,8 @@ void InitMonsterGFX(int monst)
for (anim = 0; anim < 6; anim++) {
int frames = monsterdata[mtype].Frames[anim];
if (!gbIsHellfire && mtype == MT_DIABLO && anim == 3)
frames = 6;
if (gbIsHellfire && mtype == MT_DIABLO && anim == 3)
frames = 2;
if ((animletter[anim] != 's' || monsterdata[mtype].has_special) && frames > 0) {
sprintf(strBuff, monsterdata[mtype].GraphicType, animletter[anim]);

3
Source/multi.cpp

@ -804,8 +804,7 @@ BOOL NetInit(BOOL bSinglePlayer, BOOL *pfExitProgram)
tick_delay = 1000 / ticks_per_sec;
SetRndSeed(sgGameInitInfo.dwSeed);
int numberOfLevels = gbIsHellfire ? NUMLEVELS : 17;
for (i = 0; i < numberOfLevels; i++) {
for (i = 0; i < NUMLEVELS; i++) {
glSeedTbl[i] = AdvanceRndSeed();
gnLevelTypeTbl[i] = InitLevelType(i);
}

18
Source/objects.cpp

@ -674,10 +674,7 @@ void AddChestTraps()
if (leveltype == DTYPE_CATACOMBS) {
object[oi]._oVar4 = random_(0, 2);
} else {
if (gbIsHellfire)
object[oi]._oVar4 = random_(0, 6);
else
object[oi]._oVar4 = random_(0, 3);
object[oi]._oVar4 = random_(0, gbIsHellfire ? 6 : 3);
}
}
}
@ -1375,16 +1372,11 @@ void AddShrine(int i)
int shrines = gbIsHellfire ? NUM_SHRINETYPE : 26;
for (j = 0; j < shrines; j++) {
if (currlevel < shrinemin[j] || currlevel > shrinemax[j]) {
slist[j] = 0;
} else {
slist[j] = 1;
}
slist[j] = currlevel >= shrinemin[j] && currlevel <= shrinemax[j];
if (gbIsMultiplayer && shrineavail[j] == 1) {
slist[j] = 0;
}
if (!gbIsMultiplayer && shrineavail[j] == 2) {
slist[j] = 0;
slist[j] = false;
} else if (!gbIsMultiplayer && shrineavail[j] == 2) {
slist[j] = false;
}
}
do {

19
Source/player.cpp

@ -367,11 +367,14 @@ static DWORD GetPlrGFXSize(const char *szCel)
dwMaxSize = 0;
int classesToLoad = gbIsHellfire ? NUM_CLASSES : 3;
for (c = 0; c < classesToLoad; c++) {
if (gbIsSpawn && c != 0)
for (c = 0; c < NUM_CLASSES; c++) {
if (gbIsSpawn && (c == PC_ROGUE || c == PC_SORCERER))
continue;
if (!gbIsHellfire && c == PC_MONK)
continue;
if ((c == PC_BARD && hfbard_mpq == NULL) || (c == PC_BARBARIAN && hfbarb_mpq == NULL))
continue;
for (a = &ArmourChar[0]; *a; a++) {
if (gbIsSpawn && a != &ArmourChar[0])
break;
@ -652,7 +655,6 @@ void SetPlrAnims(int pnum)
}
}
/**
* @param c plr_classes value
*/
@ -1301,7 +1303,7 @@ void PM_ChangeOffset(int pnum)
plr[pnum]._pVar6 += plr[pnum]._pxvel;
plr[pnum]._pVar7 += plr[pnum]._pyvel;
if (gbIsHellfire && currlevel == 0 && jogging_opt) {
if (currlevel == 0 && jogging_opt) {
plr[pnum]._pVar6 += plr[pnum]._pxvel;
plr[pnum]._pVar7 += plr[pnum]._pyvel;
}
@ -2164,7 +2166,7 @@ bool PM_DoWalk(int pnum, int variant)
}
//"Jog" in town which works by doubling movement speed and skipping every other animation frame
if (gbIsHellfire && currlevel == 0 && jogging_opt) {
if (currlevel == 0 && jogging_opt) {
if (plr[pnum]._pAnimFrame % 2 == 0) {
plr[pnum]._pAnimFrame++;
plr[pnum]._pVar8++;
@ -3447,8 +3449,7 @@ void ValidatePlayer()
plr[myplr]._pBaseVit = MaxStats[pc][ATTRIB_VIT];
}
int maxSpells = gbIsHellfire ? MAX_SPELLS : 37;
for (b = 1; b < maxSpells; b++) {
for (b = 1; b < MAX_SPELLS; b++) {
if (GetSpellBookLevel(b) != -1) {
msk |= SPELLBIT(b);
if (plr[myplr]._pSplLvl[b] > MAX_SPELL_LEVEL)

2
Source/quests.cpp

@ -115,8 +115,6 @@ void InitQuests()
initiatedQuests = 0;
for (z = 0; z < MAXQUESTS; z++) {
if (!gbIsHellfire && z > 15)
break;
if (gbIsMultiplayer && !(questlist[z]._qflags & QUEST_ANY))
continue;
quests[z]._qtype = questlist[z]._qdtype;

Loading…
Cancel
Save