Browse Source

Format source

pull/944/head
Anders Jenbo 5 years ago
parent
commit
38dbcf7641
  1. 16
      Source/_render.cpp
  2. 2
      Source/appfat.cpp
  3. 2
      Source/automap.cpp
  4. 34
      Source/diablo.cpp
  5. 307
      Source/drlg_l1.cpp
  6. 3
      Source/drlg_l2.cpp
  7. 59
      Source/drlg_l3.cpp
  8. 6
      Source/drlg_l4.cpp
  9. 40
      Source/gamemenu.cpp
  10. 4
      Source/gendung.cpp
  11. 2
      Source/gmenu.cpp
  12. 91
      Source/inv.cpp
  13. 3
      Source/inv.h
  14. 2
      Source/itemdat.cpp
  15. 71
      Source/items.cpp
  16. 2
      Source/lighting.cpp
  17. 54
      Source/missiles.cpp
  18. 6
      Source/monstdat.cpp
  19. 30
      Source/monster.cpp
  20. 97
      Source/msg.cpp
  21. 130
      Source/objects.cpp
  22. 6
      Source/pack.cpp
  23. 2
      Source/palette.cpp
  24. 16
      Source/player.cpp
  25. 38
      Source/quests.cpp
  26. 1
      Source/sha.cpp
  27. 37
      Source/town.cpp
  28. 4
      Source/town.h
  29. 968
      Source/towners.cpp
  30. 3
      Source/trigs.cpp
  31. 20
      defs.h
  32. 212
      enums.h

16
Source/_render.cpp

@ -741,7 +741,7 @@ __declspec(naked) void drawTopArchesUpperScreen(BYTE *pBuff)
mov edx, esi mov edx, esi
and edx, 2 and edx, 2
add esi, edx add esi, edx
// loc_4637C0: // loc_4637C0:
sub edi, 320h sub edi, 320h
add edi, ebp add edi, ebp
sub ebp, 2 sub ebp, 2
@ -876,7 +876,7 @@ __declspec(naked) void drawTopArchesUpperScreen(BYTE *pBuff)
mov edx, esi mov edx, esi
and edx, 2 and edx, 2
add esi, edx add esi, edx
// loc_4638F1: // loc_4638F1:
sub edi, 320h sub edi, 320h
add edi, ebp add edi, ebp
add ebp, 2 add ebp, 2
@ -1198,7 +1198,7 @@ __declspec(naked) void drawTopArchesUpperScreen(BYTE *pBuff)
mov edx, esi mov edx, esi
and edx, 2 and edx, 2
add esi, edx add esi, edx
// loc_463BDB: // loc_463BDB:
sub edi, 320h sub edi, 320h
add edi, ebp add edi, ebp
sub ebp, 2 sub ebp, 2
@ -5465,7 +5465,7 @@ __declspec(naked) void drawTopArchesLowerScreen(BYTE *pBuff)
mov edx, esi mov edx, esi
and edx, 2 and edx, 2
add esi, edx add esi, edx
// loc_466780: // loc_466780:
sub edi, 320h sub edi, 320h
add edi, ebp add edi, ebp
sub ebp, 2 sub ebp, 2
@ -5623,7 +5623,7 @@ __declspec(naked) void drawTopArchesLowerScreen(BYTE *pBuff)
mov edx, esi mov edx, esi
and edx, 2 and edx, 2
add esi, edx add esi, edx
// loc_4668F8: // loc_4668F8:
sub edi, 320h sub edi, 320h
add edi, ebp add edi, ebp
add ebp, 2 add ebp, 2
@ -5999,7 +5999,7 @@ __declspec(naked) void drawTopArchesLowerScreen(BYTE *pBuff)
mov edx, esi mov edx, esi
and edx, 2 and edx, 2
add esi, edx add esi, edx
// loc_466C80: // loc_466C80:
sub edi, 320h sub edi, 320h
add edi, ebp add edi, ebp
sub ebp, 2 sub ebp, 2
@ -6289,7 +6289,7 @@ __declspec(naked) void drawTopArchesLowerScreen(BYTE *pBuff)
sub edi, 320h sub edi, 320h
sub edx, 2 sub edx, 2
jge loc_466EC1 jge loc_466EC1
// loc_466F3F: // loc_466F3F:
mov edx, 2 mov edx, 2
mov eax, edi mov eax, edi
sub eax, gpBufEnd sub eax, gpBufEnd
@ -6630,7 +6630,7 @@ __declspec(naked) void drawTopArchesLowerScreen(BYTE *pBuff)
sub edi, 320h sub edi, 320h
sub edx, 2 sub edx, 2
jge loc_467240 jge loc_467240
// loc_4672BE: // loc_4672BE:
mov edx, 8 mov edx, 8
loc_4672C3: loc_4672C3:
cmp edi, gpBufEnd cmp edi, gpBufEnd

2
Source/appfat.cpp

