Browse Source

Town/misc fixes

pull/876/head
galaxyhaxz 7 years ago committed by Anders Jenbo
parent
commit
282e42b46b
  1. 15
      Source/control.cpp
  2. 11
      Source/diablo.cpp
  3. 9
      Source/diablo.h
  4. 12
      Source/stores.cpp
  5. 12
      Source/stores.h
  6. 47
      Source/town.cpp
  7. 14
      Source/towners.cpp

15
Source/control.cpp

@ -2224,7 +2224,12 @@ void DrawSpellBook()
unsigned __int64 spl;
CelDecodeOnly(384, 511, pSpellBkCel, 1, 320);
#ifdef HELLFIRE
if ( sbooktab < 5 )
CelDecodeOnly(61 * sbooktab + 391, 508, pSBkBtnCel, sbooktab + 1, 61);
#else
CelDecodeOnly(76 * sbooktab + 391, 508, pSBkBtnCel, sbooktab + 1, 76);
#endif
spl = plr[myplr]._pMemSpells | plr[myplr]._pISpells | plr[myplr]._pAblSpells;
@ -2237,7 +2242,11 @@ void DrawSpellBook()
DrawSpellCel(395, yp, pSBkIconCels, SpellITbl[sn], 37);
if (sn == plr[myplr]._pRSpell && st == plr[myplr]._pRSplType) {
SetSpellTrans(RSPLTYPE_SKILL);
#ifdef HELLFIRE
DrawSpellCel(395, yp, pSBkIconCels, 52, 37);
#else
DrawSpellCel(395, yp, pSBkIconCels, 43, 37);
#endif
}
PrintSBookStr(10, yp - 23, FALSE, spelldata[sn].sNameText, COL_WHITE);
switch (GetSBookTrans(sn, FALSE)) {
@ -2329,9 +2338,15 @@ void CheckSBook()
drawpanflag = 255;
}
}
#ifdef HELLFIRE
if (MouseX >= 327 && MouseX < 632 && MouseY >= 320 && MouseY < 349) {
sbooktab = (MouseX - 327) / 61;
}
#else
if (MouseX >= 327 && MouseX < 633 && MouseY >= 320 && MouseY < 349) { /// BUGFIX: change `< 633` to `< 631`
sbooktab = (MouseX - 327) / 76;
}
#endif
}
char *get_pieces_str(int nGold)

11
Source/diablo.cpp

@ -30,12 +30,17 @@ BOOL trigdebug; /* unused */
int setseed;
int debugmonsttypes;
int PauseMode;
int sgnTimeoutCurs;
char sgbMouseDown;
int color_cycle_timer;
#ifdef HELLFIRE
BOOLEAN UseTheoQuest;
BOOLEAN UseCowFarmer;
BOOLEAN UseNestArt;
BOOLEAN UseBardTest;
BOOLEAN UseBarbarianTest;
BOOLEAN UseMultiTest;
#endif
int sgnTimeoutCurs;
char sgbMouseDown;
int color_cycle_timer;
/* rdata */

9
Source/diablo.h

@ -111,11 +111,16 @@ extern BOOL trigdebug; /* unused */
extern int setseed;
extern int debugmonsttypes;
extern int PauseMode;
extern char sgbMouseDown;
extern int color_cycle_timer;
#ifdef HELLFIRE
extern BOOLEAN UseTheoQuest;
extern BOOLEAN UseCowFarmer;
extern BOOLEAN UseNestArt;
extern BOOLEAN UseBardTest;
extern BOOLEAN UseBarbarianTest;
extern BOOLEAN UseMultiTest;
#endif
extern char sgbMouseDown;
extern int color_cycle_timer;
void FreeGameMem();
BOOL StartGame(BOOL bNewGame, BOOL bSinglePlayer);

12
Source/stores.cpp

@ -5,7 +5,11 @@ int storenumh;
int stextlhold;
ItemStruct boyitem;
int stextshold;
#ifdef HELLFIRE
ItemStruct premiumitem[15];
#else
ItemStruct premiumitem[6];
#endif
BYTE *pSTextBoxCels;
int premiumlevel;
int talker;
@ -15,7 +19,11 @@ int stextsmax;
int InStoreFlag;
ItemStruct storehold[48];
int gossipstart;
#ifdef HELLFIRE
ItemStruct witchitem[25];
#else
ItemStruct witchitem[20];
#endif
BOOL stextscrl;
int numpremium;
ItemStruct healitem[20];
@ -29,7 +37,11 @@ int gossipend;
BYTE *pSPentSpn2Cels;
int stextsval;
int boylevel;
#ifdef HELLFIRE
ItemStruct smithitem[25];
#else
ItemStruct smithitem[20];
#endif
int stextdown;
char stextscrlubtn;
char stextflag;

