Merge branch 'master' of github.com:diasurgical/devilution

This commit is contained in:
Anders Jenbo 2020-10-14 11:02:48 +02:00
commit 57326c6c7f
8 changed files with 194 additions and 28 deletions

View file

@ -1968,8 +1968,8 @@ void drlg_l1_crypt_rndset(const BYTE *miniset, int rndper)
sw = miniset[0];
sh = miniset[1];
for (sy = 0; sy < DMAXX - sh; sy++) {
for (sx = 0; sx < DMAXY - sw; sx++) {
for (sy = 0; sy < DMAXY - sh; sy++) {
for (sx = 0; sx < DMAXX - sw; sx++) {
found = TRUE;
ii = 2;
for (yy = 0; yy < sh && found == TRUE; yy++) {

View file

@ -198,7 +198,7 @@ ObjDataStruct AllObjects[] = {
{ 1, OFILE_TSOUL, 13, 16, 0, THEME_NONE, Q_BUTCHER, 0, 5, 0, 128, TRUE, FALSE, TRUE, 0, 0, FALSE },
{ 1, OFILE_BOOK2, 6, 6, 0, THEME_NONE, -1, 0, 4, 0, 96, TRUE, TRUE, TRUE, 0, 3, FALSE },
{ 1, OFILE_L2DOORS, 5, 8, DTYPE_CATACOMBS, THEME_NONE, -1, 0, 1, 0, 64, FALSE, FALSE, TRUE, 0, 3, TRUE },
{ 1, OFILE_L2DOORS, 5, 8, DTYPE_CATACOMBS, THEME_NONE, -1, 0, 2, 0, 64, FALSE, FALSE, TRUE, 0, 3, FALSE },
{ 1, OFILE_L2DOORS, 5, 8, DTYPE_CATACOMBS, THEME_NONE, -1, 0, 2, 0, 64, FALSE, FALSE, TRUE, 0, 3, TRUE },
{ 1, OFILE_WTORCH4, 5, 8, DTYPE_CATACOMBS, THEME_NONE, -1, 1, 1, 9, 96, FALSE, TRUE, FALSE, 0, 0, FALSE },
{ 1, OFILE_WTORCH3, 5, 8, DTYPE_CATACOMBS, THEME_NONE, -1, 1, 1, 9, 96, FALSE, TRUE, FALSE, 0, 0, FALSE },
{ 1, OFILE_WTORCH1, 5, 8, DTYPE_CATACOMBS, THEME_NONE, -1, 1, 1, 9, 96, FALSE, TRUE, FALSE, 0, 0, FALSE },
@ -241,7 +241,11 @@ ObjDataStruct AllObjects[] = {
{ 1, OFILE_ALTBOY, 0, 0, DTYPE_CATHEDRAL, THEME_NONE, Q_BETRAYER, 0, 1, 0, 128, TRUE, TRUE, TRUE, 0, 0, FALSE },
{ 1, OFILE_MCIRL, 0, 0, DTYPE_CATHEDRAL, THEME_NONE, Q_BETRAYER, 0, 1, 0, 96, FALSE, TRUE, TRUE, 0, 0, FALSE },
{ 1, OFILE_MCIRL, 0, 0, DTYPE_CATHEDRAL, THEME_NONE, Q_BETRAYER, 0, 1, 0, 96, FALSE, TRUE, TRUE, 0, 0, FALSE },
#ifdef HELLFIRE
{ 1, OFILE_BKSLBRNT, 1, 24, 0, THEME_NONE, -1, 0, 1, 0, 96, TRUE, TRUE, TRUE, 0, 3, FALSE },
#else
{ 1, OFILE_BKSLBRNT, 4, 12, 0, THEME_NONE, -1, 0, 1, 0, 96, TRUE, TRUE, TRUE, 0, 3, FALSE },
#endif
{ 1, OFILE_CANDLE2, 2, 12, 0, THEME_NONE, Q_BETRAYER, 1, 2, 4, 96, TRUE, TRUE, TRUE, 0, 0, FALSE },
{ 1, OFILE_BOOK1, 13, 13, DTYPE_HELL, THEME_NONE, Q_WARLORD, 0, 4, 0, 96, TRUE, TRUE, TRUE, 0, 3, FALSE },
{ 1, OFILE_ARMSTAND, 13, 13, 0, THEME_NONE, Q_WARLORD, 0, 1, 0, 96, TRUE, FALSE, TRUE, 0, 3, FALSE },
@ -259,7 +263,7 @@ ObjDataStruct AllObjects[] = {
};
/** Maps from object_graphic_id to object CEL name. */
char *ObjMasterLoadList[56] = { // might be const
char *ObjMasterLoadList[] = { // might be const
"L1Braz",
"L1Doors",
"Lever",
@ -317,5 +321,125 @@ char *ObjMasterLoadList[56] = { // might be const
"Mushptch",
"LzStand"
};
#ifdef HELLFIRE
/** Maps from object_graphic_id to object CEL name (Hellfire Crypt overwrite). */
char *ObjCryptLoadList[] = {
"L1Braz",
"L5Door",
"L5Lever",
"Chest1",
"Chest2",
"Banner",
"SkulPile",
"SkulFire",
"SkulStik",
"CruxSk1",
"CruxSk2",
"CruxSk3",
"Book1",
"Book2",
"Rockstan",
"Angel",
"Chest3",
"Burncros",
"L5Light",
"Nude2",
"Switch4",
"TNudeM",
"TNudeW",
"TSoul",
"L2Doors",
"WTorch4",
"WTorch3",
"L5Sarco",
"Flame1",
"Prsrplt1",
"Traphole",
"MiniWatr",
"WTorch2",
"WTorch1",
"BCase",
"BShelf",
"WeapStnd",
"Urn",
"Urnexpld",
"LShrineG",
"RShrineG",
"Bloodfnt",
"Decap",
"Pedistl",
"L3Doors",
"PFountn",
"Armstand",
"Goatshrn",
"Cauldren",
"MFountn",
"TFountn",
"Altboy",
"Mcirl",
"L5Books",
"Mushptch",
"LzStand",
};
/** Maps from object_graphic_id to object CEL name (Hellfire Hive overwrite). */
char *ObjHiveLoadList[] = {
"L1Braz",
"L1Doors",
"Lever",
"Chest1",
"Chest2",
"Banner",
"SkulPile",
"SkulFire",
"SkulStik",
"CruxSk1",
"CruxSk2",
"CruxSk3",
"Book1",
"Book2",
"Rockstan",
"Angel",
"Chest3",
"Burncros",
"Candle2",
"Nude2",
"Switch4",
"TNudeM",
"TNudeW",
"TSoul",
"L2Doors",
"WTorch4",
"WTorch3",
"Sarc",
"Flame1",
"Prsrplt1",
"Traphole",
"MiniWatr",
"WTorch2",
"WTorch1",
"BCase",
"BShelf",
"WeapStnd",
"L6Pod1",
"L6Pod2",
"LShrineG",
"RShrineG",
"Bloodfnt",
"Decap",
"Pedistl",
"L3Doors",
"PFountn",
"Armstand",
"Goatshrn",
"Cauldren",
"MFountn",
"TFountn",
"Altboy",
"Mcirl",
"Bkslbrnt",
"Mushptch",
"LzStand",
};
#endif
DEVILUTION_END_NAMESPACE

View file

@ -14,7 +14,11 @@ extern "C" {
extern int ObjTypeConv[];
extern ObjDataStruct AllObjects[];
extern char *ObjMasterLoadList[56];
extern char *ObjMasterLoadList[];
#ifdef HELLFIRE
extern char *ObjCryptLoadList[];
extern char *ObjHiveLoadList[];
#endif
#ifdef __cplusplus
}

View file

@ -223,10 +223,22 @@ void InitObjectGFX()
memset(fileload, FALSE, sizeof(fileload));
#ifdef HELLFIRE
int lvl = currlevel;
if (currlevel >= 17 && currlevel <= 20)
lvl -= 8;
else if (currlevel >= 21 && currlevel <= 24)
lvl -= 20;
#endif
for (i = 0; AllObjects[i].oload != -1; i++) {
if (AllObjects[i].oload == 1
#ifdef HELLFIRE
&& (int)lvl >= AllObjects[i].ominlvl
&& (int)lvl <= AllObjects[i].omaxlvl) {
#else
&& (int)currlevel >= AllObjects[i].ominlvl
&& (int)currlevel <= AllObjects[i].omaxlvl) {
#endif
fileload[AllObjects[i].ofindex] = TRUE;
}
if (AllObjects[i].otheme != THEME_NONE) {
@ -246,6 +258,12 @@ void InitObjectGFX()
if (fileload[i]) {
ObjFileList[numobjfiles] = i;
sprintf(filestr, "Objects\\%s.CEL", ObjMasterLoadList[i]);
#ifdef HELLFIRE
if (currlevel >= 17 && currlevel < 21)
sprintf(filestr, "Objects\\%s.CEL", ObjHiveLoadList[i]);
else if (currlevel >= 21)
sprintf(filestr, "Objects\\%s.CEL", ObjCryptLoadList[i]);
#endif
pObjCels[numobjfiles] = LoadFileInMem(filestr, NULL);
numobjfiles++;
}
@ -808,7 +826,7 @@ void objects_add_lv22(int s)
return;
}
}
objects_44D8C5(86, s, xp, yp);
objects_44D8C5(OBJ_STORYBOOK, s, xp, yp);
AddObject(OBJ_STORYCANDLE, xp - 2, yp + 1);
AddObject(OBJ_STORYCANDLE, xp - 2, yp);
AddObject(OBJ_STORYCANDLE, xp - 1, yp - 1);
@ -856,7 +874,7 @@ void objects_add_lv24()
void objects_454AF0(int a1, int a2, int a3)
{
objects_44D8C5(86, a1, a2, a3);
objects_44D8C5(OBJ_STORYBOOK, a1, a2, a3);
}
#endif
@ -4914,7 +4932,14 @@ void BreakBarrel(int pnum, int i, int dam, BOOL forcebreak, BOOL sendmsg)
}
if (object[i]._otype == OBJ_BARRELEX) {
PlaySfxLoc(IS_BARLFIRE, object[i]._ox, object[i]._oy);
#ifdef HELLFIRE
if (currlevel >= 21 && currlevel <= 24)
PlaySfxLoc(IS_POPPOP3, object[i]._ox, object[i]._oy);
else if (currlevel >= 17 && currlevel <= 20)
PlaySfxLoc(IS_POPPOP8, object[i]._ox, object[i]._oy);
else
#endif
PlaySfxLoc(IS_BARLFIRE, object[i]._ox, object[i]._oy);
for (yp = object[i]._oy - 1; yp <= object[i]._oy + 1; yp++) {
for (xp = object[i]._ox - 1; xp <= object[i]._ox + 1; xp++) {
if (dMonster[xp][yp] > 0)
@ -4929,7 +4954,14 @@ void BreakBarrel(int pnum, int i, int dam, BOOL forcebreak, BOOL sendmsg)
}
}
} else {
PlaySfxLoc(IS_BARREL, object[i]._ox, object[i]._oy);
#ifdef HELLFIRE
if (currlevel >= 21 && currlevel <= 24)
PlaySfxLoc(IS_POPPOP2, object[i]._ox, object[i]._oy);
else if (currlevel >= 17 && currlevel <= 20)
PlaySfxLoc(IS_POPPOP5, object[i]._ox, object[i]._oy);
else
#endif
PlaySfxLoc(IS_BARREL, object[i]._ox, object[i]._oy);
SetRndSeed(object[i]._oRndSeed);
if (object[i]._oVar2 <= 1) {
if (object[i]._oVar3 == 0)

View file

@ -70,8 +70,12 @@ void PackPlayer(PkPlayerStruct *pPack, int pnum, BOOL manashield)
pPack->pMaxManaBase = SwapLE32(pPlayer->_pMaxManaBase);
pPack->pMemSpells = SDL_SwapLE64(pPlayer->_pMemSpells);
for (i = 0; i < MAX_SPELLS; i++)
for (i = 0; i < 37; i++) // Should be MAX_SPELLS but set to 37 to make save games compatible
pPack->pSplLvl[i] = pPlayer->_pSplLvl[i];
#ifdef HELLFIRE
for (i = 37; i < 47; i++)
pPack->pSplLvl2[i - 37] = pPlayer->_pSplLvl[i];
#endif
pki = &pPack->InvBody[0];
pi = &pPlayer->InvBody[0];
@ -222,8 +226,12 @@ void UnPackPlayer(PkPlayerStruct *pPack, int pnum, BOOL killok)
pPlayer->_pManaBase = SwapLE32(pPack->pManaBase);
pPlayer->_pMemSpells = SDL_SwapLE64(pPack->pMemSpells);
for (i = 0; i < MAX_SPELLS; i++)
for (i = 0; i < 37; i++) // Should be MAX_SPELLS but set to 37 to make save games compatible
pPlayer->_pSplLvl[i] = pPack->pSplLvl[i];
#ifdef HELLFIRE
for (i = 37; i < 47; i++)
pPlayer->_pSplLvl[i] = pPack->pSplLvl2[i - 37];
#endif
pki = &pPack->InvBody[0];
pi = &pPlayer->InvBody[0];

View file

@ -16,7 +16,7 @@ ItemStruct premiumitem[SMITH_PREMIUM_ITEMS];
BYTE *pSTextBoxCels;
int premiumlevel;
int talker;
STextStruct stext[24];
STextStruct stext[STORE_LINES];
char stextsize;
int stextsmax;
ItemStruct storehold[48];
@ -66,11 +66,7 @@ void InitStores()
pSTextBoxCels = LoadFileInMem("Data\\TextBox2.CEL", NULL);
pSPentSpn2Cels = LoadFileInMem("Data\\PentSpn2.CEL", NULL);
pSTextSlidCels = LoadFileInMem("Data\\TextSlid.CEL", NULL);
#ifdef HELLFIRE
ClearSText(0, 104);
#else
ClearSText(0, 24);
#endif
ClearSText(0, STORE_LINES);
stextflag = STORE_NONE;
PentSpn2Frame = 1;
stextsize = FALSE;
@ -1497,7 +1493,7 @@ void StartStore(char s)
chrflag = FALSE;
questlog = FALSE;
dropGoldFlag = FALSE;
ClearSText(0, 24);
ClearSText(0, STORE_LINES);
ReleaseStoreBtn();
switch (t) {
case STORE_SMITH:
@ -1575,12 +1571,12 @@ void StartStore(char s)
break;
}
for (i = 0; i < 24; i++) {
for (i = 0; i < STORE_LINES; i++) {
if (stext[i]._ssel)
break;
}
stextsel = i == 24 ? -1 : i;
stextsel = i == STORE_LINES ? -1 : i;
stextflag = t;
if (t != STORE_SBUY || storenumh)
break;
@ -1620,7 +1616,7 @@ void DrawSText()
}
}
for (i = 0; i < 24; i++) {
for (i = 0; i < STORE_LINES; i++) {
if (stext[i]._sline)
DrawSLine(i);
if (stext[i]._sstr[0])
@ -1723,7 +1719,7 @@ void STextUp()
stextsel--;
while (!stext[stextsel]._ssel) {
if (!stextsel)
stextsel = 23;
stextsel = STORE_LINES - 1;
else
stextsel--;
}
@ -1731,13 +1727,13 @@ void STextUp()
}
if (!stextsel)
stextsel = 23;
stextsel = STORE_LINES - 1;
else
stextsel--;
while (!stext[stextsel]._ssel) {
if (!stextsel)
stextsel = 23;
stextsel = STORE_LINES - 1;
else
stextsel--;
}
@ -1759,7 +1755,7 @@ void STextDown()
stextsel++;
while (!stext[stextsel]._ssel) {
if (stextsel == 23)
if (stextsel == STORE_LINES - 1)
stextsel = 0;
else
stextsel++;
@ -1767,13 +1763,13 @@ void STextDown()
return;
}
if (stextsel == 23)
if (stextsel == STORE_LINES - 1)
stextsel = 0;
else
stextsel++;
while (!stext[stextsel]._ssel) {
if (stextsel == 23)
if (stextsel == STORE_LINES - 1)
stextsel = 0;
else
stextsel++;

View file

@ -21,7 +21,7 @@ extern ItemStruct premiumitem[SMITH_PREMIUM_ITEMS];
extern BYTE *pSTextBoxCels;
extern int premiumlevel;
extern int talker;
extern STextStruct stext[24];
extern STextStruct stext[STORE_LINES];
extern char stextsize;
extern int stextsmax;
extern ItemStruct storehold[48];

2
defs.h
View file

@ -99,12 +99,14 @@
#define SMITH_PREMIUM_ITEMS 15
#define SMITH_MAX_VALUE 200000
#define SMITH_MAX_PREMIUM_VALUE 200000
#define STORE_LINES 104
#else
#define NUMLEVELS 17
#define SMITH_ITEMS 20
#define SMITH_PREMIUM_ITEMS 6
#define SMITH_MAX_VALUE 140000
#define SMITH_MAX_PREMIUM_VALUE 140000
#define STORE_LINES 24
#endif
// from diablo 2 beta