@ -519,7 +519,7 @@ static void FreeDlg()
#ifdef HELLFIRE #ifdef HELLFIRE
__declspec(naked) __declspec(naked)
#endif #endif
void __cdecl app_fatal(const char *pszFmt, ...) void __cdecl app_fatal(const char *pszFmt, ...)
{ {
va_list va; va_list va;

2
Source/automap.cpp

@ -462,7 +462,7 @@ void SearchAutomapItem()
for (i = x1; i < x2; i++) { for (i = x1; i < x2; i++) {
for (j = y1; j < y2; j++) { for (j = y1; j < y2; j++) {
if (dItem[i][j] != 0){ if (dItem[i][j] != 0) {
px = i - 2 * AutoMapXOfs - ViewX; px = i - 2 * AutoMapXOfs - ViewX;
py = j - 2 * AutoMapYOfs - ViewY; py = j - 2 * AutoMapYOfs - ViewY;

34
Source/diablo.cpp

@ -874,7 +874,7 @@ static BOOL LeftMouseDown(int wParam)
if (doomflag) { if (doomflag) {
doom_close(); doom_close();
return FALSE; return FALSE;
} }
if (spselflag) { if (spselflag) {
SetSpell(); SetSpell();
@ -919,7 +919,6 @@ static BOOL LeftMouseDown(int wParam)
if (pcurs > CURSOR_HAND && pcurs < CURSOR_FIRSTITEM) if (pcurs > CURSOR_HAND && pcurs < CURSOR_FIRSTITEM)
NewCursor(CURSOR_HAND); NewCursor(CURSOR_HAND);
} }
return FALSE; return FALSE;
} }
@ -1686,7 +1685,7 @@ LRESULT CALLBACK GM_Game(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
void LoadLvlGFX() void LoadLvlGFX()
{ {
assert(! pDungeonCels); assert(!pDungeonCels);
switch (leveltype) { switch (leveltype) {
case DTYPE_TOWN: case DTYPE_TOWN:
@ -1756,7 +1755,7 @@ void LoadLvlGFX()
void LoadAllGFX() void LoadAllGFX()
{ {
assert(! pSpeedCels); assert(!pSpeedCels);
pSpeedCels = DiabloAllocPtr(0x100000); pSpeedCels = DiabloAllocPtr(0x100000);
IncProgress(); IncProgress();
IncProgress(); IncProgress();
@ -1782,7 +1781,7 @@ void CreateLevel(int lvldir)
InitL1Triggers(); InitL1Triggers();
Freeupstairs(); Freeupstairs();
#ifdef HELLFIRE #ifdef HELLFIRE
if(currlevel < 21) { if (currlevel < 21) {
LoadRndLvlPal(1); LoadRndLvlPal(1);
} else { } else {
LoadRndLvlPal(5); LoadRndLvlPal(5);
@ -1803,7 +1802,7 @@ void CreateLevel(int lvldir)
InitL3Triggers(); InitL3Triggers();
Freeupstairs(); Freeupstairs();
#ifdef HELLFIRE #ifdef HELLFIRE
if(currlevel < 17) { if (currlevel < 17) {
LoadRndLvlPal(3); LoadRndLvlPal(3);
} else { } else {
LoadRndLvlPal(6); LoadRndLvlPal(6);
@ -1922,7 +1921,7 @@ void LoadGameLevel(BOOL firstflag, int lvldir)
InitObjects(); InitObjects();
InitItems(); InitItems();
#ifdef HELLFIRE #ifdef HELLFIRE
if ( currlevel < 17 ) if (currlevel < 17)
#endif #endif
CreateThemeRooms(); CreateThemeRooms();
glMid3Seed[currlevel] = GetRndSeed(); glMid3Seed[currlevel] = GetRndSeed();
@ -1967,7 +1966,7 @@ void LoadGameLevel(BOOL firstflag, int lvldir)
ResyncMPQuests(); ResyncMPQuests();
#ifndef SPAWN #ifndef SPAWN
} else { } else {
assert(! pSpeedCels); assert(!pSpeedCels);
pSpeedCels = DiabloAllocPtr(0x100000); pSpeedCels = DiabloAllocPtr(0x100000);
LoadSetMap(); LoadSetMap();
IncProgress(); IncProgress();
@ -2036,21 +2035,18 @@ void LoadGameLevel(BOOL firstflag, int lvldir)
} }
#ifdef HELLFIRE #ifdef HELLFIRE
if ( currlevel >= 21 ) if (currlevel >= 21) {
{ if (currlevel == 21) {
if ( currlevel == 21 )
{
items_427ABA(CornerStone.x, CornerStone.y); items_427ABA(CornerStone.x, CornerStone.y);
} }
if ( quests[Q_NAKRUL]._qactive == QUEST_DONE && currlevel == 24 ) if (quests[Q_NAKRUL]._qactive == QUEST_DONE && currlevel == 24) {
{
objects_454BA8(); objects_454BA8();
} }
} }
#endif #endif
#ifdef HELLFIRE #ifdef HELLFIRE
if ( currlevel >= 17 ) if (currlevel >= 17)
music_start(currlevel > 20 ? TMUSIC_L5 : TMUSIC_L6); music_start(currlevel > 20 ? TMUSIC_L5 : TMUSIC_L6);
else else
music_start(leveltype); music_start(leveltype);
@ -2189,13 +2185,13 @@ static PlayerStruct *get_plr_mem(PlayerStruct *p)
r = malloc(rand() & 0x7FFF); r = malloc(rand() & 0x7FFF);
pPlayer = (PlayerStruct *)malloc(sizeof(PlayerStruct) * MAX_PLRS); pPlayer = (PlayerStruct *)malloc(sizeof(PlayerStruct) * MAX_PLRS);
if(r != NULL) { if (r != NULL) {
free(r); free(r);
} }
if(pPlayer == NULL) { if (pPlayer == NULL) {
return p; return p;
} }
if(p != NULL) { if (p != NULL) {
memcpy(pPlayer, p, sizeof(PlayerStruct) * MAX_PLRS); memcpy(pPlayer, p, sizeof(PlayerStruct) * MAX_PLRS);
free(p); free(p);
} }
@ -2207,7 +2203,7 @@ void alloc_plr()
{ {
plr = get_plr_mem(NULL); plr = get_plr_mem(NULL);
if(plr == NULL) { if (plr == NULL) {
app_fatal("Unable to initialize memory"); app_fatal("Unable to initialize memory");
} }

307
Source/drlg_l1.cpp

@ -566,288 +566,285 @@ void drlg_l1_crypt_lavafloor()
{ {
int i, j; int i, j;
for ( j = 1; j < 40; j++ ) for (j = 1; j < 40; j++) {
{ for (i = 1; i < 40; i++) {
for ( i = 1; i < 40; i++ ) switch (dungeon[i][j]) {
{
switch ( dungeon[i][j] )
{
case 5: case 5:
if ( dungeon[i - 1][j] == 13 ) if (dungeon[i - 1][j] == 13)
dungeon[i - 1][j] = 203; dungeon[i - 1][j] = 203;
if ( dungeon[i - 1][j - 1] == 13 ) if (dungeon[i - 1][j - 1] == 13)
dungeon[i - 1][j - 1] = 204; dungeon[i - 1][j - 1] = 204;
if ( dungeon[i][j - 1] == 13 ) if (dungeon[i][j - 1] == 13)
dungeon[i][j - 1] = 205; dungeon[i][j - 1] = 205;
break; break;
case 7: case 7:
if ( dungeon[i - 1][j] == 13 ) if (dungeon[i - 1][j] == 13)
dungeon[i - 1][j] = 206; dungeon[i - 1][j] = 206;
if ( dungeon[i - 1][j - 1] == 13 ) if (dungeon[i - 1][j - 1] == 13)
dungeon[i - 1][j - 1] = 207; dungeon[i - 1][j - 1] = 207;
break; break;
case 8: case 8:
if ( dungeon[i - 1][j] == 13 ) if (dungeon[i - 1][j] == 13)
dungeon[i - 1][j] = 203; dungeon[i - 1][j] = 203;
if ( dungeon[i - 1][j - 1] == 13 ) if (dungeon[i - 1][j - 1] == 13)
dungeon[i - 1][j - 1] = 204; dungeon[i - 1][j - 1] = 204;
break; break;
case 9: case 9:
if ( dungeon[i - 1][j] == 13 ) if (dungeon[i - 1][j] == 13)
dungeon[i - 1][j] = 206; dungeon[i - 1][j] = 206;
if ( dungeon[i - 1][j - 1] == 13 ) if (dungeon[i - 1][j - 1] == 13)
dungeon[i - 1][j - 1] = 207; dungeon[i - 1][j - 1] = 207;
if ( dungeon[i][j - 1] == 13 ) if (dungeon[i][j - 1] == 13)
dungeon[i][j - 1] = 205; dungeon[i][j - 1] = 205;
break; break;
case 10: case 10:
if ( dungeon[i][j - 1] == 13 ) if (dungeon[i][j - 1] == 13)
dungeon[i][j - 1] = 205; dungeon[i][j - 1] = 205;
break; break;
case 11: case 11:
if ( dungeon[i - 1][j] == 13 ) if (dungeon[i - 1][j] == 13)
dungeon[i - 1][j] = 203; dungeon[i - 1][j] = 203;
if ( dungeon[i - 1][j - 1] == 13 ) if (dungeon[i - 1][j - 1] == 13)
dungeon[i - 1][j - 1] = 204; dungeon[i - 1][j - 1] = 204;
break; break;
case 12: case 12:
if ( dungeon[i][j - 1] == 13 ) if (dungeon[i][j - 1] == 13)
dungeon[i][j - 1] = 205; dungeon[i][j - 1] = 205;
break; break;
case 14: case 14:
if ( dungeon[i - 1][j] == 13 ) if (dungeon[i - 1][j] == 13)
dungeon[i - 1][j] = 203; dungeon[i - 1][j] = 203;
if ( dungeon[i - 1][j - 1] == 13 ) if (dungeon[i - 1][j - 1] == 13)
dungeon[i - 1][j - 1] = 204; dungeon[i - 1][j - 1] = 204;
break; break;
case 15: case 15:
if ( dungeon[i - 1][j] == 13 ) if (dungeon[i - 1][j] == 13)
dungeon[i - 1][j] = 206; dungeon[i - 1][j] = 206;
if ( dungeon[i - 1][j - 1] == 13 ) if (dungeon[i - 1][j - 1] == 13)
dungeon[i - 1][j - 1] = 207; dungeon[i - 1][j - 1] = 207;
break; break;
case 17: case 17:
if ( dungeon[i - 1][j] == 13 ) if (dungeon[i - 1][j] == 13)
dungeon[i - 1][j] = 206; dungeon[i - 1][j] = 206;
if ( dungeon[i - 1][j - 1] == 13 ) if (dungeon[i - 1][j - 1] == 13)
dungeon[i - 1][j - 1] = 207; dungeon[i - 1][j - 1] = 207;
break; break;
case 95: case 95:
if ( dungeon[i - 1][j] == 13 ) if (dungeon[i - 1][j] == 13)
dungeon[i - 1][j] = 203; dungeon[i - 1][j] = 203;
if ( dungeon[i - 1][j - 1] == 13 ) if (dungeon[i - 1][j - 1] == 13)
dungeon[i - 1][j - 1] = 204; dungeon[i - 1][j - 1] = 204;
break; break;
case 96: case 96:
if ( dungeon[i][j - 1] == 13 ) if (dungeon[i][j - 1] == 13)
dungeon[i][j - 1] = 208; dungeon[i][j - 1] = 208;
break; break;
case 116: case 116:
if ( dungeon[i - 1][j] == 13 ) if (dungeon[i - 1][j] == 13)
dungeon[i - 1][j] = 203; dungeon[i - 1][j] = 203;
if ( dungeon[i - 1][j - 1] == 13 ) if (dungeon[i - 1][j - 1] == 13)
dungeon[i - 1][j - 1] = 204; dungeon[i - 1][j - 1] = 204;
if ( dungeon[i][j - 1] == 13 ) if (dungeon[i][j - 1] == 13)
dungeon[i][j - 1] = 205; dungeon[i][j - 1] = 205;
break; break;
case 118: case 118:
if ( dungeon[i - 1][j] == 13 ) if (dungeon[i - 1][j] == 13)
dungeon[i - 1][j] = 206; dungeon[i - 1][j] = 206;
if ( dungeon[i - 1][j - 1] == 13 ) if (dungeon[i - 1][j - 1] == 13)
dungeon[i - 1][j - 1] = 207; dungeon[i - 1][j - 1] = 207;
break; break;
case 119: case 119:
if ( dungeon[i - 1][j] == 13 ) if (dungeon[i - 1][j] == 13)
dungeon[i - 1][j] = 203; dungeon[i - 1][j] = 203;
if ( dungeon[i - 1][j - 1] == 13 ) if (dungeon[i - 1][j - 1] == 13)
dungeon[i - 1][j - 1] = 204; dungeon[i - 1][j - 1] = 204;
break; break;
case 120: case 120:
if ( dungeon[i - 1][j] == 13 ) if (dungeon[i - 1][j] == 13)
dungeon[i - 1][j] = 206; dungeon[i - 1][j] = 206;
if ( dungeon[i - 1][j - 1] == 13 ) if (dungeon[i - 1][j - 1] == 13)
dungeon[i - 1][j - 1] = 207; dungeon[i - 1][j - 1] = 207;
if ( dungeon[i][j - 1] == 13 ) if (dungeon[i][j - 1] == 13)
dungeon[i][j - 1] = 205; dungeon[i][j - 1] = 205;
break; break;
case 121: case 121:
if ( dungeon[i][j - 1] == 13 ) if (dungeon[i][j - 1] == 13)
dungeon[i][j - 1] = 205; dungeon[i][j - 1] = 205;
break; break;
case 122: case 122:
if ( dungeon[i - 1][j] == 13 ) if (dungeon[i - 1][j] == 13)
dungeon[i - 1][j] = 211; dungeon[i - 1][j] = 211;
if ( dungeon[i - 1][j - 1] == 13 ) if (dungeon[i - 1][j - 1] == 13)
dungeon[i - 1][j - 1] = 212; dungeon[i - 1][j - 1] = 212;
break; break;
case 123: case 123:
if ( dungeon[i][j - 1] == 13 ) if (dungeon[i][j - 1] == 13)
dungeon[i][j - 1] = 205; dungeon[i][j - 1] = 205;
break; break;
case 125: case 125:
if ( dungeon[i - 1][j] == 13 ) if (dungeon[i - 1][j] == 13)
dungeon[i - 1][j] = 203; dungeon[i - 1][j] = 203;
if ( dungeon[i - 1][j - 1] == 13 ) if (dungeon[i - 1][j - 1] == 13)
dungeon[i - 1][j - 1] = 204; dungeon[i - 1][j - 1] = 204;
break; break;
case 126: case 126:
if ( dungeon[i - 1][j] == 13 ) if (dungeon[i - 1][j] == 13)
dungeon[i - 1][j] = 206; dungeon[i - 1][j] = 206;
if ( dungeon[i - 1][j - 1] == 13 ) if (dungeon[i - 1][j - 1] == 13)
dungeon[i - 1][j - 1] = 207; dungeon[i - 1][j - 1] = 207;
break; break;
case 128: case 128:
if ( dungeon[i - 1][j] == 13 ) if (dungeon[i - 1][j] == 13)
dungeon[i - 1][j] = 206; dungeon[i - 1][j] = 206;
if ( dungeon[i - 1][j - 1] == 13 ) if (dungeon[i - 1][j - 1] == 13)
dungeon[i - 1][j - 1] = 207; dungeon[i - 1][j - 1] = 207;
break; break;
case 133: case 133:
if ( dungeon[i - 1][j] == 13 ) if (dungeon[i - 1][j] == 13)
dungeon[i - 1][j] = 203; dungeon[i - 1][j] = 203;
if ( dungeon[i - 1][j - 1] == 13 ) if (dungeon[i - 1][j - 1] == 13)
dungeon[i - 1][j - 1] = 204; dungeon[i - 1][j - 1] = 204;
if ( dungeon[i][j - 1] == 13 ) if (dungeon[i][j - 1] == 13)
dungeon[i][j - 1] = 205; dungeon[i][j - 1] = 205;
break; break;
case 135: case 135:
if ( dungeon[i - 1][j] == 13 ) if (dungeon[i - 1][j] == 13)
dungeon[i - 1][j] = 206; dungeon[i - 1][j] = 206;
if ( dungeon[i - 1][j - 1] == 13 ) if (dungeon[i - 1][j - 1] == 13)
dungeon[i - 1][j - 1] = 207; dungeon[i - 1][j - 1] = 207;
break; break;
case 136: case 136:
if ( dungeon[i - 1][j] == 13 ) if (dungeon[i - 1][j] == 13)
dungeon[i - 1][j] = 203; dungeon[i - 1][j] = 203;
if ( dungeon[i - 1][j - 1] == 13 ) if (dungeon[i - 1][j - 1] == 13)
dungeon[i - 1][j - 1] = 204; dungeon[i - 1][j - 1] = 204;
break; break;
case 137: case 137:
if ( dungeon[i - 1][j] == 13 ) if (dungeon[i - 1][j] == 13)
dungeon[i - 1][j] = 213; dungeon[i - 1][j] = 213;
if ( dungeon[i - 1][j - 1] == 13 ) if (dungeon[i - 1][j - 1] == 13)
dungeon[i - 1][j - 1] = 214; dungeon[i - 1][j - 1] = 214;
if ( dungeon[i][j - 1] == 13 ) if (dungeon[i][j - 1] == 13)
dungeon[i][j - 1] = 205; dungeon[i][j - 1] = 205;
break; break;
case 138: case 138:
if ( dungeon[i][j - 1] == 13 ) if (dungeon[i][j - 1] == 13)
dungeon[i][j - 1] = 205; dungeon[i][j - 1] = 205;
break; break;
case 139: case 139:
if ( dungeon[i - 1][j] == 13 ) if (dungeon[i - 1][j] == 13)
dungeon[i - 1][j] = 215; dungeon[i - 1][j] = 215;
if ( dungeon[i - 1][j - 1] == 13 ) if (dungeon[i - 1][j - 1] == 13)
dungeon[i - 1][j - 1] = 216; dungeon[i - 1][j - 1] = 216;
break; break;
case 140: case 140:
if ( dungeon[i][j - 1] == 13 ) if (dungeon[i][j - 1] == 13)
dungeon[i][j - 1] = 217; dungeon[i][j - 1] = 217;
break; break;
case 142: case 142:
if ( dungeon[i - 1][j] == 13 ) if (dungeon[i - 1][j] == 13)
dungeon[i - 1][j] = 203; dungeon[i - 1][j] = 203;
if ( dungeon[i - 1][j - 1] == 13 ) if (dungeon[i - 1][j - 1] == 13)
dungeon[i - 1][j - 1] = 204; dungeon[i - 1][j - 1] = 204;
break; break;
case 143: case 143:
if ( dungeon[i - 1][j] == 13 ) if (dungeon[i - 1][j] == 13)
dungeon[i - 1][j] = 213; dungeon[i - 1][j] = 213;
if ( dungeon[i - 1][j - 1] == 13 ) if (dungeon[i - 1][j - 1] == 13)
dungeon[i - 1][j - 1] = 214; dungeon[i - 1][j - 1] = 214;
break; break;
case 145: case 145:
if ( dungeon[i - 1][j] == 13 ) if (dungeon[i - 1][j] == 13)
dungeon[i - 1][j] = 213; dungeon[i - 1][j] = 213;
if ( dungeon[i - 1][j - 1] == 13 ) if (dungeon[i - 1][j - 1] == 13)
dungeon[i - 1][j - 1] = 214; dungeon[i - 1][j - 1] = 214;
break; break;
case 150: case 150:
if ( dungeon[i - 1][j] == 13 ) if (dungeon[i - 1][j] == 13)
dungeon[i - 1][j] = 203; dungeon[i - 1][j] = 203;
if ( dungeon[i - 1][j - 1] == 13 ) if (dungeon[i - 1][j - 1] == 13)
dungeon[i - 1][j - 1] = 204; dungeon[i - 1][j - 1] = 204;
if ( dungeon[i][j - 1] == 13 ) if (dungeon[i][j - 1] == 13)
dungeon[i][j - 1] = 217; dungeon[i][j - 1] = 217;
break; break;
case 152: case 152:
if ( dungeon[i - 1][j] == 13 ) if (dungeon[i - 1][j] == 13)
dungeon[i - 1][j] = 206; dungeon[i - 1][j] = 206;
if ( dungeon[i - 1][j - 1] == 13 ) if (dungeon[i - 1][j - 1] == 13)
dungeon[i - 1][j - 1] = 207; dungeon[i - 1][j - 1] = 207;
break; break;
case 153: case 153:
if ( dungeon[i - 1][j] == 13 ) if (dungeon[i - 1][j] == 13)
dungeon[i - 1][j] = 203; dungeon[i - 1][j] = 203;
if ( dungeon[i - 1][j - 1] == 13 ) if (dungeon[i - 1][j - 1] == 13)
dungeon[i - 1][j - 1] = 204; dungeon[i - 1][j - 1] = 204;
break; break;
case 154: case 154:
if ( dungeon[i - 1][j] == 13 ) if (dungeon[i - 1][j] == 13)
dungeon[i - 1][j] = 206; dungeon[i - 1][j] = 206;
if ( dungeon[i - 1][j - 1] == 13 ) if (dungeon[i - 1][j - 1] == 13)
dungeon[i - 1][j - 1] = 207; dungeon[i - 1][j - 1] = 207;
if ( dungeon[i][j - 1] == 13 ) if (dungeon[i][j - 1] == 13)
dungeon[i][j - 1] = 205; dungeon[i][j - 1] = 205;
break; break;
case 155: case 155:
if ( dungeon[i][j - 1] == 13 ) if (dungeon[i][j - 1] == 13)
dungeon[i][j - 1] = 205; dungeon[i][j - 1] = 205;
break; break;
case 156: case 156:
if ( dungeon[i - 1][j] == 13 ) if (dungeon[i - 1][j] == 13)
dungeon[i - 1][j] = 203; dungeon[i - 1][j] = 203;
if ( dungeon[i - 1][j - 1] == 13 ) if (dungeon[i - 1][j - 1] == 13)
dungeon[i - 1][j - 1] = 204; dungeon[i - 1][j - 1] = 204;
break; break;
case 157: case 157:
if ( dungeon[i][j - 1] == 13 ) if (dungeon[i][j - 1] == 13)
dungeon[i][j - 1] = 217; dungeon[i][j - 1] = 217;
break; break;
case 159: case 159:
if ( dungeon[i - 1][j] == 13 ) if (dungeon[i - 1][j] == 13)
dungeon[i - 1][j] = 203; dungeon[i - 1][j] = 203;
if ( dungeon[i - 1][j - 1] == 13 ) if (dungeon[i - 1][j - 1] == 13)
dungeon[i - 1][j - 1] = 204; dungeon[i - 1][j - 1] = 204;
break; break;
case 160: case 160:
if ( dungeon[i - 1][j] == 13 ) if (dungeon[i - 1][j] == 13)
dungeon[i - 1][j] = 206; dungeon[i - 1][j] = 206;
if ( dungeon[i - 1][j - 1] == 13 ) if (dungeon[i - 1][j - 1] == 13)
dungeon[i - 1][j - 1] = 207; dungeon[i - 1][j - 1] = 207;
break; break;
case 162: case 162:
if ( dungeon[i - 1][j] == 13 ) if (dungeon[i - 1][j] == 13)
dungeon[i - 1][j] = 209; dungeon[i - 1][j] = 209;
if ( dungeon[i - 1][j - 1] == 13 ) if (dungeon[i - 1][j - 1] == 13)
dungeon[i - 1][j - 1] = 210; dungeon[i - 1][j - 1] = 210;
break; break;
case 167: case 167:
if ( dungeon[i - 1][j] == 13 ) if (dungeon[i - 1][j] == 13)
dungeon[i - 1][j] = 209; dungeon[i - 1][j] = 209;
if ( dungeon[i - 1][j - 1] == 13 ) if (dungeon[i - 1][j - 1] == 13)
dungeon[i - 1][j - 1] = 210; dungeon[i - 1][j - 1] = 210;
break; break;
case 187: case 187:
if ( dungeon[i][j - 1] == 13 ) if (dungeon[i][j - 1] == 13)
dungeon[i][j - 1] = 208; dungeon[i][j - 1] = 208;
break; break;
case 185: case 185:
if ( dungeon[i - 1][j] == 13 ) if (dungeon[i - 1][j] == 13)
dungeon[i - 1][j] = 203; dungeon[i - 1][j] = 203;
if ( dungeon[i - 1][j - 1] == 13 ) if (dungeon[i - 1][j - 1] == 13)
dungeon[i - 1][j - 1] = 204; dungeon[i - 1][j - 1] = 204;
break; break;
case 186: case 186:
if ( dungeon[i - 1][j] == 13 ) if (dungeon[i - 1][j] == 13)
dungeon[i - 1][j] = 203; dungeon[i - 1][j] = 203;
if ( dungeon[i - 1][j - 1] == 13 ) if (dungeon[i - 1][j - 1] == 13)
dungeon[i - 1][j - 1] = 204; dungeon[i - 1][j - 1] = 204;
break; break;
case 192: case 192:
if ( dungeon[i - 1][j] == 13 ) if (dungeon[i - 1][j] == 13)
dungeon[i - 1][j] = 209; dungeon[i - 1][j] = 209;
if ( dungeon[i - 1][j - 1] == 13 ) if (dungeon[i - 1][j - 1] == 13)
dungeon[i - 1][j - 1] = 210; dungeon[i - 1][j - 1] = 210;
break; break;
} }
@ -2527,15 +2524,15 @@ static void DRLG_L5DirtFix()
} else { } else {
for (j = 0; j < DMAXY - 1; j++) { for (j = 0; j < DMAXY - 1; j++) {
for (i = 0; i < DMAXX - 1; i++) { for (i = 0; i < DMAXX - 1; i++) {
if ( dungeon[i][j] == 19 ) if (dungeon[i][j] == 19)
dungeon[i][j] = 83; dungeon[i][j] = 83;
if ( dungeon[i][j] == 21 ) if (dungeon[i][j] == 21)
dungeon[i][j] = 85; dungeon[i][j] = 85;
if ( dungeon[i][j] == 23 ) if (dungeon[i][j] == 23)
dungeon[i][j] = 87; dungeon[i][j] = 87;
if ( dungeon[i][j] == 24 ) if (dungeon[i][j] == 24)
dungeon[i][j] = 88; dungeon[i][j] = 88;
if ( dungeon[i][j] == 18 ) if (dungeon[i][j] == 18)
dungeon[i][j] = 82; dungeon[i][j] = 82;
} }
} }
@ -2645,82 +2642,64 @@ static void DRLG_L5(int entry)
} }
#ifdef HELLFIRE #ifdef HELLFIRE
} else if (entry == 0) { } else if (entry == 0) {
if ( currlevel < 21 ) if (currlevel < 21) {
{ if (DRLG_PlaceMiniSet(STAIRSUP, 1, 1, 0, 0, 1, -1, 0) < 0)
if ( DRLG_PlaceMiniSet(STAIRSUP, 1, 1, 0, 0, 1, -1, 0) < 0 )
doneflag = 0; doneflag = 0;
if ( DRLG_PlaceMiniSet(STAIRSDOWN, 1, 1, 0, 0, 0, -1, 1) < 0 ) if (DRLG_PlaceMiniSet(STAIRSDOWN, 1, 1, 0, 0, 0, -1, 1) < 0)
doneflag = 0; doneflag = 0;
} } else if (currlevel == 21) {
else if ( currlevel == 21 ) if (DRLG_PlaceMiniSet(L5STAIRSTOWN, 1, 1, 0, 0, 0, -1, 6) < 0)
{
if ( DRLG_PlaceMiniSet(L5STAIRSTOWN, 1, 1, 0, 0, 0, -1, 6) < 0 )
doneflag = 0; doneflag = 0;
if ( DRLG_PlaceMiniSet(L5STAIRSDOWN, 1, 1, 0, 0, 0, -1, 1) < 0 ) if (DRLG_PlaceMiniSet(L5STAIRSDOWN, 1, 1, 0, 0, 0, -1, 1) < 0)
doneflag = 0; doneflag = 0;
ViewY++; ViewY++;
} } else {
else if (DRLG_PlaceMiniSet(L5STAIRSUP, 1, 1, 0, 0, 1, -1, 0) < 0)
{
if ( DRLG_PlaceMiniSet(L5STAIRSUP, 1, 1, 0, 0, 1, -1, 0) < 0 )
doneflag = 0; doneflag = 0;
if ( currlevel != 24 ) if (currlevel != 24) {
{ if (DRLG_PlaceMiniSet(L5STAIRSDOWN, 1, 1, 0, 0, 0, -1, 1) < 0)
if ( DRLG_PlaceMiniSet(L5STAIRSDOWN, 1, 1, 0, 0, 0, -1, 1) < 0 )
doneflag = 0; doneflag = 0;
} }
ViewY++; ViewY++;
} }
} else if ( entry == 1 ) { } else if (entry == 1) {
if ( currlevel < 21 ) if (currlevel < 21) {
{ if (DRLG_PlaceMiniSet(STAIRSUP, 1, 1, 0, 0, 0, -1, 0) < 0)
if ( DRLG_PlaceMiniSet(STAIRSUP, 1, 1, 0, 0, 0, -1, 0) < 0 )
doneflag = 0; doneflag = 0;
if ( DRLG_PlaceMiniSet(STAIRSDOWN, 1, 1, 0, 0, 1, -1, 1) < 0 ) if (DRLG_PlaceMiniSet(STAIRSDOWN, 1, 1, 0, 0, 1, -1, 1) < 0)
doneflag = 0; doneflag = 0;
ViewY--; ViewY--;
} } else if (currlevel == 21) {
else if ( currlevel == 21 ) if (DRLG_PlaceMiniSet(L5STAIRSTOWN, 1, 1, 0, 0, 0, -1, 6) < 0)
{
if ( DRLG_PlaceMiniSet(L5STAIRSTOWN, 1, 1, 0, 0, 0, -1, 6) < 0 )
doneflag = 0; doneflag = 0;
if ( DRLG_PlaceMiniSet(L5STAIRSDOWN, 1, 1, 0, 0, 1, -1, 1) < 0 ) if (DRLG_PlaceMiniSet(L5STAIRSDOWN, 1, 1, 0, 0, 1, -1, 1) < 0)
doneflag = 0; doneflag = 0;
ViewY += 3; ViewY += 3;
} } else {
else if (DRLG_PlaceMiniSet(L5STAIRSUP, 1, 1, 0, 0, 1, -1, 0) < 0)
{
if ( DRLG_PlaceMiniSet(L5STAIRSUP, 1, 1, 0, 0, 1, -1, 0) < 0 )
doneflag = 0; doneflag = 0;
if ( currlevel != 24 ) if (currlevel != 24) {
{ if (DRLG_PlaceMiniSet(L5STAIRSDOWN, 1, 1, 0, 0, 1, -1, 1) < 0)
if ( DRLG_PlaceMiniSet(L5STAIRSDOWN, 1, 1, 0, 0, 1, -1, 1) < 0 )
doneflag = 0; doneflag = 0;
} }
ViewY += 3; ViewY += 3;
} }
} else { } else {
if ( currlevel < 21 ) if (currlevel < 21) {
{ if (DRLG_PlaceMiniSet(STAIRSUP, 1, 1, 0, 0, 0, -1, 0) < 0)
if ( DRLG_PlaceMiniSet(STAIRSUP, 1, 1, 0, 0, 0, -1, 0) < 0 )
doneflag = 0; doneflag = 0;
if ( DRLG_PlaceMiniSet(STAIRSDOWN, 1, 1, 0, 0, 0, -1, 1) < 0 ) if (DRLG_PlaceMiniSet(STAIRSDOWN, 1, 1, 0, 0, 0, -1, 1) < 0)
doneflag = 0; doneflag = 0;
} } else if (currlevel == 21) {
else if ( currlevel == 21 ) if (DRLG_PlaceMiniSet(L5STAIRSTOWN, 1, 1, 0, 0, 1, -1, 6) < 0)
{
if ( DRLG_PlaceMiniSet(L5STAIRSTOWN, 1, 1, 0, 0, 1, -1, 6) < 0 )
doneflag = 0; doneflag = 0;
if ( DRLG_PlaceMiniSet(L5STAIRSDOWN, 1, 1, 0, 0, 0, -1, 1) < 0 ) if (DRLG_PlaceMiniSet(L5STAIRSDOWN, 1, 1, 0, 0, 0, -1, 1) < 0)
doneflag = 0; doneflag = 0;
} } else {
else if (DRLG_PlaceMiniSet(L5STAIRSUP, 1, 1, 0, 0, 1, -1, 0) < 0)
{
if ( DRLG_PlaceMiniSet(L5STAIRSUP, 1, 1, 0, 0, 1, -1, 0) < 0 )
doneflag = 0; doneflag = 0;
if ( currlevel != 24 ) if (currlevel != 24) {
{ if (DRLG_PlaceMiniSet(L5STAIRSDOWN, 1, 1, 0, 0, 0, -1, 1) < 0)
if ( DRLG_PlaceMiniSet(L5STAIRSDOWN, 1, 1, 0, 0, 0, -1, 1) < 0 )
doneflag = 0; doneflag = 0;
} }
} }
@ -2763,12 +2742,9 @@ static void DRLG_L5(int entry)
} }
#ifdef HELLFIRE #ifdef HELLFIRE
if ( currlevel < 21 ) if (currlevel < 21) {
{
DRLG_L5Subs(); DRLG_L5Subs();
} } else {
else
{
drlg_l1_crypt_pattern1(10); drlg_l1_crypt_pattern1(10);
drlg_l1_crypt_rndset(byte_48A1B4, 95); drlg_l1_crypt_rndset(byte_48A1B4, 95);
drlg_l1_crypt_rndset(byte_48A1B8, 95); drlg_l1_crypt_rndset(byte_48A1B8, 95);
@ -2776,8 +2752,7 @@ static void DRLG_L5(int entry)
drlg_l1_crypt_rndset(byte_48A1C8, 100); drlg_l1_crypt_rndset(byte_48A1C8, 100);
drlg_l1_crypt_rndset(byte_48A1E0, 60); drlg_l1_crypt_rndset(byte_48A1E0, 60);
drlg_l1_crypt_lavafloor(); drlg_l1_crypt_lavafloor();
switch ( currlevel ) switch (currlevel) {
{
case 21: case 21:
drlg_l1_crypt_pattern2(30); drlg_l1_crypt_pattern2(30);
drlg_l1_crypt_pattern3(15); drlg_l1_crypt_pattern3(15);
@ -2875,24 +2850,20 @@ void CreateL5Dungeon(DWORD rseed, int entry)
DRLG_FreeL1SP(); DRLG_FreeL1SP();
#ifdef HELLFIRE #ifdef HELLFIRE
if ( currlevel < 17 ) if (currlevel < 17)
DRLG_InitL1Vals(); DRLG_InitL1Vals();
else else
DRLG_InitL5Vals(); DRLG_InitL5Vals();
DRLG_SetPC(); DRLG_SetPC();
for ( j = dminy; j < dmaxy; j++ ) for (j = dminy; j < dmaxy; j++) {
{ for (i = dminx; i < dmaxx; i++) {
for ( i = dminx; i < dmaxx; i++ ) if (dPiece[i][j] == 290) {
{
if ( dPiece[i][j] == 290 )
{
UberRow = i; UberRow = i;
UberCol = j; UberCol = j;
} }
if ( dPiece[i][j] == 317 ) if (dPiece[i][j] == 317) {
{
CornerStone.x = i; CornerStone.x = i;
CornerStone.y = j; CornerStone.y = j;
} }

3
Source/drlg_l2.cpp

@ -57,7 +57,7 @@ BYTE VARCH2[] = {
47, 44, 47, 44,
0, 0, 0, 0,
// clang-format on // clang-format on
}; };
/** Miniset: Arch vertical. */ /** Miniset: Arch vertical. */
BYTE VARCH3[] = { BYTE VARCH3[] = {
// clang-format off // clang-format off
@ -354,6 +354,7 @@ BYTE VARCH21[] = {
}; };
/** Miniset: Arch vertical - open wall. */ /** Miniset: Arch vertical - open wall. */
BYTE VARCH22[] = { BYTE VARCH22[] = {
// clang-format off
2, 3, // width, height 2, 3, // width, height
2, 7, // search 2, 7, // search

59
Source/drlg_l3.cpp

@ -503,7 +503,7 @@ const BYTE L3XTRA5[] = {
/** Miniset: Anvil of Fury island. */ /** Miniset: Anvil of Fury island. */
const BYTE L3ANVIL[] = { const BYTE L3ANVIL[] = {
// clang-format on // clang-format off
11, 11, // width, height 11, 11, // width, height
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, // search 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, // search
@ -541,7 +541,7 @@ const BYTE byte_48A780[] = { 1, 1, 7, 30 };
const BYTE byte_48A784[] = { 1, 1, 7, 31 }; const BYTE byte_48A784[] = { 1, 1, 7, 31 };
const BYTE byte_48A788[] = { 1, 1, 7, 32 }; const BYTE byte_48A788[] = { 1, 1, 7, 32 };
const BYTE byte_48A790[] = { const BYTE byte_48A790[] = {
// clang-format on // clang-format off
3, 3, // width, height 3, 3, // width, height
7, 7, 7, // search 7, 7, 7, // search
@ -554,7 +554,7 @@ const BYTE byte_48A790[] = {
// clang-format on // clang-format on
}; };
const BYTE byte_48A7A8[] = { const BYTE byte_48A7A8[] = {
// clang-format on // clang-format off
3, 3, // width, height 3, 3, // width, height
7, 7, 7, // search 7, 7, 7, // search
@ -585,7 +585,7 @@ const BYTE byte_48A7F8[] = { 1, 1, 10, 48 };
const BYTE byte_48A7FC[] = { 1, 1, 11, 49 }; const BYTE byte_48A7FC[] = { 1, 1, 11, 49 };
const BYTE byte_48A800[] = { 1, 1, 11, 50 }; const BYTE byte_48A800[] = { 1, 1, 11, 50 };
const BYTE byte_48A808[] = { const BYTE byte_48A808[] = {
// clang-format on // clang-format off
3, 3, // width, height 3, 3, // width, height
7, 7, 7, // search 7, 7, 7, // search
@ -598,7 +598,7 @@ const BYTE byte_48A808[] = {
// clang-format on // clang-format on
}; };
const BYTE byte_48A820[] = { const BYTE byte_48A820[] = {
// clang-format on // clang-format off
3, 3, // width, height 3, 3, // width, height
7, 7, 7, // search 7, 7, 7, // search
@ -611,7 +611,7 @@ const BYTE byte_48A820[] = {
// clang-format on // clang-format on
}; };
const BYTE byte_48A838[] = { const BYTE byte_48A838[] = {
// clang-format on // clang-format off
3, 3, // width, height 3, 3, // width, height
7, 7, 7, // search 7, 7, 7, // search
@ -624,7 +624,7 @@ const BYTE byte_48A838[] = {
// clang-format on // clang-format on
}; };
const BYTE byte_48A850[] = { const BYTE byte_48A850[] = {
// clang-format on // clang-format off
3, 3, // width, height 3, 3, // width, height
7, 7, 7, // search 7, 7, 7, // search
@ -637,7 +637,7 @@ const BYTE byte_48A850[] = {
// clang-format on // clang-format on
}; };
const BYTE byte_48A868[] = { const BYTE byte_48A868[] = {
// clang-format on // clang-format off
3, 3, // width, height 3, 3, // width, height
7, 7, 7, // search 7, 7, 7, // search
@ -650,7 +650,7 @@ const BYTE byte_48A868[] = {
// clang-format on // clang-format on
}; };
const BYTE byte_48A880[] = { const BYTE byte_48A880[] = {
// clang-format on // clang-format off
3, 3, // width, height 3, 3, // width, height
7, 7, 7, // search 7, 7, 7, // search
@ -663,7 +663,7 @@ const BYTE byte_48A880[] = {
// clang-format on // clang-format on
}; };
const BYTE byte_48A898[] = { const BYTE byte_48A898[] = {
// clang-format on // clang-format off
3, 3, // width, height 3, 3, // width, height
7, 7, 7, // search 7, 7, 7, // search
@ -676,7 +676,7 @@ const BYTE byte_48A898[] = {
// clang-format on // clang-format on
}; };
const BYTE byte_48A8B0[] = { const BYTE byte_48A8B0[] = {
// clang-format on // clang-format off
3, 3, // width, height 3, 3, // width, height
7, 7, 7, // search 7, 7, 7, // search
@ -689,7 +689,7 @@ const BYTE byte_48A8B0[] = {
// clang-format on // clang-format on
}; };
const BYTE byte_48A8C8[] = { const BYTE byte_48A8C8[] = {
// clang-format on // clang-format off
3, 3, // width, height 3, 3, // width, height
7, 7, 7, // search 7, 7, 7, // search
@ -702,7 +702,7 @@ const BYTE byte_48A8C8[] = {
// clang-format on // clang-format on
}; };
const BYTE byte_48A8E0[] = { const BYTE byte_48A8E0[] = {
// clang-format on // clang-format off
3, 3, // width, height 3, 3, // width, height
7, 7, 7, // search 7, 7, 7, // search
@ -715,7 +715,7 @@ const BYTE byte_48A8E0[] = {
// clang-format on // clang-format on
}; };
const BYTE L6ISLE1[] = { const BYTE L6ISLE1[] = {
// clang-format on // clang-format off
2, 3, // width, height 2, 3, // width, height
5, 14, // search 5, 14, // search
@ -728,7 +728,7 @@ const BYTE L6ISLE1[] = {
// clang-format on // clang-format on
}; };
const BYTE L6ISLE2[] = { const BYTE L6ISLE2[] = {
// clang-format on // clang-format off
3, 2, // width, height 3, 2, // width, height
5, 2, 14, // search 5, 2, 14, // search
@ -739,7 +739,7 @@ const BYTE L6ISLE2[] = {
// clang-format on // clang-format on
}; };
const BYTE L6ISLE3[] = { const BYTE L6ISLE3[] = {
// clang-format on // clang-format off
2, 3, // width, height 2, 3, // width, height
5, 14, // search 5, 14, // search
@ -752,7 +752,7 @@ const BYTE L6ISLE3[] = {
// clang-format on // clang-format on
}; };
const BYTE L6ISLE4[] = { const BYTE L6ISLE4[] = {
// clang-format on // clang-format off
3, 2, // width, height 3, 2, // width, height
5, 2, 14, // search 5, 2, 14, // search
@ -763,7 +763,7 @@ const BYTE L6ISLE4[] = {
// clang-format on // clang-format on
}; };
const BYTE L6ISLE5[] = { const BYTE L6ISLE5[] = {
// clang-format on // clang-format off
2, 2, // width, height 2, 2, // width, height
5, 14, // search 5, 14, // search
@ -774,7 +774,7 @@ const BYTE L6ISLE5[] = {
// clang-format on // clang-format on
}; };
const BYTE byte_48A948[] = { const BYTE byte_48A948[] = {
// clang-format on // clang-format off
4, 4, // width, height 4, 4, // width, height
7, 7, 7, 7, // search 7, 7, 7, 7, // search
@ -789,7 +789,7 @@ const BYTE byte_48A948[] = {
// clang-format on // clang-format on
}; };
const BYTE byte_48A970[] = { const BYTE byte_48A970[] = {
// clang-format on // clang-format off
4, 4, // width, height 4, 4, // width, height
7, 7, 7, 7, // search 7, 7, 7, 7, // search
@ -804,7 +804,7 @@ const BYTE byte_48A970[] = {
// clang-format on // clang-format on
}; };
const BYTE byte_48A998[] = { const BYTE byte_48A998[] = {
// clang-format on // clang-format off
4, 5, // width, height 4, 5, // width, height
7, 7, 7, 7, // search 7, 7, 7, 7, // search
@ -821,7 +821,7 @@ const BYTE byte_48A998[] = {
// clang-format on // clang-format on
}; };
const BYTE byte_48A9C8[] = { const BYTE byte_48A9C8[] = {
// clang-format on // clang-format off
4, 5, // width, height 4, 5, // width, height
7, 7, 7, 7, // search 7, 7, 7, 7, // search
@ -2359,7 +2359,7 @@ static void DRLG_L3(int entry)
genok = DRLG_L3PlaceMiniSet(L3UP, 1, 1, -1, -1, TRUE, 0); genok = DRLG_L3PlaceMiniSet(L3UP, 1, 1, -1, -1, TRUE, 0);
#ifdef HELLFIRE #ifdef HELLFIRE
} else { } else {
if ( currlevel != 17 ) if (currlevel != 17)
genok = DRLG_L3PlaceMiniSet(L6UP, 1, 1, -1, -1, TRUE, 0); genok = DRLG_L3PlaceMiniSet(L6UP, 1, 1, -1, -1, TRUE, 0);
else else
genok = DRLG_L3PlaceMiniSet(L6HOLDWARP, 1, 1, -1, -1, TRUE, 6); genok = DRLG_L3PlaceMiniSet(L6HOLDWARP, 1, 1, -1, -1, TRUE, 6);
@ -2372,7 +2372,7 @@ static void DRLG_L3(int entry)
genok = DRLG_L3PlaceMiniSet(L3DOWN, 1, 1, -1, -1, FALSE, 1); genok = DRLG_L3PlaceMiniSet(L3DOWN, 1, 1, -1, -1, FALSE, 1);
#ifdef HELLFIRE #ifdef HELLFIRE
} else { } else {
if ( currlevel != 20 ) if (currlevel != 20)
genok = DRLG_L3PlaceMiniSet(L6DOWN, 1, 1, -1, -1, FALSE, 1); genok = DRLG_L3PlaceMiniSet(L6DOWN, 1, 1, -1, -1, FALSE, 1);
} }
#endif #endif
@ -2387,7 +2387,7 @@ static void DRLG_L3(int entry)
genok = DRLG_L3PlaceMiniSet(L3UP, 1, 1, -1, -1, FALSE, 0); genok = DRLG_L3PlaceMiniSet(L3UP, 1, 1, -1, -1, FALSE, 0);
#ifdef HELLFIRE #ifdef HELLFIRE
} else { } else {
if ( currlevel != 17 ) if (currlevel != 17)
genok = DRLG_L3PlaceMiniSet(L6UP, 1, 1, -1, -1, FALSE, 0); genok = DRLG_L3PlaceMiniSet(L6UP, 1, 1, -1, -1, FALSE, 0);
else else
genok = DRLG_L3PlaceMiniSet(L6HOLDWARP, 1, 1, -1, -1, FALSE, 6); genok = DRLG_L3PlaceMiniSet(L6HOLDWARP, 1, 1, -1, -1, FALSE, 6);
@ -2402,8 +2402,7 @@ static void DRLG_L3(int entry)
ViewY -= 2; ViewY -= 2;
#ifdef HELLFIRE #ifdef HELLFIRE
} else { } else {
if ( currlevel != 20 ) if (currlevel != 20) {
{
genok = DRLG_L3PlaceMiniSet(L6DOWN, 1, 1, -1, -1, TRUE, 1); genok = DRLG_L3PlaceMiniSet(L6DOWN, 1, 1, -1, -1, TRUE, 1);
ViewX += 2; ViewX += 2;
ViewY -= 2; ViewY -= 2;
@ -2421,7 +2420,7 @@ static void DRLG_L3(int entry)
genok = DRLG_L3PlaceMiniSet(L3UP, 1, 1, -1, -1, FALSE, 0); genok = DRLG_L3PlaceMiniSet(L3UP, 1, 1, -1, -1, FALSE, 0);
#ifdef HELLFIRE #ifdef HELLFIRE
} else { } else {
if ( currlevel != 17 ) if (currlevel != 17)
genok = DRLG_L3PlaceMiniSet(L6UP, 1, 1, -1, -1, FALSE, 0); genok = DRLG_L3PlaceMiniSet(L6UP, 1, 1, -1, -1, FALSE, 0);
else else
genok = DRLG_L3PlaceMiniSet(L6HOLDWARP, 1, 1, -1, -1, TRUE, 6); genok = DRLG_L3PlaceMiniSet(L6HOLDWARP, 1, 1, -1, -1, TRUE, 6);
@ -2434,7 +2433,7 @@ static void DRLG_L3(int entry)
genok = DRLG_L3PlaceMiniSet(L3DOWN, 1, 1, -1, -1, FALSE, 1); genok = DRLG_L3PlaceMiniSet(L3DOWN, 1, 1, -1, -1, FALSE, 1);
#ifdef HELLFIRE #ifdef HELLFIRE
} else { } else {
if ( currlevel != 20 ) if (currlevel != 20)
genok = DRLG_L3PlaceMiniSet(L6DOWN, 1, 1, -1, -1, FALSE, 1); genok = DRLG_L3PlaceMiniSet(L6DOWN, 1, 1, -1, -1, FALSE, 1);
} }
#endif #endif
@ -2457,7 +2456,7 @@ static void DRLG_L3(int entry)
lavapool += drlg_l3_hive_rnd_piece(byte_48A9C8, 40); lavapool += drlg_l3_hive_rnd_piece(byte_48A9C8, 40);
lavapool += drlg_l3_hive_rnd_piece(byte_48A948, 50); lavapool += drlg_l3_hive_rnd_piece(byte_48A948, 50);
lavapool += drlg_l3_hive_rnd_piece(byte_48A970, 60); lavapool += drlg_l3_hive_rnd_piece(byte_48A970, 60);
if ( lavapool < 3 ) if (lavapool < 3)
lavapool = FALSE; lavapool = FALSE;
} }
#endif #endif

6
Source/drlg_l4.cpp

@ -241,9 +241,9 @@ static void L4makeDmt()
for (j = 0, dmty = 1; dmty <= 77; j++, dmty += 2) { for (j = 0, dmty = 1; dmty <= 77; j++, dmty += 2) {
for (i = 0, dmtx = 1; dmtx <= 77; i++, dmtx += 2) { for (i = 0, dmtx = 1; dmtx <= 77; i++, dmtx += 2) {
val = 8 * L4dungeon[dmtx + 1][dmty + 1] val = 8 * L4dungeon[dmtx + 1][dmty + 1]
+ 4 * L4dungeon[dmtx][dmty + 1] + 4 * L4dungeon[dmtx][dmty + 1]
+ 2 * L4dungeon[dmtx + 1][dmty] + 2 * L4dungeon[dmtx + 1][dmty]
+ L4dungeon[dmtx][dmty]; + L4dungeon[dmtx][dmty];
idx = L4ConvTbl[val]; idx = L4ConvTbl[val];
dungeon[i][j] = idx; dungeon[i][j] = idx;
} }

40
Source/gamemenu.cpp

@ -13,7 +13,7 @@ BOOL jogging_opt = TRUE;
/** Contains the game menu items of the single player menu. */ /** Contains the game menu items of the single player menu. */
TMenuItem sgSingleMenu[] = { TMenuItem sgSingleMenu[] = {
// clang-format off // clang-format off
// dwFlags, pszStr, fnMenu // dwFlags, pszStr, fnMenu
{ GMENU_ENABLED, "Save Game", &gamemenu_save_game }, { GMENU_ENABLED, "Save Game", &gamemenu_save_game },
{ GMENU_ENABLED, "Options", &gamemenu_options }, { GMENU_ENABLED, "Options", &gamemenu_options },
@ -25,11 +25,11 @@ TMenuItem sgSingleMenu[] = {
{ GMENU_ENABLED, "Quit Hellfire", &gamemenu_quit_game }, { GMENU_ENABLED, "Quit Hellfire", &gamemenu_quit_game },
#endif #endif
{ GMENU_ENABLED, NULL, NULL } { GMENU_ENABLED, NULL, NULL }
// clang-format on // clang-format on
}; };
/** Contains the game menu items of the multi player menu. */ /** Contains the game menu items of the multi player menu. */
TMenuItem sgMultiMenu[] = { TMenuItem sgMultiMenu[] = {
// clang-format off // clang-format off
// dwFlags, pszStr, fnMenu // dwFlags, pszStr, fnMenu
{ GMENU_ENABLED, "Options", &gamemenu_options }, { GMENU_ENABLED, "Options", &gamemenu_options },
{ GMENU_ENABLED, "New Game", &gamemenu_new_game }, { GMENU_ENABLED, "New Game", &gamemenu_new_game },
@ -40,10 +40,10 @@ TMenuItem sgMultiMenu[] = {
{ GMENU_ENABLED, "Quit Hellfire", &gamemenu_quit_game }, { GMENU_ENABLED, "Quit Hellfire", &gamemenu_quit_game },
#endif #endif
{ GMENU_ENABLED, NULL, NULL }, { GMENU_ENABLED, NULL, NULL },
// clang-format on // clang-format on
}; };
TMenuItem sgOptionsMenu[] = { TMenuItem sgOptionsMenu[] = {
// clang-format off // clang-format off
// dwFlags, pszStr, fnMenu // dwFlags, pszStr, fnMenu
{ GMENU_ENABLED | GMENU_SLIDER, NULL, &gamemenu_music_volume }, { GMENU_ENABLED | GMENU_SLIDER, NULL, &gamemenu_music_volume },
{ GMENU_ENABLED | GMENU_SLIDER, NULL, &gamemenu_sound_volume }, { GMENU_ENABLED | GMENU_SLIDER, NULL, &gamemenu_sound_volume },
@ -55,7 +55,7 @@ TMenuItem sgOptionsMenu[] = {
#endif #endif
{ GMENU_ENABLED , "Previous Menu", &gamemenu_previous }, { GMENU_ENABLED , "Previous Menu", &gamemenu_previous },
{ GMENU_ENABLED , NULL, NULL }, { GMENU_ENABLED , NULL, NULL },
// clang-format on // clang-format on
}; };
/** Specifies the menu names for music enabled and disabled. */ /** Specifies the menu names for music enabled and disabled. */
const char *const music_toggle_names[] = { const char *const music_toggle_names[] = {
@ -303,17 +303,17 @@ void gamemenu_music_volume(BOOL bActivate)
#else #else
music_start(leveltype); music_start(leveltype);
#endif #endif
} }
} else { } else {
volume = gamemenu_slider_music_sound(&sgOptionsMenu[0]); volume = gamemenu_slider_music_sound(&sgOptionsMenu[0]);
sound_get_or_set_music_volume(volume); sound_get_or_set_music_volume(volume);
if (volume == VOLUME_MIN) { if (volume == VOLUME_MIN) {
if (gbMusicOn) { if (gbMusicOn) {
gbMusicOn = FALSE; gbMusicOn = FALSE;
music_stop(); music_stop();
} }
} else if (!gbMusicOn) { } else if (!gbMusicOn) {
gbMusicOn = TRUE; gbMusicOn = TRUE;
#ifdef HELLFIRE #ifdef HELLFIRE
int lt; int lt;
if (currlevel >= 17) { if (currlevel >= 17) {
@ -327,9 +327,9 @@ void gamemenu_music_volume(BOOL bActivate)
#else #else
music_start(leveltype); music_start(leveltype);
#endif #endif
} }
} }
gamemenu_get_music(); gamemenu_get_music();
} }
void gamemenu_sound_volume(BOOL bActivate) void gamemenu_sound_volume(BOOL bActivate)

4
Source/gendung.cpp

@ -176,7 +176,7 @@ void FillSolidBlockTbls()
break; break;
case DTYPE_CATHEDRAL: case DTYPE_CATHEDRAL:
#ifdef HELLFIRE #ifdef HELLFIRE
if ( currlevel < 17 ) if (currlevel < 17)
pSBFile = LoadFileInMem("Levels\\L1Data\\L1.SOL", &dwTiles); pSBFile = LoadFileInMem("Levels\\L1Data\\L1.SOL", &dwTiles);
else else
pSBFile = LoadFileInMem("NLevels\\L5Data\\L5.SOL", &dwTiles); pSBFile = LoadFileInMem("NLevels\\L5Data\\L5.SOL", &dwTiles);
@ -189,7 +189,7 @@ void FillSolidBlockTbls()
break; break;
case DTYPE_CAVES: case DTYPE_CAVES:
#ifdef HELLFIRE #ifdef HELLFIRE
if ( currlevel < 17 ) if (currlevel < 17)
pSBFile = LoadFileInMem("Levels\\L3Data\\L3.SOL", &dwTiles); pSBFile = LoadFileInMem("Levels\\L3Data\\L3.SOL", &dwTiles);
else else
pSBFile = LoadFileInMem("NLevels\\L6Data\\L6.SOL", &dwTiles); pSBFile = LoadFileInMem("NLevels\\L6Data\\L6.SOL", &dwTiles);

2
Source/gmenu.cpp

@ -236,7 +236,7 @@ void gmenu_draw()
#ifdef HELLFIRE #ifdef HELLFIRE
ticks = GetTickCount(); ticks = GetTickCount();
if ((int)(ticks - LogoAnim_tick) > 25) { if ((int)(ticks - LogoAnim_tick) > 25) {
LogoAnim_frame++; LogoAnim_frame++;
if (LogoAnim_frame > 16) if (LogoAnim_frame > 16)
LogoAnim_frame = 1; LogoAnim_frame = 1;
LogoAnim_tick = ticks; LogoAnim_tick = ticks;

91
Source/inv.cpp

@ -228,7 +228,7 @@ void DrawInv()
#ifdef HELLFIRE #ifdef HELLFIRE
if (frame <= 179) { if (frame <= 179) {
#endif #endif
CelBlitOutline(color, RIGHT_PANEL_X + 133, 59 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8); CelBlitOutline(color, RIGHT_PANEL_X + 133, 59 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8);
#ifdef HELLFIRE #ifdef HELLFIRE
} else { } else {
CelBlitOutline(color, RIGHT_PANEL_X + 133, 59 + SCREEN_Y, pCursCels2, frame - 179, frame_width, 0, 8); CelBlitOutline(color, RIGHT_PANEL_X + 133, 59 + SCREEN_Y, pCursCels2, frame - 179, frame_width, 0, 8);
@ -250,7 +250,7 @@ void DrawInv()
#ifdef HELLFIRE #ifdef HELLFIRE
if (frame <= 179) { if (frame <= 179) {
#endif #endif
CelDrawLightRed(RIGHT_PANEL_X + 133, 59 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8, 1); CelDrawLightRed(RIGHT_PANEL_X + 133, 59 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8, 1);
#ifdef HELLFIRE #ifdef HELLFIRE
} else { } else {
CelDrawLightRed(RIGHT_PANEL_X + 133, 59 + SCREEN_Y, pCursCels2, frame - 179, frame_width, 0, 8, 1); CelDrawLightRed(RIGHT_PANEL_X + 133, 59 + SCREEN_Y, pCursCels2, frame - 179, frame_width, 0, 8, 1);
@ -276,7 +276,7 @@ void DrawInv()
#ifdef HELLFIRE #ifdef HELLFIRE
if (frame <= 179) { if (frame <= 179) {
#endif #endif
CelBlitOutline(color, RIGHT_PANEL_X + 48, 205 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8); CelBlitOutline(color, RIGHT_PANEL_X + 48, 205 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8);
#ifdef HELLFIRE #ifdef HELLFIRE
} else { } else {
CelBlitOutline(color, RIGHT_PANEL_X + 48, 205 + SCREEN_Y, pCursCels2, frame - 179, frame_width, 0, 8); CelBlitOutline(color, RIGHT_PANEL_X + 48, 205 + SCREEN_Y, pCursCels2, frame - 179, frame_width, 0, 8);
@ -288,7 +288,7 @@ void DrawInv()
#ifdef HELLFIRE #ifdef HELLFIRE
if (frame <= 179) { if (frame <= 179) {
#endif #endif
CelClippedDraw(RIGHT_PANEL_X + 48, 205 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8); CelClippedDraw(RIGHT_PANEL_X + 48, 205 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8);
#ifdef HELLFIRE #ifdef HELLFIRE
} else { } else {
CelClippedDraw(RIGHT_PANEL_X + 48, 205 + SCREEN_Y, pCursCels2, frame - 179, frame_width, 0, 8); CelClippedDraw(RIGHT_PANEL_X + 48, 205 + SCREEN_Y, pCursCels2, frame - 179, frame_width, 0, 8);
@ -298,7 +298,7 @@ void DrawInv()
#ifdef HELLFIRE #ifdef HELLFIRE
if (frame <= 179) { if (frame <= 179) {
#endif #endif
CelDrawLightRed(RIGHT_PANEL_X + 48, 205 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8, 1); CelDrawLightRed(RIGHT_PANEL_X + 48, 205 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8, 1);
#ifdef HELLFIRE #ifdef HELLFIRE
} else { } else {
CelDrawLightRed(RIGHT_PANEL_X + 48, 205 + SCREEN_Y, pCursCels2, frame - 179, frame_width, 0, 8, 1); CelDrawLightRed(RIGHT_PANEL_X + 48, 205 + SCREEN_Y, pCursCels2, frame - 179, frame_width, 0, 8, 1);
@ -324,7 +324,7 @@ void DrawInv()
#ifdef HELLFIRE #ifdef HELLFIRE
if (frame <= 179) { if (frame <= 179) {
#endif #endif
CelBlitOutline(color, RIGHT_PANEL_X + 249, 205 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8); CelBlitOutline(color, RIGHT_PANEL_X + 249, 205 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8);
#ifdef HELLFIRE #ifdef HELLFIRE
} else { } else {
CelBlitOutline(color, RIGHT_PANEL_X + 249, 205 + SCREEN_Y, pCursCels2, frame - 179, frame_width, 0, 8); CelBlitOutline(color, RIGHT_PANEL_X + 249, 205 + SCREEN_Y, pCursCels2, frame - 179, frame_width, 0, 8);
@ -336,7 +336,7 @@ void DrawInv()
#ifdef HELLFIRE #ifdef HELLFIRE
if (frame <= 179) { if (frame <= 179) {
#endif #endif
CelClippedDraw(RIGHT_PANEL_X + 249, 205 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8); CelClippedDraw(RIGHT_PANEL_X + 249, 205 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8);
#ifdef HELLFIRE #ifdef HELLFIRE
} else { } else {
CelClippedDraw(RIGHT_PANEL_X + 249, 205 + SCREEN_Y, pCursCels2, frame - 179, frame_width, 0, 8); CelClippedDraw(RIGHT_PANEL_X + 249, 205 + SCREEN_Y, pCursCels2, frame - 179, frame_width, 0, 8);
@ -346,7 +346,7 @@ void DrawInv()
#ifdef HELLFIRE #ifdef HELLFIRE
if (frame <= 179) { if (frame <= 179) {
#endif #endif
CelDrawLightRed(RIGHT_PANEL_X + 249, 205 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8, 1); CelDrawLightRed(RIGHT_PANEL_X + 249, 205 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8, 1);
#ifdef HELLFIRE #ifdef HELLFIRE
} else { } else {
CelDrawLightRed(RIGHT_PANEL_X + 249, 205 + SCREEN_Y, pCursCels2, frame - 179, frame_width, 0, 8, 1); CelDrawLightRed(RIGHT_PANEL_X + 249, 205 + SCREEN_Y, pCursCels2, frame - 179, frame_width, 0, 8, 1);
@ -372,7 +372,7 @@ void DrawInv()
#ifdef HELLFIRE #ifdef HELLFIRE
if (frame <= 179) { if (frame <= 179) {
#endif #endif
CelBlitOutline(color, RIGHT_PANEL_X + 205, 60 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8); CelBlitOutline(color, RIGHT_PANEL_X + 205, 60 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8);
#ifdef HELLFIRE #ifdef HELLFIRE
} else { } else {
CelBlitOutline(color, RIGHT_PANEL_X + 205, 60 + SCREEN_Y, pCursCels2, frame - 179, frame_width, 0, 8); CelBlitOutline(color, RIGHT_PANEL_X + 205, 60 + SCREEN_Y, pCursCels2, frame - 179, frame_width, 0, 8);
@ -384,7 +384,7 @@ void DrawInv()
#ifdef HELLFIRE #ifdef HELLFIRE
if (frame <= 179) { if (frame <= 179) {
#endif #endif
CelClippedDraw(RIGHT_PANEL_X + 205, 60 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8); CelClippedDraw(RIGHT_PANEL_X + 205, 60 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8);
#ifdef HELLFIRE #ifdef HELLFIRE
} else { } else {
CelClippedDraw(RIGHT_PANEL_X + 205, 60 + SCREEN_Y, pCursCels2, frame - 179, frame_width, 0, 8); CelClippedDraw(RIGHT_PANEL_X + 205, 60 + SCREEN_Y, pCursCels2, frame - 179, frame_width, 0, 8);
@ -394,7 +394,7 @@ void DrawInv()
#ifdef HELLFIRE #ifdef HELLFIRE
if (frame <= 179) { if (frame <= 179) {
#endif #endif
CelDrawLightRed(RIGHT_PANEL_X + 205, 60 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8, 1); CelDrawLightRed(RIGHT_PANEL_X + 205, 60 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8, 1);
#ifdef HELLFIRE #ifdef HELLFIRE
} else { } else {
CelDrawLightRed(RIGHT_PANEL_X + 205, 60 + SCREEN_Y, pCursCels2, frame - 179, frame_width, 0, 8, 1); CelDrawLightRed(RIGHT_PANEL_X + 205, 60 + SCREEN_Y, pCursCels2, frame - 179, frame_width, 0, 8, 1);
@ -423,7 +423,7 @@ void DrawInv()
#ifdef HELLFIRE #ifdef HELLFIRE
if (frame <= 179) { if (frame <= 179) {
#endif #endif
CelBlitOutline(color, screen_x, screen_y, pCursCels, frame, frame_width, 0, 8); CelBlitOutline(color, screen_x, screen_y, pCursCels, frame, frame_width, 0, 8);
#ifdef HELLFIRE #ifdef HELLFIRE
} else { } else {
CelBlitOutline(color, screen_x, screen_y, pCursCels2, frame - 179, frame_width, 0, 8); CelBlitOutline(color, screen_x, screen_y, pCursCels2, frame - 179, frame_width, 0, 8);
@ -435,7 +435,7 @@ void DrawInv()
#ifdef HELLFIRE #ifdef HELLFIRE
if (frame <= 179) { if (frame <= 179) {
#endif #endif
CelClippedDraw(screen_x, screen_y, pCursCels, frame, frame_width, 0, 8); CelClippedDraw(screen_x, screen_y, pCursCels, frame, frame_width, 0, 8);
#ifdef HELLFIRE #ifdef HELLFIRE
} else { } else {
CelClippedDraw(screen_x, screen_y, pCursCels2, frame - 179, frame_width, 0, 8); CelClippedDraw(screen_x, screen_y, pCursCels2, frame - 179, frame_width, 0, 8);
@ -445,7 +445,7 @@ void DrawInv()
#ifdef HELLFIRE #ifdef HELLFIRE
if (frame <= 179) { if (frame <= 179) {
#endif #endif
CelDrawLightRed(screen_x, screen_y, pCursCels, frame, frame_width, 0, 8, 1); CelDrawLightRed(screen_x, screen_y, pCursCels, frame, frame_width, 0, 8, 1);
#ifdef HELLFIRE #ifdef HELLFIRE
} else { } else {
CelDrawLightRed(screen_x, screen_y, pCursCels2, frame - 179, frame_width, 0, 8, 1); CelDrawLightRed(screen_x, screen_y, pCursCels2, frame - 179, frame_width, 0, 8, 1);
@ -464,8 +464,8 @@ void DrawInv()
cel_transparency_active = TRUE; cel_transparency_active = TRUE;
pBuff = frame_width == INV_SLOT_SIZE_PX pBuff = frame_width == INV_SLOT_SIZE_PX
? &gpBuffer[SCREENXY(RIGHT_PANEL_X + 197, SCREEN_Y)] ? &gpBuffer[SCREENXY(RIGHT_PANEL_X + 197, SCREEN_Y)]
: &gpBuffer[SCREENXY(RIGHT_PANEL_X + 183, SCREEN_Y)]; : &gpBuffer[SCREENXY(RIGHT_PANEL_X + 183, SCREEN_Y)];
#ifdef HELLFIRE #ifdef HELLFIRE
if (frame <= 179) { if (frame <= 179) {
#endif #endif
@ -502,7 +502,7 @@ void DrawInv()
#ifdef HELLFIRE #ifdef HELLFIRE
if (frame <= 179) { if (frame <= 179) {
#endif #endif
CelBlitOutline(color, screen_x, screen_y, pCursCels, frame, frame_width, 0, 8); CelBlitOutline(color, screen_x, screen_y, pCursCels, frame, frame_width, 0, 8);
#ifdef HELLFIRE #ifdef HELLFIRE
} else { } else {
CelBlitOutline(color, screen_x, screen_y, pCursCels2, frame - 179, frame_width, 0, 8); CelBlitOutline(color, screen_x, screen_y, pCursCels2, frame - 179, frame_width, 0, 8);
@ -514,7 +514,7 @@ void DrawInv()
#ifdef HELLFIRE #ifdef HELLFIRE
if (frame <= 179) { if (frame <= 179) {
#endif #endif
CelClippedDraw(screen_x, screen_y, pCursCels, frame, frame_width, 0, 8); CelClippedDraw(screen_x, screen_y, pCursCels, frame, frame_width, 0, 8);
#ifdef HELLFIRE #ifdef HELLFIRE
} else { } else {
CelClippedDraw(screen_x, screen_y, pCursCels2, frame - 179, frame_width, 0, 8); CelClippedDraw(screen_x, screen_y, pCursCels2, frame - 179, frame_width, 0, 8);
@ -524,7 +524,7 @@ void DrawInv()
#ifdef HELLFIRE #ifdef HELLFIRE
if (frame <= 179) { if (frame <= 179) {
#endif #endif
CelDrawLightRed(screen_x, screen_y, pCursCels, frame, frame_width, 0, 8, 1); CelDrawLightRed(screen_x, screen_y, pCursCels, frame, frame_width, 0, 8, 1);
#ifdef HELLFIRE #ifdef HELLFIRE
} else { } else {
CelDrawLightRed(screen_x, screen_y, pCursCels2, frame - 179, frame_width, 0, 8, 1); CelDrawLightRed(screen_x, screen_y, pCursCels2, frame - 179, frame_width, 0, 8, 1);
@ -550,7 +550,7 @@ void DrawInv()
#ifdef HELLFIRE #ifdef HELLFIRE
if (frame <= 179) { if (frame <= 179) {
#endif #endif
CelBlitOutline(color, RIGHT_PANEL_X + 133, 160 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8); CelBlitOutline(color, RIGHT_PANEL_X + 133, 160 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8);
#ifdef HELLFIRE #ifdef HELLFIRE
} else { } else {
CelBlitOutline(color, RIGHT_PANEL_X + 133, 160 + SCREEN_Y, pCursCels2, frame - 179, frame_width, 0, 8); CelBlitOutline(color, RIGHT_PANEL_X + 133, 160 + SCREEN_Y, pCursCels2, frame - 179, frame_width, 0, 8);
@ -562,7 +562,7 @@ void DrawInv()
#ifdef HELLFIRE #ifdef HELLFIRE
if (frame <= 179) { if (frame <= 179) {
#endif #endif
CelClippedDraw(RIGHT_PANEL_X + 133, 160 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8); CelClippedDraw(RIGHT_PANEL_X + 133, 160 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8);
#ifdef HELLFIRE #ifdef HELLFIRE
} else { } else {
CelClippedDraw(RIGHT_PANEL_X + 133, 160 + SCREEN_Y, pCursCels2, frame - 179, frame_width, 0, 8); CelClippedDraw(RIGHT_PANEL_X + 133, 160 + SCREEN_Y, pCursCels2, frame - 179, frame_width, 0, 8);
@ -572,7 +572,7 @@ void DrawInv()
#ifdef HELLFIRE #ifdef HELLFIRE
if (frame <= 179) { if (frame <= 179) {
#endif #endif
CelDrawLightRed(RIGHT_PANEL_X + 133, 160 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8, 1); CelDrawLightRed(RIGHT_PANEL_X + 133, 160 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8, 1);
#ifdef HELLFIRE #ifdef HELLFIRE
} else { } else {
CelDrawLightRed(RIGHT_PANEL_X + 133, 160 + SCREEN_Y, pCursCels2, frame - 179, frame_width, 0, 8, 1); CelDrawLightRed(RIGHT_PANEL_X + 133, 160 + SCREEN_Y, pCursCels2, frame - 179, frame_width, 0, 8, 1);
@ -612,11 +612,11 @@ void DrawInv()
#ifdef HELLFIRE #ifdef HELLFIRE
if (frame <= 179) { if (frame <= 179) {
#endif #endif
CelBlitOutline( CelBlitOutline(
color, color,
InvRect[j + SLOTXY_INV_FIRST].X + SCREEN_X, InvRect[j + SLOTXY_INV_FIRST].X + SCREEN_X,
InvRect[j + SLOTXY_INV_FIRST].Y + SCREEN_Y - 1, InvRect[j + SLOTXY_INV_FIRST].Y + SCREEN_Y - 1,
pCursCels, frame, frame_width, 0, 8); pCursCels, frame, frame_width, 0, 8);
#ifdef HELLFIRE #ifdef HELLFIRE
} else { } else {
CelBlitOutline( CelBlitOutline(
@ -632,10 +632,10 @@ void DrawInv()
#ifdef HELLFIRE #ifdef HELLFIRE
if (frame <= 179) { if (frame <= 179) {
#endif #endif
CelClippedDraw( CelClippedDraw(
InvRect[j + SLOTXY_INV_FIRST].X + SCREEN_X, InvRect[j + SLOTXY_INV_FIRST].X + SCREEN_X,
InvRect[j + SLOTXY_INV_FIRST].Y + SCREEN_Y - 1, InvRect[j + SLOTXY_INV_FIRST].Y + SCREEN_Y - 1,
pCursCels, frame, frame_width, 0, 8); pCursCels, frame, frame_width, 0, 8);
#ifdef HELLFIRE #ifdef HELLFIRE
} else { } else {
CelClippedDraw( CelClippedDraw(
@ -648,10 +648,10 @@ void DrawInv()
#ifdef HELLFIRE #ifdef HELLFIRE
if (frame <= 179) { if (frame <= 179) {
#endif #endif
CelDrawLightRed( CelDrawLightRed(
InvRect[j + SLOTXY_INV_FIRST].X + SCREEN_X, InvRect[j + SLOTXY_INV_FIRST].X + SCREEN_X,
InvRect[j + SLOTXY_INV_FIRST].Y + SCREEN_Y - 1, InvRect[j + SLOTXY_INV_FIRST].Y + SCREEN_Y - 1,
pCursCels, frame, frame_width, 0, 8, 1); pCursCels, frame, frame_width, 0, 8, 1);
#ifdef HELLFIRE #ifdef HELLFIRE
} else { } else {
CelDrawLightRed( CelDrawLightRed(
@ -694,7 +694,7 @@ void DrawInvBelt()
#ifdef HELLFIRE #ifdef HELLFIRE
if (frame <= 179) if (frame <= 179)
#endif #endif
CelBlitOutline(color, InvRect[i + SLOTXY_BELT_FIRST].X + SCREEN_X, InvRect[i + SLOTXY_BELT_FIRST].Y + SCREEN_Y - 1, pCursCels, frame, frame_width, 0, 8); CelBlitOutline(color, InvRect[i + SLOTXY_BELT_FIRST].X + SCREEN_X, InvRect[i + SLOTXY_BELT_FIRST].Y + SCREEN_Y - 1, pCursCels, frame, frame_width, 0, 8);
#ifdef HELLFIRE #ifdef HELLFIRE
else else
CelBlitOutline(color, InvRect[i + SLOTXY_BELT_FIRST].X + SCREEN_X, InvRect[i + SLOTXY_BELT_FIRST].Y + SCREEN_Y - 1, pCursCels2, frame - 179, frame_width, 0, 8); CelBlitOutline(color, InvRect[i + SLOTXY_BELT_FIRST].X + SCREEN_X, InvRect[i + SLOTXY_BELT_FIRST].Y + SCREEN_Y - 1, pCursCels2, frame - 179, frame_width, 0, 8);
@ -705,7 +705,7 @@ void DrawInvBelt()
#ifdef HELLFIRE #ifdef HELLFIRE
if (frame <= 179) if (frame <= 179)
#endif #endif
CelClippedDraw(InvRect[i + SLOTXY_BELT_FIRST].X + SCREEN_X, InvRect[i + SLOTXY_BELT_FIRST].Y + SCREEN_Y - 1, pCursCels, frame, frame_width, 0, 8); CelClippedDraw(InvRect[i + SLOTXY_BELT_FIRST].X + SCREEN_X, InvRect[i + SLOTXY_BELT_FIRST].Y + SCREEN_Y - 1, pCursCels, frame, frame_width, 0, 8);
#ifdef HELLFIRE #ifdef HELLFIRE
else else
CelClippedDraw(InvRect[i + SLOTXY_BELT_FIRST].X + SCREEN_X, InvRect[i + SLOTXY_BELT_FIRST].Y + SCREEN_Y - 1, pCursCels2, frame - 179, frame_width, 0, 8); CelClippedDraw(InvRect[i + SLOTXY_BELT_FIRST].X + SCREEN_X, InvRect[i + SLOTXY_BELT_FIRST].Y + SCREEN_Y - 1, pCursCels2, frame - 179, frame_width, 0, 8);
@ -714,7 +714,7 @@ void DrawInvBelt()
#ifdef HELLFIRE #ifdef HELLFIRE
if (frame <= 179) if (frame <= 179)
#endif #endif
CelDrawLightRed(InvRect[i + SLOTXY_BELT_FIRST].X + SCREEN_X, InvRect[i + SLOTXY_BELT_FIRST].Y + SCREEN_Y - 1, pCursCels, frame, frame_width, 0, 8, 1); CelDrawLightRed(InvRect[i + SLOTXY_BELT_FIRST].X + SCREEN_X, InvRect[i + SLOTXY_BELT_FIRST].Y + SCREEN_Y - 1, pCursCels, frame, frame_width, 0, 8, 1);
#ifdef HELLFIRE #ifdef HELLFIRE
else else
CelDrawLightRed(InvRect[i + SLOTXY_BELT_FIRST].X + SCREEN_X, InvRect[i + SLOTXY_BELT_FIRST].Y + SCREEN_Y - 1, pCursCels2, frame - 179, frame_width, 0, 8, 1); CelDrawLightRed(InvRect[i + SLOTXY_BELT_FIRST].X + SCREEN_X, InvRect[i + SLOTXY_BELT_FIRST].Y + SCREEN_Y - 1, pCursCels2, frame - 179, frame_width, 0, 8, 1);
@ -1095,13 +1095,12 @@ void CheckInvPaste(int pnum, int mx, int my)
done = TRUE; done = TRUE;
if (il == ILOC_ONEHAND && plr[pnum].HoldItem._iLoc == ILOC_TWOHAND) { if (il == ILOC_ONEHAND && plr[pnum].HoldItem._iLoc == ILOC_TWOHAND) {
#ifdef HELLFIRE #ifdef HELLFIRE
if (plr[pnum]._pClass == PC_BARBARIAN if (plr[pnum]._pClass == PC_BARBARIAN
&& (plr[pnum].HoldItem._itype == ITYPE_SWORD || plr[pnum].HoldItem._itype == ITYPE_MACE) && (plr[pnum].HoldItem._itype == ITYPE_SWORD || plr[pnum].HoldItem._itype == ITYPE_MACE))
) il = ILOC_ONEHAND;
il = ILOC_ONEHAND; else
else
#endif #endif
il = ILOC_TWOHAND; il = ILOC_TWOHAND;
done = TRUE; done = TRUE;
} }
if (plr[pnum].HoldItem._iLoc == ILOC_UNEQUIPABLE && il == ILOC_BELT) { if (plr[pnum].HoldItem._iLoc == ILOC_UNEQUIPABLE && il == ILOC_BELT) {
@ -2761,9 +2760,9 @@ void UseStaffCharge(int pnum)
if (plr[pnum].InvBody[INVLOC_HAND_LEFT]._itype != ITYPE_NONE if (plr[pnum].InvBody[INVLOC_HAND_LEFT]._itype != ITYPE_NONE
&& (plr[pnum].InvBody[INVLOC_HAND_LEFT]._iMiscId == IMISC_STAFF && (plr[pnum].InvBody[INVLOC_HAND_LEFT]._iMiscId == IMISC_STAFF
#ifdef HELLFIRE #ifdef HELLFIRE
|| plr[myplr].InvBody[INVLOC_HAND_LEFT]._iMiscId == IMISC_UNIQUE // BUGFIX: myplr->pnum || plr[myplr].InvBody[INVLOC_HAND_LEFT]._iMiscId == IMISC_UNIQUE // BUGFIX: myplr->pnum
#endif #endif
) )
&& plr[pnum].InvBody[INVLOC_HAND_LEFT]._iSpell == plr[pnum]._pRSpell && plr[pnum].InvBody[INVLOC_HAND_LEFT]._iSpell == plr[pnum]._pRSpell
&& plr[pnum].InvBody[INVLOC_HAND_LEFT]._iCharges > 0) { && plr[pnum].InvBody[INVLOC_HAND_LEFT]._iCharges > 0) {
plr[pnum].InvBody[INVLOC_HAND_LEFT]._iCharges--; plr[pnum].InvBody[INVLOC_HAND_LEFT]._iCharges--;

3
Source/inv.h

@ -37,7 +37,8 @@ void DrawInvMsg(const char *msg);
int InvPutItem(int pnum, int x, int y); 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 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 #ifdef HELLFIRE
, int to_hit, int max_dam, int min_str, int min_mag, int min_dex, int ac ,
int to_hit, int max_dam, int min_str, int min_mag, int min_dex, int ac
#endif #endif
); );
char CheckInvHLight(); char CheckInvHLight();

2
Source/itemdat.cpp

@ -323,7 +323,7 @@ const PLStruct PL_Prefix[] = {
/** Contains the data related to each item suffix. */ /** Contains the data related to each item suffix. */
const PLStruct PL_Suffix[] = { const PLStruct PL_Suffix[] = {
// clang-format off // clang-format off
// PLName, PLPower, PLParam1, PLParam2, PLMinLvl, PLIType, PLGOE, PLDouble, PLOk, PLMinVal, PLMaxVal, PLMultVal // PLName, PLPower, PLParam1, PLParam2, PLMinLvl, PLIType, PLGOE, PLDouble, PLOk, PLMinVal, PLMaxVal, PLMultVal
#ifdef HELLFIRE #ifdef HELLFIRE
{ "quality", IPL_DAMMOD, 1, 2, 2, PLT_WEAP | PLT_STAFF | PLT_BOW , 0, FALSE, TRUE, 100, 200, 2 }, { "quality", IPL_DAMMOD, 1, 2, 2, PLT_WEAP | PLT_STAFF | PLT_BOW , 0, FALSE, TRUE, 100, 200, 2 },

71
Source/items.cpp

@ -304,6 +304,7 @@ char *off_4A5AC4 = "SItem";
int idoppely = 16; int idoppely = 16;
/** Maps from Griswold premium item number to a quality level delta as added to the base quality level. */ /** Maps from Griswold premium item number to a quality level delta as added to the base quality level. */
int premiumlvladd[SMITH_PREMIUM_ITEMS] = { int premiumlvladd[SMITH_PREMIUM_ITEMS] = {
// clang-format off
-1, -1,
-1, -1,
#ifdef HELLFIRE #ifdef HELLFIRE
@ -325,6 +326,7 @@ int premiumlvladd[SMITH_PREMIUM_ITEMS] = {
3, 3,
3, 3,
#endif #endif
// clang-format on
}; };
#ifdef HELLFIRE #ifdef HELLFIRE
@ -436,14 +438,14 @@ int items_42342E(int i)
res = 0; res = 0;
for (j = 0; j < NUM_INVLOC; j++) { for (j = 0; j < NUM_INVLOC; j++) {
if (plr[i].InvBody[j]._iClass != ITYPE_NONE && if (plr[i].InvBody[j]._iClass != ITYPE_NONE
(plr[i].InvBody[j]._itype == ITYPE_LARMOR || plr[i].InvBody[j]._itype == ITYPE_MARMOR || plr[i].InvBody[j]._itype == ITYPE_HARMOR) && (plr[i].InvBody[j]._itype == ITYPE_LARMOR || plr[i].InvBody[j]._itype == ITYPE_MARMOR || plr[i].InvBody[j]._itype == ITYPE_HARMOR)
&& res < plr[i].InvBody[j]._iIvalue) && res < plr[i].InvBody[j]._iIvalue)
res = plr[i].InvBody[j]._iIvalue; res = plr[i].InvBody[j]._iIvalue;
} }
for (j = 0; j < NUM_INV_GRID_ELEM; j++) { for (j = 0; j < NUM_INV_GRID_ELEM; j++) {
if (plr[i].InvList[j]._iClass != ITYPE_NONE && if (plr[i].InvList[j]._iClass != ITYPE_NONE
(plr[i].InvList[j]._itype == ITYPE_LARMOR || plr[i].InvList[j]._itype == ITYPE_MARMOR || plr[i].InvList[j]._itype == ITYPE_HARMOR) && (plr[i].InvList[j]._itype == ITYPE_LARMOR || plr[i].InvList[j]._itype == ITYPE_MARMOR || plr[i].InvList[j]._itype == ITYPE_HARMOR)
&& res < plr[i].InvList[j]._iIvalue) && res < plr[i].InvList[j]._iIvalue)
res = plr[i].InvList[j]._iIvalue; res = plr[i].InvList[j]._iIvalue;
} }
@ -893,9 +895,9 @@ void CalcPlrItemVals(int p, BOOL Loadgfx)
else if (plr[p].InvBody[INVLOC_HAND_RIGHT]._itype == ITYPE_SHIELD) else if (plr[p].InvBody[INVLOC_HAND_RIGHT]._itype == ITYPE_SHIELD)
plr[p]._pIAC -= plr[p].InvBody[INVLOC_HAND_RIGHT]._iAC / 2; plr[p]._pIAC -= plr[p].InvBody[INVLOC_HAND_RIGHT]._iAC / 2;
} else if (plr[p].InvBody[INVLOC_HAND_LEFT]._itype != ITYPE_STAFF && plr[p].InvBody[INVLOC_HAND_RIGHT]._itype != ITYPE_STAFF && plr[p].InvBody[INVLOC_HAND_LEFT]._itype != ITYPE_BOW && plr[p].InvBody[INVLOC_HAND_RIGHT]._itype != ITYPE_BOW) { } else if (plr[p].InvBody[INVLOC_HAND_LEFT]._itype != ITYPE_STAFF && plr[p].InvBody[INVLOC_HAND_RIGHT]._itype != ITYPE_STAFF && plr[p].InvBody[INVLOC_HAND_LEFT]._itype != ITYPE_BOW && plr[p].InvBody[INVLOC_HAND_RIGHT]._itype != ITYPE_BOW) {
plr[p]._pDamageMod += plr[p]._pLevel * plr[p]._pVitality / 100; plr[p]._pDamageMod += plr[p]._pLevel * plr[p]._pVitality / 100;
} }
plr[p]._pIAC += plr[p]._pLevel/4; plr[p]._pIAC += plr[p]._pLevel / 4;
} }
#endif #endif
else { else {
@ -1744,12 +1746,12 @@ void GetBookSpell(int i, int lvl)
#ifdef HELLFIRE #ifdef HELLFIRE
else else
#endif #endif
if (spelldata[bs].sType == STYPE_LIGHTNING) if (spelldata[bs].sType == STYPE_LIGHTNING)
item[i]._iCurs = ICURS_BOOK_BLUE; item[i]._iCurs = ICURS_BOOK_BLUE;
#ifdef HELLFIRE #ifdef HELLFIRE
else else
#endif #endif
if (spelldata[bs].sType == STYPE_MAGIC) if (spelldata[bs].sType == STYPE_MAGIC)
item[i]._iCurs = ICURS_BOOK_GREY; item[i]._iCurs = ICURS_BOOK_GREY;
} }
@ -2568,7 +2570,7 @@ void GetItemBonus(int i, int idata, int minlvl, int maxlvl, BOOL onlygood)
#ifdef HELLFIRE #ifdef HELLFIRE
if (allowspells) if (allowspells)
#endif #endif
GetStaffSpell(i, maxlvl, onlygood); GetStaffSpell(i, maxlvl, onlygood);
#ifdef HELLFIRE #ifdef HELLFIRE
else else
GetItemPower(i, minlvl, maxlvl, 0x100, onlygood); GetItemPower(i, minlvl, maxlvl, 0x100, onlygood);
@ -2626,7 +2628,7 @@ int RndItem(int m)
for (i = 0; AllItemsList[i].iLoc != ILOC_INVALID; i++) { for (i = 0; AllItemsList[i].iLoc != ILOC_INVALID; i++) {
if (AllItemsList[i].iRnd == IDROP_DOUBLE && monster[m].mLevel >= AllItemsList[i].iMinMLvl if (AllItemsList[i].iRnd == IDROP_DOUBLE && monster[m].mLevel >= AllItemsList[i].iMinMLvl
#ifdef HELLFIRE #ifdef HELLFIRE
&& ri < 512 && ri < 512
#endif #endif
) { ) {
ril[ri] = i; ril[ri] = i;
@ -2634,7 +2636,7 @@ int RndItem(int m)
} }
if (AllItemsList[i].iRnd && monster[m].mLevel >= AllItemsList[i].iMinMLvl if (AllItemsList[i].iRnd && monster[m].mLevel >= AllItemsList[i].iMinMLvl
#ifdef HELLFIRE #ifdef HELLFIRE
&& ri < 512 && ri < 512
#endif #endif
) { ) {
ril[ri] = i; ril[ri] = i;
@ -4010,7 +4012,7 @@ void PrintItemPower(char plidx, ItemStruct *x)
sprintf(tempstr, "Fire hit damage: %i", x->_iFMinDam); sprintf(tempstr, "Fire hit damage: %i", x->_iFMinDam);
else else
#endif #endif
sprintf(tempstr, "Fire hit damage: %i-%i", x->_iFMinDam, x->_iFMaxDam); sprintf(tempstr, "Fire hit damage: %i-%i", x->_iFMinDam, x->_iFMaxDam);
break; break;
case IPL_LIGHTDAM: case IPL_LIGHTDAM:
#ifdef HELLFIRE #ifdef HELLFIRE
@ -4018,7 +4020,7 @@ void PrintItemPower(char plidx, ItemStruct *x)
sprintf(tempstr, "Lightning hit damage: %i", x->_iLMinDam); sprintf(tempstr, "Lightning hit damage: %i", x->_iLMinDam);
else else
#endif #endif
sprintf(tempstr, "Lightning hit damage: %i-%i", x->_iLMinDam, x->_iLMaxDam); sprintf(tempstr, "Lightning hit damage: %i-%i", x->_iLMinDam, x->_iLMaxDam);
break; break;
case IPL_STR: case IPL_STR:
case IPL_STR_CURSE: case IPL_STR_CURSE:
@ -4078,7 +4080,7 @@ void PrintItemPower(char plidx, ItemStruct *x)
sprintf(tempstr, "fire arrows damage: %i", x->_iFMinDam); sprintf(tempstr, "fire arrows damage: %i", x->_iFMinDam);
else else
#endif #endif
sprintf(tempstr, "fire arrows damage: %i-%i", x->_iFMinDam, x->_iFMaxDam); sprintf(tempstr, "fire arrows damage: %i-%i", x->_iFMinDam, x->_iFMaxDam);
break; break;
case IPL_LIGHT_ARROWS: case IPL_LIGHT_ARROWS:
#ifdef HELLFIRE #ifdef HELLFIRE
@ -4086,7 +4088,7 @@ void PrintItemPower(char plidx, ItemStruct *x)
sprintf(tempstr, "lightning arrows damage %i", x->_iLMinDam); sprintf(tempstr, "lightning arrows damage %i", x->_iLMinDam);
else else
#endif #endif
sprintf(tempstr, "lightning arrows damage %i-%i", x->_iLMinDam, x->_iLMaxDam); sprintf(tempstr, "lightning arrows damage %i-%i", x->_iLMinDam, x->_iLMaxDam);
break; break;
case IPL_THORNS: case IPL_THORNS:
strcpy(tempstr, "attacker takes 1-3 damage"); strcpy(tempstr, "attacker takes 1-3 damage");
@ -4431,7 +4433,7 @@ void PrintItemDetails(ItemStruct *x)
sprintf(tempstr, "damage: %i Dur: %i/%i", x->_iMinDam, x->_iDurability, x->_iMaxDur); sprintf(tempstr, "damage: %i Dur: %i/%i", x->_iMinDam, x->_iDurability, x->_iMaxDur);
} else } else
#endif #endif
if (x->_iMaxDur == DUR_INDESTRUCTIBLE) if (x->_iMaxDur == DUR_INDESTRUCTIBLE)
sprintf(tempstr, "damage: %i-%i Indestructible", x->_iMinDam, x->_iMaxDam); sprintf(tempstr, "damage: %i-%i Indestructible", x->_iMinDam, x->_iMaxDam);
else else
sprintf(tempstr, "damage: %i-%i Dur: %i/%i", x->_iMinDam, x->_iMaxDam, x->_iDurability, x->_iMaxDur); sprintf(tempstr, "damage: %i-%i Dur: %i/%i", x->_iMinDam, x->_iMaxDam, x->_iDurability, x->_iMaxDur);
@ -4450,7 +4452,7 @@ void PrintItemDetails(ItemStruct *x)
sprintf(tempstr, "dam: %i Dur: %i/%i", x->_iMinDam, x->_iDurability, x->_iMaxDur); sprintf(tempstr, "dam: %i Dur: %i/%i", x->_iMinDam, x->_iDurability, x->_iMaxDur);
else else
#endif #endif
sprintf(tempstr, "dam: %i-%i Dur: %i/%i", x->_iMinDam, x->_iMaxDam, x->_iDurability, x->_iMaxDur); 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); sprintf(tempstr, "Charges: %i/%i", x->_iCharges, x->_iMaxCharges);
AddPanelString(tempstr, TRUE); AddPanelString(tempstr, TRUE);
} }
@ -4498,7 +4500,7 @@ void PrintItemDur(ItemStruct *x)
sprintf(tempstr, "damage: %i Dur: %i/%i", x->_iMinDam, x->_iDurability, x->_iMaxDur); sprintf(tempstr, "damage: %i Dur: %i/%i", x->_iMinDam, x->_iDurability, x->_iMaxDur);
} else } else
#endif #endif
if (x->_iMaxDur == DUR_INDESTRUCTIBLE) if (x->_iMaxDur == DUR_INDESTRUCTIBLE)
sprintf(tempstr, "damage: %i-%i Indestructible", x->_iMinDam, x->_iMaxDam); sprintf(tempstr, "damage: %i-%i Indestructible", x->_iMinDam, x->_iMaxDam);
else else
sprintf(tempstr, "damage: %i-%i Dur: %i/%i", x->_iMinDam, x->_iMaxDam, x->_iDurability, x->_iMaxDur); sprintf(tempstr, "damage: %i-%i Dur: %i/%i", x->_iMinDam, x->_iMaxDam, x->_iDurability, x->_iMaxDur);
@ -4819,8 +4821,7 @@ int RndSmithItem(int lvl)
#ifdef HELLFIRE #ifdef HELLFIRE
if (AllItemsList[i].iRnd == IDROP_DOUBLE && ri < 512) { if (AllItemsList[i].iRnd == IDROP_DOUBLE && ri < 512) {
#else #else
if (AllItemsList[i].iRnd == IDROP_DOUBLE) if (AllItemsList[i].iRnd == IDROP_DOUBLE) {
{
#endif #endif
ril[ri] = i; ril[ri] = i;
ri++; ri++;
@ -5211,7 +5212,7 @@ void SpawnBoy(int lvl)
{ {
int itype; int itype;
if (boylevel<lvl>> 1 || boyitem._itype == ITYPE_NONE) { if (boylevel<lvl> > 1 || boyitem._itype == ITYPE_NONE) {
do { do {
item[0]._iSeed = GetRndSeed(); item[0]._iSeed = GetRndSeed();
SetRndSeed(item[0]._iSeed); SetRndSeed(item[0]._iSeed);
@ -5460,24 +5461,24 @@ void RecreateWitchItem(int ii, int idx, int lvl, int iseed)
volatile int hi_predelnik = random_(0, 1); volatile int hi_predelnik = random_(0, 1);
iblvl = lvl; iblvl = lvl;
GetItemAttrs(ii, idx, iblvl); GetItemAttrs(ii, idx, iblvl);
} else{ } else {
#endif #endif
SetRndSeed(iseed); SetRndSeed(iseed);
itype = RndWitchItem(lvl) - 1; itype = RndWitchItem(lvl) - 1;
GetItemAttrs(ii, itype, lvl); GetItemAttrs(ii, itype, lvl);
iblvl = -1; iblvl = -1;
if (random_(51, 100) <= 5) if (random_(51, 100) <= 5)
iblvl = 2 * lvl; iblvl = 2 * lvl;
if (iblvl == -1 && item[ii]._iMiscId == IMISC_STAFF) if (iblvl == -1 && item[ii]._iMiscId == IMISC_STAFF)
iblvl = 2 * lvl; iblvl = 2 * lvl;
if (iblvl != -1) if (iblvl != -1)
#ifdef HELLFIRE #ifdef HELLFIRE
GetItemBonus(ii, itype, iblvl >> 1, iblvl, TRUE, TRUE); GetItemBonus(ii, itype, iblvl >> 1, iblvl, TRUE, TRUE);
} }
#else #else
GetItemBonus(ii, itype, iblvl >> 1, iblvl, TRUE); GetItemBonus(ii, itype, iblvl >> 1, iblvl, TRUE);
#endif #endif
} }
item[ii]._iSeed = iseed; item[ii]._iSeed = iseed;
item[ii]._iCreateInfo = lvl | CF_WITCH; item[ii]._iCreateInfo = lvl | CF_WITCH;

2
Source/lighting.cpp

@ -568,7 +568,7 @@ void DoLighting(int nXPos, int nYPos, int nRadius, int Lnum)
#endif #endif
} }
mult = xoff + 8*yoff; mult = xoff + 8 * yoff;
for (y = 0; y < min_y; y++) { for (y = 0; y < min_y; y++) {
for (x = 1; x < max_x; x++) { for (x = 1; x < max_x; x++) {
radius_block = lightblock[mult][y][x]; radius_block = lightblock[mult][y][x];

54
Source/missiles.cpp

@ -1045,13 +1045,13 @@ void CheckMissileCol(int i, int mindam, int maxdam, BOOL shift, int mx, int my,
if (dMonster[mx][my] < 0 if (dMonster[mx][my] < 0
&& monster[-(dMonster[mx][my] + 1)]._mmode == MM_STONE && monster[-(dMonster[mx][my] + 1)]._mmode == MM_STONE
&& MonsterMHit( && MonsterMHit(
missile[i]._misource, missile[i]._misource,
-(dMonster[mx][my] + 1), -(dMonster[mx][my] + 1),
mindam, mindam,
maxdam, maxdam,
missile[i]._midist, missile[i]._midist,
missile[i]._mitype, missile[i]._mitype,
shift)) { shift)) {
if (!nodel) if (!nodel)
missile[i]._mirange = 0; missile[i]._mirange = 0;
missile[i]._miHitFlag = TRUE; missile[i]._miHitFlag = TRUE;
@ -1060,13 +1060,13 @@ void CheckMissileCol(int i, int mindam, int maxdam, BOOL shift, int mx, int my,
if (dPlayer[mx][my] > 0 if (dPlayer[mx][my] > 0
&& dPlayer[mx][my] - 1 != missile[i]._misource && dPlayer[mx][my] - 1 != missile[i]._misource
&& Plr2PlrMHit( && Plr2PlrMHit(
missile[i]._misource, missile[i]._misource,
dPlayer[mx][my] - 1, dPlayer[mx][my] - 1,
mindam, mindam,
maxdam, maxdam,
missile[i]._midist, missile[i]._midist,
missile[i]._mitype, missile[i]._mitype,
shift)) { shift)) {
if (!nodel) if (!nodel)
missile[i]._mirange = 0; missile[i]._mirange = 0;
missile[i]._miHitFlag = TRUE; missile[i]._miHitFlag = TRUE;
@ -1082,14 +1082,14 @@ void CheckMissileCol(int i, int mindam, int maxdam, BOOL shift, int mx, int my,
} }
if (dPlayer[mx][my] > 0 if (dPlayer[mx][my] > 0
&& PlayerMHit( && PlayerMHit(
dPlayer[mx][my] - 1, dPlayer[mx][my] - 1,
missile[i]._misource, missile[i]._misource,
missile[i]._midist, missile[i]._midist,
mindam, mindam,
maxdam, maxdam,
missile[i]._mitype, missile[i]._mitype,
shift, shift,
0)) { 0)) {
if (!nodel) if (!nodel)
missile[i]._mirange = 0; missile[i]._mirange = 0;
missile[i]._miHitFlag = TRUE; missile[i]._miHitFlag = TRUE;
@ -3119,7 +3119,7 @@ void AddBlodboil(int mi, int sx, int sy, int dx, int dy, int midir, char mienemy
#ifndef SPAWN #ifndef SPAWN
PS_ROGUE70, PS_ROGUE70,
PS_MAGE70, PS_MAGE70,
PS_MAGE70, // BUGFIX: PS_MONK70? PS_MAGE70, // BUGFIX: PS_MONK70?
PS_ROGUE70, PS_ROGUE70,
#else #else
0, 0,
@ -3883,12 +3883,12 @@ void MI_Fireball(int i)
} }
if (missile[i]._miyvel > 0 if (missile[i]._miyvel > 0
&& (TransList[dTransVal[mx + 1][my]] && nSolidTable[dPiece[mx + 1][my]] && (TransList[dTransVal[mx + 1][my]] && nSolidTable[dPiece[mx + 1][my]]
|| TransList[dTransVal[mx - 1][my]] && nSolidTable[dPiece[mx - 1][my]])) { || TransList[dTransVal[mx - 1][my]] && nSolidTable[dPiece[mx - 1][my]])) {
missile[i]._miyoff -= 32; missile[i]._miyoff -= 32;
} }
if (missile[i]._mixvel > 0 if (missile[i]._mixvel > 0
&& (TransList[dTransVal[mx][my + 1]] && nSolidTable[dPiece[mx][my + 1]] && (TransList[dTransVal[mx][my + 1]] && nSolidTable[dPiece[mx][my + 1]]
|| TransList[dTransVal[mx][my - 1]] && nSolidTable[dPiece[mx][my - 1]])) { || TransList[dTransVal[mx][my - 1]] && nSolidTable[dPiece[mx][my - 1]])) {
missile[i]._mixoff -= 32; missile[i]._mixoff -= 32;
} }
missile[i]._mimfnum = 0; missile[i]._mimfnum = 0;
@ -4094,12 +4094,12 @@ void mi_immolation(int i)
} }
if (missile[i]._miyvel > 0 if (missile[i]._miyvel > 0
&& (TransList[dTransVal[mx + 1][my]] && nSolidTable[dPiece[mx + 1][my]] && (TransList[dTransVal[mx + 1][my]] && nSolidTable[dPiece[mx + 1][my]]
|| TransList[dTransVal[mx - 1][my]] && nSolidTable[dPiece[mx - 1][my]])) { || TransList[dTransVal[mx - 1][my]] && nSolidTable[dPiece[mx - 1][my]])) {
missile[i]._miyoff -= 32; missile[i]._miyoff -= 32;
} }
if (missile[i]._mixvel > 0 if (missile[i]._mixvel > 0
&& (TransList[dTransVal[mx][my + 1]] && nSolidTable[dPiece[mx][my + 1]] && (TransList[dTransVal[mx][my + 1]] && nSolidTable[dPiece[mx][my + 1]]
|| TransList[dTransVal[mx][my - 1]] && nSolidTable[dPiece[mx][my - 1]])) { || TransList[dTransVal[mx][my - 1]] && nSolidTable[dPiece[mx][my - 1]])) {
missile[i]._mixoff -= 32; missile[i]._mixoff -= 32;
} }
missile[i]._mimfnum = 0; missile[i]._mimfnum = 0;

6
Source/monstdat.cpp

@ -402,7 +402,7 @@ char MonstAvailTbl[] = {
#ifdef HELLFIRE #ifdef HELLFIRE
MAT_RETAIL, // Satyr Lord MAT_RETAIL, // Satyr Lord
#else #else
MAT_NEVER, // Lord Sayter MAT_NEVER, // Lord Sayter
#endif #endif
MAT_RETAIL, // Flesh Clan MAT_RETAIL, // Flesh Clan
MAT_RETAIL, // Stone Clan MAT_RETAIL, // Stone Clan
@ -453,7 +453,7 @@ char MonstAvailTbl[] = {
#ifdef HELLFIRE #ifdef HELLFIRE
MAT_RETAIL, // Devil Kin Brute MAT_RETAIL, // Devil Kin Brute
#else #else
MAT_NEVER, // Devil Kin Brute MAT_NEVER, // Devil Kin Brute
#endif #endif
MAT_RETAIL, // Winged-Demon MAT_RETAIL, // Winged-Demon
MAT_RETAIL, // Gargoyle MAT_RETAIL, // Gargoyle
@ -474,7 +474,7 @@ char MonstAvailTbl[] = {
#ifdef HELLFIRE #ifdef HELLFIRE
MAT_RETAIL, // The Shredded MAT_RETAIL, // The Shredded
#else #else
MAT_NEVER, // Unraveler MAT_NEVER, // Unraveler
#endif #endif
MAT_NEVER, // Hollow One MAT_NEVER, // Hollow One
MAT_NEVER, // Pain Master MAT_NEVER, // Pain Master

30
Source/monster.cpp

@ -1395,7 +1395,7 @@ void M_Enemy(int i)
continue; continue;
if (!(Monst->_mFlags & MFLAG_GOLEM) if (!(Monst->_mFlags & MFLAG_GOLEM)
&& ((abs(monster[mi]._mx - Monst->_mx) >= 2 || abs(monster[mi]._my - Monst->_my) >= 2) && !M_Ranged(i) && ((abs(monster[mi]._mx - Monst->_mx) >= 2 || abs(monster[mi]._my - Monst->_my) >= 2) && !M_Ranged(i)
|| (!(Monst->_mFlags & MFLAG_GOLEM) && !(monster[mi]._mFlags & MFLAG_GOLEM)))) { || (!(Monst->_mFlags & MFLAG_GOLEM) && !(monster[mi]._mFlags & MFLAG_GOLEM)))) {
continue; continue;
} }
sameroom = dTransVal[Monst->_mx][Monst->_my] == dTransVal[monster[mi]._mx][monster[mi]._my]; sameroom = dTransVal[Monst->_mx][Monst->_my] == dTransVal[monster[mi]._mx][monster[mi]._my];
@ -2738,7 +2738,7 @@ BOOL M_DoRSpAttack(int i)
#ifdef HELLFIRE #ifdef HELLFIRE
if (Monsters[i].Snds[3][0] != 0) if (Monsters[i].Snds[3][0] != 0)
#endif #endif
PlayEffect(i, 3); PlayEffect(i, 3);
} }
if (monster[i]._mAi == AI_MEGA && monster[i]._mAnimFrame == 3) { if (monster[i]._mAi == AI_MEGA && monster[i]._mAnimFrame == 3) {
@ -4295,11 +4295,11 @@ void MAI_Scav(int i)
continue; continue;
done = dDead[Monst->_mx + x][Monst->_my + y] != 0 done = dDead[Monst->_mx + x][Monst->_my + y] != 0
&& LineClearF( && LineClearF(
CheckNoSolid, CheckNoSolid,
Monst->_mx, Monst->_mx,
Monst->_my, Monst->_my,
Monst->_mx + x, Monst->_mx + x,
Monst->_my + y); Monst->_my + y);
} }
} }
x--; x--;
@ -4312,11 +4312,11 @@ void MAI_Scav(int i)
continue; continue;
done = dDead[Monst->_mx + x][Monst->_my + y] != 0 done = dDead[Monst->_mx + x][Monst->_my + y] != 0
&& LineClearF( && LineClearF(
CheckNoSolid, CheckNoSolid,
Monst->_mx, Monst->_mx,
Monst->_my, Monst->_my,
Monst->_mx + x, Monst->_mx + x,
Monst->_my + y); Monst->_my + y);
} }
} }
x++; x++;
@ -4365,7 +4365,7 @@ void MAI_Garg(int i)
return; return;
} }
if (Monst->_mhitpoints<Monst->_mmaxhp>> 1 && !(Monst->_mFlags & MFLAG_NOHEAL)) if (Monst->_mhitpoints<Monst->_mmaxhp> > 1 && !(Monst->_mFlags & MFLAG_NOHEAL))
Monst->_mgoal = MGOAL_RETREAT; Monst->_mgoal = MGOAL_RETREAT;
if (Monst->_mgoal == MGOAL_RETREAT) { if (Monst->_mgoal == MGOAL_RETREAT) {
if (abs(dx) >= Monst->_mint + 2 || abs(dy) >= Monst->_mint + 2) { if (abs(dx) >= Monst->_mint + 2 || abs(dy) >= Monst->_mint + 2) {
@ -4754,8 +4754,8 @@ void MAI_Rhino(int i)
v = random_(134, 100); v = random_(134, 100);
if (v >= 2 * Monst->_mint + 33 if (v >= 2 * Monst->_mint + 33
&& (Monst->_mVar1 != MM_WALK && Monst->_mVar1 != MM_WALK2 && Monst->_mVar1 != MM_WALK3 && (Monst->_mVar1 != MM_WALK && Monst->_mVar1 != MM_WALK2 && Monst->_mVar1 != MM_WALK3
|| Monst->_mVar2 || Monst->_mVar2
|| v >= 2 * Monst->_mint + 83)) { || v >= 2 * Monst->_mint + 83)) {
M_StartDelay(i, random_(135, 10) + 10); M_StartDelay(i, random_(135, 10) + 10);
} else { } else {
M_CallWalk(i, md); M_CallWalk(i, md);

97
Source/msg.cpp

@ -54,7 +54,7 @@ static void msg_pre_packet()
i = -1; i = -1;
for (TMegaPkt *pkt = sgpMegaPkt; pkt != NULL; pkt = pkt->pNext) { for (TMegaPkt *pkt = sgpMegaPkt; pkt != NULL; pkt = pkt->pNext) {
BYTE * data = pkt->data; BYTE *data = pkt->data;
int spaceLeft = sizeof(pkt->data); int spaceLeft = sizeof(pkt->data);
while (spaceLeft != pkt->dwSpaceLeft) { while (spaceLeft != pkt->dwSpaceLeft) {
if (*data == FAKE_CMD_SETID) { if (*data == FAKE_CMD_SETID) {
@ -317,12 +317,12 @@ static void DeltaImportJunk(BYTE *src)
#endif #endif
src += sizeof(DPortal); src += sizeof(DPortal);
SetPortalStats( SetPortalStats(
i, i,
TRUE, TRUE,
sgJunk.portal[i].x, sgJunk.portal[i].x,
sgJunk.portal[i].y, sgJunk.portal[i].y,
sgJunk.portal[i].level, sgJunk.portal[i].level,
sgJunk.portal[i].ltype); sgJunk.portal[i].ltype);
} }
} }
@ -500,14 +500,14 @@ void delta_sync_golem(TCmdGolem *pG, int pnum, BYTE bLevel)
if (gbMaxPlayers == 1) if (gbMaxPlayers == 1)
return; return;
sgbDeltaChanged = TRUE; sgbDeltaChanged = TRUE;
DMonsterStr *pD = &sgLevels[bLevel].monster[pnum]; DMonsterStr *pD = &sgLevels[bLevel].monster[pnum];
pD->_mx = pG->_mx; pD->_mx = pG->_mx;
pD->_my = pG->_my; pD->_my = pG->_my;
pD->_mactive = UCHAR_MAX; pD->_mactive = UCHAR_MAX;
pD->_menemy = pG->_menemy; pD->_menemy = pG->_menemy;
pD->_mdir = pG->_mdir; pD->_mdir = pG->_mdir;
pD->_mhitpoints = pG->_mhitpoints; pD->_mhitpoints = pG->_mhitpoints;
} }
void delta_leave_sync(BYTE bLevel) void delta_leave_sync(BYTE bLevel)
@ -618,10 +618,10 @@ static void delta_put_item(TCmdPItem *pI, int x, int y, BYTE bLevel)
TCmdPItem *pD = sgLevels[bLevel].item; TCmdPItem *pD = sgLevels[bLevel].item;
for (i = 0; i < MAXITEMS; i++, pD++) { for (i = 0; i < MAXITEMS; i++, pD++) {
if (pD->bCmd != CMD_WALKXY if (pD->bCmd != CMD_WALKXY
&& pD->bCmd != 0xFF && pD->bCmd != 0xFF
&& pD->wIndx == pI->wIndx && pD->wIndx == pI->wIndx
&& pD->wCI == pI->wCI && pD->wCI == pI->wCI
&& pD->dwSeed == pI->dwSeed) { && pD->dwSeed == pI->dwSeed) {
if (pD->bCmd == CMD_ACK_PLRINFO) if (pD->bCmd == CMD_ACK_PLRINFO)
return; return;
app_fatal("Trying to drop a floor item?"); app_fatal("Trying to drop a floor item?");
@ -665,10 +665,10 @@ void DeltaAddItem(int ii)
TCmdPItem *pD = sgLevels[currlevel].item; TCmdPItem *pD = sgLevels[currlevel].item;
for (i = 0; i < MAXITEMS; i++, pD++) { for (i = 0; i < MAXITEMS; i++, pD++) {
if (pD->bCmd != 0xFF if (pD->bCmd != 0xFF
&& pD->wIndx == item[ii].IDidx && pD->wIndx == item[ii].IDidx
&& pD->wCI == item[ii]._iCreateInfo && pD->wCI == item[ii]._iCreateInfo
&& pD->dwSeed == item[ii]._iSeed && pD->dwSeed == item[ii]._iSeed
&& (pD->bCmd == CMD_WALKXY || pD->bCmd == CMD_STAND)) { && (pD->bCmd == CMD_WALKXY || pD->bCmd == CMD_STAND)) {
return; return;
} }
} }
@ -772,9 +772,9 @@ void DeltaLoadLevel()
if (sgLevels[currlevel].item[i].bCmd != 0xFF) { if (sgLevels[currlevel].item[i].bCmd != 0xFF) {
if (sgLevels[currlevel].item[i].bCmd == CMD_WALKXY) { if (sgLevels[currlevel].item[i].bCmd == CMD_WALKXY) {
ii = FindGetItem( ii = FindGetItem(
sgLevels[currlevel].item[i].wIndx, sgLevels[currlevel].item[i].wIndx,
sgLevels[currlevel].item[i].wCI, sgLevels[currlevel].item[i].wCI,
sgLevels[currlevel].item[i].dwSeed); sgLevels[currlevel].item[i].dwSeed);
if (ii != -1) { if (ii != -1) {
if (dItem[item[ii]._ix][item[ii]._iy] == ii + 1) if (dItem[item[ii]._ix][item[ii]._iy] == ii + 1)
dItem[item[ii]._ix][item[ii]._iy] = 0; dItem[item[ii]._ix][item[ii]._iy] = 0;
@ -787,23 +787,23 @@ void DeltaLoadLevel()
itemactive[numitems] = ii; itemactive[numitems] = ii;
if (sgLevels[currlevel].item[i].wIndx == IDI_EAR) { if (sgLevels[currlevel].item[i].wIndx == IDI_EAR) {
RecreateEar( RecreateEar(
ii, ii,
sgLevels[currlevel].item[i].wCI, sgLevels[currlevel].item[i].wCI,
sgLevels[currlevel].item[i].dwSeed, sgLevels[currlevel].item[i].dwSeed,
sgLevels[currlevel].item[i].bId, sgLevels[currlevel].item[i].bId,
sgLevels[currlevel].item[i].bDur, sgLevels[currlevel].item[i].bDur,
sgLevels[currlevel].item[i].bMDur, sgLevels[currlevel].item[i].bMDur,
sgLevels[currlevel].item[i].bCh, sgLevels[currlevel].item[i].bCh,
sgLevels[currlevel].item[i].bMCh, sgLevels[currlevel].item[i].bMCh,
sgLevels[currlevel].item[i].wValue, sgLevels[currlevel].item[i].wValue,
sgLevels[currlevel].item[i].dwBuff); sgLevels[currlevel].item[i].dwBuff);
} else { } else {
RecreateItem( RecreateItem(
ii, ii,
sgLevels[currlevel].item[i].wIndx, sgLevels[currlevel].item[i].wIndx,
sgLevels[currlevel].item[i].wCI, sgLevels[currlevel].item[i].wCI,
sgLevels[currlevel].item[i].dwSeed, sgLevels[currlevel].item[i].dwSeed,
sgLevels[currlevel].item[i].wValue); sgLevels[currlevel].item[i].wValue);
if (sgLevels[currlevel].item[i].bId) if (sgLevels[currlevel].item[i].bId)
item[ii]._iIdentified = TRUE; item[ii]._iIdentified = TRUE;
item[ii]._iDurability = sgLevels[currlevel].item[i].bDur; item[ii]._iDurability = sgLevels[currlevel].item[i].bDur;
@ -1472,7 +1472,8 @@ static DWORD On_GETITEM(TCmd *pCmd, int pnum)
if (currlevel != p->bLevel) { 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 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 #ifdef HELLFIRE
, p->wToHit, p->wMaxDam, p->bMinStr, p->bMinMag, p->bMinDex, p->bAC ,
p->wToHit, p->wMaxDam, p->bMinStr, p->bMinMag, p->bMinDex, p->bAC
#endif #endif
); );
if (ii != -1) if (ii != -1)
@ -1538,7 +1539,8 @@ static DWORD On_AGETITEM(TCmd *pCmd, int pnum)
if (currlevel != p->bLevel) { 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 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 #ifdef HELLFIRE
, p->wToHit, p->wMaxDam, p->bMinStr, p->bMinMag, p->bMinDex, p->bAC ,
p->wToHit, p->wMaxDam, p->bMinStr, p->bMinMag, p->bMinDex, p->bAC
#endif #endif
); );
if (ii != -1) if (ii != -1)
@ -1583,7 +1585,8 @@ static DWORD On_PUTITEM(TCmd *pCmd, int pnum)
else 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 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 #ifdef HELLFIRE
, p->wToHit, p->wMaxDam, p->bMinStr, p->bMinMag, p->bMinDex, p->bAC ,
p->wToHit, p->wMaxDam, p->bMinStr, p->bMinMag, p->bMinDex, p->bAC
#endif #endif
); );
if (ii != -1) { if (ii != -1) {
@ -1610,7 +1613,8 @@ static DWORD On_SYNCPUTITEM(TCmd *pCmd, int pnum)
else if (currlevel == plr[pnum].plrlevel) { 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 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 #ifdef HELLFIRE
, p->wToHit, p->wMaxDam, p->bMinStr, p->bMinMag, p->bMinDex, p->bAC ,
p->wToHit, p->wMaxDam, p->bMinStr, p->bMinMag, p->bMinDex, p->bAC
#endif #endif
); );
if (ii != -1) { if (ii != -1) {
@ -1638,7 +1642,8 @@ static DWORD On_RESPAWNITEM(TCmd *pCmd, int pnum)
if (currlevel == plr[pnum].plrlevel && pnum != myplr) { 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 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 #ifdef HELLFIRE
, p->wToHit, p->wMaxDam, p->bMinStr, p->bMinMag, p->bMinDex, p->bAC ,
p->wToHit, p->wMaxDam, p->bMinStr, p->bMinMag, p->bMinDex, p->bAC
#endif #endif
); );
} }

130
Source/objects.cpp

@ -1977,9 +1977,9 @@ void Obj_Door(int i)
dx = object[i]._ox; dx = object[i]._ox;
dy = object[i]._oy; dy = object[i]._oy;
dok = dMonster[dx][dy] == 0; dok = dMonster[dx][dy] == 0;
dok = dok HFAND (dItem[dx][dy] == 0); dok = dok HFAND(dItem[dx][dy] == 0);
dok = dok HFAND (dDead[dx][dy] == 0); dok = dok HFAND(dDead[dx][dy] == 0);
dok = dok HFAND (dPlayer[dx][dy] == 0); dok = dok HFAND(dPlayer[dx][dy] == 0);
object[i]._oSelFlag = 2; object[i]._oSelFlag = 2;
object[i]._oVar4 = dok ? 1 : 2; object[i]._oVar4 = dok ? 1 : 2;
object[i]._oMissFlag = TRUE; object[i]._oMissFlag = TRUE;
@ -2409,40 +2409,40 @@ void DoorSet(int oi, int dx, int dy)
#ifdef HELLFIRE #ifdef HELLFIRE
if (currlevel < 17) { if (currlevel < 17) {
#endif #endif
if (pn == 43) if (pn == 43)
ObjSetMicro(dx, dy, 392); ObjSetMicro(dx, dy, 392);
if (pn == 45) if (pn == 45)
ObjSetMicro(dx, dy, 394); ObjSetMicro(dx, dy, 394);
if (pn == 50 && object[oi]._otype == OBJ_L1LDOOR) if (pn == 50 && object[oi]._otype == OBJ_L1LDOOR)
ObjSetMicro(dx, dy, 411); ObjSetMicro(dx, dy, 411);
if (pn == 50 && object[oi]._otype == OBJ_L1RDOOR) if (pn == 50 && object[oi]._otype == OBJ_L1RDOOR)
ObjSetMicro(dx, dy, 412); ObjSetMicro(dx, dy, 412);
if (pn == 54) if (pn == 54)
ObjSetMicro(dx, dy, 397); ObjSetMicro(dx, dy, 397);
if (pn == 55) if (pn == 55)
ObjSetMicro(dx, dy, 398); ObjSetMicro(dx, dy, 398);
if (pn == 61) if (pn == 61)
ObjSetMicro(dx, dy, 399); ObjSetMicro(dx, dy, 399);
if (pn == 67) if (pn == 67)
ObjSetMicro(dx, dy, 400); ObjSetMicro(dx, dy, 400);
if (pn == 68) if (pn == 68)
ObjSetMicro(dx, dy, 401); ObjSetMicro(dx, dy, 401);
if (pn == 69) if (pn == 69)
ObjSetMicro(dx, dy, 403); ObjSetMicro(dx, dy, 403);
if (pn == 70) if (pn == 70)
ObjSetMicro(dx, dy, 404); ObjSetMicro(dx, dy, 404);
if (pn == 72) if (pn == 72)
ObjSetMicro(dx, dy, 406); ObjSetMicro(dx, dy, 406);
if (pn == 212) if (pn == 212)
ObjSetMicro(dx, dy, 407); ObjSetMicro(dx, dy, 407);
if (pn == 354) if (pn == 354)
ObjSetMicro(dx, dy, 409); ObjSetMicro(dx, dy, 409);
if (pn == 355) if (pn == 355)
ObjSetMicro(dx, dy, 410); ObjSetMicro(dx, dy, 410);
if (pn == 411) if (pn == 411)
ObjSetMicro(dx, dy, 396); ObjSetMicro(dx, dy, 396);
if (pn == 412) if (pn == 412)
ObjSetMicro(dx, dy, 396); ObjSetMicro(dx, dy, 396);
#ifdef HELLFIRE #ifdef HELLFIRE
} else { } else {
if (pn == 75) if (pn == 75)
@ -2564,14 +2564,14 @@ void OperateL1RDoor(int pnum, int oi, DIABOOL sendflag)
#ifdef HELLFIRE #ifdef HELLFIRE
if (currlevel < 17) { if (currlevel < 17) {
#endif #endif
if (object[oi]._oVar2 != 50) { if (object[oi]._oVar2 != 50) {
ObjSetMicro(xp - 1, yp, object[oi]._oVar2); ObjSetMicro(xp - 1, yp, object[oi]._oVar2);
} else { } else {
if (dPiece[xp - 1][yp] == 396) if (dPiece[xp - 1][yp] == 396)
ObjSetMicro(xp - 1, yp, 411); ObjSetMicro(xp - 1, yp, 411);
else else
ObjSetMicro(xp - 1, yp, 50); ObjSetMicro(xp - 1, yp, 50);
} }
#ifdef HELLFIRE #ifdef HELLFIRE
} else { } else {
if (object[oi]._oVar2 != 86) { if (object[oi]._oVar2 != 86) {
@ -2672,14 +2672,14 @@ void OperateL1LDoor(int pnum, int oi, DIABOOL sendflag)
#ifdef HELLFIRE #ifdef HELLFIRE
if (currlevel < 17) { if (currlevel < 17) {
#endif #endif
if (object[oi]._oVar2 != 50) { if (object[oi]._oVar2 != 50) {
ObjSetMicro(xp, yp - 1, object[oi]._oVar2); ObjSetMicro(xp, yp - 1, object[oi]._oVar2);
} else { } else {
if (dPiece[xp][yp - 1] == 396) if (dPiece[xp][yp - 1] == 396)
ObjSetMicro(xp, yp - 1, 412); ObjSetMicro(xp, yp - 1, 412);
else else
ObjSetMicro(xp, yp - 1, 50); ObjSetMicro(xp, yp - 1, 50);
} }
#ifdef HELLFIRE #ifdef HELLFIRE
} else { } else {
if (object[oi]._oVar2 != 86) { if (object[oi]._oVar2 != 86) {
@ -2729,8 +2729,8 @@ void OperateL2RDoor(int pnum, int oi, DIABOOL sendflag)
if (!deltaload) if (!deltaload)
PlaySfxLoc(IS_DOORCLOS, object[oi]._ox, yp); PlaySfxLoc(IS_DOORCLOS, object[oi]._ox, yp);
dok = dMonster[xp][yp] == 0; dok = dMonster[xp][yp] == 0;
dok = dok HFAND (dItem[xp][yp] == 0); dok = dok HFAND(dItem[xp][yp] == 0);
dok = dok HFAND (dDead[xp][yp] == 0); dok = dok HFAND(dDead[xp][yp] == 0);
if (dok) { if (dok) {
if (pnum == myplr && sendflag) if (pnum == myplr && sendflag)
NetSendCmdParam1(TRUE, CMD_CLOSEDOOR, oi); NetSendCmdParam1(TRUE, CMD_CLOSEDOOR, oi);
@ -2774,8 +2774,8 @@ void OperateL2LDoor(int pnum, int oi, BOOL sendflag)
if (!deltaload) if (!deltaload)
PlaySfxLoc(IS_DOORCLOS, object[oi]._ox, yp); PlaySfxLoc(IS_DOORCLOS, object[oi]._ox, yp);
dok = dMonster[xp][yp] == 0; dok = dMonster[xp][yp] == 0;
dok = dok HFAND (dItem[xp][yp] == 0); dok = dok HFAND(dItem[xp][yp] == 0);
dok = dok HFAND (dDead[xp][yp] == 0); dok = dok HFAND(dDead[xp][yp] == 0);
if (dok) { if (dok) {
if (pnum == myplr && sendflag) if (pnum == myplr && sendflag)
NetSendCmdParam1(TRUE, CMD_CLOSEDOOR, oi); NetSendCmdParam1(TRUE, CMD_CLOSEDOOR, oi);
@ -2820,8 +2820,8 @@ void OperateL3RDoor(int pnum, int oi, DIABOOL sendflag)
if (!deltaload) if (!deltaload)
PlaySfxLoc(IS_DOORCLOS, object[oi]._ox, yp); PlaySfxLoc(IS_DOORCLOS, object[oi]._ox, yp);
dok = dMonster[xp][yp] == 0; dok = dMonster[xp][yp] == 0;
dok = dok HFAND (dItem[xp][yp] == 0); dok = dok HFAND(dItem[xp][yp] == 0);
dok = dok HFAND (dDead[xp][yp] == 0); dok = dok HFAND(dDead[xp][yp] == 0);
if (dok) { if (dok) {
if (pnum == myplr && sendflag) if (pnum == myplr && sendflag)
NetSendCmdParam1(TRUE, CMD_CLOSEDOOR, oi); NetSendCmdParam1(TRUE, CMD_CLOSEDOOR, oi);
@ -2866,8 +2866,8 @@ void OperateL3LDoor(int pnum, int oi, DIABOOL sendflag)
if (!deltaload) if (!deltaload)
PlaySfxLoc(IS_DOORCLOS, object[oi]._ox, yp); PlaySfxLoc(IS_DOORCLOS, object[oi]._ox, yp);
dok = dMonster[xp][yp] == 0; dok = dMonster[xp][yp] == 0;
dok = dok HFAND (dItem[xp][yp] == 0); dok = dok HFAND(dItem[xp][yp] == 0);
dok = dok HFAND (dDead[xp][yp] == 0); dok = dok HFAND(dDead[xp][yp] == 0);
if (dok) { if (dok) {
if (pnum == myplr && sendflag) if (pnum == myplr && sendflag)
NetSendCmdParam1(TRUE, CMD_CLOSEDOOR, oi); NetSendCmdParam1(TRUE, CMD_CLOSEDOOR, oi);
@ -5262,13 +5262,13 @@ void GetObjectStr(int i)
case OBJ_BARREL: case OBJ_BARREL:
case OBJ_BARRELEX: case OBJ_BARRELEX:
#ifdef HELLFIRE #ifdef HELLFIRE
if (currlevel > 16 && currlevel < 21) // for hive levels if (currlevel > 16 && currlevel < 21) // for hive levels
strcpy(infostr, "Pod"); //Then a barrel is called a pod strcpy(infostr, "Pod"); //Then a barrel is called a pod
else if (currlevel > 20 && currlevel < 25) // for crypt levels else if (currlevel > 20 && currlevel < 25) // for crypt levels
strcpy(infostr, "Urn"); //Then a barrel is called an urn strcpy(infostr, "Urn"); //Then a barrel is called an urn
else else
#endif #endif
strcpy(infostr, "Barrel"); strcpy(infostr, "Barrel");
break; break;
case OBJ_SKELBOOK: case OBJ_SKELBOOK:
strcpy(infostr, "Skeleton Tome"); strcpy(infostr, "Skeleton Tome");

6
Source/pack.cpp

@ -9,7 +9,8 @@
#ifndef HELLFIRE #ifndef HELLFIRE
static static
#endif #endif
void PackItem(PkItemStruct *id, ItemStruct *is) void
PackItem(PkItemStruct *id, ItemStruct *is)
{ {
if (is->_itype == ITYPE_NONE) { if (is->_itype == ITYPE_NONE) {
id->idx = 0xFFFF; id->idx = 0xFFFF;
@ -136,7 +137,8 @@ void PackPlayer(PkPlayerStruct *pPack, int pnum, BOOL manashield)
#ifndef HELLFIRE #ifndef HELLFIRE
static static
#endif #endif
void UnPackItem(PkItemStruct *is, ItemStruct *id) void
UnPackItem(PkItemStruct *is, ItemStruct *id)
{ {
if (is->idx == 0xFFFF) { if (is->idx == 0xFFFF) {
id->_itype = ITYPE_NONE; id->_itype = ITYPE_NONE;

2
Source/palette.cpp

@ -305,8 +305,6 @@ void palette_update_crypt()
system_palette[i].peGreen = col.peGreen; system_palette[i].peGreen = col.peGreen;
system_palette[i].peBlue = col.peBlue; system_palette[i].peBlue = col.peBlue;
dword_6E2D58 = 0; dword_6E2D58 = 0;
} else { } else {
dword_6E2D58++; dword_6E2D58++;

16
Source/player.cpp

@ -108,6 +108,7 @@ int StrengthTbl[NUM_CLASSES] = {
}; };
/** Maps from player_class to starting stat in magic. */ /** Maps from player_class to starting stat in magic. */
int MagicTbl[NUM_CLASSES] = { int MagicTbl[NUM_CLASSES] = {
// clang-format off
10, 10,
15, 15,
35, 35,
@ -116,6 +117,7 @@ int MagicTbl[NUM_CLASSES] = {
20, 20,
0, 0,
#endif #endif
// clang-format on
}; };
/** Maps from player_class to starting stat in dexterity. */ /** Maps from player_class to starting stat in dexterity. */
int DexterityTbl[NUM_CLASSES] = { int DexterityTbl[NUM_CLASSES] = {
@ -162,6 +164,7 @@ const char *const ClassStrTblOld[] = {
}; };
/** Maps from player_class to maximum stats. */ /** Maps from player_class to maximum stats. */
int MaxStats[NUM_CLASSES][4] = { int MaxStats[NUM_CLASSES][4] = {
// clang-format off
{ 250, 50, 60, 100 }, { 250, 50, 60, 100 },
{ 55, 70, 250, 80 }, { 55, 70, 250, 80 },
{ 45, 250, 85, 80 }, { 45, 250, 85, 80 },
@ -170,6 +173,7 @@ int MaxStats[NUM_CLASSES][4] = {
{ 120, 120, 120, 100 }, { 120, 120, 120, 100 },
{ 255, 0, 55, 150 }, { 255, 0, 55, 150 },
#endif #endif
// clang-format on
}; };
/** Specifies the experience point limit of each level. */ /** Specifies the experience point limit of each level. */
int ExpLvlsTbl[MAXCHARLEVEL] = { int ExpLvlsTbl[MAXCHARLEVEL] = {
@ -2082,9 +2086,9 @@ void DropHalfPlayersGold(int pnum)
for (i = 0; i < MAXBELTITEMS && hGold > 0; i++) { for (i = 0; i < MAXBELTITEMS && hGold > 0; i++) {
if (plr[pnum].SpdList[i]._itype == ITYPE_GOLD && if (plr[pnum].SpdList[i]._itype == ITYPE_GOLD &&
#ifndef HELLFIRE #ifndef HELLFIRE
plr[pnum].SpdList[i]._ivalue != GOLD_MAX_LIMIT) { plr[pnum].SpdList[i]._ivalue != GOLD_MAX_LIMIT) {
#else #else
plr[pnum].SpdList[i]._ivalue != MaxGold) { plr[pnum].SpdList[i]._ivalue != MaxGold) {
#endif #endif
if (hGold < plr[pnum].SpdList[i]._ivalue) { if (hGold < plr[pnum].SpdList[i]._ivalue) {
plr[pnum].SpdList[i]._ivalue -= hGold; plr[pnum].SpdList[i]._ivalue -= hGold;
@ -2137,9 +2141,9 @@ void DropHalfPlayersGold(int pnum)
for (i = 0; i < plr[pnum]._pNumInv && hGold > 0; i++) { for (i = 0; i < plr[pnum]._pNumInv && hGold > 0; i++) {
if (plr[pnum].InvList[i]._itype == ITYPE_GOLD && if (plr[pnum].InvList[i]._itype == ITYPE_GOLD &&
#ifndef HELLFIRE #ifndef HELLFIRE
plr[pnum].InvList[i]._ivalue != GOLD_MAX_LIMIT) { plr[pnum].InvList[i]._ivalue != GOLD_MAX_LIMIT) {
#else #else
plr[pnum].InvList[i]._ivalue != MaxGold) { plr[pnum].InvList[i]._ivalue != MaxGold) {
#endif #endif
if (hGold < plr[pnum].InvList[i]._ivalue) { if (hGold < plr[pnum].InvList[i]._ivalue) {
plr[pnum].InvList[i]._ivalue -= hGold; plr[pnum].InvList[i]._ivalue -= hGold;
@ -3848,7 +3852,7 @@ void ProcessPlayers()
break; break;
default: default:
#endif #endif
PlaySFX(sfxdnum); PlaySFX(sfxdnum);
#ifdef HELLFIRE #ifdef HELLFIRE
} }
#endif #endif
@ -4703,7 +4707,7 @@ void PlayDungMsgs()
sfxdnum = PS_MAGE92; sfxdnum = PS_MAGE92;
} else } else
#endif #endif
if (plr[myplr]._pClass == PC_MONK) { if (plr[myplr]._pClass == PC_MONK) {
sfxdnum = PS_MONK92; sfxdnum = PS_MONK92;
} }
#ifndef SPAWN #ifndef SPAWN

38
Source/quests.cpp

@ -120,29 +120,29 @@ void InitQuests()
for (z = 0; z < MAXQUESTS; z++) { for (z = 0; z < MAXQUESTS; z++) {
if (gbMaxPlayers > 1 && !(questlist[z]._qflags & QUEST_ANY)) if (gbMaxPlayers > 1 && !(questlist[z]._qflags & QUEST_ANY))
continue; continue;
quests[z]._qtype = questlist[z]._qdtype; quests[z]._qtype = questlist[z]._qdtype;
if (gbMaxPlayers > 1) { if (gbMaxPlayers > 1) {
quests[z]._qlevel = questlist[z]._qdmultlvl; quests[z]._qlevel = questlist[z]._qdmultlvl;
if (!delta_quest_inited(initiatedQuests)) { if (!delta_quest_inited(initiatedQuests)) {
quests[z]._qactive = QUEST_INIT;
quests[z]._qvar1 = 0;
quests[z]._qlog = FALSE;
}
initiatedQuests++;
} else {
quests[z]._qactive = QUEST_INIT; quests[z]._qactive = QUEST_INIT;
quests[z]._qlevel = questlist[z]._qdlvl;
quests[z]._qvar1 = 0; quests[z]._qvar1 = 0;
quests[z]._qlog = FALSE; quests[z]._qlog = FALSE;
} }
initiatedQuests++;
quests[z]._qslvl = questlist[z]._qslvl; } else {
quests[z]._qtx = 0; quests[z]._qactive = QUEST_INIT;
quests[z]._qty = 0; quests[z]._qlevel = questlist[z]._qdlvl;
quests[z]._qidx = z; quests[z]._qvar1 = 0;
quests[z]._qlvltype = questlist[z]._qlvlt; quests[z]._qlog = FALSE;
quests[z]._qvar2 = 0; }
quests[z]._qmsg = questlist[z]._qdmsg;
quests[z]._qslvl = questlist[z]._qslvl;
quests[z]._qtx = 0;
quests[z]._qty = 0;
quests[z]._qidx = z;
quests[z]._qlvltype = questlist[z]._qlvlt;
quests[z]._qvar2 = 0;
quests[z]._qmsg = questlist[z]._qdmsg;
} }
if (gbMaxPlayers == 1) { if (gbMaxPlayers == 1) {

1
Source/sha.cpp

@ -11,7 +11,6 @@
#define SHA1CircularShift(bits, word) \ #define SHA1CircularShift(bits, word) \
(((word) << (bits)) | ((word) >> (32 - (bits)))) (((word) << (bits)) | ((word) >> (32 - (bits))))
SHA1Context sgSHA1[3]; SHA1Context sgSHA1[3];
static void SHA1Init(SHA1Context *context) static void SHA1Init(SHA1Context *context)

37
Source/town.cpp

@ -1575,7 +1575,8 @@ void T_FillTile(BYTE *P3Tiles, int xx, int yy, int t)
} }
#ifdef HELLFIRE #ifdef HELLFIRE
void town_4751C6(){ void town_4751C6()
{
dPiece[78][60] = 0x48a; dPiece[78][60] = 0x48a;
dPiece[79][60] = 0x48b; dPiece[79][60] = 0x48b;
dPiece[78][61] = 0x48c; dPiece[78][61] = 0x48c;
@ -1625,7 +1626,8 @@ void town_4751C6(){
SetTownMicros(); SetTownMicros();
} }
void town_475379(){ void town_475379()
{
dPiece[78][60] = 0x48a; dPiece[78][60] = 0x48a;
dPiece[79][60] = 0x4eb; dPiece[79][60] = 0x4eb;
dPiece[78][61] = 0x4ec; dPiece[78][61] = 0x4ec;
@ -1675,7 +1677,8 @@ void town_475379(){
SetTownMicros(); SetTownMicros();
} }
void town_47552C(){ void town_47552C()
{
dPiece[36][21] = 0x52b; dPiece[36][21] = 0x52b;
dPiece[37][21] = 0x52c; dPiece[37][21] = 0x52c;
dPiece[36][22] = 0x52d; dPiece[36][22] = 0x52d;
@ -1689,7 +1692,8 @@ void town_47552C(){
SetTownMicros(); SetTownMicros();
} }
void town_475595(){ void town_475595()
{
dPiece[36][21] = 0x533; dPiece[36][21] = 0x533;
dPiece[37][21] = 0x534; dPiece[37][21] = 0x534;
dPiece[36][22] = 0x535; dPiece[36][22] = 0x535;
@ -1739,16 +1743,13 @@ void T_Pass3()
if (gbMaxPlayers == 1) { if (gbMaxPlayers == 1) {
#endif #endif
#ifdef HELLFIRE #ifdef HELLFIRE
if(quests[Q_FARMER]._qactive == 3 || quests[Q_FARMER]._qactive == 10 if (quests[Q_FARMER]._qactive == 3 || quests[Q_FARMER]._qactive == 10
|| quests[Q_JERSEY]._qactive == 3 || quests[Q_JERSEY]._qactive == 10) || quests[Q_JERSEY]._qactive == 3 || quests[Q_JERSEY]._qactive == 10) {
{
town_4751C6(); town_4751C6();
} } else {
else
{
town_475379(); town_475379();
} }
if ( quests[Q_GRAVE]._qactive == 3 || plr[myplr]._pLvlVisited[21] ) if (quests[Q_GRAVE]._qactive == 3 || plr[myplr]._pLvlVisited[21])
town_475595(); town_475595();
else else
town_47552C(); town_47552C();
@ -1788,18 +1789,14 @@ void T_Pass3()
} }
} }
#ifdef HELLFIRE #ifdef HELLFIRE
else else {
{ if (quests[Q_FARMER]._qactive == 3 || quests[Q_FARMER]._qactive == 10
if(quests[Q_FARMER]._qactive == 3 || quests[Q_FARMER]._qactive == 10 || quests[Q_JERSEY]._qactive == 3 || quests[Q_JERSEY]._qactive == 10) {
|| quests[Q_JERSEY]._qactive == 3 || quests[Q_JERSEY]._qactive == 10)
{
town_4751C6(); town_4751C6();
} } else {
else
{
town_475379(); town_475379();
} }
if ( quests[Q_GRAVE]._qactive == 3 || plr[myplr]._pLvlVisited[21] ) if (quests[Q_GRAVE]._qactive == 3 || plr[myplr]._pLvlVisited[21])
town_475595(); town_475595();
else else
town_47552C(); town_47552C();

4
Source/town.h

@ -12,8 +12,8 @@ void town_draw_town_all(BYTE *pBuff, int x, int y, int row, int CelCap, int sx,
void T_DrawView(int StartX, int StartY); void T_DrawView(int StartX, int StartY);
#ifdef HELLFIRE #ifdef HELLFIRE
void town_4751C6(); void town_4751C6();
void town_475595(); void town_475595();
#endif #endif
void CreateTown(int entry); void CreateTown(int entry);
#endif /* __TOWN_H__ */ #endif /* __TOWN_H__ */

968
Source/towners.cpp

File diff suppressed because it is too large Load Diff

3
Source/trigs.cpp

@ -17,7 +17,7 @@ int TownDownList[] = { 716, 715, 719, 720, 721, 723, 724, 725, 726, 727, -1 };
int TownWarp1List[] = { 1171, 1172, 1173, 1174, 1175, 1176, 1177, 1178, 1179, 1181, 1183, 1185, -1 }; int TownWarp1List[] = { 1171, 1172, 1173, 1174, 1175, 1176, 1177, 1178, 1179, 1181, 1183, 1185, -1 };
#ifdef HELLFIRE #ifdef HELLFIRE
int TownCryptList[] = { 1331, 1332, 1333, 1334, 1335, 1336, 1337, 1338, -1 }; int TownCryptList[] = { 1331, 1332, 1333, 1334, 1335, 1336, 1337, 1338, -1 };
int TownHiveList[] = { 1307,1308,1309,1310, -1}; int TownHiveList[] = { 1307, 1308, 1309, 1310, -1 };
#endif #endif
/** Specifies the dungeon piece IDs which constitute stairways leading up from the cathedral. */ /** Specifies the dungeon piece IDs which constitute stairways leading up from the cathedral. */
int L1UpList[] = { 127, 129, 130, 131, 132, 133, 135, 137, 138, 139, 140, -1 }; int L1UpList[] = { 127, 129, 130, 131, 132, 133, 135, 137, 138, 139, 140, -1 };
@ -71,7 +71,6 @@ void InitTownTriggers()
trigs[numtrigs]._tmsg = WM_DIABNEXTLVL; trigs[numtrigs]._tmsg = WM_DIABNEXTLVL;
numtrigs++; numtrigs++;
#ifndef SPAWN #ifndef SPAWN
if (gbMaxPlayers == MAX_PLRS) { if (gbMaxPlayers == MAX_PLRS) {
for (i = 0; i < sizeof(townwarps) / sizeof(townwarps[0]); i++) { for (i = 0; i < sizeof(townwarps) / sizeof(townwarps[0]); i++) {

20
defs.h

@ -130,7 +130,7 @@
// 256 kilobytes + 3 bytes (demo leftover) for file magic (262147) // 256 kilobytes + 3 bytes (demo leftover) for file magic (262147)
// final game uses 4-byte magic instead of 3 // final game uses 4-byte magic instead of 3
#define FILEBUFF ((256*1024)+3) #define FILEBUFF ((256 * 1024) + 3)
#define PMSG_COUNT 8 #define PMSG_COUNT 8
@ -216,22 +216,22 @@
#define DIALOG_TOP ((SCREEN_HEIGHT - PANEL_HEIGHT) / 2 - 18) #define DIALOG_TOP ((SCREEN_HEIGHT - PANEL_HEIGHT) / 2 - 18)
#define DIALOG_Y (SCREEN_Y + DIALOG_TOP) #define DIALOG_Y (SCREEN_Y + DIALOG_TOP)
#define SCREENXY(x, y) ((x) + SCREEN_X + ((y) + SCREEN_Y) * BUFFER_WIDTH) #define SCREENXY(x, y) ((x) + SCREEN_X + ((y) + SCREEN_Y) * BUFFER_WIDTH)
#define MemFreeDbg(p) \ #define MemFreeDbg(p) \
{ \ { \
void *p__p; \ void *p__p; \
p__p = p; \ p__p = p; \
p = NULL; \ p = NULL; \
mem_free_dbg(p__p); \ mem_free_dbg(p__p); \
} }
#undef assert #undef assert
#ifndef _DEBUG #ifndef _DEBUG
#define assert(exp) ((void)0) #define assert(exp) ((void)0)
#else #else
#define assert(exp) (void)( (exp) || (assert_fail(__LINE__, __FILE__, #exp), 0) ) #define assert(exp) (void)((exp) || (assert_fail(__LINE__, __FILE__, #exp), 0))
#endif #endif
#ifndef INVALID_FILE_ATTRIBUTES #ifndef INVALID_FILE_ATTRIBUTES

212
enums.h

@ -1850,11 +1850,11 @@ typedef enum monster_resistance {
RESIST_MAGIC = 0x01, RESIST_MAGIC = 0x01,
RESIST_FIRE = 0x02, RESIST_FIRE = 0x02,
RESIST_LIGHTNING = 0x04, RESIST_LIGHTNING = 0x04,
IMMUNE_MAGIC = 0x08, IMMUNE_MAGIC = 0x08,
IMMUNE_FIRE = 0x10, IMMUNE_FIRE = 0x10,
IMMUNE_LIGHTNING = 0x20, IMMUNE_LIGHTNING = 0x20,
IMMUNE_NULL_40 = 0x40, IMMUNE_NULL_40 = 0x40,
IMMUNE_ACID = 0x80, IMMUNE_ACID = 0x80,
} monster_resistance; } monster_resistance;
typedef enum missile_resistance { typedef enum missile_resistance {
@ -2130,81 +2130,81 @@ typedef enum _speech_id {
TEXT_HBLOODY = 0x104, TEXT_HBLOODY = 0x104,
TEXT_HBLINDING = 0x105, TEXT_HBLINDING = 0x105,
TEXT_HBLOODWAR = 0x106, TEXT_HBLOODWAR = 0x106,
TEXT_BBONER = 0x107, TEXT_BBONER = 0x107,
TEXT_BBLOODY = 0x108, TEXT_BBLOODY = 0x108,
TEXT_BBLINDING = 0x109, TEXT_BBLINDING = 0x109,
TEXT_BBLOODWAR = 0x10A, TEXT_BBLOODWAR = 0x10A,
TEXT_GRAVE1 = 0x10B, TEXT_GRAVE1 = 0x10B,
TEXT_GRAVE2 = 0x10C, TEXT_GRAVE2 = 0x10C,
TEXT_GRAVE3 = 0x10D, TEXT_GRAVE3 = 0x10D,
TEXT_GRAVE4 = 0x10E, TEXT_GRAVE4 = 0x10E,
TEXT_GRAVE5 = 0x10F, TEXT_GRAVE5 = 0x10F,
TEXT_GRAVE6 = 0x110, TEXT_GRAVE6 = 0x110,
TEXT_GRAVE7 = 0x111, TEXT_GRAVE7 = 0x111,
TEXT_GRAVE8 = 0x112, TEXT_GRAVE8 = 0x112,
TEXT_GRAVE9 = 0x113, TEXT_GRAVE9 = 0x113,
TEXT_GRAVE10 = 0x114, TEXT_GRAVE10 = 0x114,
TEXT_FARMER1 = 0x115, TEXT_FARMER1 = 0x115,
TEXT_FARMER2 = 0x116, TEXT_FARMER2 = 0x116,
TEXT_FARMER3 = 0x117, TEXT_FARMER3 = 0x117,
TEXT_FARMER4 = 0x118, TEXT_FARMER4 = 0x118,
TEXT_FARMER5 = 0x119, TEXT_FARMER5 = 0x119,
TEXT_GIRL1 = 0x11A, TEXT_GIRL1 = 0x11A,
TEXT_GIRL2 = 0x11B, TEXT_GIRL2 = 0x11B,
TEXT_GIRL3 = 0x11C, TEXT_GIRL3 = 0x11C,
TEXT_GIRL4 = 0x11D, TEXT_GIRL4 = 0x11D,
TEXT_DEFILER1 = 0x11E, TEXT_DEFILER1 = 0x11E,
TEXT_DEFILER2 = 0x11F, TEXT_DEFILER2 = 0x11F,
TEXT_DEFILER3 = 0x120, TEXT_DEFILER3 = 0x120,
TEXT_DEFILER4 = 0x121, TEXT_DEFILER4 = 0x121,
TEXT_DEFILER5 = 0x122, TEXT_DEFILER5 = 0x122,
TEXT_NAKRUL1 = 0x123, TEXT_NAKRUL1 = 0x123,
TEXT_NAKRUL2 = 0x124, TEXT_NAKRUL2 = 0x124,
TEXT_NAKRUL3 = 0x125, TEXT_NAKRUL3 = 0x125,
TEXT_NAKRUL4 = 0x126, TEXT_NAKRUL4 = 0x126,
TEXT_NAKRUL5 = 0x127, TEXT_NAKRUL5 = 0x127,
TEXT_CORNSTN = 0x128, TEXT_CORNSTN = 0x128,
TEXT_JERSEY1 = 0x129, TEXT_JERSEY1 = 0x129,
TEXT_JERSEY2 = 0x12A, TEXT_JERSEY2 = 0x12A,
TEXT_JERSEY3 = 0x12B, TEXT_JERSEY3 = 0x12B,
TEXT_JERSEY4 = 0x12C, TEXT_JERSEY4 = 0x12C,
TEXT_JERSEY5 = 0x12D, TEXT_JERSEY5 = 0x12D,
TEXT_JERSEY6 = 0x12E, TEXT_JERSEY6 = 0x12E,
TEXT_JERSEY7 = 0x12F, TEXT_JERSEY7 = 0x12F,
TEXT_JERSEY8 = 0x130, TEXT_JERSEY8 = 0x130,
TEXT_JERSEY9 = 0x131, TEXT_JERSEY9 = 0x131,
TEXT_TRADER = 0x132, TEXT_TRADER = 0x132,
TEXT_FARMER6 = 0x133, TEXT_FARMER6 = 0x133,
TEXT_FARMER7 = 0x134, TEXT_FARMER7 = 0x134,
TEXT_FARMER8 = 0x135, TEXT_FARMER8 = 0x135,
TEXT_FARMER9 = 0x136, TEXT_FARMER9 = 0x136,
TEXT_FARMER10 = 0x137, TEXT_FARMER10 = 0x137,
TEXT_JERSEY10 = 0x138, TEXT_JERSEY10 = 0x138,
TEXT_JERSEY11 = 0x139, TEXT_JERSEY11 = 0x139,
TEXT_JERSEY12 = 0x13A, TEXT_JERSEY12 = 0x13A,
TEXT_JERSEY13 = 0x13B, TEXT_JERSEY13 = 0x13B,
TEXT_SKLJRN = 0x13C, TEXT_SKLJRN = 0x13C,
TEXT_BOOK4 = 0x13D, TEXT_BOOK4 = 0x13D,
TEXT_BOOK5 = 0x13E, TEXT_BOOK5 = 0x13E,
TEXT_BOOK6 = 0x13F, TEXT_BOOK6 = 0x13F,
TEXT_BOOK7 = 0x140, TEXT_BOOK7 = 0x140,
TEXT_BOOK8 = 0x141, TEXT_BOOK8 = 0x141,
TEXT_BOOK9 = 0x142, TEXT_BOOK9 = 0x142,
TEXT_BOOKA = 0x143, TEXT_BOOKA = 0x143,
TEXT_BOOKB = 0x144, TEXT_BOOKB = 0x144,
TEXT_BOOKC = 0x145, TEXT_BOOKC = 0x145,
TEXT_OBOOKA = 0x146, TEXT_OBOOKA = 0x146,
TEXT_OBOOKB = 0x147, TEXT_OBOOKB = 0x147,
TEXT_OBOOKC = 0x148, TEXT_OBOOKC = 0x148,
TEXT_MBOOKA = 0x149, TEXT_MBOOKA = 0x149,
TEXT_MBOOKB = 0x14A, TEXT_MBOOKB = 0x14A,
TEXT_MBOOKC = 0x14B, TEXT_MBOOKC = 0x14B,
TEXT_RBOOKA = 0x14C, TEXT_RBOOKA = 0x14C,
TEXT_RBOOKB = 0x14D, TEXT_RBOOKB = 0x14D,
TEXT_RBOOKC = 0x14E, TEXT_RBOOKC = 0x14E,
TEXT_BBOOKA = 0x14F, TEXT_BBOOKA = 0x14F,
TEXT_BBOOKB = 0x150, TEXT_BBOOKB = 0x150,
TEXT_BBOOKC = 0x151, TEXT_BBOOKC = 0x151,
#endif #endif
} _speech_id; } _speech_id;
@ -2303,7 +2303,7 @@ typedef enum placeflag {
PLACE_UNIQUE = 4, PLACE_UNIQUE = 4,
} placeflag; } placeflag;
/* /*
First 5 bits store level First 5 bits store level
6th bit stores onlygood flag 6th bit stores onlygood flag
7th bit stores uper15 flag - uper means unique percent, this flag is true for unique monsters and loot from them has 15% to become unique 7th bit stores uper15 flag - uper means unique percent, this flag is true for unique monsters and loot from them has 15% to become unique
@ -3094,33 +3094,33 @@ typedef enum _setlevels {
} _setlevels; } _setlevels;
typedef enum quest_id { typedef enum quest_id {
Q_ROCK = 0x0, Q_ROCK = 0x00,
Q_MUSHROOM = 0x1, Q_MUSHROOM = 0x01,
Q_GARBUD = 0x2, Q_GARBUD = 0x02,
Q_ZHAR = 0x3, Q_ZHAR = 0x03,
Q_VEIL = 0x4, Q_VEIL = 0x04,
Q_DIABLO = 0x5, Q_DIABLO = 0x05,
Q_BUTCHER = 0x6, Q_BUTCHER = 0x06,
Q_LTBANNER = 0x7, Q_LTBANNER = 0x07,
Q_BLIND = 0x8, Q_BLIND = 0x08,
Q_BLOOD = 0x9, Q_BLOOD = 0x09,
Q_ANVIL = 0xA, Q_ANVIL = 0x0A,
Q_WARLORD = 0xB, Q_WARLORD = 0x0B,
Q_SKELKING = 0xC, Q_SKELKING = 0x0C,
Q_PWATER = 0xD, Q_PWATER = 0x0D,
Q_SCHAMB = 0xE, Q_SCHAMB = 0x0E,
Q_BETRAYER = 0xF, Q_BETRAYER = 0x0F,
#ifdef HELLFIRE #ifdef HELLFIRE
Q_GRAVE = 0x10, Q_GRAVE = 0x10,
Q_FARMER = 0x11, Q_FARMER = 0x11,
Q_GIRL = 0x12, Q_GIRL = 0x12,
Q_TRADER = 0x13, Q_TRADER = 0x13,
Q_DEFILER = 0x14, Q_DEFILER = 0x14,
Q_NAKRUL = 0x15, Q_NAKRUL = 0x15,
Q_CORNSTN = 0x16, Q_CORNSTN = 0x16,
Q_JERSEY = 0x17, Q_JERSEY = 0x17,
#endif #endif
Q_INVALID = -1, Q_INVALID = -1,
} quest_id; } quest_id;
typedef enum quest_state { typedef enum quest_state {

Loading…
Cancel
Save