12
Source/stores.h

@ -7,7 +7,11 @@ extern int storenumh;
extern int stextlhold;
extern ItemStruct boyitem;
extern int stextshold;
#ifdef HELLFIRE
extern ItemStruct premiumitem[15];
#else
extern ItemStruct premiumitem[6];
#endif
extern BYTE *pSTextBoxCels;
extern int premiumlevel;
extern int talker;
@ -17,7 +21,11 @@ extern int stextsmax;
extern int InStoreFlag;
extern ItemStruct storehold[48];
extern int gossipstart;
#ifdef HELLFIRE
extern ItemStruct witchitem[25];
#else
extern ItemStruct witchitem[20];
#endif
extern BOOL stextscrl;
extern int numpremium;
extern ItemStruct healitem[20];
@ -31,7 +39,11 @@ extern int gossipend;
extern BYTE *pSPentSpn2Cels;
extern int stextsval;
extern int boylevel;
#ifdef HELLFIRE
extern ItemStruct smithitem[25];
#else
extern ItemStruct smithitem[20];
#endif
extern int stextdown;
extern char stextscrlubtn;
extern char stextflag;

47
Source/town.cpp

@ -1580,18 +1580,45 @@ void T_Pass3()
#ifndef SPAWN
if (gbMaxPlayers == 1) {
#ifdef HELLFIRE
if(quests[QTYPE_FARMER]._qactive == 3 || quests[QTYPE_FARMER]._qactive == 10
|| quests[QTYPE_JERSEY]._qactive == 3 || quests[QTYPE_JERSEY]._qactive == 10)
{
town_4751C6();
}
else
{
town_475379();
}
if ( quests[QTYPE_GRAVE]._qactive == 3 || plr[myplr]._pLvlVisited[21] )
town_475595();
else
town_47552C();
#endif
#ifdef HELLFIRE
if (!(plr[myplr].pTownWarps & 1) && plr[myplr]._pLevel < 10) {
#else
if (!(plr[myplr].pTownWarps & 1)) {
#endif
#endif
T_FillTile(P3Tiles, 48, 20, 320);
#ifndef SPAWN
}
#ifdef HELLFIRE
if (!(plr[myplr].pTownWarps & 2) && plr[myplr]._pLevel < 15) {
#else
if (!(plr[myplr].pTownWarps & 2)) {
#endif
#endif
T_FillTile(P3Tiles, 16, 68, 332);
T_FillTile(P3Tiles, 16, 70, 331);
#ifndef SPAWN
}
#ifdef HELLFIRE
if (!(plr[myplr].pTownWarps & 4) && plr[myplr]._pLevel < 20) {
#else
if (!(plr[myplr].pTownWarps & 4)) {
#endif
#endif
for (x = 36; x < 46; x++) {
T_FillTile(P3Tiles, x, 78, random(0, 4) + 1);
@ -1600,8 +1627,26 @@ void T_Pass3()
}
}
#endif
#ifdef HELLFIRE
else
{
if(quests[QTYPE_FARMER]._qactive == 3 || quests[QTYPE_FARMER]._qactive == 10
|| quests[QTYPE_JERSEY]._qactive == 3 || quests[QTYPE_JERSEY]._qactive == 10)
{
town_4751C6();
}
else
{
town_475379();
}
if ( quests[QTYPE_GRAVE]._qactive == 3 || plr[myplr]._pLvlVisited[21] )
town_475595();
else
town_47552C();
}
#endif
if (quests[13]._qactive != 3 && quests[13]._qactive) {
if (quests[QTYPE_PW]._qactive != 3 && quests[QTYPE_PW]._qactive) {
T_FillTile(P3Tiles, 60, 70, 342);
} else {
T_FillTile(P3Tiles, 60, 70, 71);

14
Source/towners.cpp

@ -451,6 +451,20 @@ void InitTowners()
InitBarmaid();
InitBoy();
InitCows();
#ifdef HELLFIRE
if ( UseCowFarmer )
{
InitCowFarmer();
}
else if ( quests[QTYPE_FARMER]._qactive != 10 )
{
InitFarmer();
}
if ( UseTheoQuest && plr->_pLvlVisited[17] )
{
InitGirl();
}
#endif
}
void FreeTownerGFX()

Loading…
Cancel
Save