diff --git a/Source/appfat.cpp b/Source/appfat.cpp index 7809c51f5..693847bbd 100644 --- a/Source/appfat.cpp +++ b/Source/appfat.cpp @@ -15,6 +15,9 @@ BOOL terminating; /** Thread id of the last callee to FreeDlg(). */ int cleanup_thread_id; +/** + * @brief Terminates the game and displays an error message box. + */ void app_fatal(const char *pszFmt, ...) { va_list va; @@ -30,6 +33,9 @@ void app_fatal(const char *pszFmt, ...) diablo_quit(1); } +/** + * @brief Displays an error message box based on the given format string and variable argument list. + */ void MsgBox(const char *pszFmt, va_list va) { char text[256]; @@ -39,6 +45,9 @@ void MsgBox(const char *pszFmt, va_list va) UiErrorOkDialog("Error", text); } +/** + * @brief Cleans up after a fatal application error. + */ void FreeDlg() { if (terminating && cleanup_thread_id != SDL_GetThreadID(NULL)) @@ -55,6 +64,9 @@ void FreeDlg() SNetDestroy(); } +/** + * @brief Displays a warning message box based on the given formatted error message. + */ void DrawDlg(char *pszFmt, ...) { char text[256]; @@ -74,6 +86,9 @@ void assert_fail(int nLineNo, const char *pszFile, const char *pszFail) } #endif +/** + * @brief Terminates the game and displays an error dialog box based on the given dialog_id. + */ void ErrDlg(const char *title, const char *error, char *log_file_path, int log_line_nr) { char text[1024]; @@ -86,6 +101,9 @@ void ErrDlg(const char *title, const char *error, char *log_file_path, int log_l app_fatal(NULL); } +/** + * @brief Terminates the game with a file not found error dialog. + */ void FileErrDlg(const char *error) { char text[1024]; @@ -110,6 +128,9 @@ void FileErrDlg(const char *error) app_fatal(NULL); } +/** + * @brief Terminates the game with an insert CD error dialog. + */ void InsertCDDlg(const char *fileName) { char text[1024]; @@ -125,6 +146,9 @@ void InsertCDDlg(const char *fileName) app_fatal(NULL); } +/** + * @brief Terminates the game with a read-only directory error dialog. + */ void DirErrorDlg(char *error) { char text[1024]; diff --git a/Source/automap.cpp b/Source/automap.cpp index 6cafca9fe..b358631e0 100644 --- a/Source/automap.cpp +++ b/Source/automap.cpp @@ -47,6 +47,9 @@ int AmLine4; #define MAPFLAG_DIRT 0x40 #define MAPFLAG_STAIRS 0x80 +/** + * @brief Initializes the automap. + */ void InitAutomapOnce() { automapflag = FALSE; @@ -58,6 +61,9 @@ void InitAutomapOnce() AmLine4 = 2; } +/** + * @brief Loads the mapping between tile IDs and automap shapes. + */ void InitAutomap() { BYTE b1, b2; @@ -98,7 +104,7 @@ void InitAutomap() return; } - dwTiles >>= 1; + dwTiles /= 2; pTmp = pAFile; for (i = 1; i <= dwTiles; i++) { @@ -116,6 +122,9 @@ void InitAutomap() } } +/** + * @brief Displays the automap. + */ void StartAutomap() { AutoMapXOfs = 0; @@ -123,30 +132,45 @@ void StartAutomap() automapflag = TRUE; } +/** + * @brief Scrolls the automap upwards. + */ void AutomapUp() { AutoMapXOfs--; AutoMapYOfs--; } +/** + * @brief Scrolls the automap downwards. + */ void AutomapDown() { AutoMapXOfs++; AutoMapYOfs++; } +/** + * @brief Scrolls the automap leftwards. + */ void AutomapLeft() { AutoMapXOfs--; AutoMapYOfs++; } +/** + * @brief Scrolls the automap rightwards. + */ void AutomapRight() { AutoMapXOfs++; AutoMapYOfs--; } +/** + * @brief Increases the zoom level of the automap. + */ void AutomapZoomIn() { if (AutoMapScale < 200) { @@ -159,6 +183,9 @@ void AutomapZoomIn() } } +/** + * @brief Decreases the zoom level of the automap. + */ void AutomapZoomOut() { if (AutoMapScale > 50) { @@ -171,6 +198,9 @@ void AutomapZoomOut() } } +/** + * @brief Renders the automap on screen. + */ void DrawAutomap() { int cells; @@ -236,7 +266,7 @@ void DrawAutomap() for (j = 0; j < cells; j++) { WORD maptype = GetAutomapType(mapx + j, mapy - j, TRUE); - if (maptype) + if (maptype != 0) DrawAutomapTile(x, sy, maptype); x += AmLine64; } @@ -245,7 +275,7 @@ void DrawAutomap() y = sy + AmLine16; for (j = 0; j <= cells; j++) { WORD maptype = GetAutomapType(mapx + j, mapy - j, TRUE); - if (maptype) + if (maptype != 0) DrawAutomapTile(x, y, maptype); x += AmLine64; } @@ -257,6 +287,9 @@ void DrawAutomap() gpBufEnd = &gpBuffer[BUFFER_WIDTH * (SCREEN_HEIGHT + SCREEN_Y)]; } +/** + * @brief Renders the given automap shape at the specified screen coordinates. + */ void DrawAutomapTile(int sx, int sy, WORD automap_type) { BOOL do_vert; @@ -369,7 +402,7 @@ void DrawAutomapTile(int sx, int sy, WORD automap_type) DrawLine(sx, sy, x1, y2, COLOR_DIM); DrawLine(sx, sy, x2, y2, COLOR_DIM); } - if (!(flags & (MAPFLAG_VERTDOOR | MAPFLAG_VERTGRATE | MAPFLAG_VERTARCH))) + if ((flags & (MAPFLAG_VERTDOOR | MAPFLAG_VERTGRATE | MAPFLAG_VERTARCH)) == 0) DrawLine(sx, sy - AmLine16, sx - AmLine32, sy, COLOR_DIM); } @@ -402,7 +435,7 @@ void DrawAutomapTile(int sx, int sy, WORD automap_type) DrawLine(sx, sy, x1, y2, COLOR_DIM); DrawLine(sx, sy, x2, y2, COLOR_DIM); } - if (!(flags & (MAPFLAG_HORZDOOR | MAPFLAG_HORZGRATE | MAPFLAG_HORZARCH))) + if ((flags & (MAPFLAG_HORZDOOR | MAPFLAG_HORZGRATE | MAPFLAG_HORZARCH)) == 0) DrawLine(sx, sy - AmLine16, sx + AmLine32, sy, COLOR_DIM); } @@ -442,21 +475,24 @@ void DrawAutomapTile(int sx, int sy, WORD automap_type) } } +/** + * @brief Renders an arrow on the automap, centered on and facing the direction of the player. + */ void DrawAutomapPlr() { int px, py; int x, y; if (plr[myplr]._pmode == PM_WALK3) { - x = plr[myplr]._px; - y = plr[myplr]._py; + x = plr[myplr]._pfutx; + y = plr[myplr]._pfuty; if (plr[myplr]._pdir == DIR_W) x++; else y++; } else { - x = plr[myplr].WorldX; - y = plr[myplr].WorldY; + x = plr[myplr]._px; + y = plr[myplr]._py; } px = x - 2 * AutoMapXOfs - ViewX; py = y - 2 * AutoMapYOfs - ViewY; @@ -514,6 +550,9 @@ void DrawAutomapPlr() } } +/** + * @brief Returns the automap shape at the given coordinate. + */ WORD GetAutomapType(int x, int y, BOOL view) { WORD rv; @@ -555,6 +594,9 @@ WORD GetAutomapType(int x, int y, BOOL view) return rv; } +/** + * @brief Renders game info, such as the name of the current level, and in multi player the name of the game and the game password. + */ void DrawAutomapText() { char desc[256]; @@ -570,14 +612,17 @@ void DrawAutomapText() nextline = 50; } } - if (setlevel) + if (setlevel) { PrintGameStr(8, nextline, quest_level_names[(BYTE)setlvlnum], COL_GOLD); - else if (currlevel) { + } else if (currlevel) { sprintf(desc, "Level: %i", currlevel); PrintGameStr(8, nextline, desc, COL_GOLD); } } +/** + * @brief Marks the given coordinate as within view on the automap. + */ void SetAutomapView(int x, int y) { WORD maptype, solid; @@ -650,6 +695,9 @@ void SetAutomapView(int x, int y) } } +/** + * @brief Resets the zoom level of the automap. + */ void AutomapZoomReset() { AutoMapXOfs = 0; diff --git a/Source/codec.cpp b/Source/codec.cpp index 5f970c5d7..81894dfea 100644 --- a/Source/codec.cpp +++ b/Source/codec.cpp @@ -17,6 +17,8 @@ typedef struct CodecSignature { WORD unused; } CodecSignature; +#define BLOCKSIZE 64 + int codec_decode(BYTE *pbSrcDst, DWORD size, char *pszPassword) { char buf[128]; @@ -25,20 +27,20 @@ int codec_decode(BYTE *pbSrcDst, DWORD size, char *pszPassword) CodecSignature *sig; codec_init_key(0, pszPassword); - if (size <= 8) + if (size <= sizeof(CodecSignature)) return 0; - size = size - 8; - if (size % 64 != 0) + size -= sizeof(CodecSignature); + if (size % BLOCKSIZE != 0) return 0; - for (i = size; i != 0; pbSrcDst += 64, i -= 64) { - memcpy(buf, pbSrcDst, 64); + for (i = size; i != 0; pbSrcDst += BLOCKSIZE, i -= BLOCKSIZE) { + memcpy(buf, pbSrcDst, BLOCKSIZE); SHA1Result(0, dst); - for (int j = 0; j < 64; j++) { + for (int j = 0; j < BLOCKSIZE; j++) { buf[j] ^= dst[j % SHA1HashSize]; } SHA1Calculate(0, buf, NULL); memset(dst, 0, sizeof(dst)); - memcpy(pbSrcDst, buf, 64); + memcpy(pbSrcDst, buf, BLOCKSIZE); } memset(buf, 0, sizeof(buf)); @@ -53,7 +55,7 @@ int codec_decode(BYTE *pbSrcDst, DWORD size, char *pszPassword) goto error; } - size += sig->last_chunk_size - 64; + size += sig->last_chunk_size - BLOCKSIZE; SHA1Clear(); return size; error: @@ -95,9 +97,9 @@ void codec_init_key(int unused, char *pszPassword) DWORD codec_get_encoded_len(DWORD dwSrcBytes) { - if (dwSrcBytes % 64 != 0) - dwSrcBytes += 64 - (dwSrcBytes % 64); - return dwSrcBytes + 8; + if (dwSrcBytes % BLOCKSIZE != 0) + dwSrcBytes += BLOCKSIZE - (dwSrcBytes % BLOCKSIZE); + return dwSrcBytes + sizeof(CodecSignature); } void codec_encode(BYTE *pbSrcDst, DWORD size, int size_64, char *pszPassword) @@ -115,19 +117,19 @@ void codec_encode(BYTE *pbSrcDst, DWORD size, int size_64, char *pszPassword) last_chunk = 0; while (size != 0) { - chunk = size < 64 ? size : 64; + chunk = size < BLOCKSIZE ? size : BLOCKSIZE; memcpy(buf, pbSrcDst, chunk); - if (chunk < 64) - memset(buf + chunk, 0, 64 - chunk); + if (chunk < BLOCKSIZE) + memset(buf + chunk, 0, BLOCKSIZE - chunk); SHA1Result(0, dst); SHA1Calculate(0, buf, NULL); - for (int j = 0; j < 64; j++) { + for (int j = 0; j < BLOCKSIZE; j++) { buf[j] ^= dst[j % SHA1HashSize]; } memset(dst, 0, sizeof(dst)); - memcpy(pbSrcDst, buf, 64); + memcpy(pbSrcDst, buf, BLOCKSIZE); last_chunk = chunk; - pbSrcDst += 64; + pbSrcDst += BLOCKSIZE; size -= chunk; } memset(buf, 0, sizeof(buf)); @@ -135,10 +137,9 @@ void codec_encode(BYTE *pbSrcDst, DWORD size, int size_64, char *pszPassword) sig = (CodecSignature *)pbSrcDst; sig->error = 0; sig->unused = 0; - sig->checksum = *(DWORD *)tmp; + sig->checksum = *(DWORD *)&tmp[0]; sig->last_chunk_size = last_chunk; SHA1Clear(); } DEVILUTION_END_NAMESPACE - diff --git a/Source/control.cpp b/Source/control.cpp index 701b7a188..6c637093a 100644 --- a/Source/control.cpp +++ b/Source/control.cpp @@ -646,9 +646,12 @@ void DrawFlask(BYTE *pCelBuff, int w, int nSrcOff, BYTE *pBuff, int nDstOff, int */ void DrawLifeFlask() { - int filled = (double)plr[myplr]._pHitPoints / (double)plr[myplr]._pMaxHP * 80.0; - plr[myplr]._pHPPer = filled; + double p; + int filled; + p = (double)plr[myplr]._pHitPoints / (double)plr[myplr]._pMaxHP * 80.0; + plr[myplr]._pHPPer = p; + filled = plr[myplr]._pHPPer; if (filled > 80) filled = 80; filled = 80 - filled; @@ -668,7 +671,10 @@ void DrawLifeFlask() */ void UpdateLifeFlask() { - int filled = (double)plr[myplr]._pHitPoints / (double)plr[myplr]._pMaxHP * 80.0; + double p; + int filled; + p = (double)plr[myplr]._pHitPoints / (double)plr[myplr]._pMaxHP * 80.0; + filled = p; plr[myplr]._pHPPer = filled; if (filled > 69) @@ -778,7 +784,7 @@ void InitControlPan() pMultiBtns = LoadFileInMem("CtrlPan\\P8But2.CEL", NULL); pTalkBtns = LoadFileInMem("CtrlPan\\TalkButt.CEL", NULL); sgbPlrTalkTbl = 0; - sgszTalkMsg[0] = 0; + sgszTalkMsg[0] = '\0'; for (i = 0; i < MAX_PLRS; i++) whisper[i] = TRUE; for (i = 0; i < sizeof(talkbtndown) / sizeof(talkbtndown[0]); i++) @@ -1279,7 +1285,7 @@ void CPrintString(int y, char *str, BOOL center, int lines) lineOffset = 0; sx = 177 + PANEL_X; sy = lineOffsets[lines][y] + PANEL_Y; - if (center == 1) { + if (center == TRUE) { strWidth = 0; tmp = str; while (*tmp) { @@ -1580,7 +1586,7 @@ void DrawLevelUpIcon() { int nCel; - if (!stextflag) { + if (stextflag == STORE_NONE) { nCel = lvlbtndown ? 3 : 2; ADD_PlrStringXY(PANEL_LEFT + 0, PANEL_TOP - 49, PANEL_LEFT + 120, "Level Up", COL_WHITE); CelDraw(40 + PANEL_X, -17 + PANEL_Y, pChrButtons, nCel, 41); @@ -1911,7 +1917,7 @@ void DrawGoldSplit(int amount) ADD_PlrStringXY(366, 121, 600, "you want to remove?", COL_GOLD); if (amount > 0) { sprintf(tempstr, "%u", amount); - PrintGameStr(388, 140, tempstr, 0); + PrintGameStr(388, 140, tempstr, COL_WHITE); for (i = 0; i < tempstr[i]; i++) { screen_x += fontkern[fontframe[gbFontTransTbl[(BYTE)tempstr[i]]]] + 1; } @@ -1946,7 +1952,7 @@ void control_drop_gold(char vkey) input[strlen(input) - 1] = '\0'; dropGoldValue = atoi(input); } else if (vkey - '0' >= 0 && vkey - '0' <= 9) { - if (dropGoldValue || atoi(input) <= initialDropGoldValue) { + if (dropGoldValue != 0 || atoi(input) <= initialDropGoldValue) { input[strlen(input)] = vkey; if (atoi(input) > initialDropGoldValue) return; @@ -2075,7 +2081,7 @@ char *control_print_talk_msg(char *msg, int *x, int y, int color) if (width > 514 + PANEL_LEFT) return msg; msg++; - if (c) { + if (c != 0) { PrintChar(*x, y + 22 + PANEL_Y, c, color); } *x += fontkern[c] + 1; @@ -2137,7 +2143,7 @@ void control_reset_talk_msg(char *msg) if (whisper[i]) pmask |= 1 << i; } - NetSendCmdString(pmask, sgszTalkMsg); + NetSendCmdString(pmask, sgszTalkMsg); } void control_type_message() @@ -2149,7 +2155,7 @@ void control_type_message() } talkflag = TRUE; - sgszTalkMsg[0] = 0; + sgszTalkMsg[0] = '\0'; PentSpn2Frame = 1; for (i = 0; i < 3; i++) { talkbtndown[i] = FALSE; @@ -2225,7 +2231,7 @@ void control_press_enter() int i; BYTE talk_save; - if (sgszTalkMsg[0]) { + if (sgszTalkMsg[0] != 0) { control_reset_talk_msg(sgszTalkMsg); for (i = 0; i < 8; i++) { if (!strcmp(sgszTalkSave[i], sgszTalkMsg)) diff --git a/Source/cursor.cpp b/Source/cursor.cpp index 3a588bc69..39483beb7 100644 --- a/Source/cursor.cpp +++ b/Source/cursor.cpp @@ -7,17 +7,17 @@ DEVILUTION_BEGIN_NAMESPACE -int cursH; -int icursH28; int cursW; +int cursH; int pcursmonst = -1; int icursW28; +int icursH28; BYTE *pCursCels; -int icursH; /** inv_item value */ char pcursinvitem; int icursW; +int icursH; char pcursitem; char pcursobj; char pcursplr; @@ -28,7 +28,8 @@ int pcurs; /* rdata */ /** Maps from objcurs.cel frame number to frame width. */ -const int InvItemWidth[180] = { +const int InvItemWidth[] = { + // clang-format off // Cursors 0, 33, 32, 32, 32, 32, 32, 32, 32, 32, 32, 23, // Items @@ -48,11 +49,13 @@ const int InvItemWidth[180] = { 2 * 28, 2 * 28, 2 * 28, 2 * 28, 2 * 28, 2 * 28, 2 * 28, 2 * 28, 2 * 28, 2 * 28, 2 * 28, 2 * 28, 2 * 28, 2 * 28, 2 * 28, 2 * 28, 2 * 28, 2 * 28, 2 * 28, 2 * 28, 2 * 28, 2 * 28, 2 * 28, 2 * 28, 2 * 28, 2 * 28, 2 * 28, 2 * 28, 2 * 28, 2 * 28, - 2 * 28, 2 * 28, 2 * 28, 2 * 28, 2 * 28, 2 * 28, 2 * 28, 2 * 28 + 2 * 28, 2 * 28, 2 * 28, 2 * 28, 2 * 28, 2 * 28, 2 * 28, 2 * 28, + // clang-format on }; /** Maps from objcurs.cel frame number to frame height. */ -const int InvItemHeight[180] = { +const int InvItemHeight[] = { + // clang-format off // Cursors 0, 29, 32, 32, 32, 32, 32, 32, 32, 32, 32, 35, // Items @@ -72,12 +75,13 @@ const int InvItemHeight[180] = { 3 * 28, 3 * 28, 3 * 28, 3 * 28, 3 * 28, 3 * 28, 3 * 28, 3 * 28, 3 * 28, 3 * 28, 3 * 28, 3 * 28, 3 * 28, 3 * 28, 3 * 28, 3 * 28, 3 * 28, 3 * 28, 3 * 28, 3 * 28, 3 * 28, 3 * 28, 3 * 28, 3 * 28, 3 * 28, 3 * 28, 3 * 28, 3 * 28, 3 * 28, 3 * 28, - 3 * 28, 3 * 28, 3 * 28, 3 * 28, 3 * 28, 3 * 28, 3 * 28, 3 * 28 + 3 * 28, 3 * 28, 3 * 28, 3 * 28, 3 * 28, 3 * 28, 3 * 28, 3 * 28, + // clang-format on }; void InitCursor() { - /// ASSERT: assert(! pCursCels); + assert(!pCursCels); pCursCels = LoadFileInMem("Data\\Inv\\Objcurs.CEL", NULL); ClearCursor(); } @@ -186,17 +190,16 @@ void CheckCursMove() sx = MouseX; sy = MouseY; - if (PANELS_COVER) { if (chrflag || questlog) { - if (sx >= 160) { - sx -= 160; + if (sx >= SCREEN_WIDTH / 4) { + sx -= SCREEN_WIDTH / 4; } else { sx = 0; } } else if (invflag || sbookflag) { - if (sx <= 320) { - sx += 160; + if (sx <= SCREEN_WIDTH / 2) { + sx += SCREEN_WIDTH / 4; } else { sx = 0; } @@ -238,8 +241,8 @@ void CheckCursMove() sy = SCREEN_HEIGHT; } - tx = sx >> 6; // sx / 64 - ty = sy >> 5; // sy / 32 + tx = sx >> 6; // sx / 64 + ty = sy >> 5; // sy / 32 px = sx & 0x3F; // sx % 64 py = sy & 0x1F; // sx % 32 mx = ViewX + tx + ty - (zoomflag ? (SCREEN_WIDTH / 64) : (SCREEN_WIDTH / 2 / 64)); @@ -495,7 +498,7 @@ void CheckCursMove() } if (dFlags[mx][my] & BFLAG_DEAD_PLAYER) { for (i = 0; i < MAX_PLRS; i++) { - if (plr[i].WorldX == mx && plr[i].WorldY == my && i != myplr) { + if (plr[i]._px == mx && plr[i]._py == my && i != myplr) { cursmx = mx; cursmy = my; pcursplr = i; @@ -507,7 +510,7 @@ void CheckCursMove() for (yy = -1; yy < 2; yy++) { if (dFlags[mx + xx][my + yy] & BFLAG_DEAD_PLAYER) { for (i = 0; i < MAX_PLRS; i++) { - if (plr[i].WorldX == mx + xx && plr[i].WorldY == my + yy && i != myplr) { + if (plr[i]._px == mx + xx && plr[i]._py == my + yy && i != myplr) { cursmx = mx + xx; cursmy = my + yy; pcursplr = i; diff --git a/Source/cursor.h b/Source/cursor.h index 42b1df215..42da1ff94 100644 --- a/Source/cursor.h +++ b/Source/cursor.h @@ -6,11 +6,11 @@ #ifndef __CURSOR_H__ #define __CURSOR_H__ -extern int cursH; -extern int icursH28; extern int cursW; +extern int cursH; extern int pcursmonst; extern int icursW28; +extern int icursH28; extern BYTE *pCursCels; extern int icursH; extern char pcursinvitem; @@ -34,7 +34,7 @@ void CheckRportal(); void CheckCursMove(); /* rdata */ -extern const int InvItemWidth[180]; -extern const int InvItemHeight[180]; +extern const int InvItemWidth[]; +extern const int InvItemHeight[]; #endif /* __CURSOR_H__ */ diff --git a/Source/debug.cpp b/Source/debug.cpp index deeb8316a..19d84267c 100644 --- a/Source/debug.cpp +++ b/Source/debug.cpp @@ -161,7 +161,7 @@ void PrintDebugPlayer(BOOL bNextPlayer) NetSendCmdString(1 << myplr, dstr); sprintf(dstr, " Lvl = %i : Change = %i", plr[dbgplr].plrlevel, plr[dbgplr]._pLvlChanging); NetSendCmdString(1 << myplr, dstr); - sprintf(dstr, " x = %i, y = %i : tx = %i, ty = %i", plr[dbgplr].WorldX, plr[dbgplr].WorldY, plr[dbgplr]._ptargx, plr[dbgplr]._ptargy); + sprintf(dstr, " x = %i, y = %i : tx = %i, ty = %i", plr[dbgplr]._px, plr[dbgplr]._py, plr[dbgplr]._ptargx, plr[dbgplr]._ptargy); NetSendCmdString(1 << myplr, dstr); sprintf(dstr, " mode = %i : daction = %i : walk[0] = %i", plr[dbgplr]._pmode, plr[dbgplr].destAction, plr[dbgplr].walkpath[0]); NetSendCmdString(1 << myplr, dstr); diff --git a/Source/diablo.cpp b/Source/diablo.cpp index 13c12e874..255637f5d 100644 --- a/Source/diablo.cpp +++ b/Source/diablo.cpp @@ -11,19 +11,19 @@ DEVILUTION_BEGIN_NAMESPACE SDL_Window *ghMainWnd; +DWORD glSeedTbl[NUMLEVELS]; +int gnLevelTypeTbl[NUMLEVELS]; +int glEndSeed[NUMLEVELS]; int glMid1Seed[NUMLEVELS]; int glMid2Seed[NUMLEVELS]; -int gnLevelTypeTbl[NUMLEVELS]; -int MouseY; +int glMid3Seed[NUMLEVELS]; int MouseX; +int MouseY; BOOL gbGameLoopStartup; -DWORD glSeedTbl[NUMLEVELS]; BOOL gbRunGame; -int glMid3Seed[NUMLEVELS]; BOOL gbRunGameResult; BOOL zoomflag; BOOL gbProcessPlayers; -int glEndSeed[NUMLEVELS]; BOOL gbLoadGame; int DebugMonsters[10]; BOOLEAN cineflag; @@ -126,11 +126,11 @@ BOOL StartGame(BOOL bNewGame, BOOL bSinglePlayer) InitPortals(); InitDungMsgs(myplr); } - if (!gbValidSaveFile || !gbLoadGame) + if (!gbValidSaveFile || !gbLoadGame) { uMsg = WM_DIABNEWGAME; - else + } else { uMsg = WM_DIABLOADGAME; - + } run_game_loop(uMsg); NetClose(); pfile_create_player_description(0, 0); @@ -155,7 +155,7 @@ static bool ProcessInput() return false; } - if (!gmenu_is_active() && sgnTimeoutCurs == 0) { + if (!gmenu_is_active() && sgnTimeoutCurs == CURSOR_NONE) { #ifndef USE_SDL1 finish_simulated_mouse_clicks(MouseX, MouseY); #endif @@ -219,7 +219,7 @@ void run_game_loop(unsigned int uMsg) pfile_flush_W(); PaletteFadeOut(8); - SetCursor_(CURSOR_NONE); + NewCursor(CURSOR_NONE); ClearScreenBuffer(); force_redraw = 255; scrollrt_draw_game_screen(TRUE); @@ -323,9 +323,9 @@ void diablo_deinit() if (was_archives_init) init_cleanup(); if (was_window_init) - dx_cleanup(); // Cleanup SDL surfaces stuff, so we have to do it before SDL_Quit(). + dx_cleanup(); // Cleanup SDL surfaces stuff, so we have to do it before SDL_Quit(). if (was_fonts_init) - FontsCleanup(); + FontsCleanup(); if (SDL_WasInit(SDL_INIT_EVERYTHING & ~SDL_INIT_HAPTIC)) SDL_Quit(); } @@ -394,25 +394,25 @@ void diablo_parse_flags(int argc, char **argv) basePath += '/'; #endif } else if (strcasecmp("-n", argv[i]) == 0) { - showintrodebug = 0; + showintrodebug = FALSE; } else if (strcasecmp("-f", argv[i]) == 0) { EnableFrameCount(); } else if (strcasecmp("-x", argv[i]) == 0) { fullscreen = FALSE; #ifdef _DEBUG } else if (strcasecmp("-^", argv[i]) == 0) { - debug_mode_key_inverted_v = 1; + debug_mode_key_inverted_v = TRUE; } else if (strcasecmp("-$", argv[i]) == 0) { - debug_mode_dollar_sign = 1; - /* + debug_mode_dollar_sign = TRUE; + /* } else if (strcasecmp("-b", argv[i]) == 0) { debug_mode_key_b = 1; */ } else if (strcasecmp("-d", argv[i]) == 0) { - debug_mode_key_d = 1; + debug_mode_key_d = TRUE; } else if (strcasecmp("-i", argv[i]) == 0) { - debug_mode_key_i = 1; - /* + debug_mode_key_i = TRUE; + /* } else if (strcasecmp("-j", argv[i]) == 0) { debug_mode_key_J_trigger = argv[++i]; */ @@ -430,7 +430,7 @@ void diablo_parse_flags(int argc, char **argv) } else if (strcasecmp("-r", argv[i]) == 0) { setseed = SDL_atoi(argv[++i]); } else if (strcasecmp("-s", argv[i]) == 0) { - debug_mode_key_s = 1; + debug_mode_key_s = TRUE; } else if (strcasecmp("-t", argv[i]) == 0) { leveldebug = TRUE; setlevel = TRUE; @@ -438,7 +438,7 @@ void diablo_parse_flags(int argc, char **argv) } else if (strcasecmp("-v", argv[i]) == 0) { visiondebug = TRUE; } else if (strcasecmp("-w", argv[i]) == 0) { - debug_mode_key_w = 1; + debug_mode_key_w = TRUE; #endif } else { printf("unrecognized option '%s'\n", argv[i]); @@ -645,7 +645,7 @@ LRESULT GM_Game(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) BOOL LeftMouseDown(int wParam) { - if (!gmenu_left_mouse(TRUE) && !control_check_talk_btn() && !sgnTimeoutCurs) { + if (!gmenu_left_mouse(TRUE) && !control_check_talk_btn() && sgnTimeoutCurs == CURSOR_NONE) { if (deathflag) { control_check_btn_press(); } else if (PauseMode != 2) { @@ -653,7 +653,7 @@ BOOL LeftMouseDown(int wParam) doom_close(); } else if (spselflag) { SetSpell(); - } else if (stextflag) { + } else if (stextflag != STORE_NONE) { CheckStoreBtn(); } else if (MouseY < PANEL_TOP || MouseX < PANEL_LEFT || MouseX > PANEL_LEFT + PANEL_WIDTH) { if (!gmenu_is_active() && !TryIconCurs()) { @@ -672,10 +672,10 @@ BOOL LeftMouseDown(int wParam) } else if (pcurs >= CURSOR_FIRSTITEM) { if (TryInvPut()) { NetSendCmdPItem(TRUE, CMD_PUTITEM, cursmx, cursmy); - SetCursor_(CURSOR_HAND); + NewCursor(CURSOR_HAND); } } else { - if (plr[myplr]._pStatPts && !spselflag) + if (plr[myplr]._pStatPts != 0 && !spselflag) CheckLvlBtn(); if (!lvlbtndown) return LeftMouseCmd(wParam == MK_SHIFT + MK_LBUTTON); @@ -686,7 +686,7 @@ BOOL LeftMouseDown(int wParam) CheckInvScrn(); DoPanBtn(); if (pcurs > CURSOR_HAND && pcurs < CURSOR_FIRSTITEM) - SetCursor_(CURSOR_HAND); + NewCursor(CURSOR_HAND); } } } @@ -698,7 +698,7 @@ BOOL LeftMouseCmd(BOOL bShift) { BOOL bNear; - /// ASSERT: assert(MouseY < 352); // PANEL_TOP + assert(MouseY < PANEL_TOP); // 352 if (leveltype == DTYPE_TOWN) { if (pcursitem != -1 && pcurs == CURSOR_HAND) @@ -708,7 +708,7 @@ BOOL LeftMouseCmd(BOOL bShift) if (pcursitem == -1 && pcursmonst == -1 && pcursplr == -1) return TRUE; } else { - bNear = abs(plr[myplr].WorldX - cursmx) < 2 && abs(plr[myplr].WorldY - cursmy) < 2; + bNear = abs(plr[myplr]._px - cursmx) < 2 && abs(plr[myplr]._py - cursmy) < 2; if (pcursitem != -1 && pcurs == CURSOR_HAND && !bShift) { NetSendCmdLocParam1(TRUE, invflag ? CMD_GOTOGETITEM : CMD_GOTOAGETITEM, cursmx, cursmy, pcursitem); } else if (pcursobj != -1 && (!bShift || bNear && object[pcursobj]._oBreak == 1)) { @@ -764,21 +764,21 @@ BOOL TryIconCurs() if (pcursinvitem != -1) { CheckIdentify(myplr, pcursinvitem); } else { - SetCursor_(CURSOR_HAND); + NewCursor(CURSOR_HAND); } return TRUE; } else if (pcurs == CURSOR_REPAIR) { if (pcursinvitem != -1) { DoRepair(myplr, pcursinvitem); } else { - SetCursor_(CURSOR_HAND); + NewCursor(CURSOR_HAND); } return TRUE; } else if (pcurs == CURSOR_RECHARGE) { if (pcursinvitem != -1) { DoRecharge(myplr, pcursinvitem); } else { - SetCursor_(CURSOR_HAND); + NewCursor(CURSOR_HAND); } return TRUE; } else if (pcurs == CURSOR_TELEPORT) { @@ -789,10 +789,10 @@ BOOL TryIconCurs() } else { NetSendCmdLocParam2(TRUE, CMD_TSPELLXY, cursmx, cursmy, plr[myplr]._pTSpell, GetSpellLevel(myplr, plr[myplr]._pTSpell)); } - SetCursor_(CURSOR_HAND); + NewCursor(CURSOR_HAND); return TRUE; } else if (pcurs == CURSOR_DISARM && pcursobj == -1) { - SetCursor_(CURSOR_HAND); + NewCursor(CURSOR_HAND); return TRUE; } @@ -809,7 +809,7 @@ void LeftMouseUp() ReleaseChrBtns(); if (lvlbtndown) ReleaseLvlBtn(); - if (stextflag) + if (stextflag != STORE_NONE) ReleaseStoreBtn(); } @@ -818,7 +818,7 @@ void RightMouseDown() if (!gmenu_is_active() && sgnTimeoutCurs == CURSOR_NONE && PauseMode != 2 && !plr[myplr]._pInvincible) { if (doomflag) { doom_close(); - } else if (!stextflag) { + } else if (stextflag == STORE_NONE) { if (spselflag) { SetSpell(); } else if (MouseY >= SPANEL_HEIGHT @@ -829,7 +829,7 @@ void RightMouseDown() if (pcursinvitem == -1 || !UseInvItem(myplr, pcursinvitem)) CheckPlrSpell(); } else if (pcurs > CURSOR_HAND && pcurs < CURSOR_FIRSTITEM) { - SetCursor_(CURSOR_HAND); + NewCursor(CURSOR_HAND); } } } @@ -852,7 +852,7 @@ void diablo_hotkey_msg(DWORD dwMsg) return; } - /// ASSERT: assert(dwMsg < sizeof(spszMsgTbl) / sizeof(spszMsgTbl[0])); + assert(dwMsg < sizeof(spszMsgTbl) / sizeof(spszMsgTbl[0])); if (!getIniValue("NetMsg", spszMsgHotKeyTbl[dwMsg], szMsg, MAX_SEND_STR_LEN)) { snprintf(szMsg, MAX_SEND_STR_LEN, "%s", spszMsgTbl[dwMsg]); setIniValue("NetMsg", spszMsgHotKeyTbl[dwMsg], szMsg); @@ -874,7 +874,7 @@ void PressKey(int vkey) } if (deathflag) { - if (sgnTimeoutCurs != 0) { + if (sgnTimeoutCurs != CURSOR_NONE) { return; } if (vkey == VK_F9) { @@ -904,7 +904,7 @@ void PressKey(int vkey) return; } - if (sgnTimeoutCurs != 0 || dropGoldFlag) { + if (sgnTimeoutCurs != CURSOR_NONE || dropGoldFlag) { return; } if (vkey == VK_PAUSE) { @@ -928,7 +928,7 @@ void PressKey(int vkey) } else if (vkey == VK_F1) { if (helpflag) { helpflag = FALSE; - } else if (stextflag) { + } else if (stextflag != STORE_NONE) { ClearPanel(); AddPanelString("No help available", TRUE); /// BUGFIX: message isn't displayed AddPanelString("while in stores", TRUE); @@ -1091,7 +1091,7 @@ void diablo_pause_game() */ void PressChar(int vkey) { - if (gmenu_is_active() || control_talk_last_key(vkey) || sgnTimeoutCurs != 0 || deathflag) { + if (gmenu_is_active() || control_talk_last_key(vkey) || sgnTimeoutCurs != CURSOR_NONE || deathflag) { return; } if ((char)vkey == 'p' || (char)vkey == 'P') { @@ -1121,7 +1121,7 @@ void PressChar(int vkey) return; case 'I': case 'i': - if (!stextflag) { + if (stextflag == STORE_NONE) { sbookflag = FALSE; invflag = !invflag; if (!invflag || chrflag) { @@ -1137,7 +1137,7 @@ void PressChar(int vkey) return; case 'C': case 'c': - if (!stextflag) { + if (stextflag == STORE_NONE) { questlog = FALSE; chrflag = !chrflag; if (!chrflag || invflag) { @@ -1153,7 +1153,7 @@ void PressChar(int vkey) return; case 'Q': case 'q': - if (!stextflag) { + if (stextflag == STORE_NONE) { chrflag = FALSE; if (!questlog) { StartQuestlog(); @@ -1168,7 +1168,7 @@ void PressChar(int vkey) return; case 'S': case 's': - if (!stextflag) { + if (stextflag == STORE_NONE) { invflag = FALSE; if (!spselflag) { DoSpeedBook(); @@ -1180,7 +1180,7 @@ void PressChar(int vkey) return; case 'B': case 'b': - if (!stextflag) { + if (stextflag == STORE_NONE) { invflag = FALSE; sbookflag = !sbookflag; } @@ -1328,7 +1328,7 @@ void PressChar(int vkey) case 'T': case 't': if (debug_mode_key_inverted_v) { - sprintf(tempstr, "PX = %i PY = %i", plr[myplr].WorldX, plr[myplr].WorldY); + sprintf(tempstr, "PX = %i PY = %i", plr[myplr]._px, plr[myplr]._py); NetSendCmdString(1 << myplr, tempstr); sprintf(tempstr, "CX = %i CY = %i DP = %i", cursmx, cursmy, dungeon[cursmx][cursmy]); NetSendCmdString(1 << myplr, tempstr); @@ -1350,7 +1350,7 @@ void PressChar(int vkey) void LoadLvlGFX() { - /// ASSERT: assert(! pDungeonCels); + assert(!pDungeonCels); switch (leveltype) { case DTYPE_TOWN: @@ -1453,7 +1453,7 @@ void LoadGameLevel(BOOL firstflag, int lvldir) glSeedTbl[currlevel] = setseed; music_stop(); - SetCursor_(CURSOR_HAND); + NewCursor(CURSOR_HAND); SetRndSeed(glSeedTbl[currlevel]); IncProgress(); MakeLightTable(); @@ -1636,11 +1636,11 @@ void LoadGameLevel(BOOL firstflag, int lvldir) if (plr[i].plractive && plr[i].plrlevel == currlevel && (!plr[i]._pLvlChanging || i == myplr)) { if (plr[i]._pHitPoints > 0) { if (gbMaxPlayers == 1) - dPlayer[plr[i].WorldX][plr[i].WorldY] = i + 1; + dPlayer[plr[i]._px][plr[i]._py] = i + 1; else SyncInitPlrPos(i); } else { - dFlags[plr[i].WorldX][plr[i].WorldY] |= BFLAG_DEAD_PLAYER; + dFlags[plr[i]._px][plr[i]._py] |= BFLAG_DEAD_PLAYER; } } } @@ -1739,13 +1739,13 @@ void timeout_cursor(BOOL bTimeout) ClearPanel(); AddPanelString("-- Network timeout --", TRUE); AddPanelString("-- Waiting for players --", TRUE); - SetCursor_(CURSOR_HOURGLASS); + NewCursor(CURSOR_HOURGLASS); force_redraw = 255; } scrollrt_draw_game_screen(TRUE); - } else if (sgnTimeoutCurs) { - SetCursor_(sgnTimeoutCurs); - sgnTimeoutCurs = 0; + } else if (sgnTimeoutCurs != CURSOR_NONE) { + NewCursor(sgnTimeoutCurs); + sgnTimeoutCurs = CURSOR_NONE; ClearPanel(); force_redraw = 255; } diff --git a/Source/diablo.h b/Source/diablo.h index e2e265905..c16f6272f 100644 --- a/Source/diablo.h +++ b/Source/diablo.h @@ -7,26 +7,26 @@ #define __DIABLO_H__ extern SDL_Window *ghMainWnd; +extern DWORD glSeedTbl[NUMLEVELS]; +extern int gnLevelTypeTbl[NUMLEVELS]; +extern int glEndSeed[NUMLEVELS]; extern int glMid1Seed[NUMLEVELS]; extern int glMid2Seed[NUMLEVELS]; -extern int gnLevelTypeTbl[NUMLEVELS]; -extern int MouseY; +extern int glMid3Seed[NUMLEVELS]; extern int MouseX; +extern int MouseY; extern BOOL gbGameLoopStartup; -extern DWORD glSeedTbl[NUMLEVELS]; extern BOOL gbRunGame; -extern int glMid3Seed[NUMLEVELS]; extern BOOL gbRunGameResult; extern BOOL zoomflag; extern BOOL gbProcessPlayers; -extern int glEndSeed[NUMLEVELS]; extern BOOL gbLoadGame; extern HINSTANCE ghInst; extern int DebugMonsters[10]; extern BOOLEAN cineflag; extern int force_redraw; extern BOOL visiondebug; -/* These are defined in fonts.h */ +/* These are defined in fonts.h */ extern BOOL was_fonts_init; extern void FontsCleanup(); /** unused */ diff --git a/Source/drlg_l2.cpp b/Source/drlg_l2.cpp index 1e239c138..54d6fbc00 100644 --- a/Source/drlg_l2.cpp +++ b/Source/drlg_l2.cpp @@ -12,8 +12,8 @@ DEVILUTION_BEGIN_NAMESPACE int nSx1; -int nSx2; int nSy1; +int nSx2; int nSy2; int nRoomCnt; BYTE predungeon[DMAXX][DMAXY]; @@ -1490,8 +1490,7 @@ static void DRLG_L2Pass3() v3 = SDL_SwapLE16(*(MegaTiles + 2)) + 1; v4 = SDL_SwapLE16(*(MegaTiles + 3)) + 1; - for (j = 0; j < MAXDUNY; j += 2) - { + for (j = 0; j < MAXDUNY; j += 2) { for (i = 0; i < MAXDUNX; i += 2) { dPiece[i][j] = v1; dPiece[i + 1][j] = v2; diff --git a/Source/drlg_l2.h b/Source/drlg_l2.h index 8b9e86906..c0a7a0184 100644 --- a/Source/drlg_l2.h +++ b/Source/drlg_l2.h @@ -7,8 +7,8 @@ #define __DRLG_L2_H__ extern int nSx1; -extern int nSx2; extern int nSy1; +extern int nSx2; extern int nSy2; extern int nRoomCnt; extern BYTE predungeon[DMAXX][DMAXY]; diff --git a/Source/drlg_l4.cpp b/Source/drlg_l4.cpp index 85a7c0bda..1e573a0de 100644 --- a/Source/drlg_l4.cpp +++ b/Source/drlg_l4.cpp @@ -9,10 +9,10 @@ DEVILUTION_BEGIN_NAMESPACE int diabquad1x; int diabquad1y; -int diabquad3x; -int diabquad3y; int diabquad2x; int diabquad2y; +int diabquad3x; +int diabquad3y; int diabquad4x; int diabquad4y; #ifndef SPAWN @@ -20,8 +20,8 @@ BOOL hallok[20]; int l4holdx; int l4holdy; int SP4x1; -int SP4x2; int SP4y1; +int SP4x2; int SP4y2; BYTE L4dungeon[80][80]; BYTE dung[20][20]; @@ -1144,8 +1144,8 @@ static void uShape() } if (dung[i][j] == 1) { // BUGFIX: check that i + 1 < 20 and j + 1 < 20 (fixed) - if (i + 1 < 20 && j + 1 < 20 && - dung[i][j + 1] == 1 && dung[i + 1][j + 1] == 0) { + if (i + 1 < 20 && j + 1 < 20 + && dung[i][j + 1] == 1 && dung[i + 1][j + 1] == 0) { hallok[j] = TRUE; } else { hallok[j] = FALSE; @@ -1182,8 +1182,8 @@ static void uShape() } if (dung[i][j] == 1) { // BUGFIX: check that i + 1 < 20 and j + 1 < 20 (fixed) - if (i + 1 < 20 && j + 1 < 20 && - dung[i + 1][j] == 1 && dung[i + 1][j + 1] == 0) { + if (i + 1 < 20 && j + 1 < 20 + && dung[i + 1][j] == 1 && dung[i + 1][j + 1] == 0) { hallok[i] = TRUE; } else { hallok[i] = FALSE; @@ -1899,8 +1899,7 @@ static void DRLG_L4Pass3() v3 = SDL_SwapLE16(*(MegaTiles + 2)) + 1; v4 = SDL_SwapLE16(*(MegaTiles + 3)) + 1; - for (j = 0; j < MAXDUNY; j += 2) - { + for (j = 0; j < MAXDUNY; j += 2) { for (i = 0; i < MAXDUNX; i += 2) { dPiece[i][j] = v1; dPiece[i + 1][j] = v2; diff --git a/Source/drlg_l4.h b/Source/drlg_l4.h index cf64e9176..b2e52c776 100644 --- a/Source/drlg_l4.h +++ b/Source/drlg_l4.h @@ -8,18 +8,18 @@ extern int diabquad1x; extern int diabquad1y; -extern int diabquad3x; -extern int diabquad3y; extern int diabquad2x; extern int diabquad2y; +extern int diabquad3x; +extern int diabquad3y; extern int diabquad4x; extern int diabquad4y; extern BOOL hallok[20]; extern int l4holdx; extern int l4holdy; extern int SP4x1; -extern int SP4x2; extern int SP4y1; +extern int SP4x2; extern int SP4y2; extern BYTE L4dungeon[80][80]; extern BYTE dung[20][20]; diff --git a/Source/dthread.cpp b/Source/dthread.cpp index 0735dfe8d..ed06db8fd 100644 --- a/Source/dthread.cpp +++ b/Source/dthread.cpp @@ -64,7 +64,7 @@ void dthread_start() } sghWorkToDoEvent = StartEvent(); - if (!sghWorkToDoEvent) { + if (sghWorkToDoEvent == NULL) { error_buf = TraceLastError(); app_fatal("dthread:1\n%s", error_buf); } diff --git a/Source/effects.cpp b/Source/effects.cpp index c0e683d89..baa4eff3f 100644 --- a/Source/effects.cpp +++ b/Source/effects.cpp @@ -30,900 +30,902 @@ const char MonstSndChar[] = { 'a', 'h', 'd', 's' }; TSFX sgSFX[] = { // clang-format off // bFlags, pszName, pSnd - { SFX_MISC, "Sfx\\Misc\\Walk1.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Walk2.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Walk3.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Walk4.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\BFire.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Fmag.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Tmag.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Lghit.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Lghit1.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Swing.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Swing2.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Dead.wav", NULL }, - { SFX_STREAM, "Sfx\\Misc\\Questdon.wav", NULL }, - { SFX_MISC, "Sfx\\Items\\Armrfkd.wav", NULL }, - { SFX_MISC, "Sfx\\Items\\Barlfire.wav", NULL }, - { SFX_MISC, "Sfx\\Items\\Barrel.wav", NULL }, - { SFX_MISC, "Sfx\\Items\\Bhit.wav", NULL }, - { SFX_MISC, "Sfx\\Items\\Bhit1.wav", NULL }, - { SFX_MISC, "Sfx\\Items\\Chest.wav", NULL }, - { SFX_MISC, "Sfx\\Items\\Doorclos.wav", NULL }, - { SFX_MISC, "Sfx\\Items\\Dooropen.wav", NULL }, - { SFX_MISC, "Sfx\\Items\\Flipanvl.wav", NULL }, - { SFX_MISC, "Sfx\\Items\\Flipaxe.wav", NULL }, - { SFX_MISC, "Sfx\\Items\\Flipblst.wav", NULL }, - { SFX_MISC, "Sfx\\Items\\Flipbody.wav", NULL }, - { SFX_MISC, "Sfx\\Items\\Flipbook.wav", NULL }, - { SFX_MISC, "Sfx\\Items\\Flipbow.wav", NULL }, - { SFX_MISC, "Sfx\\Items\\Flipcap.wav", NULL }, - { SFX_MISC, "Sfx\\Items\\Flipharm.wav", NULL }, - { SFX_MISC, "Sfx\\Items\\Fliplarm.wav", NULL }, - { SFX_MISC, "Sfx\\Items\\Flipmag.wav", NULL }, - { SFX_MISC, "Sfx\\Items\\Flipmag1.wav", NULL }, - { SFX_MISC, "Sfx\\Items\\Flipmush.wav", NULL }, - { SFX_MISC, "Sfx\\Items\\Flippot.wav", NULL }, - { SFX_MISC, "Sfx\\Items\\Flipring.wav", NULL }, - { SFX_MISC, "Sfx\\Items\\Fliprock.wav", NULL }, - { SFX_MISC, "Sfx\\Items\\Flipscrl.wav", NULL }, - { SFX_MISC, "Sfx\\Items\\Flipshld.wav", NULL }, - { SFX_MISC, "Sfx\\Items\\Flipsign.wav", NULL }, - { SFX_MISC, "Sfx\\Items\\Flipstaf.wav", NULL }, - { SFX_MISC, "Sfx\\Items\\Flipswor.wav", NULL }, - { SFX_MISC, "Sfx\\Items\\Gold.wav", NULL }, - { SFX_MISC, "Sfx\\Items\\Hlmtfkd.wav", NULL }, - { SFX_MISC, "Sfx\\Items\\Invanvl.wav", NULL }, - { SFX_MISC, "Sfx\\Items\\Invaxe.wav", NULL }, - { SFX_MISC, "Sfx\\Items\\Invblst.wav", NULL }, - { SFX_MISC, "Sfx\\Items\\Invbody.wav", NULL }, - { SFX_MISC, "Sfx\\Items\\Invbook.wav", NULL }, - { SFX_MISC, "Sfx\\Items\\Invbow.wav", NULL }, - { SFX_MISC, "Sfx\\Items\\Invcap.wav", NULL }, - { SFX_MISC, "Sfx\\Items\\Invgrab.wav", NULL }, - { SFX_MISC, "Sfx\\Items\\Invharm.wav", NULL }, - { SFX_MISC, "Sfx\\Items\\Invlarm.wav", NULL }, - { SFX_MISC, "Sfx\\Items\\Invmush.wav", NULL }, - { SFX_MISC, "Sfx\\Items\\Invpot.wav", NULL }, - { SFX_MISC, "Sfx\\Items\\Invring.wav", NULL }, - { SFX_MISC, "Sfx\\Items\\Invrock.wav", NULL }, - { SFX_MISC, "Sfx\\Items\\Invscrol.wav", NULL }, - { SFX_MISC, "Sfx\\Items\\Invshiel.wav", NULL }, - { SFX_MISC, "Sfx\\Items\\Invsign.wav", NULL }, - { SFX_MISC, "Sfx\\Items\\Invstaf.wav", NULL }, - { SFX_MISC, "Sfx\\Items\\Invsword.wav", NULL }, - { SFX_MISC, "Sfx\\Items\\Lever.wav", NULL }, - { SFX_MISC, "Sfx\\Items\\Magic.wav", NULL }, - { SFX_MISC, "Sfx\\Items\\Magic1.wav", NULL }, - { SFX_MISC, "Sfx\\Items\\Readbook.wav", NULL }, - { SFX_MISC, "Sfx\\Items\\Sarc.wav", NULL }, - { SFX_MISC, "Sfx\\Items\\Shielfkd.wav", NULL }, - { SFX_MISC, "Sfx\\Items\\Swrdfkd.wav", NULL }, - { SFX_UI, "Sfx\\Items\\Titlemov.wav", NULL }, - { SFX_UI, "Sfx\\Items\\Titlslct.wav", NULL }, - { SFX_UI, "Sfx\\Misc\\blank.wav", NULL }, - { SFX_MISC, "Sfx\\Items\\Trap.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Cast1.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Cast10.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Cast12.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Cast2.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Cast3.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Cast4.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Cast5.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Cast6.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Cast7.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Cast8.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Cast9.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Healing.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Repair.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Acids1.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Acids2.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Apoc.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Arrowall.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Bldboil.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Blodstar.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Blsimpt.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Bonesp.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Bsimpct.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Caldron.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Cbolt.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Chltning.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\DSerp.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Elecimp1.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Elementl.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Ethereal.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Fball.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Fbolt1.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Fbolt2.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Firimp1.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Firimp2.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Flamwave.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Flash.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Fountain.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Golum.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Golumded.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Gshrine.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Guard.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Grdlanch.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Holybolt.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Hyper.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Infravis.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Invisibl.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Invpot.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Lning1.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Ltning.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Mshield.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Nova.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Portal.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Puddle.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Resur.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Scurse.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Scurimp.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Sentinel.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Shatter.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Soulfire.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Spoutlop.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Spoutstr.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Storm.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Trapdis.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Teleport.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Vtheft.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Wallloop.wav", NULL }, - { SFX_MISC, "Sfx\\Misc\\Wallstrt.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Walk1.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Walk2.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Walk3.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Walk4.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\BFire.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Fmag.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Tmag.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Lghit.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Lghit1.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Swing.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Swing2.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Dead.wav", NULL }, + { sfx_STREAM, "Sfx\\Misc\\Questdon.wav", NULL }, + { sfx_MISC, "Sfx\\Items\\Armrfkd.wav", NULL }, + { sfx_MISC, "Sfx\\Items\\Barlfire.wav", NULL }, + { sfx_MISC, "Sfx\\Items\\Barrel.wav", NULL }, + { sfx_MISC, "Sfx\\Items\\Bhit.wav", NULL }, + { sfx_MISC, "Sfx\\Items\\Bhit1.wav", NULL }, + { sfx_MISC, "Sfx\\Items\\Chest.wav", NULL }, + { sfx_MISC, "Sfx\\Items\\Doorclos.wav", NULL }, + { sfx_MISC, "Sfx\\Items\\Dooropen.wav", NULL }, + { sfx_MISC, "Sfx\\Items\\Flipanvl.wav", NULL }, + { sfx_MISC, "Sfx\\Items\\Flipaxe.wav", NULL }, + { sfx_MISC, "Sfx\\Items\\Flipblst.wav", NULL }, + { sfx_MISC, "Sfx\\Items\\Flipbody.wav", NULL }, + { sfx_MISC, "Sfx\\Items\\Flipbook.wav", NULL }, + { sfx_MISC, "Sfx\\Items\\Flipbow.wav", NULL }, + { sfx_MISC, "Sfx\\Items\\Flipcap.wav", NULL }, + { sfx_MISC, "Sfx\\Items\\Flipharm.wav", NULL }, + { sfx_MISC, "Sfx\\Items\\Fliplarm.wav", NULL }, + { sfx_MISC, "Sfx\\Items\\Flipmag.wav", NULL }, + { sfx_MISC, "Sfx\\Items\\Flipmag1.wav", NULL }, + { sfx_MISC, "Sfx\\Items\\Flipmush.wav", NULL }, + { sfx_MISC, "Sfx\\Items\\Flippot.wav", NULL }, + { sfx_MISC, "Sfx\\Items\\Flipring.wav", NULL }, + { sfx_MISC, "Sfx\\Items\\Fliprock.wav", NULL }, + { sfx_MISC, "Sfx\\Items\\Flipscrl.wav", NULL }, + { sfx_MISC, "Sfx\\Items\\Flipshld.wav", NULL }, + { sfx_MISC, "Sfx\\Items\\Flipsign.wav", NULL }, + { sfx_MISC, "Sfx\\Items\\Flipstaf.wav", NULL }, + { sfx_MISC, "Sfx\\Items\\Flipswor.wav", NULL }, + { sfx_MISC, "Sfx\\Items\\Gold.wav", NULL }, + { sfx_MISC, "Sfx\\Items\\Hlmtfkd.wav", NULL }, + { sfx_MISC, "Sfx\\Items\\Invanvl.wav", NULL }, + { sfx_MISC, "Sfx\\Items\\Invaxe.wav", NULL }, + { sfx_MISC, "Sfx\\Items\\Invblst.wav", NULL }, + { sfx_MISC, "Sfx\\Items\\Invbody.wav", NULL }, + { sfx_MISC, "Sfx\\Items\\Invbook.wav", NULL }, + { sfx_MISC, "Sfx\\Items\\Invbow.wav", NULL }, + { sfx_MISC, "Sfx\\Items\\Invcap.wav", NULL }, + { sfx_MISC, "Sfx\\Items\\Invgrab.wav", NULL }, + { sfx_MISC, "Sfx\\Items\\Invharm.wav", NULL }, + { sfx_MISC, "Sfx\\Items\\Invlarm.wav", NULL }, + { sfx_MISC, "Sfx\\Items\\Invmush.wav", NULL }, + { sfx_MISC, "Sfx\\Items\\Invpot.wav", NULL }, + { sfx_MISC, "Sfx\\Items\\Invring.wav", NULL }, + { sfx_MISC, "Sfx\\Items\\Invrock.wav", NULL }, + { sfx_MISC, "Sfx\\Items\\Invscrol.wav", NULL }, + { sfx_MISC, "Sfx\\Items\\Invshiel.wav", NULL }, + { sfx_MISC, "Sfx\\Items\\Invsign.wav", NULL }, + { sfx_MISC, "Sfx\\Items\\Invstaf.wav", NULL }, + { sfx_MISC, "Sfx\\Items\\Invsword.wav", NULL }, + { sfx_MISC, "Sfx\\Items\\Lever.wav", NULL }, + { sfx_MISC, "Sfx\\Items\\Magic.wav", NULL }, + { sfx_MISC, "Sfx\\Items\\Magic1.wav", NULL }, + { sfx_MISC, "Sfx\\Items\\Readbook.wav", NULL }, + { sfx_MISC, "Sfx\\Items\\Sarc.wav", NULL }, + { sfx_MISC, "Sfx\\Items\\Shielfkd.wav", NULL }, + { sfx_MISC, "Sfx\\Items\\Swrdfkd.wav", NULL }, + { sfx_UI, "Sfx\\Items\\Titlemov.wav", NULL }, + { sfx_UI, "Sfx\\Items\\Titlslct.wav", NULL }, + { sfx_UI, "Sfx\\Misc\\blank.wav", NULL }, + { sfx_MISC, "Sfx\\Items\\Trap.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Cast1.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Cast10.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Cast12.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Cast2.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Cast3.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Cast4.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Cast5.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Cast6.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Cast7.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Cast8.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Cast9.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Healing.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Repair.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Acids1.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Acids2.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Apoc.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Arrowall.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Bldboil.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Blodstar.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Blsimpt.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Bonesp.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Bsimpct.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Caldron.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Cbolt.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Chltning.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\DSerp.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Elecimp1.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Elementl.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Ethereal.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Fball.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Fbolt1.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Fbolt2.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Firimp1.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Firimp2.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Flamwave.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Flash.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Fountain.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Golum.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Golumded.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Gshrine.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Guard.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Grdlanch.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Holybolt.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Hyper.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Infravis.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Invisibl.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Invpot.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Lning1.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Ltning.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Mshield.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Nova.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Portal.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Puddle.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Resur.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Scurse.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Scurimp.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Sentinel.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Shatter.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Soulfire.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Spoutlop.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Spoutstr.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Storm.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Trapdis.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Teleport.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Vtheft.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Wallloop.wav", NULL }, + { sfx_MISC, "Sfx\\Misc\\Wallstrt.wav", NULL }, #ifndef SPAWN - { SFX_STREAM, "Sfx\\Towners\\Bmaid01.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bmaid02.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bmaid03.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bmaid04.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bmaid05.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bmaid06.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bmaid07.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bmaid08.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bmaid09.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bmaid10.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bmaid11.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bmaid12.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bmaid13.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bmaid14.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bmaid15.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bmaid16.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bmaid17.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bmaid18.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bmaid19.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bmaid20.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bmaid21.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bmaid22.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bmaid23.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bmaid24.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bmaid25.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bmaid26.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bmaid27.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bmaid28.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bmaid29.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bmaid30.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bmaid01.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bmaid02.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bmaid03.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bmaid04.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bmaid05.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bmaid06.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bmaid07.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bmaid08.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bmaid09.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bmaid10.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bmaid11.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bmaid12.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bmaid13.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bmaid14.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bmaid15.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bmaid16.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bmaid17.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bmaid18.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bmaid19.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bmaid20.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bmaid21.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bmaid22.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bmaid23.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bmaid24.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bmaid25.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bmaid26.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bmaid27.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bmaid28.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bmaid29.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bmaid30.wav", NULL }, #endif - { SFX_STREAM, "Sfx\\Towners\\Bmaid31.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bmaid31.wav", NULL }, #ifndef SPAWN - { SFX_STREAM, "Sfx\\Towners\\Bmaid32.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bmaid33.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bmaid34.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bmaid35.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bmaid36.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bmaid37.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bmaid38.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bmaid39.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bmaid40.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bsmith01.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bsmith02.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bsmith03.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bsmith04.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bsmith05.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bsmith06.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bsmith07.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bsmith08.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bsmith09.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bsmith10.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bsmith11.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bsmith12.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bsmith13.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bsmith14.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bsmith15.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bsmith16.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bsmith17.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bsmith18.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bsmith19.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bsmith20.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bsmith21.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bsmith22.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bsmith23.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bsmith24.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bsmith25.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bsmith26.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bsmith27.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bsmith28.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bsmith29.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bsmith30.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bsmith31.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bsmith32.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bsmith33.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bsmith34.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bsmith35.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bsmith36.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bsmith37.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bsmith38.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bsmith39.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bsmith40.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bsmith41.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bsmith42.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bsmith43.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bmaid32.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bmaid33.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bmaid34.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bmaid35.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bmaid36.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bmaid37.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bmaid38.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bmaid39.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bmaid40.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bsmith01.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bsmith02.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bsmith03.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bsmith04.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bsmith05.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bsmith06.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bsmith07.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bsmith08.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bsmith09.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bsmith10.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bsmith11.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bsmith12.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bsmith13.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bsmith14.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bsmith15.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bsmith16.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bsmith17.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bsmith18.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bsmith19.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bsmith20.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bsmith21.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bsmith22.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bsmith23.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bsmith24.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bsmith25.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bsmith26.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bsmith27.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bsmith28.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bsmith29.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bsmith30.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bsmith31.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bsmith32.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bsmith33.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bsmith34.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bsmith35.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bsmith36.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bsmith37.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bsmith38.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bsmith39.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bsmith40.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bsmith41.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bsmith42.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bsmith43.wav", NULL }, #endif - { SFX_STREAM, "Sfx\\Towners\\Bsmith44.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bsmith44.wav", NULL }, #ifndef SPAWN - { SFX_STREAM, "Sfx\\Towners\\Bsmith45.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bsmith46.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bsmith47.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bsmith48.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bsmith49.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bsmith50.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bsmith51.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bsmith52.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bsmith53.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bsmith54.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bsmith55.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Bsmith56.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bsmith45.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bsmith46.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bsmith47.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bsmith48.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bsmith49.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bsmith50.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bsmith51.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bsmith52.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bsmith53.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bsmith54.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bsmith55.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Bsmith56.wav", NULL }, #endif { 0, "Sfx\\Towners\\Cow1.wav", NULL }, { 0, "Sfx\\Towners\\Cow2.wav", NULL }, #ifndef SPAWN - { SFX_STREAM, "Sfx\\Towners\\Deadguy2.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Drunk01.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Drunk02.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Drunk03.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Drunk04.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Drunk05.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Drunk06.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Drunk07.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Drunk08.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Drunk09.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Drunk10.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Drunk11.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Drunk12.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Drunk13.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Drunk14.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Drunk15.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Drunk16.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Drunk17.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Drunk18.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Drunk19.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Drunk20.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Drunk21.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Drunk22.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Drunk23.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Drunk24.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Drunk25.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Drunk26.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Deadguy2.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Drunk01.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Drunk02.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Drunk03.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Drunk04.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Drunk05.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Drunk06.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Drunk07.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Drunk08.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Drunk09.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Drunk10.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Drunk11.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Drunk12.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Drunk13.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Drunk14.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Drunk15.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Drunk16.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Drunk17.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Drunk18.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Drunk19.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Drunk20.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Drunk21.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Drunk22.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Drunk23.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Drunk24.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Drunk25.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Drunk26.wav", NULL }, #endif - { SFX_STREAM, "Sfx\\Towners\\Drunk27.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Drunk27.wav", NULL }, #ifndef SPAWN - { SFX_STREAM, "Sfx\\Towners\\Drunk28.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Drunk29.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Drunk30.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Drunk31.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Drunk32.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Drunk33.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Drunk34.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Drunk35.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Healer01.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Healer02.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Healer03.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Healer04.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Healer05.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Healer06.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Healer07.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Healer08.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Healer09.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Healer10.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Healer11.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Healer12.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Healer13.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Healer14.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Healer15.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Healer16.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Healer17.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Healer18.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Healer19.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Healer20.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Healer21.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Healer22.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Healer23.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Healer24.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Healer25.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Healer26.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Healer27.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Healer28.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Healer29.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Healer30.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Healer31.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Healer32.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Healer33.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Healer34.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Healer35.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Healer36.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Drunk28.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Drunk29.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Drunk30.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Drunk31.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Drunk32.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Drunk33.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Drunk34.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Drunk35.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Healer01.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Healer02.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Healer03.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Healer04.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Healer05.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Healer06.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Healer07.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Healer08.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Healer09.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Healer10.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Healer11.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Healer12.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Healer13.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Healer14.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Healer15.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Healer16.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Healer17.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Healer18.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Healer19.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Healer20.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Healer21.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Healer22.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Healer23.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Healer24.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Healer25.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Healer26.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Healer27.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Healer28.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Healer29.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Healer30.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Healer31.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Healer32.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Healer33.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Healer34.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Healer35.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Healer36.wav", NULL }, #endif - { SFX_STREAM, "Sfx\\Towners\\Healer37.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Healer37.wav", NULL }, #ifndef SPAWN - { SFX_STREAM, "Sfx\\Towners\\Healer38.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Healer39.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Healer40.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Healer41.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Healer42.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Healer43.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Healer44.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Healer45.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Healer46.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Healer47.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Pegboy01.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Pegboy02.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Pegboy03.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Pegboy04.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Pegboy05.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Pegboy06.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Pegboy07.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Pegboy08.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Pegboy09.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Pegboy10.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Pegboy11.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Pegboy12.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Pegboy13.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Pegboy14.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Pegboy15.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Pegboy16.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Pegboy17.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Pegboy18.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Pegboy19.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Pegboy20.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Pegboy21.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Pegboy22.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Pegboy23.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Pegboy24.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Pegboy25.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Pegboy26.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Pegboy27.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Pegboy28.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Pegboy29.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Pegboy30.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Pegboy31.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Healer38.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Healer39.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Healer40.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Healer41.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Healer42.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Healer43.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Healer44.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Healer45.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Healer46.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Healer47.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Pegboy01.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Pegboy02.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Pegboy03.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Pegboy04.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Pegboy05.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Pegboy06.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Pegboy07.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Pegboy08.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Pegboy09.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Pegboy10.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Pegboy11.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Pegboy12.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Pegboy13.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Pegboy14.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Pegboy15.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Pegboy16.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Pegboy17.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Pegboy18.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Pegboy19.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Pegboy20.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Pegboy21.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Pegboy22.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Pegboy23.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Pegboy24.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Pegboy25.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Pegboy26.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Pegboy27.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Pegboy28.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Pegboy29.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Pegboy30.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Pegboy31.wav", NULL }, #endif - { SFX_STREAM, "Sfx\\Towners\\Pegboy32.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Pegboy32.wav", NULL }, #ifndef SPAWN - { SFX_STREAM, "Sfx\\Towners\\Pegboy33.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Pegboy34.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Pegboy35.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Pegboy36.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Pegboy37.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Pegboy38.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Pegboy39.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Pegboy40.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Pegboy41.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Pegboy42.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Pegboy43.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Priest00.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Priest01.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Priest02.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Priest03.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Priest04.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Priest05.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Priest06.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Priest07.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Storyt00.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Storyt01.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Storyt02.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Storyt03.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Storyt04.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Storyt05.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Storyt06.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Storyt07.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Storyt08.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Storyt09.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Storyt10.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Storyt11.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Storyt12.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Storyt13.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Storyt14.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Storyt15.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Storyt16.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Storyt17.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Storyt18.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Storyt19.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Storyt20.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Storyt21.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Storyt22.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Storyt23.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Storyt24.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Pegboy33.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Pegboy34.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Pegboy35.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Pegboy36.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Pegboy37.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Pegboy38.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Pegboy39.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Pegboy40.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Pegboy41.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Pegboy42.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Pegboy43.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Priest00.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Priest01.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Priest02.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Priest03.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Priest04.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Priest05.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Priest06.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Priest07.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Storyt00.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Storyt01.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Storyt02.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Storyt03.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Storyt04.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Storyt05.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Storyt06.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Storyt07.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Storyt08.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Storyt09.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Storyt10.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Storyt11.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Storyt12.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Storyt13.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Storyt14.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Storyt15.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Storyt16.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Storyt17.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Storyt18.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Storyt19.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Storyt20.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Storyt21.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Storyt22.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Storyt23.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Storyt24.wav", NULL }, #endif - { SFX_STREAM, "Sfx\\Towners\\Storyt25.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Storyt25.wav", NULL }, #ifndef SPAWN - { SFX_STREAM, "Sfx\\Towners\\Storyt26.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Storyt27.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Storyt28.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Storyt29.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Storyt30.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Storyt31.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Storyt32.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Storyt33.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Storyt34.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Storyt35.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Storyt36.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Storyt37.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Storyt38.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Storyt26.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Storyt27.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Storyt28.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Storyt29.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Storyt30.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Storyt31.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Storyt32.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Storyt33.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Storyt34.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Storyt35.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Storyt36.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Storyt37.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Storyt38.wav", NULL }, #endif - { SFX_STREAM, "Sfx\\Towners\\Tavown00.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Tavown00.wav", NULL }, #ifndef SPAWN - { SFX_STREAM, "Sfx\\Towners\\Tavown01.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Tavown02.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Tavown03.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Tavown04.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Tavown05.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Tavown06.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Tavown07.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Tavown08.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Tavown09.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Tavown10.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Tavown11.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Tavown12.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Tavown13.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Tavown14.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Tavown15.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Tavown16.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Tavown17.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Tavown18.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Tavown19.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Tavown20.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Tavown21.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Tavown22.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Tavown23.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Tavown24.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Tavown25.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Tavown26.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Tavown27.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Tavown28.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Tavown29.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Tavown30.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Tavown31.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Tavown32.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Tavown33.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Tavown34.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Tavown35.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Tavown01.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Tavown02.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Tavown03.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Tavown04.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Tavown05.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Tavown06.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Tavown07.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Tavown08.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Tavown09.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Tavown10.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Tavown11.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Tavown12.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Tavown13.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Tavown14.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Tavown15.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Tavown16.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Tavown17.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Tavown18.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Tavown19.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Tavown20.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Tavown21.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Tavown22.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Tavown23.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Tavown24.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Tavown25.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Tavown26.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Tavown27.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Tavown28.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Tavown29.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Tavown30.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Tavown31.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Tavown32.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Tavown33.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Tavown34.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Tavown35.wav", NULL }, #endif - { SFX_STREAM, "Sfx\\Towners\\Tavown36.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Tavown36.wav", NULL }, #ifndef SPAWN - { SFX_STREAM, "Sfx\\Towners\\Tavown37.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Tavown38.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Tavown39.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Tavown40.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Tavown41.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Tavown42.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Tavown43.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Tavown44.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Tavown45.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Witch01.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Witch02.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Witch03.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Witch04.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Witch05.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Witch06.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Witch07.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Witch08.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Witch09.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Witch10.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Witch11.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Witch12.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Witch13.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Witch14.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Witch15.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Witch16.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Witch17.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Witch18.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Witch19.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Witch20.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Witch21.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Witch22.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Witch23.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Witch24.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Witch25.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Witch26.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Witch27.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Witch28.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Witch29.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Witch30.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Witch31.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Witch32.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Witch33.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Witch34.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Witch35.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Witch36.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Witch37.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Tavown37.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Tavown38.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Tavown39.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Tavown40.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Tavown41.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Tavown42.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Tavown43.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Tavown44.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Tavown45.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Witch01.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Witch02.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Witch03.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Witch04.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Witch05.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Witch06.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Witch07.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Witch08.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Witch09.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Witch10.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Witch11.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Witch12.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Witch13.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Witch14.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Witch15.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Witch16.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Witch17.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Witch18.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Witch19.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Witch20.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Witch21.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Witch22.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Witch23.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Witch24.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Witch25.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Witch26.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Witch27.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Witch28.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Witch29.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Witch30.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Witch31.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Witch32.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Witch33.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Witch34.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Witch35.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Witch36.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Witch37.wav", NULL }, #endif - { SFX_STREAM, "Sfx\\Towners\\Witch38.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Witch38.wav", NULL }, #ifndef SPAWN - { SFX_STREAM, "Sfx\\Towners\\Witch39.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Witch40.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Witch41.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Witch42.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Witch43.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Witch44.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Witch45.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Witch46.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Witch47.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Witch48.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Witch49.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Witch50.wav", NULL }, - { SFX_STREAM, "Sfx\\Towners\\Wound01.wav", NULL }, - { SFX_STREAM | SFX_SORCEROR, "Sfx\\Sorceror\\Mage01.wav", NULL }, - { SFX_STREAM | SFX_SORCEROR, "Sfx\\Sorceror\\Mage02.wav", NULL }, - { SFX_STREAM | SFX_SORCEROR, "Sfx\\Sorceror\\Mage03.wav", NULL }, - { SFX_STREAM | SFX_SORCEROR, "Sfx\\Sorceror\\Mage04.wav", NULL }, - { SFX_STREAM | SFX_SORCEROR, "Sfx\\Sorceror\\Mage05.wav", NULL }, - { SFX_STREAM | SFX_SORCEROR, "Sfx\\Sorceror\\Mage06.wav", NULL }, - { SFX_STREAM | SFX_SORCEROR, "Sfx\\Sorceror\\Mage07.wav", NULL }, - { SFX_STREAM | SFX_SORCEROR, "Sfx\\Sorceror\\Mage08.wav", NULL }, - { SFX_STREAM | SFX_SORCEROR, "Sfx\\Sorceror\\Mage09.wav", NULL }, - { SFX_STREAM | SFX_SORCEROR, "Sfx\\Sorceror\\Mage10.wav", NULL }, - { SFX_STREAM | SFX_SORCEROR, "Sfx\\Sorceror\\Mage11.wav", NULL }, - { SFX_STREAM | SFX_SORCEROR, "Sfx\\Sorceror\\Mage12.wav", NULL }, - { SFX_SORCEROR, "Sfx\\Sorceror\\Mage13.wav", NULL }, - { SFX_SORCEROR, "Sfx\\Sorceror\\Mage14.wav", NULL }, - { SFX_SORCEROR, "Sfx\\Sorceror\\Mage15.wav", NULL }, - { SFX_SORCEROR, "Sfx\\Sorceror\\Mage16.wav", NULL }, - { SFX_SORCEROR, "Sfx\\Sorceror\\Mage17.wav", NULL }, - { SFX_SORCEROR, "Sfx\\Sorceror\\Mage18.wav", NULL }, - { SFX_SORCEROR, "Sfx\\Sorceror\\Mage19.wav", NULL }, - { SFX_SORCEROR, "Sfx\\Sorceror\\Mage20.wav", NULL }, - { SFX_SORCEROR, "Sfx\\Sorceror\\Mage21.wav", NULL }, - { SFX_SORCEROR, "Sfx\\Sorceror\\Mage22.wav", NULL }, - { SFX_SORCEROR, "Sfx\\Sorceror\\Mage23.wav", NULL }, - { SFX_SORCEROR, "Sfx\\Sorceror\\Mage24.wav", NULL }, - { SFX_SORCEROR, "Sfx\\Sorceror\\Mage25.wav", NULL }, - { SFX_SORCEROR, "Sfx\\Sorceror\\Mage26.wav", NULL }, - { SFX_SORCEROR, "Sfx\\Sorceror\\Mage27.wav", NULL }, - { SFX_SORCEROR, "Sfx\\Sorceror\\Mage28.wav", NULL }, - { SFX_SORCEROR, "Sfx\\Sorceror\\Mage29.wav", NULL }, - { SFX_SORCEROR, "Sfx\\Sorceror\\Mage30.wav", NULL }, - { SFX_SORCEROR, "Sfx\\Sorceror\\Mage31.wav", NULL }, - { SFX_SORCEROR, "Sfx\\Sorceror\\Mage32.wav", NULL }, - { SFX_SORCEROR, "Sfx\\Sorceror\\Mage33.wav", NULL }, - { SFX_SORCEROR, "Sfx\\Sorceror\\Mage34.wav", NULL }, - { SFX_SORCEROR, "Sfx\\Sorceror\\Mage35.wav", NULL }, - { SFX_SORCEROR, "Sfx\\Sorceror\\Mage36.wav", NULL }, - { SFX_SORCEROR, "Sfx\\Sorceror\\Mage37.wav", NULL }, - { SFX_SORCEROR, "Sfx\\Sorceror\\Mage38.wav", NULL }, - { SFX_SORCEROR, "Sfx\\Sorceror\\Mage39.wav", NULL }, - { SFX_SORCEROR, "Sfx\\Sorceror\\Mage40.wav", NULL }, - { SFX_SORCEROR, "Sfx\\Sorceror\\Mage41.wav", NULL }, - { SFX_SORCEROR, "Sfx\\Sorceror\\Mage42.wav", NULL }, - { SFX_SORCEROR, "Sfx\\Sorceror\\Mage43.wav", NULL }, - { SFX_SORCEROR, "Sfx\\Sorceror\\Mage44.wav", NULL }, - { SFX_SORCEROR, "Sfx\\Sorceror\\Mage45.wav", NULL }, - { SFX_SORCEROR, "Sfx\\Sorceror\\Mage46.wav", NULL }, - { SFX_SORCEROR, "Sfx\\Sorceror\\Mage47.wav", NULL }, - { SFX_SORCEROR, "Sfx\\Sorceror\\Mage48.wav", NULL }, - { SFX_SORCEROR, "Sfx\\Sorceror\\Mage49.wav", NULL }, - { SFX_SORCEROR, "Sfx\\Sorceror\\Mage50.wav", NULL }, - { SFX_STREAM | SFX_SORCEROR, "Sfx\\Sorceror\\Mage51.wav", NULL }, - { SFX_STREAM | SFX_SORCEROR, "Sfx\\Sorceror\\Mage52.wav", NULL }, - { SFX_STREAM | SFX_SORCEROR, "Sfx\\Sorceror\\Mage53.wav", NULL }, - { SFX_STREAM | SFX_SORCEROR, "Sfx\\Sorceror\\Mage54.wav", NULL }, - { SFX_STREAM | SFX_SORCEROR, "Sfx\\Sorceror\\Mage55.wav", NULL }, - { SFX_STREAM | SFX_SORCEROR, "Sfx\\Sorceror\\Mage56.wav", NULL }, - { SFX_SORCEROR, "Sfx\\Sorceror\\Mage57.wav", NULL }, - { SFX_STREAM | SFX_SORCEROR, "Sfx\\Sorceror\\Mage58.wav", NULL }, - { SFX_STREAM | SFX_SORCEROR, "Sfx\\Sorceror\\Mage59.wav", NULL }, - { SFX_STREAM | SFX_SORCEROR, "Sfx\\Sorceror\\Mage60.wav", NULL }, - { SFX_STREAM | SFX_SORCEROR, "Sfx\\Sorceror\\Mage61.wav", NULL }, - { SFX_STREAM | SFX_SORCEROR, "Sfx\\Sorceror\\Mage62.wav", NULL }, - { SFX_STREAM | SFX_SORCEROR, "Sfx\\Sorceror\\Mage63.wav", NULL }, - { SFX_SORCEROR, "Sfx\\Sorceror\\Mage64.wav", NULL }, - { SFX_SORCEROR, "Sfx\\Sorceror\\Mage65.wav", NULL }, - { SFX_SORCEROR, "Sfx\\Sorceror\\Mage66.wav", NULL }, - { SFX_SORCEROR, "Sfx\\Sorceror\\Mage67.wav", NULL }, - { SFX_SORCEROR, "Sfx\\Sorceror\\Mage68.wav", NULL }, - { SFX_SORCEROR, "Sfx\\Sorceror\\Mage69.wav", NULL }, - { SFX_SORCEROR, "Sfx\\Sorceror\\Mage69b.wav", NULL }, - { SFX_SORCEROR, "Sfx\\Sorceror\\Mage70.wav", NULL }, - { SFX_SORCEROR, "Sfx\\Sorceror\\Mage71.wav", NULL }, - { SFX_SORCEROR, "Sfx\\Sorceror\\Mage72.wav", NULL }, - { SFX_SORCEROR, "Sfx\\Sorceror\\Mage73.wav", NULL }, - { SFX_SORCEROR, "Sfx\\Sorceror\\Mage74.wav", NULL }, - { SFX_SORCEROR, "Sfx\\Sorceror\\Mage75.wav", NULL }, - { SFX_SORCEROR, "Sfx\\Sorceror\\Mage76.wav", NULL }, - { SFX_SORCEROR, "Sfx\\Sorceror\\Mage77.wav", NULL }, - { SFX_SORCEROR, "Sfx\\Sorceror\\Mage78.wav", NULL }, - { SFX_SORCEROR, "Sfx\\Sorceror\\Mage79.wav", NULL }, - { SFX_STREAM | SFX_SORCEROR, "Sfx\\Sorceror\\Mage80.wav", NULL }, - { SFX_STREAM | SFX_SORCEROR, "Sfx\\Sorceror\\Mage81.wav", NULL }, - { SFX_STREAM | SFX_SORCEROR, "Sfx\\Sorceror\\Mage82.wav", NULL }, - { SFX_STREAM | SFX_SORCEROR, "Sfx\\Sorceror\\Mage83.wav", NULL }, - { SFX_STREAM | SFX_SORCEROR, "Sfx\\Sorceror\\Mage84.wav", NULL }, - { SFX_STREAM | SFX_SORCEROR, "Sfx\\Sorceror\\Mage85.wav", NULL }, - { SFX_STREAM | SFX_SORCEROR, "Sfx\\Sorceror\\Mage86.wav", NULL }, - { SFX_STREAM | SFX_SORCEROR, "Sfx\\Sorceror\\Mage87.wav", NULL }, - { SFX_STREAM | SFX_SORCEROR, "Sfx\\Sorceror\\Mage88.wav", NULL }, - { SFX_STREAM | SFX_SORCEROR, "Sfx\\Sorceror\\Mage89.wav", NULL }, - { SFX_STREAM | SFX_SORCEROR, "Sfx\\Sorceror\\Mage90.wav", NULL }, - { SFX_STREAM | SFX_SORCEROR, "Sfx\\Sorceror\\Mage91.wav", NULL }, - { SFX_STREAM | SFX_SORCEROR, "Sfx\\Sorceror\\Mage92.wav", NULL }, - { SFX_STREAM | SFX_SORCEROR, "Sfx\\Sorceror\\Mage93.wav", NULL }, - { SFX_STREAM | SFX_SORCEROR, "Sfx\\Sorceror\\Mage94.wav", NULL }, - { SFX_STREAM | SFX_SORCEROR, "Sfx\\Sorceror\\Mage95.wav", NULL }, - { SFX_STREAM | SFX_SORCEROR, "Sfx\\Sorceror\\Mage96.wav", NULL }, - { SFX_STREAM | SFX_SORCEROR, "Sfx\\Sorceror\\Mage97.wav", NULL }, - { SFX_STREAM | SFX_SORCEROR, "Sfx\\Sorceror\\Mage98.wav", NULL }, - { SFX_STREAM | SFX_SORCEROR, "Sfx\\Sorceror\\Mage99.wav", NULL }, - { SFX_STREAM | SFX_SORCEROR, "Sfx\\Sorceror\\Mage100.wav", NULL }, - { SFX_STREAM | SFX_SORCEROR, "Sfx\\Sorceror\\Mage101.wav", NULL }, - { SFX_STREAM | SFX_SORCEROR, "Sfx\\Sorceror\\Mage102.wav", NULL }, - { SFX_STREAM | SFX_ROGUE, "Sfx\\Rogue\\Rogue01.wav", NULL }, - { SFX_STREAM | SFX_ROGUE, "Sfx\\Rogue\\Rogue02.wav", NULL }, - { SFX_STREAM | SFX_ROGUE, "Sfx\\Rogue\\Rogue03.wav", NULL }, - { SFX_STREAM | SFX_ROGUE, "Sfx\\Rogue\\Rogue04.wav", NULL }, - { SFX_STREAM | SFX_ROGUE, "Sfx\\Rogue\\Rogue05.wav", NULL }, - { SFX_STREAM | SFX_ROGUE, "Sfx\\Rogue\\Rogue06.wav", NULL }, - { SFX_STREAM | SFX_ROGUE, "Sfx\\Rogue\\Rogue07.wav", NULL }, - { SFX_STREAM | SFX_ROGUE, "Sfx\\Rogue\\Rogue08.wav", NULL }, - { SFX_STREAM | SFX_ROGUE, "Sfx\\Rogue\\Rogue09.wav", NULL }, - { SFX_STREAM | SFX_ROGUE, "Sfx\\Rogue\\Rogue10.wav", NULL }, - { SFX_STREAM | SFX_ROGUE, "Sfx\\Rogue\\Rogue11.wav", NULL }, - { SFX_STREAM | SFX_ROGUE, "Sfx\\Rogue\\Rogue12.wav", NULL }, - { SFX_ROGUE, "Sfx\\Rogue\\Rogue13.wav", NULL }, - { SFX_ROGUE, "Sfx\\Rogue\\Rogue14.wav", NULL }, - { SFX_ROGUE, "Sfx\\Rogue\\Rogue15.wav", NULL }, - { SFX_ROGUE, "Sfx\\Rogue\\Rogue16.wav", NULL }, - { SFX_ROGUE, "Sfx\\Rogue\\Rogue17.wav", NULL }, - { SFX_ROGUE, "Sfx\\Rogue\\Rogue18.wav", NULL }, - { SFX_ROGUE, "Sfx\\Rogue\\Rogue19.wav", NULL }, - { SFX_ROGUE, "Sfx\\Rogue\\Rogue20.wav", NULL }, - { SFX_ROGUE, "Sfx\\Rogue\\Rogue21.wav", NULL }, - { SFX_ROGUE, "Sfx\\Rogue\\Rogue22.wav", NULL }, - { SFX_ROGUE, "Sfx\\Rogue\\Rogue23.wav", NULL }, - { SFX_ROGUE, "Sfx\\Rogue\\Rogue24.wav", NULL }, - { SFX_ROGUE, "Sfx\\Rogue\\Rogue25.wav", NULL }, - { SFX_ROGUE, "Sfx\\Rogue\\Rogue26.wav", NULL }, - { SFX_ROGUE, "Sfx\\Rogue\\Rogue27.wav", NULL }, - { SFX_ROGUE, "Sfx\\Rogue\\Rogue28.wav", NULL }, - { SFX_ROGUE, "Sfx\\Rogue\\Rogue29.wav", NULL }, - { SFX_ROGUE, "Sfx\\Rogue\\Rogue30.wav", NULL }, - { SFX_ROGUE, "Sfx\\Rogue\\Rogue31.wav", NULL }, - { SFX_ROGUE, "Sfx\\Rogue\\Rogue32.wav", NULL }, - { SFX_ROGUE, "Sfx\\Rogue\\Rogue33.wav", NULL }, - { SFX_ROGUE, "Sfx\\Rogue\\Rogue34.wav", NULL }, - { SFX_ROGUE, "Sfx\\Rogue\\Rogue35.wav", NULL }, - { SFX_ROGUE, "Sfx\\Rogue\\Rogue36.wav", NULL }, - { SFX_ROGUE, "Sfx\\Rogue\\Rogue37.wav", NULL }, - { SFX_ROGUE, "Sfx\\Rogue\\Rogue38.wav", NULL }, - { SFX_ROGUE, "Sfx\\Rogue\\Rogue39.wav", NULL }, - { SFX_ROGUE, "Sfx\\Rogue\\Rogue40.wav", NULL }, - { SFX_ROGUE, "Sfx\\Rogue\\Rogue41.wav", NULL }, - { SFX_ROGUE, "Sfx\\Rogue\\Rogue42.wav", NULL }, - { SFX_ROGUE, "Sfx\\Rogue\\Rogue43.wav", NULL }, - { SFX_ROGUE, "Sfx\\Rogue\\Rogue44.wav", NULL }, - { SFX_ROGUE, "Sfx\\Rogue\\Rogue45.wav", NULL }, - { SFX_ROGUE, "Sfx\\Rogue\\Rogue46.wav", NULL }, - { SFX_ROGUE, "Sfx\\Rogue\\Rogue47.wav", NULL }, - { SFX_ROGUE, "Sfx\\Rogue\\Rogue48.wav", NULL }, - { SFX_ROGUE, "Sfx\\Rogue\\Rogue49.wav", NULL }, - { SFX_ROGUE, "Sfx\\Rogue\\Rogue50.wav", NULL }, - { SFX_STREAM | SFX_ROGUE, "Sfx\\Rogue\\Rogue51.wav", NULL }, - { SFX_STREAM | SFX_ROGUE, "Sfx\\Rogue\\Rogue52.wav", NULL }, - { SFX_STREAM | SFX_ROGUE, "Sfx\\Rogue\\Rogue53.wav", NULL }, - { SFX_STREAM | SFX_ROGUE, "Sfx\\Rogue\\Rogue54.wav", NULL }, - { SFX_STREAM | SFX_ROGUE, "Sfx\\Rogue\\Rogue55.wav", NULL }, - { SFX_STREAM | SFX_ROGUE, "Sfx\\Rogue\\Rogue56.wav", NULL }, - { SFX_ROGUE, "Sfx\\Rogue\\Rogue57.wav", NULL }, - { SFX_STREAM | SFX_ROGUE, "Sfx\\Rogue\\Rogue58.wav", NULL }, - { SFX_STREAM | SFX_ROGUE, "Sfx\\Rogue\\Rogue59.wav", NULL }, - { SFX_STREAM | SFX_ROGUE, "Sfx\\Rogue\\Rogue60.wav", NULL }, - { SFX_STREAM | SFX_ROGUE, "Sfx\\Rogue\\Rogue61.wav", NULL }, - { SFX_STREAM | SFX_ROGUE, "Sfx\\Rogue\\Rogue62.wav", NULL }, - { SFX_STREAM | SFX_ROGUE, "Sfx\\Rogue\\Rogue63.wav", NULL }, - { SFX_ROGUE, "Sfx\\Rogue\\Rogue64.wav", NULL }, - { SFX_ROGUE, "Sfx\\Rogue\\Rogue65.wav", NULL }, - { SFX_ROGUE, "Sfx\\Rogue\\Rogue66.wav", NULL }, - { SFX_ROGUE, "Sfx\\Rogue\\Rogue67.wav", NULL }, - { SFX_ROGUE, "Sfx\\Rogue\\Rogue68.wav", NULL }, - { SFX_ROGUE, "Sfx\\Rogue\\Rogue69.wav", NULL }, - { SFX_ROGUE, "Sfx\\Rogue\\Rogue69b.wav", NULL }, - { SFX_ROGUE, "Sfx\\Rogue\\Rogue70.wav", NULL }, - { SFX_ROGUE, "Sfx\\Rogue\\Rogue71.wav", NULL }, - { SFX_ROGUE, "Sfx\\Rogue\\Rogue72.wav", NULL }, - { SFX_ROGUE, "Sfx\\Rogue\\Rogue73.wav", NULL }, - { SFX_ROGUE, "Sfx\\Rogue\\Rogue74.wav", NULL }, - { SFX_ROGUE, "Sfx\\Rogue\\Rogue75.wav", NULL }, - { SFX_ROGUE, "Sfx\\Rogue\\Rogue76.wav", NULL }, - { SFX_ROGUE, "Sfx\\Rogue\\Rogue77.wav", NULL }, - { SFX_ROGUE, "Sfx\\Rogue\\Rogue78.wav", NULL }, - { SFX_ROGUE, "Sfx\\Rogue\\Rogue79.wav", NULL }, - { SFX_STREAM | SFX_ROGUE, "Sfx\\Rogue\\Rogue80.wav", NULL }, - { SFX_STREAM | SFX_ROGUE, "Sfx\\Rogue\\Rogue81.wav", NULL }, - { SFX_STREAM | SFX_ROGUE, "Sfx\\Rogue\\Rogue82.wav", NULL }, - { SFX_STREAM | SFX_ROGUE, "Sfx\\Rogue\\Rogue83.wav", NULL }, - { SFX_STREAM | SFX_ROGUE, "Sfx\\Rogue\\Rogue84.wav", NULL }, - { SFX_STREAM | SFX_ROGUE, "Sfx\\Rogue\\Rogue85.wav", NULL }, - { SFX_STREAM | SFX_ROGUE, "Sfx\\Rogue\\Rogue86.wav", NULL }, - { SFX_STREAM | SFX_ROGUE, "Sfx\\Rogue\\Rogue87.wav", NULL }, - { SFX_STREAM | SFX_ROGUE, "Sfx\\Rogue\\Rogue88.wav", NULL }, - { SFX_STREAM | SFX_ROGUE, "Sfx\\Rogue\\Rogue89.wav", NULL }, - { SFX_STREAM | SFX_ROGUE, "Sfx\\Rogue\\Rogue90.wav", NULL }, - { SFX_STREAM | SFX_ROGUE, "Sfx\\Rogue\\Rogue91.wav", NULL }, - { SFX_STREAM | SFX_ROGUE, "Sfx\\Rogue\\Rogue92.wav", NULL }, - { SFX_STREAM | SFX_ROGUE, "Sfx\\Rogue\\Rogue93.wav", NULL }, - { SFX_STREAM | SFX_ROGUE, "Sfx\\Rogue\\Rogue94.wav", NULL }, - { SFX_STREAM | SFX_ROGUE, "Sfx\\Rogue\\Rogue95.wav", NULL }, - { SFX_STREAM | SFX_ROGUE, "Sfx\\Rogue\\Rogue96.wav", NULL }, - { SFX_STREAM | SFX_ROGUE, "Sfx\\Rogue\\Rogue97.wav", NULL }, - { SFX_STREAM | SFX_ROGUE, "Sfx\\Rogue\\Rogue98.wav", NULL }, - { SFX_STREAM | SFX_ROGUE, "Sfx\\Rogue\\Rogue99.wav", NULL }, - { SFX_STREAM | SFX_ROGUE, "Sfx\\Rogue\\Rogue100.wav", NULL }, - { SFX_STREAM | SFX_ROGUE, "Sfx\\Rogue\\Rogue101.wav", NULL }, - { SFX_STREAM | SFX_ROGUE, "Sfx\\Rogue\\Rogue102.wav", NULL }, - { SFX_STREAM | SFX_WARRIOR, "Sfx\\Warrior\\Warior01.wav", NULL }, - { SFX_STREAM | SFX_WARRIOR, "Sfx\\Warrior\\Warior02.wav", NULL }, - { SFX_STREAM | SFX_WARRIOR, "Sfx\\Warrior\\Warior03.wav", NULL }, - { SFX_STREAM | SFX_WARRIOR, "Sfx\\Warrior\\Warior04.wav", NULL }, - { SFX_STREAM | SFX_WARRIOR, "Sfx\\Warrior\\Warior05.wav", NULL }, - { SFX_STREAM | SFX_WARRIOR, "Sfx\\Warrior\\Warior06.wav", NULL }, - { SFX_STREAM | SFX_WARRIOR, "Sfx\\Warrior\\Warior07.wav", NULL }, - { SFX_STREAM | SFX_WARRIOR, "Sfx\\Warrior\\Warior08.wav", NULL }, - { SFX_STREAM | SFX_WARRIOR, "Sfx\\Warrior\\Warior09.wav", NULL }, - { SFX_STREAM | SFX_WARRIOR, "Sfx\\Warrior\\Warior10.wav", NULL }, - { SFX_STREAM | SFX_WARRIOR, "Sfx\\Warrior\\Warior11.wav", NULL }, - { SFX_STREAM | SFX_WARRIOR, "Sfx\\Warrior\\Warior12.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Witch39.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Witch40.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Witch41.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Witch42.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Witch43.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Witch44.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Witch45.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Witch46.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Witch47.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Witch48.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Witch49.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Witch50.wav", NULL }, + { sfx_STREAM, "Sfx\\Towners\\Wound01.wav", NULL }, + { sfx_STREAM | sfx_SORCEROR, "Sfx\\Sorceror\\Mage01.wav", NULL }, + { sfx_STREAM | sfx_SORCEROR, "Sfx\\Sorceror\\Mage02.wav", NULL }, + { sfx_STREAM | sfx_SORCEROR, "Sfx\\Sorceror\\Mage03.wav", NULL }, + { sfx_STREAM | sfx_SORCEROR, "Sfx\\Sorceror\\Mage04.wav", NULL }, + { sfx_STREAM | sfx_SORCEROR, "Sfx\\Sorceror\\Mage05.wav", NULL }, + { sfx_STREAM | sfx_SORCEROR, "Sfx\\Sorceror\\Mage06.wav", NULL }, + { sfx_STREAM | sfx_SORCEROR, "Sfx\\Sorceror\\Mage07.wav", NULL }, + { sfx_STREAM | sfx_SORCEROR, "Sfx\\Sorceror\\Mage08.wav", NULL }, + { sfx_STREAM | sfx_SORCEROR, "Sfx\\Sorceror\\Mage09.wav", NULL }, + { sfx_STREAM | sfx_SORCEROR, "Sfx\\Sorceror\\Mage10.wav", NULL }, + { sfx_STREAM | sfx_SORCEROR, "Sfx\\Sorceror\\Mage11.wav", NULL }, + { sfx_STREAM | sfx_SORCEROR, "Sfx\\Sorceror\\Mage12.wav", NULL }, + { sfx_SORCEROR, "Sfx\\Sorceror\\Mage13.wav", NULL }, + { sfx_SORCEROR, "Sfx\\Sorceror\\Mage14.wav", NULL }, + { sfx_SORCEROR, "Sfx\\Sorceror\\Mage15.wav", NULL }, + { sfx_SORCEROR, "Sfx\\Sorceror\\Mage16.wav", NULL }, + { sfx_SORCEROR, "Sfx\\Sorceror\\Mage17.wav", NULL }, + { sfx_SORCEROR, "Sfx\\Sorceror\\Mage18.wav", NULL }, + { sfx_SORCEROR, "Sfx\\Sorceror\\Mage19.wav", NULL }, + { sfx_SORCEROR, "Sfx\\Sorceror\\Mage20.wav", NULL }, + { sfx_SORCEROR, "Sfx\\Sorceror\\Mage21.wav", NULL }, + { sfx_SORCEROR, "Sfx\\Sorceror\\Mage22.wav", NULL }, + { sfx_SORCEROR, "Sfx\\Sorceror\\Mage23.wav", NULL }, + { sfx_SORCEROR, "Sfx\\Sorceror\\Mage24.wav", NULL }, + { sfx_SORCEROR, "Sfx\\Sorceror\\Mage25.wav", NULL }, + { sfx_SORCEROR, "Sfx\\Sorceror\\Mage26.wav", NULL }, + { sfx_SORCEROR, "Sfx\\Sorceror\\Mage27.wav", NULL }, + { sfx_SORCEROR, "Sfx\\Sorceror\\Mage28.wav", NULL }, + { sfx_SORCEROR, "Sfx\\Sorceror\\Mage29.wav", NULL }, + { sfx_SORCEROR, "Sfx\\Sorceror\\Mage30.wav", NULL }, + { sfx_SORCEROR, "Sfx\\Sorceror\\Mage31.wav", NULL }, + { sfx_SORCEROR, "Sfx\\Sorceror\\Mage32.wav", NULL }, + { sfx_SORCEROR, "Sfx\\Sorceror\\Mage33.wav", NULL }, + { sfx_SORCEROR, "Sfx\\Sorceror\\Mage34.wav", NULL }, + { sfx_SORCEROR, "Sfx\\Sorceror\\Mage35.wav", NULL }, + { sfx_SORCEROR, "Sfx\\Sorceror\\Mage36.wav", NULL }, + { sfx_SORCEROR, "Sfx\\Sorceror\\Mage37.wav", NULL }, + { sfx_SORCEROR, "Sfx\\Sorceror\\Mage38.wav", NULL }, + { sfx_SORCEROR, "Sfx\\Sorceror\\Mage39.wav", NULL }, + { sfx_SORCEROR, "Sfx\\Sorceror\\Mage40.wav", NULL }, + { sfx_SORCEROR, "Sfx\\Sorceror\\Mage41.wav", NULL }, + { sfx_SORCEROR, "Sfx\\Sorceror\\Mage42.wav", NULL }, + { sfx_SORCEROR, "Sfx\\Sorceror\\Mage43.wav", NULL }, + { sfx_SORCEROR, "Sfx\\Sorceror\\Mage44.wav", NULL }, + { sfx_SORCEROR, "Sfx\\Sorceror\\Mage45.wav", NULL }, + { sfx_SORCEROR, "Sfx\\Sorceror\\Mage46.wav", NULL }, + { sfx_SORCEROR, "Sfx\\Sorceror\\Mage47.wav", NULL }, + { sfx_SORCEROR, "Sfx\\Sorceror\\Mage48.wav", NULL }, + { sfx_SORCEROR, "Sfx\\Sorceror\\Mage49.wav", NULL }, + { sfx_SORCEROR, "Sfx\\Sorceror\\Mage50.wav", NULL }, + { sfx_STREAM | sfx_SORCEROR, "Sfx\\Sorceror\\Mage51.wav", NULL }, + { sfx_STREAM | sfx_SORCEROR, "Sfx\\Sorceror\\Mage52.wav", NULL }, + { sfx_STREAM | sfx_SORCEROR, "Sfx\\Sorceror\\Mage53.wav", NULL }, + { sfx_STREAM | sfx_SORCEROR, "Sfx\\Sorceror\\Mage54.wav", NULL }, + { sfx_STREAM | sfx_SORCEROR, "Sfx\\Sorceror\\Mage55.wav", NULL }, + { sfx_STREAM | sfx_SORCEROR, "Sfx\\Sorceror\\Mage56.wav", NULL }, + { sfx_SORCEROR, "Sfx\\Sorceror\\Mage57.wav", NULL }, + { sfx_STREAM | sfx_SORCEROR, "Sfx\\Sorceror\\Mage58.wav", NULL }, + { sfx_STREAM | sfx_SORCEROR, "Sfx\\Sorceror\\Mage59.wav", NULL }, + { sfx_STREAM | sfx_SORCEROR, "Sfx\\Sorceror\\Mage60.wav", NULL }, + { sfx_STREAM | sfx_SORCEROR, "Sfx\\Sorceror\\Mage61.wav", NULL }, + { sfx_STREAM | sfx_SORCEROR, "Sfx\\Sorceror\\Mage62.wav", NULL }, + { sfx_STREAM | sfx_SORCEROR, "Sfx\\Sorceror\\Mage63.wav", NULL }, + { sfx_SORCEROR, "Sfx\\Sorceror\\Mage64.wav", NULL }, + { sfx_SORCEROR, "Sfx\\Sorceror\\Mage65.wav", NULL }, + { sfx_SORCEROR, "Sfx\\Sorceror\\Mage66.wav", NULL }, + { sfx_SORCEROR, "Sfx\\Sorceror\\Mage67.wav", NULL }, + { sfx_SORCEROR, "Sfx\\Sorceror\\Mage68.wav", NULL }, + { sfx_SORCEROR, "Sfx\\Sorceror\\Mage69.wav", NULL }, + { sfx_SORCEROR, "Sfx\\Sorceror\\Mage69b.wav", NULL }, + { sfx_SORCEROR, "Sfx\\Sorceror\\Mage70.wav", NULL }, + { sfx_SORCEROR, "Sfx\\Sorceror\\Mage71.wav", NULL }, + { sfx_SORCEROR, "Sfx\\Sorceror\\Mage72.wav", NULL }, + { sfx_SORCEROR, "Sfx\\Sorceror\\Mage73.wav", NULL }, + { sfx_SORCEROR, "Sfx\\Sorceror\\Mage74.wav", NULL }, + { sfx_SORCEROR, "Sfx\\Sorceror\\Mage75.wav", NULL }, + { sfx_SORCEROR, "Sfx\\Sorceror\\Mage76.wav", NULL }, + { sfx_SORCEROR, "Sfx\\Sorceror\\Mage77.wav", NULL }, + { sfx_SORCEROR, "Sfx\\Sorceror\\Mage78.wav", NULL }, + { sfx_SORCEROR, "Sfx\\Sorceror\\Mage79.wav", NULL }, + { sfx_STREAM | sfx_SORCEROR, "Sfx\\Sorceror\\Mage80.wav", NULL }, + { sfx_STREAM | sfx_SORCEROR, "Sfx\\Sorceror\\Mage81.wav", NULL }, + { sfx_STREAM | sfx_SORCEROR, "Sfx\\Sorceror\\Mage82.wav", NULL }, + { sfx_STREAM | sfx_SORCEROR, "Sfx\\Sorceror\\Mage83.wav", NULL }, + { sfx_STREAM | sfx_SORCEROR, "Sfx\\Sorceror\\Mage84.wav", NULL }, + { sfx_STREAM | sfx_SORCEROR, "Sfx\\Sorceror\\Mage85.wav", NULL }, + { sfx_STREAM | sfx_SORCEROR, "Sfx\\Sorceror\\Mage86.wav", NULL }, + { sfx_STREAM | sfx_SORCEROR, "Sfx\\Sorceror\\Mage87.wav", NULL }, + { sfx_STREAM | sfx_SORCEROR, "Sfx\\Sorceror\\Mage88.wav", NULL }, + { sfx_STREAM | sfx_SORCEROR, "Sfx\\Sorceror\\Mage89.wav", NULL }, + { sfx_STREAM | sfx_SORCEROR, "Sfx\\Sorceror\\Mage90.wav", NULL }, + { sfx_STREAM | sfx_SORCEROR, "Sfx\\Sorceror\\Mage91.wav", NULL }, + { sfx_STREAM | sfx_SORCEROR, "Sfx\\Sorceror\\Mage92.wav", NULL }, + { sfx_STREAM | sfx_SORCEROR, "Sfx\\Sorceror\\Mage93.wav", NULL }, + { sfx_STREAM | sfx_SORCEROR, "Sfx\\Sorceror\\Mage94.wav", NULL }, + { sfx_STREAM | sfx_SORCEROR, "Sfx\\Sorceror\\Mage95.wav", NULL }, + { sfx_STREAM | sfx_SORCEROR, "Sfx\\Sorceror\\Mage96.wav", NULL }, + { sfx_STREAM | sfx_SORCEROR, "Sfx\\Sorceror\\Mage97.wav", NULL }, + { sfx_STREAM | sfx_SORCEROR, "Sfx\\Sorceror\\Mage98.wav", NULL }, + { sfx_STREAM | sfx_SORCEROR, "Sfx\\Sorceror\\Mage99.wav", NULL }, + { sfx_STREAM | sfx_SORCEROR, "Sfx\\Sorceror\\Mage100.wav", NULL }, + { sfx_STREAM | sfx_SORCEROR, "Sfx\\Sorceror\\Mage101.wav", NULL }, + { sfx_STREAM | sfx_SORCEROR, "Sfx\\Sorceror\\Mage102.wav", NULL }, + { sfx_STREAM | sfx_ROGUE, "Sfx\\Rogue\\Rogue01.wav", NULL }, + { sfx_STREAM | sfx_ROGUE, "Sfx\\Rogue\\Rogue02.wav", NULL }, + { sfx_STREAM | sfx_ROGUE, "Sfx\\Rogue\\Rogue03.wav", NULL }, + { sfx_STREAM | sfx_ROGUE, "Sfx\\Rogue\\Rogue04.wav", NULL }, + { sfx_STREAM | sfx_ROGUE, "Sfx\\Rogue\\Rogue05.wav", NULL }, + { sfx_STREAM | sfx_ROGUE, "Sfx\\Rogue\\Rogue06.wav", NULL }, + { sfx_STREAM | sfx_ROGUE, "Sfx\\Rogue\\Rogue07.wav", NULL }, + { sfx_STREAM | sfx_ROGUE, "Sfx\\Rogue\\Rogue08.wav", NULL }, + { sfx_STREAM | sfx_ROGUE, "Sfx\\Rogue\\Rogue09.wav", NULL }, + { sfx_STREAM | sfx_ROGUE, "Sfx\\Rogue\\Rogue10.wav", NULL }, + { sfx_STREAM | sfx_ROGUE, "Sfx\\Rogue\\Rogue11.wav", NULL }, + { sfx_STREAM | sfx_ROGUE, "Sfx\\Rogue\\Rogue12.wav", NULL }, + { sfx_ROGUE, "Sfx\\Rogue\\Rogue13.wav", NULL }, + { sfx_ROGUE, "Sfx\\Rogue\\Rogue14.wav", NULL }, + { sfx_ROGUE, "Sfx\\Rogue\\Rogue15.wav", NULL }, + { sfx_ROGUE, "Sfx\\Rogue\\Rogue16.wav", NULL }, + { sfx_ROGUE, "Sfx\\Rogue\\Rogue17.wav", NULL }, + { sfx_ROGUE, "Sfx\\Rogue\\Rogue18.wav", NULL }, + { sfx_ROGUE, "Sfx\\Rogue\\Rogue19.wav", NULL }, + { sfx_ROGUE, "Sfx\\Rogue\\Rogue20.wav", NULL }, + { sfx_ROGUE, "Sfx\\Rogue\\Rogue21.wav", NULL }, + { sfx_ROGUE, "Sfx\\Rogue\\Rogue22.wav", NULL }, + { sfx_ROGUE, "Sfx\\Rogue\\Rogue23.wav", NULL }, + { sfx_ROGUE, "Sfx\\Rogue\\Rogue24.wav", NULL }, + { sfx_ROGUE, "Sfx\\Rogue\\Rogue25.wav", NULL }, + { sfx_ROGUE, "Sfx\\Rogue\\Rogue26.wav", NULL }, + { sfx_ROGUE, "Sfx\\Rogue\\Rogue27.wav", NULL }, + { sfx_ROGUE, "Sfx\\Rogue\\Rogue28.wav", NULL }, + { sfx_ROGUE, "Sfx\\Rogue\\Rogue29.wav", NULL }, + { sfx_ROGUE, "Sfx\\Rogue\\Rogue30.wav", NULL }, + { sfx_ROGUE, "Sfx\\Rogue\\Rogue31.wav", NULL }, + { sfx_ROGUE, "Sfx\\Rogue\\Rogue32.wav", NULL }, + { sfx_ROGUE, "Sfx\\Rogue\\Rogue33.wav", NULL }, + { sfx_ROGUE, "Sfx\\Rogue\\Rogue34.wav", NULL }, + { sfx_ROGUE, "Sfx\\Rogue\\Rogue35.wav", NULL }, + { sfx_ROGUE, "Sfx\\Rogue\\Rogue36.wav", NULL }, + { sfx_ROGUE, "Sfx\\Rogue\\Rogue37.wav", NULL }, + { sfx_ROGUE, "Sfx\\Rogue\\Rogue38.wav", NULL }, + { sfx_ROGUE, "Sfx\\Rogue\\Rogue39.wav", NULL }, + { sfx_ROGUE, "Sfx\\Rogue\\Rogue40.wav", NULL }, + { sfx_ROGUE, "Sfx\\Rogue\\Rogue41.wav", NULL }, + { sfx_ROGUE, "Sfx\\Rogue\\Rogue42.wav", NULL }, + { sfx_ROGUE, "Sfx\\Rogue\\Rogue43.wav", NULL }, + { sfx_ROGUE, "Sfx\\Rogue\\Rogue44.wav", NULL }, + { sfx_ROGUE, "Sfx\\Rogue\\Rogue45.wav", NULL }, + { sfx_ROGUE, "Sfx\\Rogue\\Rogue46.wav", NULL }, + { sfx_ROGUE, "Sfx\\Rogue\\Rogue47.wav", NULL }, + { sfx_ROGUE, "Sfx\\Rogue\\Rogue48.wav", NULL }, + { sfx_ROGUE, "Sfx\\Rogue\\Rogue49.wav", NULL }, + { sfx_ROGUE, "Sfx\\Rogue\\Rogue50.wav", NULL }, + { sfx_STREAM | sfx_ROGUE, "Sfx\\Rogue\\Rogue51.wav", NULL }, + { sfx_STREAM | sfx_ROGUE, "Sfx\\Rogue\\Rogue52.wav", NULL }, + { sfx_STREAM | sfx_ROGUE, "Sfx\\Rogue\\Rogue53.wav", NULL }, + { sfx_STREAM | sfx_ROGUE, "Sfx\\Rogue\\Rogue54.wav", NULL }, + { sfx_STREAM | sfx_ROGUE, "Sfx\\Rogue\\Rogue55.wav", NULL }, + { sfx_STREAM | sfx_ROGUE, "Sfx\\Rogue\\Rogue56.wav", NULL }, + { sfx_ROGUE, "Sfx\\Rogue\\Rogue57.wav", NULL }, + { sfx_STREAM | sfx_ROGUE, "Sfx\\Rogue\\Rogue58.wav", NULL }, + { sfx_STREAM | sfx_ROGUE, "Sfx\\Rogue\\Rogue59.wav", NULL }, + { sfx_STREAM | sfx_ROGUE, "Sfx\\Rogue\\Rogue60.wav", NULL }, + { sfx_STREAM | sfx_ROGUE, "Sfx\\Rogue\\Rogue61.wav", NULL }, + { sfx_STREAM | sfx_ROGUE, "Sfx\\Rogue\\Rogue62.wav", NULL }, + { sfx_STREAM | sfx_ROGUE, "Sfx\\Rogue\\Rogue63.wav", NULL }, + { sfx_ROGUE, "Sfx\\Rogue\\Rogue64.wav", NULL }, + { sfx_ROGUE, "Sfx\\Rogue\\Rogue65.wav", NULL }, + { sfx_ROGUE, "Sfx\\Rogue\\Rogue66.wav", NULL }, + { sfx_ROGUE, "Sfx\\Rogue\\Rogue67.wav", NULL }, + { sfx_ROGUE, "Sfx\\Rogue\\Rogue68.wav", NULL }, + { sfx_ROGUE, "Sfx\\Rogue\\Rogue69.wav", NULL }, + { sfx_ROGUE, "Sfx\\Rogue\\Rogue69b.wav", NULL }, + { sfx_ROGUE, "Sfx\\Rogue\\Rogue70.wav", NULL }, + { sfx_ROGUE, "Sfx\\Rogue\\Rogue71.wav", NULL }, + { sfx_ROGUE, "Sfx\\Rogue\\Rogue72.wav", NULL }, + { sfx_ROGUE, "Sfx\\Rogue\\Rogue73.wav", NULL }, + { sfx_ROGUE, "Sfx\\Rogue\\Rogue74.wav", NULL }, + { sfx_ROGUE, "Sfx\\Rogue\\Rogue75.wav", NULL }, + { sfx_ROGUE, "Sfx\\Rogue\\Rogue76.wav", NULL }, + { sfx_ROGUE, "Sfx\\Rogue\\Rogue77.wav", NULL }, + { sfx_ROGUE, "Sfx\\Rogue\\Rogue78.wav", NULL }, + { sfx_ROGUE, "Sfx\\Rogue\\Rogue79.wav", NULL }, + { sfx_STREAM | sfx_ROGUE, "Sfx\\Rogue\\Rogue80.wav", NULL }, + { sfx_STREAM | sfx_ROGUE, "Sfx\\Rogue\\Rogue81.wav", NULL }, + { sfx_STREAM | sfx_ROGUE, "Sfx\\Rogue\\Rogue82.wav", NULL }, + { sfx_STREAM | sfx_ROGUE, "Sfx\\Rogue\\Rogue83.wav", NULL }, + { sfx_STREAM | sfx_ROGUE, "Sfx\\Rogue\\Rogue84.wav", NULL }, + { sfx_STREAM | sfx_ROGUE, "Sfx\\Rogue\\Rogue85.wav", NULL }, + { sfx_STREAM | sfx_ROGUE, "Sfx\\Rogue\\Rogue86.wav", NULL }, + { sfx_STREAM | sfx_ROGUE, "Sfx\\Rogue\\Rogue87.wav", NULL }, + { sfx_STREAM | sfx_ROGUE, "Sfx\\Rogue\\Rogue88.wav", NULL }, + { sfx_STREAM | sfx_ROGUE, "Sfx\\Rogue\\Rogue89.wav", NULL }, + { sfx_STREAM | sfx_ROGUE, "Sfx\\Rogue\\Rogue90.wav", NULL }, + { sfx_STREAM | sfx_ROGUE, "Sfx\\Rogue\\Rogue91.wav", NULL }, + { sfx_STREAM | sfx_ROGUE, "Sfx\\Rogue\\Rogue92.wav", NULL }, + { sfx_STREAM | sfx_ROGUE, "Sfx\\Rogue\\Rogue93.wav", NULL }, + { sfx_STREAM | sfx_ROGUE, "Sfx\\Rogue\\Rogue94.wav", NULL }, + { sfx_STREAM | sfx_ROGUE, "Sfx\\Rogue\\Rogue95.wav", NULL }, + { sfx_STREAM | sfx_ROGUE, "Sfx\\Rogue\\Rogue96.wav", NULL }, + { sfx_STREAM | sfx_ROGUE, "Sfx\\Rogue\\Rogue97.wav", NULL }, + { sfx_STREAM | sfx_ROGUE, "Sfx\\Rogue\\Rogue98.wav", NULL }, + { sfx_STREAM | sfx_ROGUE, "Sfx\\Rogue\\Rogue99.wav", NULL }, + { sfx_STREAM | sfx_ROGUE, "Sfx\\Rogue\\Rogue100.wav", NULL }, + { sfx_STREAM | sfx_ROGUE, "Sfx\\Rogue\\Rogue101.wav", NULL }, + { sfx_STREAM | sfx_ROGUE, "Sfx\\Rogue\\Rogue102.wav", NULL }, + { sfx_STREAM | sfx_WARRIOR, "Sfx\\Warrior\\Warior01.wav", NULL }, + { sfx_STREAM | sfx_WARRIOR, "Sfx\\Warrior\\Warior02.wav", NULL }, + { sfx_STREAM | sfx_WARRIOR, "Sfx\\Warrior\\Warior03.wav", NULL }, + { sfx_STREAM | sfx_WARRIOR, "Sfx\\Warrior\\Warior04.wav", NULL }, + { sfx_STREAM | sfx_WARRIOR, "Sfx\\Warrior\\Warior05.wav", NULL }, + { sfx_STREAM | sfx_WARRIOR, "Sfx\\Warrior\\Warior06.wav", NULL }, + { sfx_STREAM | sfx_WARRIOR, "Sfx\\Warrior\\Warior07.wav", NULL }, + { sfx_STREAM | sfx_WARRIOR, "Sfx\\Warrior\\Warior08.wav", NULL }, + { sfx_STREAM | sfx_WARRIOR, "Sfx\\Warrior\\Warior09.wav", NULL }, + { sfx_STREAM | sfx_WARRIOR, "Sfx\\Warrior\\Warior10.wav", NULL }, + { sfx_STREAM | sfx_WARRIOR, "Sfx\\Warrior\\Warior11.wav", NULL }, + { sfx_STREAM | sfx_WARRIOR, "Sfx\\Warrior\\Warior12.wav", NULL }, #endif - { SFX_WARRIOR, "Sfx\\Warrior\\Warior13.wav", NULL }, - { SFX_WARRIOR, "Sfx\\Warrior\\Warior14.wav", NULL }, - { SFX_WARRIOR, "Sfx\\Warrior\\Wario14b.wav", NULL }, - { SFX_WARRIOR, "Sfx\\Warrior\\Wario14c.wav", NULL }, - { SFX_WARRIOR, "Sfx\\Warrior\\Warior15.wav", NULL }, - { SFX_WARRIOR, "Sfx\\Warrior\\Wario15b.wav", NULL }, - { SFX_WARRIOR, "Sfx\\Warrior\\Wario15c.wav", NULL }, - { SFX_WARRIOR, "Sfx\\Warrior\\Warior16.wav", NULL }, - { SFX_WARRIOR, "Sfx\\Warrior\\Wario16b.wav", NULL }, - { SFX_WARRIOR, "Sfx\\Warrior\\Wario16c.wav", NULL }, - { SFX_WARRIOR, "Sfx\\Warrior\\Warior17.wav", NULL }, - { SFX_WARRIOR, "Sfx\\Warrior\\Warior18.wav", NULL }, - { SFX_WARRIOR, "Sfx\\Warrior\\Warior19.wav", NULL }, - { SFX_WARRIOR, "Sfx\\Warrior\\Warior20.wav", NULL }, - { SFX_WARRIOR, "Sfx\\Warrior\\Warior21.wav", NULL }, - { SFX_WARRIOR, "Sfx\\Warrior\\Warior22.wav", NULL }, - { SFX_WARRIOR, "Sfx\\Warrior\\Warior23.wav", NULL }, - { SFX_WARRIOR, "Sfx\\Warrior\\Warior24.wav", NULL }, - { SFX_WARRIOR, "Sfx\\Warrior\\Warior25.wav", NULL }, - { SFX_WARRIOR, "Sfx\\Warrior\\Warior26.wav", NULL }, - { SFX_WARRIOR, "Sfx\\Warrior\\Warior27.wav", NULL }, - { SFX_WARRIOR, "Sfx\\Warrior\\Warior28.wav", NULL }, - { SFX_WARRIOR, "Sfx\\Warrior\\Warior29.wav", NULL }, - { SFX_WARRIOR, "Sfx\\Warrior\\Warior30.wav", NULL }, - { SFX_WARRIOR, "Sfx\\Warrior\\Warior31.wav", NULL }, - { SFX_WARRIOR, "Sfx\\Warrior\\Warior32.wav", NULL }, - { SFX_WARRIOR, "Sfx\\Warrior\\Warior33.wav", NULL }, - { SFX_WARRIOR, "Sfx\\Warrior\\Warior34.wav", NULL }, - { SFX_WARRIOR, "Sfx\\Warrior\\Warior35.wav", NULL }, - { SFX_WARRIOR, "Sfx\\Warrior\\Warior36.wav", NULL }, - { SFX_WARRIOR, "Sfx\\Warrior\\Warior37.wav", NULL }, - { SFX_WARRIOR, "Sfx\\Warrior\\Warior38.wav", NULL }, - { SFX_WARRIOR, "Sfx\\Warrior\\Warior39.wav", NULL }, - { SFX_WARRIOR, "Sfx\\Warrior\\Warior40.wav", NULL }, - { SFX_WARRIOR, "Sfx\\Warrior\\Warior41.wav", NULL }, - { SFX_WARRIOR, "Sfx\\Warrior\\Warior42.wav", NULL }, - { SFX_WARRIOR, "Sfx\\Warrior\\Warior43.wav", NULL }, - { SFX_WARRIOR, "Sfx\\Warrior\\Warior44.wav", NULL }, - { SFX_WARRIOR, "Sfx\\Warrior\\Warior45.wav", NULL }, - { SFX_WARRIOR, "Sfx\\Warrior\\Warior46.wav", NULL }, - { SFX_WARRIOR, "Sfx\\Warrior\\Warior47.wav", NULL }, - { SFX_WARRIOR, "Sfx\\Warrior\\Warior48.wav", NULL }, - { SFX_WARRIOR, "Sfx\\Warrior\\Warior49.wav", NULL }, - { SFX_WARRIOR, "Sfx\\Warrior\\Warior50.wav", NULL }, - { SFX_STREAM | SFX_WARRIOR, "Sfx\\Warrior\\Warior51.wav", NULL }, - { SFX_STREAM | SFX_WARRIOR, "Sfx\\Warrior\\Warior52.wav", NULL }, - { SFX_STREAM | SFX_WARRIOR, "Sfx\\Warrior\\Warior53.wav", NULL }, - { SFX_STREAM | SFX_WARRIOR, "Sfx\\Warrior\\Warior54.wav", NULL }, - { SFX_STREAM | SFX_WARRIOR, "Sfx\\Warrior\\Warior55.wav", NULL }, - { SFX_STREAM | SFX_WARRIOR, "Sfx\\Warrior\\Warior56.wav", NULL }, - { SFX_WARRIOR, "Sfx\\Warrior\\Warior57.wav", NULL }, - { SFX_STREAM | SFX_WARRIOR, "Sfx\\Warrior\\Warior58.wav", NULL }, - { SFX_STREAM | SFX_WARRIOR, "Sfx\\Warrior\\Warior59.wav", NULL }, - { SFX_STREAM | SFX_WARRIOR, "Sfx\\Warrior\\Warior60.wav", NULL }, - { SFX_STREAM | SFX_WARRIOR, "Sfx\\Warrior\\Warior61.wav", NULL }, - { SFX_STREAM | SFX_WARRIOR, "Sfx\\Warrior\\Warior62.wav", NULL }, - { SFX_STREAM | SFX_WARRIOR, "Sfx\\Warrior\\Warior63.wav", NULL }, - { SFX_WARRIOR, "Sfx\\Warrior\\Warior64.wav", NULL }, - { SFX_WARRIOR, "Sfx\\Warrior\\Warior65.wav", NULL }, - { SFX_WARRIOR, "Sfx\\Warrior\\Warior66.wav", NULL }, - { SFX_WARRIOR, "Sfx\\Warrior\\Warior67.wav", NULL }, - { SFX_WARRIOR, "Sfx\\Warrior\\Warior68.wav", NULL }, - { SFX_WARRIOR, "Sfx\\Warrior\\Warior69.wav", NULL }, - { SFX_WARRIOR, "Sfx\\Warrior\\Wario69b.wav", NULL }, - { SFX_WARRIOR, "Sfx\\Warrior\\Warior70.wav", NULL }, - { SFX_WARRIOR, "Sfx\\Warrior\\Warior71.wav", NULL }, - { SFX_WARRIOR, "Sfx\\Warrior\\Warior72.wav", NULL }, - { SFX_WARRIOR, "Sfx\\Warrior\\Warior73.wav", NULL }, - { SFX_WARRIOR, "Sfx\\Warrior\\Warior74.wav", NULL }, - { SFX_WARRIOR, "Sfx\\Warrior\\Warior75.wav", NULL }, - { SFX_WARRIOR, "Sfx\\Warrior\\Warior76.wav", NULL }, - { SFX_WARRIOR, "Sfx\\Warrior\\Warior77.wav", NULL }, - { SFX_WARRIOR, "Sfx\\Warrior\\Warior78.wav", NULL }, - { SFX_WARRIOR, "Sfx\\Warrior\\Warior79.wav", NULL }, + { sfx_WARRIOR, "Sfx\\Warrior\\Warior13.wav", NULL }, + { sfx_WARRIOR, "Sfx\\Warrior\\Warior14.wav", NULL }, + { sfx_WARRIOR, "Sfx\\Warrior\\Wario14b.wav", NULL }, + { sfx_WARRIOR, "Sfx\\Warrior\\Wario14c.wav", NULL }, + { sfx_WARRIOR, "Sfx\\Warrior\\Warior15.wav", NULL }, + { sfx_WARRIOR, "Sfx\\Warrior\\Wario15b.wav", NULL }, + { sfx_WARRIOR, "Sfx\\Warrior\\Wario15c.wav", NULL }, + { sfx_WARRIOR, "Sfx\\Warrior\\Warior16.wav", NULL }, + { sfx_WARRIOR, "Sfx\\Warrior\\Wario16b.wav", NULL }, + { sfx_WARRIOR, "Sfx\\Warrior\\Wario16c.wav", NULL }, + { sfx_WARRIOR, "Sfx\\Warrior\\Warior17.wav", NULL }, + { sfx_WARRIOR, "Sfx\\Warrior\\Warior18.wav", NULL }, + { sfx_WARRIOR, "Sfx\\Warrior\\Warior19.wav", NULL }, + { sfx_WARRIOR, "Sfx\\Warrior\\Warior20.wav", NULL }, + { sfx_WARRIOR, "Sfx\\Warrior\\Warior21.wav", NULL }, + { sfx_WARRIOR, "Sfx\\Warrior\\Warior22.wav", NULL }, + { sfx_WARRIOR, "Sfx\\Warrior\\Warior23.wav", NULL }, + { sfx_WARRIOR, "Sfx\\Warrior\\Warior24.wav", NULL }, + { sfx_WARRIOR, "Sfx\\Warrior\\Warior25.wav", NULL }, + { sfx_WARRIOR, "Sfx\\Warrior\\Warior26.wav", NULL }, + { sfx_WARRIOR, "Sfx\\Warrior\\Warior27.wav", NULL }, + { sfx_WARRIOR, "Sfx\\Warrior\\Warior28.wav", NULL }, + { sfx_WARRIOR, "Sfx\\Warrior\\Warior29.wav", NULL }, + { sfx_WARRIOR, "Sfx\\Warrior\\Warior30.wav", NULL }, + { sfx_WARRIOR, "Sfx\\Warrior\\Warior31.wav", NULL }, + { sfx_WARRIOR, "Sfx\\Warrior\\Warior32.wav", NULL }, + { sfx_WARRIOR, "Sfx\\Warrior\\Warior33.wav", NULL }, + { sfx_WARRIOR, "Sfx\\Warrior\\Warior34.wav", NULL }, + { sfx_WARRIOR, "Sfx\\Warrior\\Warior35.wav", NULL }, + { sfx_WARRIOR, "Sfx\\Warrior\\Warior36.wav", NULL }, + { sfx_WARRIOR, "Sfx\\Warrior\\Warior37.wav", NULL }, + { sfx_WARRIOR, "Sfx\\Warrior\\Warior38.wav", NULL }, + { sfx_WARRIOR, "Sfx\\Warrior\\Warior39.wav", NULL }, + { sfx_WARRIOR, "Sfx\\Warrior\\Warior40.wav", NULL }, + { sfx_WARRIOR, "Sfx\\Warrior\\Warior41.wav", NULL }, + { sfx_WARRIOR, "Sfx\\Warrior\\Warior42.wav", NULL }, + { sfx_WARRIOR, "Sfx\\Warrior\\Warior43.wav", NULL }, + { sfx_WARRIOR, "Sfx\\Warrior\\Warior44.wav", NULL }, + { sfx_WARRIOR, "Sfx\\Warrior\\Warior45.wav", NULL }, + { sfx_WARRIOR, "Sfx\\Warrior\\Warior46.wav", NULL }, + { sfx_WARRIOR, "Sfx\\Warrior\\Warior47.wav", NULL }, + { sfx_WARRIOR, "Sfx\\Warrior\\Warior48.wav", NULL }, + { sfx_WARRIOR, "Sfx\\Warrior\\Warior49.wav", NULL }, + { sfx_WARRIOR, "Sfx\\Warrior\\Warior50.wav", NULL }, + { sfx_STREAM | sfx_WARRIOR, "Sfx\\Warrior\\Warior51.wav", NULL }, + { sfx_STREAM | sfx_WARRIOR, "Sfx\\Warrior\\Warior52.wav", NULL }, + { sfx_STREAM | sfx_WARRIOR, "Sfx\\Warrior\\Warior53.wav", NULL }, + { sfx_STREAM | sfx_WARRIOR, "Sfx\\Warrior\\Warior54.wav", NULL }, + { sfx_STREAM | sfx_WARRIOR, "Sfx\\Warrior\\Warior55.wav", NULL }, + { sfx_STREAM | sfx_WARRIOR, "Sfx\\Warrior\\Warior56.wav", NULL }, + { sfx_WARRIOR, "Sfx\\Warrior\\Warior57.wav", NULL }, + { sfx_STREAM | sfx_WARRIOR, "Sfx\\Warrior\\Warior58.wav", NULL }, + { sfx_STREAM | sfx_WARRIOR, "Sfx\\Warrior\\Warior59.wav", NULL }, + { sfx_STREAM | sfx_WARRIOR, "Sfx\\Warrior\\Warior60.wav", NULL }, + { sfx_STREAM | sfx_WARRIOR, "Sfx\\Warrior\\Warior61.wav", NULL }, + { sfx_STREAM | sfx_WARRIOR, "Sfx\\Warrior\\Warior62.wav", NULL }, + { sfx_STREAM | sfx_WARRIOR, "Sfx\\Warrior\\Warior63.wav", NULL }, + { sfx_WARRIOR, "Sfx\\Warrior\\Warior64.wav", NULL }, + { sfx_WARRIOR, "Sfx\\Warrior\\Warior65.wav", NULL }, + { sfx_WARRIOR, "Sfx\\Warrior\\Warior66.wav", NULL }, + { sfx_WARRIOR, "Sfx\\Warrior\\Warior67.wav", NULL }, + { sfx_WARRIOR, "Sfx\\Warrior\\Warior68.wav", NULL }, + { sfx_WARRIOR, "Sfx\\Warrior\\Warior69.wav", NULL }, + { sfx_WARRIOR, "Sfx\\Warrior\\Wario69b.wav", NULL }, + { sfx_WARRIOR, "Sfx\\Warrior\\Warior70.wav", NULL }, + { sfx_WARRIOR, "Sfx\\Warrior\\Warior71.wav", NULL }, + { sfx_WARRIOR, "Sfx\\Warrior\\Warior72.wav", NULL }, + { sfx_WARRIOR, "Sfx\\Warrior\\Warior73.wav", NULL }, + { sfx_WARRIOR, "Sfx\\Warrior\\Warior74.wav", NULL }, + { sfx_WARRIOR, "Sfx\\Warrior\\Warior75.wav", NULL }, + { sfx_WARRIOR, "Sfx\\Warrior\\Warior76.wav", NULL }, + { sfx_WARRIOR, "Sfx\\Warrior\\Warior77.wav", NULL }, + { sfx_WARRIOR, "Sfx\\Warrior\\Warior78.wav", NULL }, + { sfx_WARRIOR, "Sfx\\Warrior\\Warior79.wav", NULL }, #ifndef SPAWN - { SFX_STREAM | SFX_WARRIOR, "Sfx\\Warrior\\Warior80.wav", NULL }, - { SFX_STREAM | SFX_WARRIOR, "Sfx\\Warrior\\Warior81.wav", NULL }, - { SFX_STREAM | SFX_WARRIOR, "Sfx\\Warrior\\Warior82.wav", NULL }, - { SFX_STREAM | SFX_WARRIOR, "Sfx\\Warrior\\Warior83.wav", NULL }, - { SFX_STREAM | SFX_WARRIOR, "Sfx\\Warrior\\Warior84.wav", NULL }, - { SFX_STREAM | SFX_WARRIOR, "Sfx\\Warrior\\Warior85.wav", NULL }, - { SFX_STREAM | SFX_WARRIOR, "Sfx\\Warrior\\Warior86.wav", NULL }, - { SFX_STREAM | SFX_WARRIOR, "Sfx\\Warrior\\Warior87.wav", NULL }, - { SFX_STREAM | SFX_WARRIOR, "Sfx\\Warrior\\Warior88.wav", NULL }, - { SFX_STREAM | SFX_WARRIOR, "Sfx\\Warrior\\Warior89.wav", NULL }, - { SFX_STREAM | SFX_WARRIOR, "Sfx\\Warrior\\Warior90.wav", NULL }, - { SFX_STREAM | SFX_WARRIOR, "Sfx\\Warrior\\Warior91.wav", NULL }, - { SFX_STREAM | SFX_WARRIOR, "Sfx\\Warrior\\Warior92.wav", NULL }, - { SFX_STREAM | SFX_WARRIOR, "Sfx\\Warrior\\Warior93.wav", NULL }, - { SFX_STREAM | SFX_WARRIOR, "Sfx\\Warrior\\Warior94.wav", NULL }, - { SFX_STREAM | SFX_WARRIOR, "Sfx\\Warrior\\Warior95.wav", NULL }, - { SFX_STREAM | SFX_WARRIOR, "Sfx\\Warrior\\Wario95b.wav", NULL }, - { SFX_STREAM | SFX_WARRIOR, "Sfx\\Warrior\\Wario95c.wav", NULL }, - { SFX_STREAM | SFX_WARRIOR, "Sfx\\Warrior\\Wario95d.wav", NULL }, - { SFX_STREAM | SFX_WARRIOR, "Sfx\\Warrior\\Wario95e.wav", NULL }, - { SFX_STREAM | SFX_WARRIOR, "Sfx\\Warrior\\Wario95f.wav", NULL }, + { sfx_STREAM | sfx_WARRIOR, "Sfx\\Warrior\\Warior80.wav", NULL }, + { sfx_STREAM | sfx_WARRIOR, "Sfx\\Warrior\\Warior81.wav", NULL }, + { sfx_STREAM | sfx_WARRIOR, "Sfx\\Warrior\\Warior82.wav", NULL }, + { sfx_STREAM | sfx_WARRIOR, "Sfx\\Warrior\\Warior83.wav", NULL }, + { sfx_STREAM | sfx_WARRIOR, "Sfx\\Warrior\\Warior84.wav", NULL }, + { sfx_STREAM | sfx_WARRIOR, "Sfx\\Warrior\\Warior85.wav", NULL }, + { sfx_STREAM | sfx_WARRIOR, "Sfx\\Warrior\\Warior86.wav", NULL }, + { sfx_STREAM | sfx_WARRIOR, "Sfx\\Warrior\\Warior87.wav", NULL }, + { sfx_STREAM | sfx_WARRIOR, "Sfx\\Warrior\\Warior88.wav", NULL }, + { sfx_STREAM | sfx_WARRIOR, "Sfx\\Warrior\\Warior89.wav", NULL }, + { sfx_STREAM | sfx_WARRIOR, "Sfx\\Warrior\\Warior90.wav", NULL }, + { sfx_STREAM | sfx_WARRIOR, "Sfx\\Warrior\\Warior91.wav", NULL }, + { sfx_STREAM | sfx_WARRIOR, "Sfx\\Warrior\\Warior92.wav", NULL }, + { sfx_STREAM | sfx_WARRIOR, "Sfx\\Warrior\\Warior93.wav", NULL }, + { sfx_STREAM | sfx_WARRIOR, "Sfx\\Warrior\\Warior94.wav", NULL }, + { sfx_STREAM | sfx_WARRIOR, "Sfx\\Warrior\\Warior95.wav", NULL }, + { sfx_STREAM | sfx_WARRIOR, "Sfx\\Warrior\\Wario95b.wav", NULL }, + { sfx_STREAM | sfx_WARRIOR, "Sfx\\Warrior\\Wario95c.wav", NULL }, + { sfx_STREAM | sfx_WARRIOR, "Sfx\\Warrior\\Wario95d.wav", NULL }, + { sfx_STREAM | sfx_WARRIOR, "Sfx\\Warrior\\Wario95e.wav", NULL }, + { sfx_STREAM | sfx_WARRIOR, "Sfx\\Warrior\\Wario95f.wav", NULL }, #endif - { SFX_STREAM | SFX_WARRIOR, "Sfx\\Warrior\\Wario96b.wav", NULL }, - { SFX_STREAM | SFX_WARRIOR, "Sfx\\Warrior\\Wario97.wav", NULL }, - { SFX_STREAM | SFX_WARRIOR, "Sfx\\Warrior\\Wario98.wav", NULL }, - { SFX_STREAM | SFX_WARRIOR, "Sfx\\Warrior\\Warior99.wav", NULL }, + { sfx_STREAM | sfx_WARRIOR, "Sfx\\Warrior\\Wario96b.wav", NULL }, + { sfx_STREAM | sfx_WARRIOR, "Sfx\\Warrior\\Wario97.wav", NULL }, + { sfx_STREAM | sfx_WARRIOR, "Sfx\\Warrior\\Wario98.wav", NULL }, + { sfx_STREAM | sfx_WARRIOR, "Sfx\\Warrior\\Warior99.wav", NULL }, #ifndef SPAWN - { SFX_STREAM | SFX_WARRIOR, "Sfx\\Warrior\\Wario100.wav", NULL }, - { SFX_STREAM | SFX_WARRIOR, "Sfx\\Warrior\\Wario101.wav", NULL }, - { SFX_STREAM | SFX_WARRIOR, "Sfx\\Warrior\\Wario102.wav", NULL }, - { SFX_STREAM, "Sfx\\Narrator\\Nar01.wav", NULL }, - { SFX_STREAM, "Sfx\\Narrator\\Nar02.wav", NULL }, - { SFX_STREAM, "Sfx\\Narrator\\Nar03.wav", NULL }, - { SFX_STREAM, "Sfx\\Narrator\\Nar04.wav", NULL }, - { SFX_STREAM, "Sfx\\Narrator\\Nar05.wav", NULL }, - { SFX_STREAM, "Sfx\\Narrator\\Nar06.wav", NULL }, - { SFX_STREAM, "Sfx\\Narrator\\Nar07.wav", NULL }, - { SFX_STREAM, "Sfx\\Narrator\\Nar08.wav", NULL }, - { SFX_STREAM, "Sfx\\Narrator\\Nar09.wav", NULL }, - { SFX_STREAM, "Sfx\\Misc\\Lvl16int.wav", NULL }, - { SFX_STREAM, "Sfx\\Monsters\\Butcher.wav", NULL }, - { SFX_STREAM, "Sfx\\Monsters\\Garbud01.wav", NULL }, - { SFX_STREAM, "Sfx\\Monsters\\Garbud02.wav", NULL }, - { SFX_STREAM, "Sfx\\Monsters\\Garbud03.wav", NULL }, - { SFX_STREAM, "Sfx\\Monsters\\Garbud04.wav", NULL }, - { SFX_STREAM, "Sfx\\Monsters\\Izual01.wav", NULL }, - { SFX_STREAM, "Sfx\\Monsters\\Lach01.wav", NULL }, - { SFX_STREAM, "Sfx\\Monsters\\Lach02.wav", NULL }, - { SFX_STREAM, "Sfx\\Monsters\\Lach03.wav", NULL }, - { SFX_STREAM, "Sfx\\Monsters\\Laz01.wav", NULL }, - { SFX_STREAM, "Sfx\\Monsters\\Laz02.wav", NULL }, - { SFX_STREAM, "Sfx\\Monsters\\Sking01.wav", NULL }, - { SFX_STREAM, "Sfx\\Monsters\\Snot01.wav", NULL }, - { SFX_STREAM, "Sfx\\Monsters\\Snot02.wav", NULL }, - { SFX_STREAM, "Sfx\\Monsters\\Snot03.wav", NULL }, - { SFX_STREAM, "Sfx\\Monsters\\Warlrd01.wav", NULL }, - { SFX_STREAM, "Sfx\\Monsters\\Wlock01.wav", NULL }, - { SFX_STREAM, "Sfx\\Monsters\\Zhar01.wav", NULL }, - { SFX_STREAM, "Sfx\\Monsters\\Zhar02.wav", NULL }, - { SFX_STREAM, "Sfx\\Monsters\\DiabloD.wav", NULL }, + { sfx_STREAM | sfx_WARRIOR, "Sfx\\Warrior\\Wario100.wav", NULL }, + { sfx_STREAM | sfx_WARRIOR, "Sfx\\Warrior\\Wario101.wav", NULL }, + { sfx_STREAM | sfx_WARRIOR, "Sfx\\Warrior\\Wario102.wav", NULL }, + { sfx_STREAM, "Sfx\\Narrator\\Nar01.wav", NULL }, + { sfx_STREAM, "Sfx\\Narrator\\Nar02.wav", NULL }, + { sfx_STREAM, "Sfx\\Narrator\\Nar03.wav", NULL }, + { sfx_STREAM, "Sfx\\Narrator\\Nar04.wav", NULL }, + { sfx_STREAM, "Sfx\\Narrator\\Nar05.wav", NULL }, + { sfx_STREAM, "Sfx\\Narrator\\Nar06.wav", NULL }, + { sfx_STREAM, "Sfx\\Narrator\\Nar07.wav", NULL }, + { sfx_STREAM, "Sfx\\Narrator\\Nar08.wav", NULL }, + { sfx_STREAM, "Sfx\\Narrator\\Nar09.wav", NULL }, + { sfx_STREAM, "Sfx\\Misc\\Lvl16int.wav", NULL }, + { sfx_STREAM, "Sfx\\Monsters\\Butcher.wav", NULL }, + { sfx_STREAM, "Sfx\\Monsters\\Garbud01.wav", NULL }, + { sfx_STREAM, "Sfx\\Monsters\\Garbud02.wav", NULL }, + { sfx_STREAM, "Sfx\\Monsters\\Garbud03.wav", NULL }, + { sfx_STREAM, "Sfx\\Monsters\\Garbud04.wav", NULL }, + { sfx_STREAM, "Sfx\\Monsters\\Izual01.wav", NULL }, + { sfx_STREAM, "Sfx\\Monsters\\Lach01.wav", NULL }, + { sfx_STREAM, "Sfx\\Monsters\\Lach02.wav", NULL }, + { sfx_STREAM, "Sfx\\Monsters\\Lach03.wav", NULL }, + { sfx_STREAM, "Sfx\\Monsters\\Laz01.wav", NULL }, + { sfx_STREAM, "Sfx\\Monsters\\Laz02.wav", NULL }, + { sfx_STREAM, "Sfx\\Monsters\\Sking01.wav", NULL }, + { sfx_STREAM, "Sfx\\Monsters\\Snot01.wav", NULL }, + { sfx_STREAM, "Sfx\\Monsters\\Snot02.wav", NULL }, + { sfx_STREAM, "Sfx\\Monsters\\Snot03.wav", NULL }, + { sfx_STREAM, "Sfx\\Monsters\\Warlrd01.wav", NULL }, + { sfx_STREAM, "Sfx\\Monsters\\Wlock01.wav", NULL }, + { sfx_STREAM, "Sfx\\Monsters\\Zhar01.wav", NULL }, + { sfx_STREAM, "Sfx\\Monsters\\Zhar02.wav", NULL }, + { sfx_STREAM, "Sfx\\Monsters\\DiabloD.wav", NULL }, #endif // clang-format on }; +#define PLRSFXS (sfx_WARRIOR | sfx_ROGUE | sfx_SORCEROR) + BOOL effect_is_playing(int nSFX) { TSFX *sfx = &sgSFX[nSFX]; if (sfx->pSnd) return snd_playing(sfx->pSnd); - if (sfx->bFlags & SFX_STREAM) + if (sfx->bFlags & sfx_STREAM) return sfx == sgpStreamSFX; return FALSE; @@ -1019,8 +1021,8 @@ BOOL calc_snd_position(int x, int y, int *plVolume, int *plPan) { int pan, volume; - x -= plr[myplr].WorldX; - y -= plr[myplr].WorldY; + x -= plr[myplr]._px; + y -= plr[myplr]._py; pan = (x - y) * 256; *plPan = pan; @@ -1029,7 +1031,7 @@ BOOL calc_snd_position(int x, int y, int *plVolume, int *plPan) return FALSE; volume = abs(x) > abs(y) ? abs(x) : abs(y); - volume <<= 6; + volume *= 64; *plVolume = volume; if (volume >= 6400) @@ -1057,7 +1059,7 @@ void PlaySFX_priv(TSFX *pSFX, BOOL loc, int x, int y) return; } - if (!(pSFX->bFlags & (SFX_STREAM | SFX_MISC)) && pSFX->pSnd != 0 && snd_playing(pSFX->pSnd)) { + if (!(pSFX->bFlags & (sfx_STREAM | sfx_MISC)) && pSFX->pSnd != 0 && snd_playing(pSFX->pSnd)) { return; } @@ -1067,7 +1069,7 @@ void PlaySFX_priv(TSFX *pSFX, BOOL loc, int x, int y) return; } - if (pSFX->bFlags & SFX_STREAM) { + if (pSFX->bFlags & sfx_STREAM) { stream_play(pSFX, lVolume, lPan); return; } @@ -1083,8 +1085,8 @@ void stream_play(TSFX *pSFX, int lVolume, int lPan) { BOOL success; - /// ASSERT: assert(pSFX); - /// ASSERT: assert(pSFX->bFlags & sfx_STREAM); + assert(pSFX); + assert(pSFX->bFlags & sfx_STREAM); stream_stop(); lVolume += sound_get_or_set_sound_volume(1); if (lVolume >= VOLUME_MIN) { @@ -1092,7 +1094,7 @@ void stream_play(TSFX *pSFX, int lVolume, int lPan) lVolume = VOLUME_MAX; success = SFileOpenFile(pSFX->pszName, &sghStream); if (!success) { - sghStream = 0; + sghStream = NULL; } else { if (!SFileDdaBeginEx(sghStream, 0x40000, 0, 0, lVolume, lPan, 0)) stream_stop(); @@ -1195,13 +1197,13 @@ void sound_init() { BYTE mask = 0; if (gbMaxPlayers > 1) { - mask = SFX_WARRIOR | SFX_ROGUE | SFX_SORCEROR; + mask = PLRSFXS; } else if (plr[myplr]._pClass == PC_WARRIOR) { - mask = SFX_WARRIOR; + mask = sfx_WARRIOR; } else if (plr[myplr]._pClass == PC_ROGUE) { - mask = SFX_ROGUE; + mask = sfx_ROGUE; } else if (plr[myplr]._pClass == PC_SORCERER) { - mask = SFX_SORCEROR; + mask = sfx_SORCEROR; } else { app_fatal("effects:1"); } @@ -1218,7 +1220,7 @@ void priv_sound_init(BYTE bLoadMask) return; } - pc = bLoadMask & (SFX_ROGUE | SFX_WARRIOR | SFX_SORCEROR); + pc = bLoadMask & PLRSFXS; bLoadMask ^= pc; for (i = 0; i < sizeof(sgSFX) / sizeof(TSFX); i++) { @@ -1226,7 +1228,7 @@ void priv_sound_init(BYTE bLoadMask) continue; } - if (sgSFX[i].bFlags & SFX_STREAM) { + if (sgSFX[i].bFlags & sfx_STREAM) { continue; } @@ -1234,7 +1236,7 @@ void priv_sound_init(BYTE bLoadMask) continue; } - if (sgSFX[i].bFlags & (SFX_ROGUE | SFX_WARRIOR | SFX_SORCEROR) && !(sgSFX[i].bFlags & pc)) { + if (sgSFX[i].bFlags & PLRSFXS && !(sgSFX[i].bFlags & pc)) { continue; } @@ -1244,7 +1246,7 @@ void priv_sound_init(BYTE bLoadMask) void ui_sound_init() { - priv_sound_init(SFX_UI); + priv_sound_init(sfx_UI); } void effects_play_sound(char *snd_file) diff --git a/Source/encrypt.cpp b/Source/encrypt.cpp index fcdc965ae..c092f3f0c 100644 --- a/Source/encrypt.cpp +++ b/Source/encrypt.cpp @@ -8,18 +8,16 @@ DEVILUTION_BEGIN_NAMESPACE -DWORD hashtable[1280]; +DWORD hashtable[5][256]; -void Decrypt(void *block, DWORD size, DWORD key) +void Decrypt(DWORD *castBlock, DWORD size, DWORD key) { - DWORD *castBlock; DWORD seed, i; - castBlock = (DWORD *)block; seed = 0xEEEEEEEE; for (i = 0; i < (size >> 2); i++) { DWORD t = SwapLE32(*castBlock); - seed += hashtable[0x400 + (key & 0xFF)]; + seed += hashtable[4][(key & 0xFF)]; t ^= seed + key; *castBlock = t; seed += t + (seed << 5) + 3; @@ -28,16 +26,14 @@ void Decrypt(void *block, DWORD size, DWORD key) } } -void Encrypt(void *block, DWORD size, DWORD key) +void Encrypt(DWORD *castBlock, DWORD size, DWORD key) { - DWORD *castBlock; DWORD seed, i, ch; - castBlock = (DWORD *)block; seed = 0xEEEEEEEE; for (i = 0; i < (size >> 2); i++) { DWORD t = ch = *castBlock; - seed += hashtable[0x400 + (key & 0xFF)]; + seed += hashtable[4][(key & 0xFF)]; t ^= seed + key; *castBlock = SwapLE32(t); seed += ch + (seed << 5) + 3; @@ -56,7 +52,7 @@ DWORD Hash(const char *s, int type) while (s != NULL && *s) { ch = *s++; ch = toupper(ch); - seed1 = hashtable[(type << 8) + ch] ^ (seed1 + seed2); + seed1 = hashtable[type][ch] ^ (seed1 + seed2); seed2 += ch + seed1 + (seed2 << 5) + 3; } return seed1; @@ -74,24 +70,23 @@ void InitHash() seed = (125 * seed + 3) % 0x2AAAAB; ch = (seed & 0xFFFF); seed = (125 * seed + 3) % 0x2AAAAB; - hashtable[i + j * 256] = ch << 16 | (seed & 0xFFFF); + hashtable[j][i] = ch << 16 | (seed & 0xFFFF); } } } -int PkwareCompress(void *buf, int size) +int PkwareCompress(BYTE *srcData, int size) { - BYTE *srcData, *destData; + BYTE *destData; char *ptr; unsigned int destSize, type, dsize; TDataInfo param; - srcData = (BYTE *)buf; ptr = (char *)DiabloAllocPtr(CMP_BUFFER_SIZE); destSize = 2 * size; - if (destSize < 8192) - destSize = 8192; + if (destSize < 2 * 4096) + destSize = 2 * 4096; destData = (BYTE *)DiabloAllocPtr(destSize); @@ -145,14 +140,13 @@ void PkwareBufferWrite(char *buf, unsigned int *size, void *param) pInfo->destOffset += *size; } -void PkwareDecompress(void *param, int recv_size, int dwMaxBytes) +void PkwareDecompress(BYTE *pbInBuff, int recv_size, int dwMaxBytes) { char *ptr; - BYTE *pbInBuff, *pbOutBuff; + BYTE *pbOutBuff; TDataInfo info; ptr = (char *)DiabloAllocPtr(CMP_BUFFER_SIZE); - pbInBuff = (BYTE *)param; pbOutBuff = DiabloAllocPtr(dwMaxBytes); info.srcData = pbInBuff; diff --git a/Source/encrypt.h b/Source/encrypt.h index 8a8f27e9c..adf86a765 100644 --- a/Source/encrypt.h +++ b/Source/encrypt.h @@ -6,15 +6,15 @@ #ifndef __ENCRYPT_H__ #define __ENCRYPT_H__ -extern DWORD hashtable[1280]; +extern DWORD hashtable[5][256]; -void Decrypt(void *block, DWORD size, DWORD key); -void Encrypt(void *block, DWORD size, DWORD key); +void Decrypt(DWORD *castBlock, DWORD size, DWORD key); +void Encrypt(DWORD *castBlock, DWORD size, DWORD key); DWORD Hash(const char *s, int type); void InitHash(); -int PkwareCompress(void *buf, int size); +int PkwareCompress(BYTE *srcData, int size); unsigned int PkwareBufferRead(char *buf, unsigned int *size, void *param); void PkwareBufferWrite(char *buf, unsigned int *size, void *param); -void PkwareDecompress(void *param, int recv_size, int dwMaxBytes); +void PkwareDecompress(BYTE *pbInBuff, int recv_size, int dwMaxBytes); #endif /* __ENCRYPT_H__ */ diff --git a/Source/engine.cpp b/Source/engine.cpp index 2990f0f82..ec488f306 100644 --- a/Source/engine.cpp +++ b/Source/engine.cpp @@ -165,7 +165,7 @@ void CelDrawLightRed(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, char idx = light4flag ? 1024 : 4096; if (light == 2) - idx += 256; + idx += 256; // gray colors if (light >= 4) idx += (light - 1) << 8; @@ -460,7 +460,7 @@ void CelDrawLightRedSafe(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, c idx = light4flag ? 1024 : 4096; if (light == 2) - idx += 256; + idx += 256; // gray colors if (light >= 4) idx += (light - 1) << 8; @@ -667,7 +667,7 @@ void DrawLine(int x0, int y0, int x1, int y1, BYTE col) sx = x0; sy = y0; - for(i = 0; i <= steps; i++, sx += ix, sy += iy) { + for (i = 0; i <= steps; i++, sx += ix, sy += iy) { ENG_set_pixel(sx, sy, col); } } @@ -772,7 +772,7 @@ BYTE *DiabloAllocPtr(DWORD dwBytes) if (buf == NULL) { char *text = "System memory exhausted.\n" - "Make sure you have at least 64MB of free system memory before running the game"; + "Make sure you have at least 64MB of free system memory before running the game"; ERR_DLG("Out of Memory Error", text); } @@ -827,7 +827,7 @@ BYTE *LoadFileInMem(char *pszName, DWORD *pdwFileLen) * @param p Target buffer * @return Size of file */ -DWORD LoadFileWithMem(const char *pszName, void *p) +DWORD LoadFileWithMem(const char *pszName, BYTE *p) { DWORD dwFileLen; HANDLE hsFile; @@ -1134,7 +1134,7 @@ void Cl2DrawLightTbl(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, char idx = light4flag ? 1024 : 4096; if (light == 2) - idx += 256; + idx += 256; // gray colors if (light >= 4) idx += (light - 1) << 8; diff --git a/Source/engine.h b/Source/engine.h index 71e687600..0b58c971e 100644 --- a/Source/engine.h +++ b/Source/engine.h @@ -42,7 +42,7 @@ inline BYTE *CelGetFrame(BYTE *pCelBuff, int nCel, int *nDataSize) DWORD nCellStart; nCellStart = LOAD_LE32(&pCelBuff[nCel * 4]); - *nDataSize = LOAD_LE32(&pCelBuff[(nCel+1) * 4]) - nCellStart; + *nDataSize = LOAD_LE32(&pCelBuff[(nCel + 1) * 4]) - nCellStart; return pCelBuff + nCellStart; } @@ -82,7 +82,7 @@ void engine_debug_trap(BOOL show_cursor); BYTE *DiabloAllocPtr(DWORD dwBytes); void mem_free_dbg(void *p); BYTE *LoadFileInMem(char *pszName, DWORD *pdwFileLen); -DWORD LoadFileWithMem(const char *pszName, void *p); +DWORD LoadFileWithMem(const char *pszName, BYTE *p); void Cl2ApplyTrans(BYTE *p, BYTE *ttbl, int nCel); void Cl2Draw(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth); void Cl2DrawOutline(char col, int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth); diff --git a/Source/error.cpp b/Source/error.cpp index 436e7b8e9..caf39a71e 100644 --- a/Source/error.cpp +++ b/Source/error.cpp @@ -13,7 +13,7 @@ char msgflag; char msgcnt; /** Maps from error_id to error message. */ -char *MsgStrings[44] = { +char *MsgStrings[] = { "", "No automap available in town", "No multiplayer functions in demo", @@ -57,7 +57,7 @@ char *MsgStrings[44] = { "You must be at least level 8 to use this.", "You must be at least level 13 to use this.", "You must be at least level 17 to use this.", - "Arcane knowledge gained!" + "Arcane knowledge gained!", }; void InitDiabloMsg(char e) @@ -113,7 +113,7 @@ void DrawDiabloMsg() sy += 12; } - /// ASSERT: assert(gpBuffer); + assert(gpBuffer); trans_rect(PANEL_LEFT + 104, DIALOG_TOP - 8, 432, 54); diff --git a/Source/error.h b/Source/error.h index 9205ad36a..adc7d6bac 100644 --- a/Source/error.h +++ b/Source/error.h @@ -16,6 +16,6 @@ void ClrDiabloMsg(); void DrawDiabloMsg(); /* data */ -extern char *MsgStrings[44]; +extern char *MsgStrings[]; #endif /* __ERROR_H__ */ diff --git a/Source/gamemenu.cpp b/Source/gamemenu.cpp index e84315d73..7459d095b 100644 --- a/Source/gamemenu.cpp +++ b/Source/gamemenu.cpp @@ -8,59 +8,59 @@ DEVILUTION_BEGIN_NAMESPACE /** Contains the game menu items of the single player menu. */ -TMenuItem sgSingleMenu[6] = { +TMenuItem sgSingleMenu[] = { // clang-format off - // dwFlags, pszStr, fnMenu - { GMENU_ENABLED, "Save Game", &gamemenu_save_game }, - { GMENU_ENABLED, "Options", &gamemenu_options }, - { GMENU_ENABLED, "New Game", &gamemenu_new_game }, - { GMENU_ENABLED, "Load Game", &gamemenu_load_game }, - { GMENU_ENABLED, "Quit Diablo", &gamemenu_quit_game }, - { GMENU_ENABLED, NULL, NULL } + // dwFlags, pszStr, fnMenu + { GMENU_ENABLED, "Save Game", &gamemenu_save_game }, + { GMENU_ENABLED, "Options", &gamemenu_options }, + { GMENU_ENABLED, "New Game", &gamemenu_new_game }, + { GMENU_ENABLED, "Load Game", &gamemenu_load_game }, + { GMENU_ENABLED, "Quit Diablo", &gamemenu_quit_game }, + { GMENU_ENABLED, NULL, NULL } // clang-format on }; /** Contains the game menu items of the multi player menu. */ -TMenuItem sgMultiMenu[5] = { +TMenuItem sgMultiMenu[] = { // clang-format off - // dwFlags, pszStr, fnMenu + // dwFlags, pszStr, fnMenu { GMENU_ENABLED, "Options", &gamemenu_options }, { GMENU_ENABLED, "New Game", &gamemenu_new_game }, { GMENU_ENABLED, "Restart In Town", &gamemenu_restart_town }, { GMENU_ENABLED, "Quit Diablo", &gamemenu_quit_game }, - { GMENU_ENABLED, NULL, NULL } + { GMENU_ENABLED, NULL, NULL }, // clang-format on }; -TMenuItem sgOptionsMenu[6] = { +TMenuItem sgOptionsMenu[] = { // clang-format off - // dwFlags, pszStr, fnMenu + // dwFlags, pszStr, fnMenu { GMENU_ENABLED | GMENU_SLIDER, NULL, &gamemenu_music_volume }, { GMENU_ENABLED | GMENU_SLIDER, NULL, &gamemenu_sound_volume }, { GMENU_ENABLED | GMENU_SLIDER, "Gamma", &gamemenu_gamma }, { GMENU_ENABLED , NULL, &gamemenu_color_cycling }, - { GMENU_ENABLED , "Previous Menu", &gamemenu_previous }, - { GMENU_ENABLED , NULL, NULL } + { GMENU_ENABLED , "Previous Menu", &gamemenu_previous }, + { GMENU_ENABLED , NULL, NULL }, // clang-format on }; /** Specifies the menu names for music enabled and disabled. */ -char *music_toggle_names[] = { "Music", "Music Disabled" }; +char *music_toggle_names[] = { + "Music", + "Music Disabled", +}; /** Specifies the menu names for sound enabled and disabled. */ -char *sound_toggle_names[] = { "Sound", "Sound Disabled" }; +char *sound_toggle_names[] = { + "Sound", + "Sound Disabled", +}; /** Specifies the menu names for colour cycling disabled and enabled. */ char *color_cycling_toggle_names[] = { "Color Cycling Off", "Color Cycling On" }; void gamemenu_on() { - void (*proc)(TMenuItem *); - TMenuItem *item; - if (gbMaxPlayers == 1) { - proc = gamemenu_update_single; - item = sgSingleMenu; + gmenu_set_items(sgSingleMenu, gamemenu_update_single); } else { - proc = gamemenu_update_multi; - item = sgMultiMenu; + gmenu_set_items(sgMultiMenu, gamemenu_update_multi); } - gmenu_set_items(item, proc); PressEscKey(); } @@ -74,7 +74,7 @@ void gamemenu_update_single(TMenuItem *pMenuItems) if (plr[myplr]._pmode != PM_DEATH && !deathflag) enable = TRUE; - gmenu_enable(sgSingleMenu, enable); + gmenu_enable(&sgSingleMenu[0], enable); } void gamemenu_update_multi(TMenuItem *pMenuItems) @@ -84,7 +84,7 @@ void gamemenu_update_multi(TMenuItem *pMenuItems) void gamemenu_off() { - gmenu_set_items(0, NULL); + gmenu_set_items(NULL, NULL); } void gamemenu_handle_previous() @@ -219,42 +219,31 @@ void gamemenu_get_gamma() void gamemenu_music_volume(BOOL bActivate) { int volume; + if (bActivate) { if (gbMusicOn) { gbMusicOn = FALSE; music_stop(); sound_get_or_set_music_volume(VOLUME_MIN); - gamemenu_get_music(); - return; + } else { + gbMusicOn = TRUE; + sound_get_or_set_music_volume(VOLUME_MAX); + music_start(leveltype); } - gbMusicOn = TRUE; - sound_get_or_set_music_volume(VOLUME_MAX); - music_start(leveltype); - gamemenu_get_music(); - return; - } - - volume = gamemenu_slider_music_sound(sgOptionsMenu); - sound_get_or_set_music_volume(volume); - - if (volume == VOLUME_MIN) { + } else { + volume = gamemenu_slider_music_sound(&sgOptionsMenu[0]); + sound_get_or_set_music_volume(volume); - if (gbMusicOn) { - gbMusicOn = FALSE; - music_stop(); + if (volume == VOLUME_MIN) { + if (gbMusicOn) { + gbMusicOn = FALSE; + music_stop(); + } + } else if (!gbMusicOn) { + gbMusicOn = TRUE; + music_start(leveltype); } - - gamemenu_get_music(); - return; } - - if (gbMusicOn) { - gamemenu_get_music(); - return; - } - - gbMusicOn = TRUE; - music_start(leveltype); gamemenu_get_music(); } diff --git a/Source/gendung.cpp b/Source/gendung.cpp index b2b6ebbb7..0370d4cfb 100644 --- a/Source/gendung.cpp +++ b/Source/gendung.cpp @@ -7,76 +7,85 @@ DEVILUTION_BEGIN_NAMESPACE -WORD level_frame_types[MAXTILES]; -int themeCount; -/** - * List of transparent dPieces - */ -BOOLEAN nTransTable[2049]; -//int dword_52D204; -int dMonster[MAXDUNX][MAXDUNY]; BYTE dungeon[DMAXX][DMAXY]; -char dObject[MAXDUNX][MAXDUNY]; BYTE pdungeon[DMAXX][DMAXY]; -char dDead[MAXDUNX][MAXDUNY]; -char dPreLight[MAXDUNX][MAXDUNY]; -char TransVal; -int MicroTileLen; char dflags[DMAXX][DMAXY]; -int dPiece[MAXDUNX][MAXDUNY]; -char dLight[MAXDUNX][MAXDUNY]; +int setpc_x; +int setpc_y; +int setpc_w; +int setpc_h; +BYTE *pSetPiece; BOOL setloadflag; +BYTE *pSpecialCels; BYTE *pMegaTiles; BYTE *pLevelPieces; -int gnDifficulty; +BYTE *pDungeonCels; +BYTE *pSpeedCels; +int SpeedFrameTbl[128][16]; /** * List of transparancy masks to use for dPieces */ -char block_lvid[2049]; -//char byte_5B78EB; -char dTransVal[MAXDUNX][MAXDUNY]; -BOOLEAN nTrapTable[2049]; -BYTE leveltype; -BYTE currlevel; -BOOLEAN TransList[256]; +char block_lvid[MAXTILES + 1]; +int level_frame_count[MAXTILES]; +int tile_defs[MAXTILES]; +WORD level_frame_types[MAXTILES]; +int level_frame_sizes[MAXTILES]; +int nlevel_frames; +/** + * List of light blocking dPieces + */ +BOOLEAN nBlockTable[MAXTILES + 1]; /** * List of path blocking dPieces */ -BOOLEAN nSolidTable[2049]; -ScrollStruct ScrollInfo; -BYTE *pDungeonCels; -THEME_LOC themeLoc[MAXTHEMES]; -char dPlayer[MAXDUNX][MAXDUNY]; -char dSpecial[MAXDUNX][MAXDUNY]; +BOOLEAN nSolidTable[MAXTILES + 1]; /** - * List of light blocking dPieces + * List of transparent dPieces */ -BOOLEAN nBlockTable[2049]; -BYTE *pSpecialCels; -char dFlags[MAXDUNX][MAXDUNY]; -char dItem[MAXDUNX][MAXDUNY]; -BYTE setlvlnum; +BOOLEAN nTransTable[MAXTILES + 1]; /** * List of missile blocking dPieces */ -BOOLEAN nMissileTable[2049]; -BYTE *pSetPiece; -char setlvltype; -BOOLEAN setlevel; -int LvlViewY; -int LvlViewX; +BOOLEAN nMissileTable[MAXTILES + 1]; +BOOLEAN nTrapTable[MAXTILES + 1]; +int dminx; +int dminy; int dmaxx; int dmaxy; -int setpc_h; -int setpc_w; -int setpc_x; +int gnDifficulty; +BYTE leveltype; +BYTE currlevel; +BOOLEAN setlevel; +BYTE setlvlnum; +char setlvltype; int ViewX; int ViewY; -int setpc_y; -char dMissile[MAXDUNX][MAXDUNY]; -int dminx; -int dminy; +int ViewBX; +int ViewBY; +int ViewDX; +int ViewDY; +ScrollStruct ScrollInfo; +int LvlViewX; +int LvlViewY; +int MicroTileLen; +char TransVal; +BOOLEAN TransList[256]; +int dPiece[MAXDUNX][MAXDUNY]; MICROS dpiece_defs_map_2[MAXDUNX][MAXDUNY]; +MICROS dpiece_defs_map_1[MAXDUNX * MAXDUNY]; +char dTransVal[MAXDUNX][MAXDUNY]; +char dLight[MAXDUNX][MAXDUNY]; +char dPreLight[MAXDUNX][MAXDUNY]; +char dFlags[MAXDUNX][MAXDUNY]; +char dPlayer[MAXDUNX][MAXDUNY]; +int dMonster[MAXDUNX][MAXDUNY]; +char dDead[MAXDUNX][MAXDUNY]; +char dObject[MAXDUNX][MAXDUNY]; +char dItem[MAXDUNX][MAXDUNY]; +char dMissile[MAXDUNX][MAXDUNY]; +char dSpecial[MAXDUNX][MAXDUNY]; +int themeCount; +THEME_LOC themeLoc[MAXTHEMES]; void FillSolidBlockTbls() { @@ -152,7 +161,7 @@ void SetDungeonMicros() for (x = 0; x < MAXDUNX; x++) { lv = dPiece[x][y]; pMap = &dpiece_defs_map_2[x][y]; - if (lv) { + if (lv != 0) { lv--; if (leveltype != DTYPE_HELL && leveltype != DTYPE_TOWN) pPiece = (WORD *)&pLevelPieces[20 * lv]; @@ -214,7 +223,7 @@ void DRLG_CopyTrans(int sx, int sy, int dx, int dy) void DRLG_ListTrans(int num, BYTE *List) { int i; - BYTE x1, x2, y1, y2; + BYTE x1, y1, x2, y2; for (i = 0; i < num; i++) { x1 = *List++; @@ -228,7 +237,7 @@ void DRLG_ListTrans(int num, BYTE *List) void DRLG_AreaTrans(int num, BYTE *List) { int i; - BYTE x1, x2, y1, y2; + BYTE x1, y1, x2, y2; for (i = 0; i < num; i++) { x1 = *List++; @@ -261,7 +270,7 @@ void DRLG_SetPC() for (j = 0; j < h; j++) { for (i = 0; i < w; i++) { - dFlags[i + x][j + y] |= 8; + dFlags[i + x][j + y] |= BFLAG_POPULATED; } } } @@ -278,7 +287,7 @@ void Make_SetPC(int x, int y, int w, int h) for (j = 0; j < dh; j++) { for (i = 0; i < dw; i++) { - dFlags[i + dx][j + dy] |= 8; + dFlags[i + dx][j + dy] |= BFLAG_POPULATED; } } } diff --git a/Source/gendung.h b/Source/gendung.h index ac4a89a08..9dd6b43be 100644 --- a/Source/gendung.h +++ b/Source/gendung.h @@ -6,65 +6,70 @@ #ifndef __GENDUNG_H__ #define __GENDUNG_H__ -extern WORD level_frame_types[MAXTILES]; -extern int themeCount; -extern BOOLEAN nTransTable[2049]; -//int dword_52D204; -extern int dMonster[MAXDUNX][MAXDUNY]; extern BYTE dungeon[DMAXX][DMAXY]; -extern char dObject[MAXDUNX][MAXDUNY]; extern BYTE pdungeon[DMAXX][DMAXY]; -extern char dDead[MAXDUNX][MAXDUNY]; -extern char dPreLight[MAXDUNX][MAXDUNY]; -extern char TransVal; -extern int MicroTileLen; extern char dflags[DMAXX][DMAXY]; -extern int dPiece[MAXDUNX][MAXDUNY]; -extern char dLight[MAXDUNX][MAXDUNY]; +extern int setpc_x; +extern int setpc_y; +extern int setpc_w; +extern int setpc_h; +extern BYTE *pSetPiece; extern BOOL setloadflag; +extern BYTE *pSpecialCels; extern BYTE *pMegaTiles; extern BYTE *pLevelPieces; +extern BYTE *pDungeonCels; +extern BYTE *pSpeedCels; +extern int SpeedFrameTbl[128][16]; +extern char block_lvid[MAXTILES + 1]; +extern int level_frame_count[MAXTILES]; +extern int tile_defs[MAXTILES]; +extern WORD level_frame_types[MAXTILES]; +extern int level_frame_sizes[MAXTILES]; +extern int nlevel_frames; +extern BOOLEAN nBlockTable[MAXTILES + 1]; +extern BOOLEAN nSolidTable[MAXTILES + 1]; +extern BOOLEAN nTransTable[MAXTILES + 1]; +extern BOOLEAN nMissileTable[MAXTILES + 1]; +extern BOOLEAN nTrapTable[MAXTILES + 1]; +extern int dminx; +extern int dminy; +extern int dmaxx; +extern int dmaxy; extern int gnDifficulty; -extern char block_lvid[2049]; -//char byte_5B78EB; -extern char dTransVal[MAXDUNX][MAXDUNY]; -extern BOOLEAN nTrapTable[2049]; extern BYTE leveltype; extern BYTE currlevel; -extern BOOLEAN TransList[256]; -extern BOOLEAN nSolidTable[2049]; -extern ScrollStruct ScrollInfo; -extern BYTE *pDungeonCels; -extern THEME_LOC themeLoc[MAXTHEMES]; -extern char dPlayer[MAXDUNX][MAXDUNY]; +extern BOOLEAN setlevel; +extern BYTE setlvlnum; +extern char setlvltype; +extern int ViewX; +extern int ViewY; extern int ViewBX; extern int ViewBY; extern int ViewDX; extern int ViewDY; -extern char dSpecial[MAXDUNX][MAXDUNY]; -extern BOOLEAN nBlockTable[2049]; -extern BYTE *pSpecialCels; +extern ScrollStruct ScrollInfo; +extern int LvlViewX; +extern int LvlViewY; +extern int MicroTileLen; +extern char TransVal; +extern BOOLEAN TransList[256]; +extern int dPiece[MAXDUNX][MAXDUNY]; +extern MICROS dpiece_defs_map_2[MAXDUNX][MAXDUNY]; +extern MICROS dpiece_defs_map_1[MAXDUNX * MAXDUNY]; +extern char dTransVal[MAXDUNX][MAXDUNY]; +extern char dLight[MAXDUNX][MAXDUNY]; +extern char dPreLight[MAXDUNX][MAXDUNY]; extern char dFlags[MAXDUNX][MAXDUNY]; +extern char dPlayer[MAXDUNX][MAXDUNY]; +extern int dMonster[MAXDUNX][MAXDUNY]; +extern char dDead[MAXDUNX][MAXDUNY]; +extern char dObject[MAXDUNX][MAXDUNY]; extern char dItem[MAXDUNX][MAXDUNY]; -extern BYTE setlvlnum; -extern BOOLEAN nMissileTable[2049]; -extern BYTE *pSetPiece; -extern char setlvltype; -extern BOOLEAN setlevel; -extern int LvlViewY; -extern int LvlViewX; -extern int dmaxx; -extern int dmaxy; -extern int setpc_h; -extern int setpc_w; -extern int setpc_x; -extern int ViewX; -extern int ViewY; -extern int setpc_y; extern char dMissile[MAXDUNX][MAXDUNY]; -extern int dminx; -extern int dminy; -extern MICROS dpiece_defs_map_2[MAXDUNX][MAXDUNY]; +extern char dSpecial[MAXDUNX][MAXDUNY]; +extern int themeCount; +extern THEME_LOC themeLoc[MAXTHEMES]; void FillSolidBlockTbls(); void SetDungeonMicros(); diff --git a/Source/gmenu.cpp b/Source/gmenu.cpp index a317d69ea..4f0c56363 100644 --- a/Source/gmenu.cpp +++ b/Source/gmenu.cpp @@ -21,7 +21,7 @@ BYTE *sgpLogo; int sgCurrentMenuIdx; /** Maps from font index to bigtgold.cel frame number. */ -const BYTE lfontframe[127] = { +const BYTE lfontframe[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -34,11 +34,11 @@ const BYTE lfontframe[127] = { 26, 42, 0, 43, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 20, 0, 21, 0 + 24, 25, 26, 20, 0, 21, 0, 0 }; /** Maps from bigtgold.cel frame number to character width. */ -const BYTE lfontkern[56] = { +const BYTE lfontkern[] = { 18, 33, 21, 26, 28, 19, 19, 26, 25, 11, 12, 25, 19, 34, 28, 32, 20, 32, 28, 20, 28, 36, 35, 46, 33, 33, 24, 11, 23, 22, @@ -64,7 +64,7 @@ void gmenu_print_text(int x, int y, char *pszStr) while (*pszStr) { c = gbFontTransTbl[(BYTE)*pszStr++]; c = lfontframe[c]; - if (c) + if (c != 0) CelDrawLight(x, y, BigTGold_cel, c, 46, NULL); x += lfontkern[c] + 2; } @@ -83,8 +83,8 @@ void gmenu_init_menu() { PentSpin_frame = 1; sgpCurrentMenu = NULL; - sgpCurrItem = 0; - dword_63447C = 0; + sgpCurrItem = NULL; + dword_63447C = NULL; sgCurrentMenuIdx = 0; mouseNavigation = FALSE; sgpLogo = LoadFileInMem("Data\\Diabsmal.CEL", NULL); @@ -248,7 +248,7 @@ BOOL gmenu_presskeys(int vkey) break; case VK_ESCAPE: PlaySFX(IS_TITLEMOV); - gmenu_set_items(0, 0); + gmenu_set_items(NULL, NULL); break; case VK_SPACE: return FALSE; @@ -386,7 +386,7 @@ void gmenu_slider_set(TMenuItem *pItem, int min, int max, int value) { int nSteps; - /// ASSERT: assertassert(pItem, "gmenu.cpp", 445); + assert(pItem); nSteps = (int)(pItem->dwFlags & 0xFFF000) >> 12; if (nSteps < 2) nSteps = 2; diff --git a/Source/gmenu.h b/Source/gmenu.h index 8cdb3878c..2f028b214 100644 --- a/Source/gmenu.h +++ b/Source/gmenu.h @@ -40,7 +40,7 @@ void gmenu_slider_steps(TMenuItem *pItem, int dwTicks); /* rdata */ -extern const BYTE lfontframe[127]; -extern const BYTE lfontkern[56]; +extern const BYTE lfontframe[]; +extern const BYTE lfontkern[]; #endif /* __GMENU_H__ */ diff --git a/Source/help.cpp b/Source/help.cpp index 9f3836cb2..668acb9d9 100644 --- a/Source/help.cpp +++ b/Source/help.cpp @@ -460,7 +460,7 @@ void DrawHelp() PrintSString(0, 2, TRUE, "Diablo Help", COL_GOLD, 0); DrawSLine(5); - s = gszHelpText; + s = &gszHelpText[0]; for (i = 0; i < help_select_line; i++) { c = 0; diff --git a/Source/interfac.cpp b/Source/interfac.cpp index 1389840ac..874f09bd9 100644 --- a/Source/interfac.cpp +++ b/Source/interfac.cpp @@ -7,7 +7,7 @@ DEVILUTION_BEGIN_NAMESPACE -void *sgpBackCel; +BYTE *sgpBackCel; int sgdwProgress; int progress_id; @@ -44,7 +44,7 @@ void DrawCutscene() DWORD i; lock_buf(1); - CelDraw(PANEL_X, 480 + SCREEN_Y - 1, (BYTE *)sgpBackCel, 1, 640); + CelDraw(PANEL_X, 480 + SCREEN_Y - 1, sgpBackCel, 1, 640); for (i = 0; i < sgdwProgress; i++) { DrawProgress( @@ -77,7 +77,7 @@ void ShowProgress(unsigned int uMsg) gbSomebodyWonGameKludge = FALSE; plrmsg_delay(TRUE); - /// ASSERT: assert(ghMainWnd); + assert(ghMainWnd); saveProc = SetWindowProc(DisableInputWndProc); interface_msg_pump(); @@ -119,7 +119,7 @@ void ShowProgress(unsigned int uMsg) FreeGameMem(); currlevel++; leveltype = gnLevelTypeTbl[currlevel]; - /// ASSERT: assert(plr[myplr].plrlevel == currlevel); + assert(plr[myplr].plrlevel == currlevel); IncProgress(); LoadGameLevel(FALSE, 0); IncProgress(); @@ -135,7 +135,7 @@ void ShowProgress(unsigned int uMsg) FreeGameMem(); currlevel--; leveltype = gnLevelTypeTbl[currlevel]; - /// ASSERT: assert(plr[myplr].plrlevel == currlevel); + assert(plr[myplr].plrlevel == currlevel); IncProgress(); LoadGameLevel(FALSE, 1); IncProgress(); @@ -196,7 +196,7 @@ void ShowProgress(unsigned int uMsg) FreeGameMem(); currlevel = plr[myplr].plrlevel; leveltype = gnLevelTypeTbl[currlevel]; - /// ASSERT: assert(plr[myplr].plrlevel == currlevel); + assert(plr[myplr].plrlevel == currlevel); IncProgress(); LoadGameLevel(FALSE, 6); IncProgress(); @@ -212,7 +212,7 @@ void ShowProgress(unsigned int uMsg) FreeGameMem(); currlevel = plr[myplr].plrlevel; leveltype = gnLevelTypeTbl[currlevel]; - /// ASSERT: assert(plr[myplr].plrlevel == currlevel); + assert(plr[myplr].plrlevel == currlevel); IncProgress(); LoadGameLevel(FALSE, 7); IncProgress(); @@ -228,22 +228,22 @@ void ShowProgress(unsigned int uMsg) FreeGameMem(); currlevel = plr[myplr].plrlevel; leveltype = gnLevelTypeTbl[currlevel]; - /// ASSERT: assert(plr[myplr].plrlevel == currlevel); + assert(plr[myplr].plrlevel == currlevel); IncProgress(); LoadGameLevel(FALSE, 0); IncProgress(); break; } - /// ASSERT: assert(ghMainWnd); + assert(ghMainWnd); PaletteFadeOut(8); FreeInterface(); saveProc = SetWindowProc(saveProc); - /// ASSERT: assert(saveProc == DisableInputWndProc); + assert(saveProc == DisableInputWndProc); - NetSendCmdLocParam1(TRUE, CMD_PLAYER_JOINLEVEL, plr[myplr].WorldX, plr[myplr].WorldY, plr[myplr].plrlevel); + NetSendCmdLocParam1(TRUE, CMD_PLAYER_JOINLEVEL, plr[myplr]._px, plr[myplr]._py, plr[myplr].plrlevel); plrmsg_delay(FALSE); ResetPal(); @@ -261,7 +261,7 @@ void FreeInterface() void InitCutscene(unsigned int uMsg) { - /// ASSERT: assert(! sgpBackCel); + assert(!sgpBackCel); switch (uMsg) { case WM_DIABNEXTLVL: diff --git a/Source/inv.cpp b/Source/inv.cpp index 8ae1f2018..042fefc40 100644 --- a/Source/inv.cpp +++ b/Source/inv.cpp @@ -28,7 +28,7 @@ int sgdwLastTime; // check name * 65 66 67 68 69 70 71 72 * @see graphics/inv/inventory.png */ -const InvXY InvRect[73] = { +const InvXY InvRect[] = { // clang-format off // X, Y { RIGHT_PANEL + 132, 31 }, // helmet @@ -136,7 +136,7 @@ void InvDrawSlotBack(int X, int Y, int W, int H) { BYTE *dst; - /// ASSERT: assert(gpBuffer); + assert(gpBuffer); dst = &gpBuffer[X + BUFFER_WIDTH * Y]; @@ -290,14 +290,14 @@ void DrawInv() if (plr[myplr].InvBody[INVLOC_HAND_LEFT]._iLoc == ILOC_TWOHAND) { InvDrawSlotBack(RIGHT_PANEL_X + 247, 160 + SCREEN_Y, 2 * INV_SLOT_SIZE_PX, 3 * INV_SLOT_SIZE_PX); light_table_index = 0; - cel_transparency_active = 1; + cel_transparency_active = TRUE; pBuff = frame_width == INV_SLOT_SIZE_PX - ? &gpBuffer[SCREENXY(RIGHT_PANEL_X + 197, SCREEN_Y)] - : &gpBuffer[SCREENXY(RIGHT_PANEL_X + 183, SCREEN_Y)]; + ? &gpBuffer[SCREENXY(RIGHT_PANEL_X + 197, SCREEN_Y)] + : &gpBuffer[SCREENXY(RIGHT_PANEL_X + 183, SCREEN_Y)]; CelClippedBlitLightTrans(pBuff, pCursCels, frame, frame_width); - cel_transparency_active = 0; + cel_transparency_active = FALSE; } } if (plr[myplr].InvBody[INVLOC_HAND_RIGHT]._itype != ITYPE_NONE) { @@ -1203,7 +1203,7 @@ void CheckInvCut(int pnum, int mx, int my) if (r >= SLOTXY_INV_FIRST && r <= SLOTXY_INV_LAST) { ig = r - SLOTXY_INV_FIRST; ii = plr[pnum].InvGrid[ig]; - if (ii) { + if (ii != 0) { iv = ii; if (ii <= 0) { iv = -ii; @@ -1378,7 +1378,7 @@ void CheckBookLevel(int pnum) if (plr[pnum].HoldItem._iMiscId == IMISC_BOOK) { plr[pnum].HoldItem._iMinMag = spelldata[plr[pnum].HoldItem._iSpell].sMinInt; slvl = plr[pnum]._pSplLvl[plr[pnum].HoldItem._iSpell]; - while (slvl) { + while (slvl != 0) { plr[pnum].HoldItem._iMinMag += 20 * plr[pnum].HoldItem._iMinMag / 100; slvl--; if (plr[pnum].HoldItem._iMinMag + 20 * plr[pnum].HoldItem._iMinMag / 100 > 255) { @@ -1412,7 +1412,7 @@ void CheckQuestItem(int pnum) quests[Q_ANVIL]._qvar1 = 1; } #ifndef SPAWN - if (quests[Q_ANVIL]._qlog == 1) { + if (quests[Q_ANVIL]._qlog == TRUE) { sfxdelay = 10; if (plr[myplr]._pClass == PC_WARRIOR) { sfxdnum = PS_WARR89; @@ -1442,7 +1442,7 @@ void CheckQuestItem(int pnum) quests[Q_ROCK]._qvar1 = 1; } #ifndef SPAWN - if (quests[Q_ROCK]._qlog == 1) { + if (quests[Q_ROCK]._qlog == TRUE) { sfxdelay = 10; if (plr[myplr]._pClass == PC_WARRIOR) { sfxdnum = PS_WARR87; @@ -1478,9 +1478,9 @@ void InvGetItem(int pnum, int ii) dropGoldValue = 0; } - if (dItem[item[ii]._ix][item[ii]._iy]) { + if (dItem[item[ii]._ix][item[ii]._iy] != 0) { if (myplr == pnum && pcurs >= CURSOR_FIRSTITEM) - NetSendCmdPItem(TRUE, CMD_SYNCPUTITEM, plr[myplr].WorldX, plr[myplr].WorldY); + NetSendCmdPItem(TRUE, CMD_SYNCPUTITEM, plr[myplr]._px, plr[myplr]._py); item[ii]._iCreateInfo &= ~0x8000; plr[pnum].HoldItem = item[ii]; CheckQuestItem(pnum); @@ -1516,8 +1516,9 @@ void AutoGetItem(int pnum, int ii) dropGoldValue = 0; } - if (ii != MAXITEMS && !dItem[item[ii]._ix][item[ii]._iy]) { - return; + if (ii != MAXITEMS) { + if (dItem[item[ii]._ix][item[ii]._iy] == 0) + return; } item[ii]._iCreateInfo &= 0x7FFF; @@ -1704,7 +1705,7 @@ BOOL CanPut(int x, int y) if (nSolidTable[dPiece[x][y]]) return FALSE; - if (dObject[x][y]) { + if (dObject[x][y] != 0) { if (object[dObject[x][y] > 0 ? dObject[x][y] - 1 : -1 - dObject[x][y]]._oSolidFlag) return FALSE; } @@ -1739,22 +1740,22 @@ BOOL TryInvPut() if (numitems >= 127) return FALSE; - dir = GetDirection(plr[myplr].WorldX, plr[myplr].WorldY, cursmx, cursmy); - if (CanPut(plr[myplr].WorldX + offset_x[dir], plr[myplr].WorldY + offset_y[dir])) { + dir = GetDirection(plr[myplr]._px, plr[myplr]._py, cursmx, cursmy); + if (CanPut(plr[myplr]._px + offset_x[dir], plr[myplr]._py + offset_y[dir])) { return TRUE; } dir = (dir - 1) & 7; - if (CanPut(plr[myplr].WorldX + offset_x[dir], plr[myplr].WorldY + offset_y[dir])) { + if (CanPut(plr[myplr]._px + offset_x[dir], plr[myplr]._py + offset_y[dir])) { return TRUE; } dir = (dir + 2) & 7; - if (CanPut(plr[myplr].WorldX + offset_x[dir], plr[myplr].WorldY + offset_y[dir])) { + if (CanPut(plr[myplr]._px + offset_x[dir], plr[myplr]._py + offset_y[dir])) { return TRUE; } - return CanPut(plr[myplr].WorldX, plr[myplr].WorldY); + return CanPut(plr[myplr]._px, plr[myplr]._py); } void DrawInvMsg(char *msg) @@ -1784,28 +1785,28 @@ int InvPutItem(int pnum, int x, int y) SyncGetItem(x, y, plr[pnum].HoldItem.IDidx, plr[pnum].HoldItem._iCreateInfo, plr[pnum].HoldItem._iSeed); } - d = GetDirection(plr[pnum].WorldX, plr[pnum].WorldY, x, y); - xx = x - plr[pnum].WorldX; - yy = y - plr[pnum].WorldY; + d = GetDirection(plr[pnum]._px, plr[pnum]._py, x, y); + xx = x - plr[pnum]._px; + yy = y - plr[pnum]._py; if (abs(xx) > 1 || abs(yy) > 1) { - x = plr[pnum].WorldX + offset_x[d]; - y = plr[pnum].WorldY + offset_y[d]; + x = plr[pnum]._px + offset_x[d]; + y = plr[pnum]._py + offset_y[d]; } if (!CanPut(x, y)) { d = (d - 1) & 7; - x = plr[pnum].WorldX + offset_x[d]; - y = plr[pnum].WorldY + offset_y[d]; + x = plr[pnum]._px + offset_x[d]; + y = plr[pnum]._py + offset_y[d]; if (!CanPut(x, y)) { d = (d + 2) & 7; - x = plr[pnum].WorldX + offset_x[d]; - y = plr[pnum].WorldY + offset_y[d]; + x = plr[pnum]._px + offset_x[d]; + y = plr[pnum]._py + offset_y[d]; if (!CanPut(x, y)) { done = FALSE; for (l = 1; l < 50 && !done; l++) { for (j = -l; j <= l && !done; j++) { - yp = j + plr[pnum].WorldY; + yp = j + plr[pnum]._py; for (i = -l; i <= l && !done; i++) { - xp = i + plr[pnum].WorldX; + xp = i + plr[pnum]._px; if (CanPut(xp, yp)) { done = TRUE; x = xp; @@ -1833,7 +1834,7 @@ int InvPutItem(int pnum, int x, int y) item[ii]._iy = y; RespawnItem(ii, TRUE); numitems++; - SetCursor_(CURSOR_HAND); + NewCursor(CURSOR_HAND); return ii; } @@ -1853,28 +1854,28 @@ int SyncPutItem(int pnum, int x, int y, int idx, WORD icreateinfo, int iseed, in SyncGetItem(x, y, idx, icreateinfo, iseed); } - d = GetDirection(plr[pnum].WorldX, plr[pnum].WorldY, x, y); - xx = x - plr[pnum].WorldX; - yy = y - plr[pnum].WorldY; + d = GetDirection(plr[pnum]._px, plr[pnum]._py, x, y); + xx = x - plr[pnum]._px; + yy = y - plr[pnum]._py; if (abs(xx) > 1 || abs(yy) > 1) { - x = plr[pnum].WorldX + offset_x[d]; - y = plr[pnum].WorldY + offset_y[d]; + x = plr[pnum]._px + offset_x[d]; + y = plr[pnum]._py + offset_y[d]; } if (!CanPut(x, y)) { d = (d - 1) & 7; - x = plr[pnum].WorldX + offset_x[d]; - y = plr[pnum].WorldY + offset_y[d]; + x = plr[pnum]._px + offset_x[d]; + y = plr[pnum]._py + offset_y[d]; if (!CanPut(x, y)) { d = (d + 2) & 7; - x = plr[pnum].WorldX + offset_x[d]; - y = plr[pnum].WorldY + offset_y[d]; + x = plr[pnum]._px + offset_x[d]; + y = plr[pnum]._py + offset_y[d]; if (!CanPut(x, y)) { done = FALSE; for (l = 1; l < 50 && !done; l++) { for (j = -l; j <= l && !done; j++) { - yp = j + plr[pnum].WorldY; + yp = j + plr[pnum]._py; for (i = -l; i <= l && !done; i++) { - xp = i + plr[pnum].WorldX; + xp = i + plr[pnum]._px; if (CanPut(xp, yp)) { done = TRUE; x = xp; @@ -1967,7 +1968,7 @@ char CheckInvHLight() pi = &p->InvBody[rv]; } else if (r >= 25 && r <= 64) { r = abs(p->InvGrid[r - 25]); - if (!r) + if (r == 0) return -1; ii = r - 1; rv = ii + 7; @@ -2104,7 +2105,7 @@ BOOL UseInvItem(int pnum, int cii) return TRUE; if (pcurs != CURSOR_HAND) return TRUE; - if (stextflag) + if (stextflag != STORE_NONE) return TRUE; if (cii <= INVITEM_HAND_RIGHT) return FALSE; @@ -2209,9 +2210,9 @@ void DoTelekinesis() NetSendCmdParam1(TRUE, CMD_OPOBJT, pcursobj); if (pcursitem != -1) NetSendCmdGItem(TRUE, CMD_REQUESTAGITEM, myplr, myplr, pcursitem); - if (pcursmonst != -1 && !M_Talker(pcursmonst) && !monster[pcursmonst].mtalkmsg) + if (pcursmonst != -1 && !M_Talker(pcursmonst) && monster[pcursmonst].mtalkmsg == 0) NetSendCmdParam1(TRUE, CMD_KNOCKBACK, pcursmonst); - SetCursor_(CURSOR_HAND); + NewCursor(CURSOR_HAND); } int CalculateGold(int pnum) @@ -2237,7 +2238,7 @@ BOOL DropItemBeforeTrig() { if (TryInvPut()) { NetSendCmdPItem(TRUE, CMD_PUTITEM, cursmx, cursmy); - SetCursor_(CURSOR_HAND); + NewCursor(CURSOR_HAND); return TRUE; } diff --git a/Source/itemdat.cpp b/Source/itemdat.cpp index e7d599bc1..2add10af8 100644 --- a/Source/itemdat.cpp +++ b/Source/itemdat.cpp @@ -19,7 +19,7 @@ ItemDataStruct AllItemsList[] = { { IDROP_NEVER, ICLASS_WEAPON, ILOC_TWOHAND, ICURS_SHORT_STAFF, 10, UITYPE_NONE, "Short Staff of Charged Bolt", NULL, 1, 25, 2, 4, 0, 0, 0, 20, 0, ISPL_NONE, IMISC_STAFF, SPL_CBOLT, FALSE, 520, 520 }, { IDROP_NEVER, ICLASS_WEAPON, ILOC_TWOHAND, ICURS_CLEAVER, 2, UITYPE_CLEAVER, "Cleaver", NULL, 10, 10, 4, 24, 0, 0, 0, 0, 0, ISPL_NONE, IMISC_UNIQUE, SPL_NULL, FALSE, 2000, 2000 }, { IDROP_NEVER, ICLASS_ARMOR, ILOC_HELM, ICURS_THE_UNDEAD_CROWN, 7, UITYPE_SKCROWN, "The Undead Crown", NULL, 0, 50, 0, 0, 15, 15, 0, 0, 0, ISPL_RNDSTEALLIFE, IMISC_UNIQUE, SPL_NULL, FALSE, 10000, 10000 }, - { IDROP_NEVER, ICLASS_MISC, ILOC_RING, ICURS_EMPYREAN_BAND, 12, UITYPE_INFRARING, "Empyrean Band", NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, ISPL_NONE, IMISC_UNIQUE, SPL_NULL, FALSE, 8000, 8000 }, + { IDROP_NEVER, ICLASS_MISC, ILOC_RING, ICURS_EMPYREAN_BAND, 12, UITYPE_INFRARING, "Empyrean Band", NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, ISPL_NONE, IMISC_UNIQUE, SPL_NULL, FALSE, 8000, 8000 }, { IDROP_NEVER, ICLASS_QUEST, ILOC_UNEQUIPABLE, ICURS_MAGIC_ROCK, 0, UITYPE_NONE, "Magic Rock", NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, ISPL_NONE, IMISC_NONE, SPL_NULL, FALSE, 0, 0 }, { IDROP_NEVER, ICLASS_MISC, ILOC_AMULET, ICURS_OPTIC_AMULET, 13, UITYPE_OPTAMULET, "Optic Amulet", NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, ISPL_NONE, IMISC_UNIQUE, SPL_NULL, FALSE, 5000, 5000 }, { IDROP_NEVER, ICLASS_MISC, ILOC_RING, ICURS_RING_OF_TRUTH, 12, UITYPE_TRING, "Ring of Truth", NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, ISPL_NONE, IMISC_UNIQUE, SPL_NULL, FALSE, 1000, 1000 }, diff --git a/Source/items.cpp b/Source/items.cpp index 46dfe5b2d..195edb20d 100644 --- a/Source/items.cpp +++ b/Source/items.cpp @@ -21,7 +21,7 @@ int gnNumGetRecords; /* data */ -BYTE ItemCAnimTbl[169] = { +BYTE ItemCAnimTbl[] = { 20, 16, 16, 16, 4, 4, 4, 12, 12, 12, 12, 12, 12, 12, 12, 21, 21, 25, 12, 28, 28, 28, 0, 0, 0, 32, 0, 0, 0, 24, @@ -40,7 +40,7 @@ BYTE ItemCAnimTbl[169] = { 14, 17, 17, 17, 0, 34, 1, 0, 3, 17, 8, 8, 6, 1, 3, 3, 11, 3, 4 }; -char *ItemDropNames[ITEMTYPES] = { +char *ItemDropNames[] = { "Armor2", "Axe", "FBttle", @@ -75,9 +75,9 @@ char *ItemDropNames[ITEMTYPES] = { "Innsign", "Bldstn", "Fanvil", - "FLazStaf" + "FLazStaf", }; -BYTE ItemAnimLs[ITEMTYPES] = { +BYTE ItemAnimLs[] = { 15, 13, 16, @@ -112,9 +112,9 @@ BYTE ItemAnimLs[ITEMTYPES] = { 13, 13, 13, - 8 + 8, }; -int ItemDropSnds[ITEMTYPES] = { +int ItemDropSnds[] = { IS_FHARM, IS_FAXE, IS_FPOT, @@ -149,9 +149,9 @@ int ItemDropSnds[ITEMTYPES] = { IS_ISIGN, IS_FBLST, IS_FANVL, - IS_FSTAF + IS_FSTAF, }; -int ItemInvSnds[ITEMTYPES] = { +int ItemInvSnds[] = { IS_IHARM, IS_IAXE, IS_IPOT, @@ -186,7 +186,7 @@ int ItemInvSnds[ITEMTYPES] = { IS_ISIGN, IS_IBLST, IS_IANVL, - IS_ISTAF + IS_ISTAF, }; int idoppely = 16; int premiumlvladd[6] = { -1, -1, 0, 0, 1, 2 }; @@ -205,13 +205,13 @@ void InitItemGFX() BOOL ItemPlace(int xp, int yp) { - if (dMonster[xp][yp]) + if (dMonster[xp][yp] != 0) return FALSE; - if (dPlayer[xp][yp]) + if (dPlayer[xp][yp] != 0) return FALSE; - if (dItem[xp][yp]) + if (dItem[xp][yp] != 0) return FALSE; - if (dObject[xp][yp]) + if (dObject[xp][yp] != 0) return FALSE; if (dFlags[xp][yp] & BFLAG_POPULATED) return FALSE; @@ -342,8 +342,8 @@ void CalcPlrItemVals(int p, BOOL Loadgfx) ItemStruct *itm = &plr[p].InvBody[i]; if (itm->_itype != ITYPE_NONE && itm->_iStatFlag) { - mind += itm->_iMinDam; tac += itm->_iAC; + mind += itm->_iMinDam; maxd += itm->_iMaxDam; if (itm->_iSpell != SPL_NULL) { @@ -359,7 +359,6 @@ void CalcPlrItemVals(int p, BOOL Loadgfx) tmpac = 1; bac += tmpac; } - dmod += itm->_iPLDamMod; iflgs |= itm->_iFlags; sadd += itm->_iPLStr; madd += itm->_iPLMag; @@ -368,6 +367,7 @@ void CalcPlrItemVals(int p, BOOL Loadgfx) fr += itm->_iPLFR; lr += itm->_iPLLR; mr += itm->_iPLMR; + dmod += itm->_iPLDamMod; ghit += itm->_iPLGetHit; lrad += itm->_iPLLight; ihp += itm->_iPLHP; @@ -395,15 +395,15 @@ void CalcPlrItemVals(int p, BOOL Loadgfx) } } + plr[p]._pIMinDam = mind; plr[p]._pIMaxDam = maxd; plr[p]._pIAC = tac; plr[p]._pIBonusDam = bdam; plr[p]._pIBonusToHit = btohit; plr[p]._pIBonusAC = bac; plr[p]._pIFlags = iflgs; - plr[p]._pIGetHit = ghit; - plr[p]._pIMinDam = mind; plr[p]._pIBonusDamMod = dmod; + plr[p]._pIGetHit = ghit; if (lrad < 2) { lrad = 2; @@ -471,19 +471,16 @@ void CalcPlrItemVals(int p, BOOL Loadgfx) lr = 0; } - if (mr > 75) { - mr = 75; - } + if (mr > MAXRESIST) + mr = MAXRESIST; plr[p]._pMagResist = mr; - if (fr > 75) { - fr = 75; - } + if (fr > MAXRESIST) + fr = MAXRESIST; plr[p]._pFireResist = fr; - if (lr > 75) { - lr = 75; - } + if (lr > MAXRESIST) + lr = MAXRESIST; plr[p]._pLghtResist = lr; if (plr[p]._pClass == PC_WARRIOR) { @@ -585,7 +582,7 @@ void CalcPlrItemVals(int p, BOOL Loadgfx) d = plr[p]._pdir; - // TODO: Add debug assert here ( plr[p]._pNAnim[d] != NULL ) + assert(plr[p]._pNAnim[d]); plr[p]._pAnimData = plr[p]._pNAnim[d]; plr[p]._pAnimLen = plr[p]._pNFrames; @@ -736,7 +733,7 @@ void CalcPlrBookVals(int p) { int i, slvl; - if (!currlevel) { + if (currlevel == 0) { for (i = 1; witchitem[i]._itype != ITYPE_NONE; i++) { WitchBookLevel(i); witchitem[i]._iStatFlag = StoreStatOk(&witchitem[i]); @@ -748,7 +745,7 @@ void CalcPlrBookVals(int p) plr[p].InvList[i]._iMinMag = spelldata[plr[p].InvList[i]._iSpell].sMinInt; slvl = plr[p]._pSplLvl[plr[p].InvList[i]._iSpell]; - while (slvl) { + while (slvl != 0) { plr[p].InvList[i]._iMinMag += 20 * plr[p].InvList[i]._iMinMag / 100; slvl--; if (plr[p].InvList[i]._iMinMag + 20 * plr[p].InvList[i]._iMinMag / 100 > 255) { @@ -771,7 +768,7 @@ void CalcPlrInv(int p, BOOL Loadgfx) CalcPlrBookVals(p); CalcPlrScrolls(p); CalcPlrStaff(p); - if (p == myplr && !currlevel) + if (p == myplr && currlevel == 0) RecalcStoreStats(); } } @@ -881,7 +878,7 @@ void CreatePlrItems(int p) plr[p]._pNumInv = 0; - pi = plr[p].SpdList; + pi = &plr[p].SpdList[0]; for (i = MAXBELTITEMS; i != 0; i--) { pi->_itype = ITYPE_NONE; pi++; @@ -970,16 +967,16 @@ BOOL ItemSpaceOk(int i, int j) if (i < 0 || i + 1 >= MAXDUNX || j < 0 || j + 1 >= MAXDUNY) return FALSE; - if (dMonster[i][j]) + if (dMonster[i][j] != 0) return FALSE; - if (dPlayer[i][j]) + if (dPlayer[i][j] != 0) return FALSE; - if (dItem[i][j]) + if (dItem[i][j] != 0) return FALSE; - if (dObject[i][j]) { + if (dObject[i][j] != 0) { oi = dObject[i][j] > 0 ? dObject[i][j] - 1 : -(dObject[i][j] + 1); if (object[oi]._oSolidFlag) return FALSE; @@ -1124,7 +1121,7 @@ void GetBookSpell(int i, int lvl) if (lvl > 5) lvl = 5; #endif - s = 1; + s = SPL_FIREBOLT; while (rv > 0) { if (spelldata[s].sBookLvl != -1 && lvl >= spelldata[s].sBookLvl) { rv--; @@ -1229,7 +1226,7 @@ void GetStaffSpell(int i, int lvl, BOOL onlygood) if (lvl > 10) lvl = 10; #endif - s = 1; + s = SPL_FIREBOLT; while (rv > 0) { if (spelldata[s].sStaffLvl != -1 && l >= spelldata[s].sStaffLvl) { rv--; @@ -1241,7 +1238,7 @@ void GetStaffSpell(int i, int lvl, BOOL onlygood) if (gbMaxPlayers == 1 && s == SPL_HEALOTHER) s = SPL_FLARE; if (s == MAX_SPELLS) - s = 1; + s = SPL_FIREBOLT; } sprintf(istr, "%s of %s", item[i]._iName, spelldata[bs].sNameText); if (!control_WriteStringToBuffer((BYTE *)istr)) @@ -1700,7 +1697,7 @@ void GetItemPower(int i, int minlvl, int maxlvl, int flgs, BOOL onlygood) } } } - if (nt) { + if (nl != 0) { preidx = l[random_(23, nt)]; sprintf(istr, "%s %s", PL_Prefix[preidx].PLName, item[i]._iIName); strcpy(item[i]._iIName, istr); @@ -1728,7 +1725,7 @@ void GetItemPower(int i, int minlvl, int maxlvl, int flgs, BOOL onlygood) nl++; } } - if (nl) { + if (nl != 0) { sufidx = l[random_(23, nl)]; sprintf(istr, "%s of %s", item[i]._iIName, PL_Suffix[sufidx].PLName); strcpy(item[i]._iIName, istr); @@ -1963,7 +1960,7 @@ int CheckUnique(int i, int lvl, int uper, BOOL recreate) } } - if (!numu) + if (numu == 0) return -1; random_(29, 10); /// BUGFIX: unused, last unique in array always gets chosen @@ -2483,7 +2480,7 @@ void FreeItemGFX() { int i; - for (i = 0; i < 35; i++) { + for (i = 0; i < ITEMTYPES; i++) { MemFreeDbg(itemanims[i]); } } @@ -2535,7 +2532,7 @@ void DoRepair(int pnum, int cii) ItemStruct *pi; p = &plr[pnum]; - PlaySfxLoc(IS_REPAIR, p->WorldX, p->WorldY); + PlaySfxLoc(IS_REPAIR, p->_px, p->_py); if (cii >= NUM_INVLOC) { pi = &p->InvList[cii - NUM_INVLOC]; @@ -2959,7 +2956,7 @@ void PrintUString(int x, int y, BOOL cjustflag, char *str, int col) void DrawULine(int y) { - /// ASSERT: assert(gpBuffer); + assert(gpBuffer); int i; BYTE *src, *dst; diff --git a/Source/items.h b/Source/items.h index 92e8e201b..274560154 100644 --- a/Source/items.h +++ b/Source/items.h @@ -132,11 +132,11 @@ void PutItemRecord(int nSeed, WORD wCI, int nIndex); /* data */ -extern BYTE ItemCAnimTbl[169]; -extern char *ItemDropNames[ITEMTYPES]; -extern BYTE ItemAnimLs[ITEMTYPES]; -extern int ItemDropSnds[ITEMTYPES]; -extern int ItemInvSnds[ITEMTYPES]; +extern BYTE ItemCAnimTbl[]; +extern char *ItemDropNames[]; +extern BYTE ItemAnimLs[]; +extern int ItemDropSnds[]; +extern int ItemInvSnds[]; extern int idoppely; extern int premiumlvladd[6]; diff --git a/Source/lighting.cpp b/Source/lighting.cpp index 72b7fcb97..e42716f7a 100644 --- a/Source/lighting.cpp +++ b/Source/lighting.cpp @@ -656,9 +656,8 @@ void DoUnLight(int nXPos, int nYPos, int nRadius) for (y = min_y; y < max_y; y++) { for (x = min_x; x < max_x; x++) { - if (x >= 0 && x < MAXDUNX && y >= 0 && y < MAXDUNY) { + if (x >= 0 && x < MAXDUNX && y >= 0 && y < MAXDUNY) dLight[x][y] = dPreLight[x][y]; - } } } } @@ -758,9 +757,9 @@ void DoVision(int nXPos, int nYPos, int nRadius, BOOL doautomap, BOOL visible) if (nCrawlX >= 0 && nCrawlX < MAXDUNX && nCrawlY >= 0 && nCrawlY < MAXDUNY) { nBlockerFlag = nBlockTable[dPiece[nCrawlX][nCrawlY]]; if ((x1adj + nCrawlX >= 0 && x1adj + nCrawlX < MAXDUNX && y1adj + nCrawlY >= 0 && y1adj + nCrawlY < MAXDUNY - && !nBlockTable[dPiece[x1adj + nCrawlX][y1adj + nCrawlY]]) + && !nBlockTable[dPiece[x1adj + nCrawlX][y1adj + nCrawlY]]) || (x2adj + nCrawlX >= 0 && x2adj + nCrawlX < MAXDUNX && y2adj + nCrawlY >= 0 && y2adj + nCrawlY < MAXDUNY - && !nBlockTable[dPiece[x2adj + nCrawlX][y2adj + nCrawlY]])) { + && !nBlockTable[dPiece[x2adj + nCrawlX][y2adj + nCrawlY]])) { if (doautomap) { if (dFlags[nCrawlX][nCrawlY] >= 0) { SetAutomapView(nCrawlX, nCrawlY); @@ -791,7 +790,7 @@ void FreeLightTable() void InitLightTable() { - /// ASSERT: assert(! pLightTbl); + assert(!pLightTbl); pLightTbl = DiabloAllocPtr(LIGHTSIZE); } @@ -983,13 +982,13 @@ void ToggleLighting() lightflag ^= TRUE; - if (lightflag) { + if (lightflag != 0) { memset(dLight, 0, sizeof(dLight)); } else { memcpy(dLight, dPreLight, sizeof(dLight)); for (i = 0; i < MAX_PLRS; i++) { if (plr[i].plractive && plr[i].plrlevel == currlevel) { - DoLighting(plr[i].WorldX, plr[i].WorldY, plr[i]._pLightRad, -1); + DoLighting(plr[i]._px, plr[i]._py, plr[i]._pLightRad, -1); } } } @@ -1022,7 +1021,7 @@ int AddLight(int x, int y, int r) { int lid; - if (lightflag) { + if (lightflag != 0) { return -1; } @@ -1035,8 +1034,8 @@ int AddLight(int x, int y, int r) LightList[lid]._lradius = r; LightList[lid]._xoff = 0; LightList[lid]._yoff = 0; - LightList[lid]._ldel = 0; - LightList[lid]._lunflag = 0; + LightList[lid]._ldel = FALSE; + LightList[lid]._lunflag = FALSE; dolighting = TRUE; } @@ -1049,7 +1048,7 @@ void AddUnLight(int i) return; } - LightList[i]._ldel = 1; + LightList[i]._ldel = TRUE; dolighting = TRUE; } @@ -1059,7 +1058,7 @@ void ChangeLightRadius(int i, int r) return; } - LightList[i]._lunflag = 1; + LightList[i]._lunflag = TRUE; LightList[i]._lunx = LightList[i]._lx; LightList[i]._luny = LightList[i]._ly; LightList[i]._lunr = LightList[i]._lradius; @@ -1073,7 +1072,7 @@ void ChangeLightXY(int i, int x, int y) return; } - LightList[i]._lunflag = 1; + LightList[i]._lunflag = TRUE; LightList[i]._lunx = LightList[i]._lx; LightList[i]._luny = LightList[i]._ly; LightList[i]._lunr = LightList[i]._lradius; @@ -1088,7 +1087,7 @@ void ChangeLightOff(int i, int x, int y) return; } - LightList[i]._lunflag = 1; + LightList[i]._lunflag = TRUE; LightList[i]._lunx = LightList[i]._lx; LightList[i]._luny = LightList[i]._ly; LightList[i]._lunr = LightList[i]._lradius; @@ -1103,7 +1102,7 @@ void ChangeLight(int i, int x, int y, int r) return; } - LightList[i]._lunflag = 1; + LightList[i]._lunflag = TRUE; LightList[i]._lunx = LightList[i]._lx; LightList[i]._luny = LightList[i]._ly; LightList[i]._lunr = LightList[i]._lradius; @@ -1118,7 +1117,7 @@ void ProcessLightList() int i, j; BYTE temp; - if (lightflag) { + if (lightflag != 0) { return; } @@ -1130,7 +1129,7 @@ void ProcessLightList() } if (LightList[j]._lunflag) { DoUnLight(LightList[j]._lunx, LightList[j]._luny, LightList[j]._lunr); - LightList[j]._lunflag = 0; + LightList[j]._lunflag = FALSE; } } for (i = 0; i < numlights; i++) { @@ -1199,7 +1198,7 @@ void ChangeVisionRadius(int id, int r) for (i = 0; i < numvision; i++) { if (VisionList[i]._lid == id) { - VisionList[i]._lunflag = 1; + VisionList[i]._lunflag = TRUE; VisionList[i]._lunx = VisionList[i]._lx; VisionList[i]._luny = VisionList[i]._ly; VisionList[i]._lunr = VisionList[i]._lradius; @@ -1215,7 +1214,7 @@ void ChangeVisionXY(int id, int x, int y) for (i = 0; i < numvision; i++) { if (VisionList[i]._lid == id) { - VisionList[i]._lunflag = 1; + VisionList[i]._lunflag = TRUE; VisionList[i]._lunx = VisionList[i]._lx; VisionList[i]._luny = VisionList[i]._ly; VisionList[i]._lunr = VisionList[i]._lradius; @@ -1238,7 +1237,7 @@ void ProcessVisionList() } if (VisionList[i]._lunflag) { DoUnVision(VisionList[i]._lunx, VisionList[i]._luny, VisionList[i]._lunr); - VisionList[i]._lunflag = 0; + VisionList[i]._lunflag = FALSE; } } for (i = 0; i < TransVal; i++) { diff --git a/Source/loadsave.cpp b/Source/loadsave.cpp index 56030afa3..ca3d4a9c2 100644 --- a/Source/loadsave.cpp +++ b/Source/loadsave.cpp @@ -220,7 +220,7 @@ void CopyBytes(const void *src, const int n, void *dst) void CopyChar(const void *src, void *dst) { - *(char*)dst = *(char*)src; + *(char *)dst = *(char *)src; tbuff += 1; } @@ -237,9 +237,10 @@ void CopyShorts(const void *src, const int n, void *dst) { const auto *s = reinterpret_cast(src); auto *d = reinterpret_cast(dst); - for(int i = 0; i < n; i++) { + for (int i = 0; i < n; i++) { CopyShort(s, d); - ++d; ++s; + ++d; + ++s; } } @@ -256,9 +257,10 @@ void CopyInts(const void *src, const int n, void *dst) { const auto *s = reinterpret_cast(src); auto *d = reinterpret_cast(dst); - for(int i = 0; i < n; i++) { + for (int i = 0; i < n; i++) { CopyInt(s, d); - ++d; ++s; + ++d; + ++s; } } @@ -285,10 +287,10 @@ void LoadPlayer(int i) CopyInt(tbuff, &pPlayer->destParam3); CopyInt(tbuff, &pPlayer->destParam4); CopyInt(tbuff, &pPlayer->plrlevel); - CopyInt(tbuff, &pPlayer->WorldX); - CopyInt(tbuff, &pPlayer->WorldY); CopyInt(tbuff, &pPlayer->_px); CopyInt(tbuff, &pPlayer->_py); + CopyInt(tbuff, &pPlayer->_pfutx); + CopyInt(tbuff, &pPlayer->_pfuty); CopyInt(tbuff, &pPlayer->_ptargx); CopyInt(tbuff, &pPlayer->_ptargy); CopyInt(tbuff, &pPlayer->_pownerx); @@ -1010,10 +1012,10 @@ void SavePlayer(int i) CopyInt(&pPlayer->destParam3, tbuff); CopyInt(&pPlayer->destParam4, tbuff); CopyInt(&pPlayer->plrlevel, tbuff); - CopyInt(&pPlayer->WorldX, tbuff); - CopyInt(&pPlayer->WorldY, tbuff); CopyInt(&pPlayer->_px, tbuff); CopyInt(&pPlayer->_py, tbuff); + CopyInt(&pPlayer->_pfutx, tbuff); + CopyInt(&pPlayer->_pfuty, tbuff); CopyInt(&pPlayer->_ptargx, tbuff); CopyInt(&pPlayer->_ptargy, tbuff); CopyInt(&pPlayer->_pownerx, tbuff); @@ -1113,7 +1115,7 @@ void SavePlayer(int i) CopyInt(&pPlayer->_pVar8, tbuff); CopyBytes(&pPlayer->_pLvlVisited, NUMLEVELS, tbuff); CopyBytes(&pPlayer->_pSLvlVisited, NUMLEVELS, tbuff); // only 10 used - tbuff += 2; // Alignment + tbuff += 2; // Alignment CopyInt(&pPlayer->_pGFXLoad, tbuff); tbuff += 4 * 8; // Skip pointers _pNAnim @@ -1549,7 +1551,7 @@ void SaveLevel() int dwLen; BYTE *SaveBuff; - if (!currlevel) + if (currlevel == 0) glSeedTbl[0] = GetRndSeed(); dwLen = codec_get_encoded_len(FILEBUFF); @@ -1722,7 +1724,7 @@ void LoadLevel() for (i = 0; i < MAX_PLRS; i++) { if (plr[i].plractive && currlevel == plr[i].plrlevel) - LightList[plr[i]._plid]._lunflag = 1; + LightList[plr[i]._plid]._lunflag = TRUE; } mem_free_dbg(LoadBuff); diff --git a/Source/minitext.cpp b/Source/minitext.cpp index cbb264145..045ea7325 100644 --- a/Source/minitext.cpp +++ b/Source/minitext.cpp @@ -74,11 +74,11 @@ void InitQTextMsg(int m) qtextptr = alltext[m].txtstr; qtextflag = TRUE; qtexty = 500; - sgLastScroll = qscroll_spd_tbl[alltext[m].txtspd - 1]; - if (sgLastScroll <= 0) - scrolltexty = 50 / -(sgLastScroll - 1); + qtextSpd = qscroll_spd_tbl[alltext[m].txtspd - 1]; + if (qtextSpd <= 0) + scrolltexty = 50 / -(qtextSpd - 1); else - scrolltexty = ((sgLastScroll + 1) * 50) / sgLastScroll; + scrolltexty = ((qtextSpd + 1) * 50) / qtextSpd; qtextSpd = SDL_GetTicks(); } PlaySFX(alltext[m].sfxnr); @@ -168,7 +168,7 @@ void DrawQText() } } - for (currTime = SDL_GetTicks(); qtextSpd + scrolltexty < currTime; qtextSpd += scrolltexty) { + for (currTime = SDL_GetTicks(); sgLastScroll + scrolltexty < currTime; sgLastScroll += scrolltexty) { qtexty--; if (qtexty <= 209) { qtexty += 38; diff --git a/Source/minitext.h b/Source/minitext.h index 568e51b6f..27b740e5c 100644 --- a/Source/minitext.h +++ b/Source/minitext.h @@ -8,9 +8,7 @@ extern int qtexty; extern char *qtextptr; -extern int qtextSpd; extern BOOLEAN qtextflag; -extern int scrolltexty; extern BYTE *pMedTextCels; extern BYTE *pTextBoxCels; diff --git a/Source/missiles.cpp b/Source/missiles.cpp index 67dd07445..5b221af52 100644 --- a/Source/missiles.cpp +++ b/Source/missiles.cpp @@ -670,8 +670,8 @@ BOOL MonsterMHit(int pnum, int m, int mindam, int maxdam, int dist, int t, BOOLE if (!monster[m]._msquelch) { monster[m]._msquelch = UCHAR_MAX; - monster[m]._lastx = plr[pnum].WorldX; - monster[m]._lasty = plr[pnum].WorldY; + monster[m]._lastx = plr[pnum]._px; + monster[m]._lasty = plr[pnum]._py; } return TRUE; } @@ -798,12 +798,12 @@ BOOL PlayerMHit(int pnum, int m, int dist, int mind, int maxd, int mtype, BOOLEA SyncPlrKill(pnum, earflag); } else { if (plr[pnum]._pClass == PC_WARRIOR) { - PlaySfxLoc(PS_WARR69, plr[pnum].WorldX, plr[pnum].WorldY); + PlaySfxLoc(PS_WARR69, plr[pnum]._px, plr[pnum]._py); #ifndef SPAWN } else if (plr[pnum]._pClass == PC_ROGUE) { - PlaySfxLoc(PS_ROGUE69, plr[pnum].WorldX, plr[pnum].WorldY); + PlaySfxLoc(PS_ROGUE69, plr[pnum]._px, plr[pnum]._py); } else if (plr[pnum]._pClass == PC_SORCERER) { - PlaySfxLoc(PS_MAGE69, plr[pnum].WorldX, plr[pnum].WorldY); + PlaySfxLoc(PS_MAGE69, plr[pnum]._px, plr[pnum]._py); #endif } drawhpflag = TRUE; @@ -811,7 +811,7 @@ BOOL PlayerMHit(int pnum, int m, int dist, int mind, int maxd, int mtype, BOOLEA } else { if (blk < blkper) { if (m != -1) { - tac = GetDirection(plr[pnum].WorldX, plr[pnum].WorldY, monster[m]._mx, monster[m]._my); + tac = GetDirection(plr[pnum]._px, plr[pnum]._py, monster[m]._mx, monster[m]._my); } else { tac = plr[pnum]._pdir; } @@ -935,10 +935,10 @@ BOOL Plr2PlrMHit(int pnum, int p, int mindam, int maxdam, int dist, int mtype, B } else { return TRUE; } - PlaySfxLoc(tac, plr[pnum].WorldX, plr[pnum].WorldY); + PlaySfxLoc(tac, plr[pnum]._px, plr[pnum]._py); } else { if (blkper < blk) { - StartPlrBlock(p, GetDirection(plr[p].WorldX, plr[p].WorldY, plr[pnum].WorldX, plr[pnum].WorldY)); + StartPlrBlock(p, GetDirection(plr[p]._px, plr[p]._py, plr[pnum]._px, plr[pnum]._py)); } else { if (pnum == myplr) NetSendCmdDamage(TRUE, p, dam); @@ -973,13 +973,13 @@ void CheckMissileCol(int i, int mindam, int maxdam, BOOL shift, int mx, int my, if (dMonster[mx][my] < 0 && monster[-(dMonster[mx][my] + 1)]._mmode == MM_STONE && MonsterMHit( - missile[i]._misource, - -(dMonster[mx][my] + 1), - mindam, - maxdam, - missile[i]._midist, - missile[i]._mitype, - shift)) { + missile[i]._misource, + -(dMonster[mx][my] + 1), + mindam, + maxdam, + missile[i]._midist, + missile[i]._mitype, + shift)) { if (!nodel) missile[i]._mirange = 0; missile[i]._miHitFlag = TRUE; @@ -988,13 +988,13 @@ void CheckMissileCol(int i, int mindam, int maxdam, BOOL shift, int mx, int my, if (dPlayer[mx][my] > 0 && dPlayer[mx][my] - 1 != missile[i]._misource && Plr2PlrMHit( - missile[i]._misource, - dPlayer[mx][my] - 1, - mindam, - maxdam, - missile[i]._midist, - missile[i]._mitype, - shift)) { + missile[i]._misource, + dPlayer[mx][my] - 1, + mindam, + maxdam, + missile[i]._midist, + missile[i]._mitype, + shift)) { if (!nodel) missile[i]._mirange = 0; missile[i]._miHitFlag = TRUE; @@ -1010,14 +1010,14 @@ void CheckMissileCol(int i, int mindam, int maxdam, BOOL shift, int mx, int my, } if (dPlayer[mx][my] > 0 && PlayerMHit( - dPlayer[mx][my] - 1, - missile[i]._misource, - missile[i]._midist, - mindam, - maxdam, - missile[i]._mitype, - shift, - 0)) { + dPlayer[mx][my] - 1, + missile[i]._misource, + missile[i]._midist, + mindam, + maxdam, + missile[i]._mitype, + shift, + 0)) { if (!nodel) missile[i]._mirange = 0; missile[i]._miHitFlag = TRUE; @@ -1074,9 +1074,9 @@ void SetMissAnim(int mi, int animtype) { int dir = missile[mi]._mimfnum; - if (animtype > MFILE_NULL) { - animtype = MFILE_NULL; - } + if (animtype > MFILE_NULL) { + animtype = MFILE_NULL; + } missile[mi]._miAnimType = animtype; missile[mi]._miAnimFlags = misfiledata[animtype].mFlags; @@ -1415,8 +1415,8 @@ void AddLightball(int mi, int sx, int sy, int dx, int dy, int midir, char mienem missile[mi]._miVar1 = sx; missile[mi]._miVar2 = sy; } else { - missile[mi]._miVar1 = plr[id].WorldX; - missile[mi]._miVar2 = plr[id].WorldY; + missile[mi]._miVar1 = plr[id]._px; + missile[mi]._miVar2 = plr[id]._py; } } @@ -2444,8 +2444,8 @@ void AddDiabApoca(int mi, int sx, int sy, int dx, int dy, int midir, char mienem for (pnum = 0; pnum < gbMaxPlayers; pnum++) { if (plr[pnum].plractive) { - if (LineClear(sx, sy, plr[pnum]._px, plr[pnum]._py)) { - AddMissile(0, 0, plr[pnum]._px, plr[pnum]._py, 0, MIS_BOOM2, mienemy, id, dam, 0); + if (LineClear(sx, sy, plr[pnum]._pfutx, plr[pnum]._pfuty)) { + AddMissile(0, 0, plr[pnum]._pfutx, plr[pnum]._pfuty, 0, MIS_BOOM2, mienemy, id, dam, 0); } } } @@ -2869,8 +2869,8 @@ void MI_Fireball(int i) missile[i]._mirange--; if (missile[i]._micaster == 0) { - px = plr[id].WorldX; - py = plr[id].WorldY; + px = plr[id]._px; + py = plr[id]._py; } else { px = monster[id]._mx; py = monster[id]._my; @@ -2917,12 +2917,12 @@ void MI_Fireball(int i) } 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]])) { missile[i]._miyoff -= 32; } 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]])) { missile[i]._mixoff -= 32; } missile[i]._mimfnum = 0; @@ -3060,7 +3060,7 @@ void MI_Town(int i) } for (p = 0; p < MAX_PLRS; p++) { - if (plr[p].plractive && currlevel == plr[p].plrlevel && !plr[p]._pLvlChanging && plr[p]._pmode == PM_STAND && plr[p].WorldX == missile[i]._mix && plr[p].WorldY == missile[i]._miy) { + if (plr[p].plractive && currlevel == plr[p].plrlevel && !plr[p]._pLvlChanging && plr[p]._pmode == PM_STAND && plr[p]._px == missile[i]._mix && plr[p]._py == missile[i]._miy) { ClrPlrPath(p); if (p == myplr) { NetSendCmdParam1(TRUE, CMD_WARP, missile[i]._misource); @@ -3124,16 +3124,16 @@ void MI_Manashield(int i) int id, diff; id = missile[i]._misource; - missile[i]._mix = plr[id].WorldX; - missile[i]._miy = plr[id].WorldY; + missile[i]._mix = plr[id]._px; + missile[i]._miy = plr[id]._py; missile[i]._mitxoff = plr[id]._pxoff << 16; missile[i]._mityoff = plr[id]._pyoff << 16; if (plr[id]._pmode == PM_WALK3) { + missile[i]._misx = plr[id]._pfutx; + missile[i]._misy = plr[id]._pfuty; + } else { missile[i]._misx = plr[id]._px; missile[i]._misy = plr[id]._py; - } else { - missile[i]._misx = plr[id].WorldX; - missile[i]._misy = plr[id].WorldY; } GetMissilePos(i); if (plr[id]._pmode == PM_WALK3) { @@ -3200,16 +3200,16 @@ void MI_Etherealize(int i) missile[i]._mirange--; src = missile[i]._misource; - missile[i]._mix = plr[src].WorldX; - missile[i]._miy = plr[src].WorldY; + missile[i]._mix = plr[src]._px; + missile[i]._miy = plr[src]._py; missile[i]._mitxoff = plr[src]._pxoff << 16; missile[i]._mityoff = plr[src]._pyoff << 16; if (plr[src]._pmode == PM_WALK3) { + missile[i]._misx = plr[src]._pfutx; + missile[i]._misy = plr[src]._pfuty; + } else { missile[i]._misx = plr[src]._px; missile[i]._misy = plr[src]._py; - } else { - missile[i]._misx = plr[src].WorldX; - missile[i]._misy = plr[src].WorldY; } GetMissilePos(i); if (plr[src]._pmode == PM_WALK3) { @@ -3464,24 +3464,24 @@ void MI_Teleport(int i) if (missile[i]._mirange <= 0) { missile[i]._miDelFlag = TRUE; } else { - dPlayer[plr[id].WorldX][plr[id].WorldY] = 0; - PlrClrTrans(plr[id].WorldX, plr[id].WorldY); - plr[id].WorldX = missile[i]._mix; - plr[id].WorldY = missile[i]._miy; - plr[id]._px = plr[id].WorldX; - plr[id]._py = plr[id].WorldY; - plr[id]._poldx = plr[id].WorldX; - plr[id]._poldy = plr[id].WorldY; - PlrDoTrans(plr[id].WorldX, plr[id].WorldY); + dPlayer[plr[id]._px][plr[id]._py] = 0; + PlrClrTrans(plr[id]._px, plr[id]._py); + plr[id]._px = missile[i]._mix; + plr[id]._py = missile[i]._miy; + plr[id]._pfutx = plr[id]._px; + plr[id]._pfuty = plr[id]._py; + plr[id]._poldx = plr[id]._px; + plr[id]._poldy = plr[id]._py; + PlrDoTrans(plr[id]._px, plr[id]._py); missile[i]._miVar1 = 1; - dPlayer[plr[id].WorldX][plr[id].WorldY] = id + 1; + dPlayer[plr[id]._px][plr[id]._py] = id + 1; if (leveltype != DTYPE_TOWN) { - ChangeLightXY(plr[id]._plid, plr[id].WorldX, plr[id].WorldY); - ChangeVisionXY(plr[id]._pvid, plr[id].WorldX, plr[id].WorldY); + ChangeLightXY(plr[id]._plid, plr[id]._px, plr[id]._py); + ChangeVisionXY(plr[id]._pvid, plr[id]._px, plr[id]._py); } if (id == myplr) { - ViewX = plr[id].WorldX - ScrollInfo._sdx; - ViewY = plr[id].WorldY - ScrollInfo._sdy; + ViewX = plr[id]._px - ScrollInfo._sdx; + ViewY = plr[id]._py - ScrollInfo._sdy; } } } @@ -3587,8 +3587,8 @@ void mi_null_32(int i) by = missile[i]._miy; enemy = monster[src]._menemy; if (!(monster[src]._mFlags & MFLAG_TARGETS_MONSTER)) { - cx = plr[enemy].WorldX; - cy = plr[enemy].WorldY; + cx = plr[enemy]._px; + cy = plr[enemy]._py; } else { cx = monster[enemy]._mx; cy = monster[enemy]._my; @@ -3917,8 +3917,8 @@ void MI_Element(int i) if (missile[i]._miAnimType == MFILE_BIGEXP) { cx = missile[i]._mix; cy = missile[i]._miy; - px = plr[id].WorldX; - py = plr[id].WorldY; + px = plr[id]._px; + py = plr[id]._py; ChangeLight(missile[i]._mlid, cx, cy, missile[i]._miAnimFrame); if (!CheckBlock(px, py, cx, cy)) CheckMissileCol(i, dam, dam, TRUE, cx, cy, TRUE); diff --git a/Source/monstdat.cpp b/Source/monstdat.cpp index 0d9a6ab8c..7947746e2 100644 --- a/Source/monstdat.cpp +++ b/Source/monstdat.cpp @@ -125,140 +125,259 @@ MonsterData monsterdata[] = { // clang-format on }; -char MonstConvTbl[128] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, 29, 30, - 31, 32, 34, 35, 36, 37, 38, 40, 39, 41, - 42, 43, 44, 45, 46, 47, 48, 49, 50, 52, - 53, 54, 55, 56, 57, 59, 58, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 0, - 0, 0, 0, 72, 73, 74, 75, 0, 0, 0, - 0, 77, 76, 78, 79, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 92, 91, 93, 94, 95, - 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, - 106, 107, 108, 0, 110, 0, 109, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 80, 111 +/** + * Map between .DUN file value and monster type enum + */ +BYTE MonstConvTbl[] = { + MT_NZOMBIE, + MT_BZOMBIE, + MT_GZOMBIE, + MT_YZOMBIE, + MT_RFALLSP, + MT_DFALLSP, + MT_YFALLSP, + MT_BFALLSP, + MT_WSKELAX, + MT_TSKELAX, + MT_RSKELAX, + MT_XSKELAX, + MT_RFALLSD, + MT_DFALLSD, + MT_YFALLSD, + MT_BFALLSD, + MT_NSCAV, + MT_BSCAV, + MT_WSCAV, + MT_YSCAV, + MT_WSKELBW, + MT_TSKELBW, + MT_RSKELBW, + MT_XSKELBW, + MT_WSKELSD, + MT_TSKELSD, + MT_RSKELSD, + MT_XSKELSD, + MT_SNEAK, + MT_STALKER, + MT_UNSEEN, + MT_ILLWEAV, + MT_NGOATMC, + MT_BGOATMC, + MT_RGOATMC, + MT_GGOATMC, + MT_FIEND, + MT_GLOOM, + MT_BLINK, + MT_FAMILIAR, + MT_NGOATBW, + MT_BGOATBW, + MT_RGOATBW, + MT_GGOATBW, + MT_NACID, + MT_RACID, + MT_BACID, + MT_XACID, + MT_SKING, + MT_FAT, + MT_MUDMAN, + MT_TOAD, + MT_FLAYED, + MT_WYRM, + MT_CAVSLUG, + MT_DEVOUR, + MT_DVLWYRM, + MT_NMAGMA, + MT_YMAGMA, + MT_BMAGMA, + MT_WMAGMA, + MT_HORNED, + MT_MUDRUN, + MT_FROSTC, + MT_OBLORD, + MT_BONEDMN, + MT_REDDTH, + MT_LTCHDMN, + MT_UDEDBLRG, + MT_NZOMBIE, + MT_NZOMBIE, + MT_NZOMBIE, + MT_NZOMBIE, + MT_INCIN, + MT_FLAMLRD, + MT_DOOMFIRE, + MT_HELLBURN, + MT_NZOMBIE, + MT_NZOMBIE, + MT_NZOMBIE, + MT_NZOMBIE, + MT_RSTORM, + MT_STORM, + MT_STORML, + MT_MAEL, + MT_WINGED, + MT_GARGOYLE, + MT_BLOODCLW, + MT_DEATHW, + MT_MEGA, + MT_GUARD, + MT_VTEXLRD, + MT_BALROG, + MT_NSNAKE, + MT_RSNAKE, + MT_GSNAKE, + MT_BSNAKE, + MT_NBLACK, + MT_RTBLACK, + MT_BTBLACK, + MT_RBLACK, + MT_UNRAV, + MT_HOLOWONE, + MT_PAINMSTR, + MT_REALWEAV, + MT_SUCCUBUS, + MT_SNOWWICH, + MT_HLSPWN, + MT_SOLBRNR, + MT_COUNSLR, + MT_MAGISTR, + MT_CABALIST, + MT_ADVOCATE, + MT_NZOMBIE, + MT_DIABLO, + MT_NZOMBIE, + MT_GOLEM, + MT_NZOMBIE, + MT_NZOMBIE, + MT_NZOMBIE, + MT_NZOMBIE, + MT_NZOMBIE, + MT_NZOMBIE, + MT_NZOMBIE, + MT_NZOMBIE, + MT_NZOMBIE, + MT_BIGFALL, + MT_DARKMAGE, }; +#define MAT_NEVER 0 +#define MAT_ALWAYS 1 +#define MAT_RETAIL 2 /** - * 0 = Never avalible - * 1 = Avalible in retail and shareware - * 2 = avalible in retail only + * Define what version a monster type is available in */ BYTE MonstAvailTbl[] = { - 1, // Zombie - 1, // Ghoul - 1, // Rotting Carcass - 1, // Black Death - 1, // Fallen One - 1, // Carver - 1, // Devil Kin - 1, // Dark One - 1, // Skeleton - 1, // Corpse Axe - 1, // Burning Dead - 1, // Horror - 1, // Fallen One - 1, // Carver - 1, // Devil Kin - 1, // Dark One - 1, // Scavenger - 1, // Plague Eater - 1, // Shadow Beast - 1, // Bone Gasher - 1, // Skeleton - 1, // Corpse Bow - 1, // Burning Dead - 1, // Horror - 1, // Skeleton Captain - 1, // Corpse Captain - 1, // Burning Dead Captain - 1, // Horror Captain - 0, // Invisible Lord - 2, // Hidden - 2, // Stalker - 2, // Unseen - 2, // Illusion Weaver - 0, // Lord Sayter - 2, // Flesh Clan - 2, // Stone Clan - 2, // Fire Clan - 2, // Night Clan - 1, // Fiend - 1, // Blink - 1, // Gloom - 1, // Familiar - 2, // Flesh Clan - 2, // Stone Clan - 2, // Fire Clan - 2, // Night Clan - 2, // Acid Beast - 2, // Poison Spitter - 2, // Pit Beast - 2, // Lava Maw - 0, // Skeleton King - 0, // The Butcher - 2, // Overlord - 2, // Mud Man - 2, // Toad Demon - 2, // Flayed One - 0, // Wyrm - 0, // Cave Slug - 0, // Devil Wyrm - 0, // Devourer - 2, // Magma Demon - 2, // Blood Stone - 2, // Hell Stone - 2, // Lava Lord - 2, // Horned Demon - 2, // Mud Runner - 2, // Frost Charger - 2, // Obsidian Lord - 0, // Bone Demon (oldboned in Hellfire) - 0, // Red Death - 0, // Litch Demon - 0, // Undead Balrog - 0, // Incinerator - 0, // Flame Lord - 0, // Doom Fire - 0, // Hell Burner - 2, // Red Storm - 2, // Storm Rider - 2, // Storm Lord - 2, // Maelstorm - 0, // Devil Kin Brute - 2, // Winged-Demon - 2, // Gargoyle - 2, // Blood Claw - 2, // Death Wing - 2, // Slayer - 2, // Guardian - 2, // Vortex Lord - 2, // Balrog - 2, // Cave Viper - 2, // Fire Drake - 2, // Gold Viper - 2, // Azure Drake - 2, // Black Knight - 2, // Doom Guard - 2, // Steel Lord - 2, // Blood Knight - 0, // Unraveler - 0, // Hollow One - 0, // Pain Master - 0, // Reality Weaver - 2, // Succubus - 2, // Snow Witch - 2, // Hell Spawn - 2, // Soul Burner - 2, // Counselor - 2, // Magistrate - 2, // Cabalist - 2, // Advocate - 0, // Golem - 0, // The Dark Lord - 0, // The Arch-Litch Malignus + MAT_ALWAYS, // Zombie + MAT_ALWAYS, // Ghoul + MAT_ALWAYS, // Rotting Carcass + MAT_ALWAYS, // Black Death + MAT_ALWAYS, // Fallen One + MAT_ALWAYS, // Carver + MAT_ALWAYS, // Devil Kin + MAT_ALWAYS, // Dark One + MAT_ALWAYS, // Skeleton + MAT_ALWAYS, // Corpse Axe + MAT_ALWAYS, // Burning Dead + MAT_ALWAYS, // Horror + MAT_ALWAYS, // Fallen One + MAT_ALWAYS, // Carver + MAT_ALWAYS, // Devil Kin + MAT_ALWAYS, // Dark One + MAT_ALWAYS, // Scavenger + MAT_ALWAYS, // Plague Eater + MAT_ALWAYS, // Shadow Beast + MAT_ALWAYS, // Bone Gasher + MAT_ALWAYS, // Skeleton + MAT_ALWAYS, // Corpse Bow + MAT_ALWAYS, // Burning Dead + MAT_ALWAYS, // Horror + MAT_ALWAYS, // Skeleton Captain + MAT_ALWAYS, // Corpse Captain + MAT_ALWAYS, // Burning Dead Captain + MAT_ALWAYS, // Horror Captain + MAT_NEVER, // Invisible Lord + MAT_RETAIL, // Hidden + MAT_RETAIL, // Stalker + MAT_RETAIL, // Unseen + MAT_RETAIL, // Illusion Weaver + MAT_NEVER, // Lord Sayter + MAT_RETAIL, // Flesh Clan + MAT_RETAIL, // Stone Clan + MAT_RETAIL, // Fire Clan + MAT_RETAIL, // Night Clan + MAT_ALWAYS, // Fiend + MAT_ALWAYS, // Blink + MAT_ALWAYS, // Gloom + MAT_ALWAYS, // Familiar + MAT_RETAIL, // Flesh Clan + MAT_RETAIL, // Stone Clan + MAT_RETAIL, // Fire Clan + MAT_RETAIL, // Night Clan + MAT_RETAIL, // Acid Beast + MAT_RETAIL, // Poison Spitter + MAT_RETAIL, // Pit Beast + MAT_RETAIL, // Lava Maw + MAT_NEVER, // Skeleton King + MAT_NEVER, // The Butcher + MAT_RETAIL, // Overlord + MAT_RETAIL, // Mud Man + MAT_RETAIL, // Toad Demon + MAT_RETAIL, // Flayed One + MAT_NEVER, // Wyrm + MAT_NEVER, // Cave Slug + MAT_NEVER, // Devil Wyrm + MAT_NEVER, // Devourer + MAT_RETAIL, // Magma Demon + MAT_RETAIL, // Blood Stone + MAT_RETAIL, // Hell Stone + MAT_RETAIL, // Lava Lord + MAT_RETAIL, // Horned Demon + MAT_RETAIL, // Mud Runner + MAT_RETAIL, // Frost Charger + MAT_RETAIL, // Obsidian Lord + MAT_NEVER, // Bone Demon (oldboned in Hellfire) + MAT_NEVER, // Red Death + MAT_NEVER, // Litch Demon + MAT_NEVER, // Undead Balrog + MAT_NEVER, // Incinerator + MAT_NEVER, // Flame Lord + MAT_NEVER, // Doom Fire + MAT_NEVER, // Hell Burner + MAT_RETAIL, // Red Storm + MAT_RETAIL, // Storm Rider + MAT_RETAIL, // Storm Lord + MAT_RETAIL, // Maelstorm + MAT_NEVER, // Devil Kin Brute + MAT_RETAIL, // Winged-Demon + MAT_RETAIL, // Gargoyle + MAT_RETAIL, // Blood Claw + MAT_RETAIL, // Death Wing + MAT_RETAIL, // Slayer + MAT_RETAIL, // Guardian + MAT_RETAIL, // Vortex Lord + MAT_RETAIL, // Balrog + MAT_RETAIL, // Cave Viper + MAT_RETAIL, // Fire Drake + MAT_RETAIL, // Gold Viper + MAT_RETAIL, // Azure Drake + MAT_RETAIL, // Black Knight + MAT_RETAIL, // Doom Guard + MAT_RETAIL, // Steel Lord + MAT_RETAIL, // Blood Knight + MAT_NEVER, // Unraveler + MAT_NEVER, // Hollow One + MAT_NEVER, // Pain Master + MAT_NEVER, // Reality Weaver + MAT_RETAIL, // Succubus + MAT_RETAIL, // Snow Witch + MAT_RETAIL, // Hell Spawn + MAT_RETAIL, // Soul Burner + MAT_RETAIL, // Counselor + MAT_RETAIL, // Magistrate + MAT_RETAIL, // Cabalist + MAT_RETAIL, // Advocate + MAT_NEVER, // Golem + MAT_NEVER, // The Dark Lord + MAT_NEVER, // The Arch-Litch Malignus }; UniqMonstStruct UniqMonst[] = { diff --git a/Source/monstdat.h b/Source/monstdat.h index 2a4e845c5..28de9975f 100644 --- a/Source/monstdat.h +++ b/Source/monstdat.h @@ -7,7 +7,7 @@ #define __MONSTDAT_H__ extern MonsterData monsterdata[]; -extern char MonstConvTbl[128]; +extern BYTE MonstConvTbl[]; extern BYTE MonstAvailTbl[]; extern UniqMonstStruct UniqMonst[]; diff --git a/Source/monster.cpp b/Source/monster.cpp index b63a8e681..d2a3c0270 100644 --- a/Source/monster.cpp +++ b/Source/monster.cpp @@ -19,6 +19,7 @@ BOOLEAN sgbSaveSoundOn; MonsterStruct monster[MAXMONSTERS]; int totalmonsters; CMonster Monsters[MAX_LVLMTYPES]; +BYTE GraphicTable[NUMLEVELS][MAX_LVLMTYPES]; int monstimgtot; int uniquetrans; int nummtypes; @@ -513,8 +514,8 @@ void ClrAllMonsters() Monst->_mFlags = 0; Monst->_mDelFlag = FALSE; Monst->_menemy = random_(89, gbActivePlayers); - Monst->_menemyx = plr[Monst->_menemy]._px; - Monst->_menemyy = plr[Monst->_menemy]._py; + Monst->_menemyx = plr[Monst->_menemy]._pfutx; + Monst->_menemyy = plr[Monst->_menemy]._pfuty; } } @@ -691,15 +692,9 @@ void PlaceUniqueMonst(int uniqindex, int miniontype, int unpackfilesize) Monst->mtalkmsg = Uniq->mtalkmsg; Monst->mlid = AddLight(Monst->_mx, Monst->_my, 3); - if (gbMaxPlayers == 1) { - if (Monst->mtalkmsg) { - Monst->_mgoal = MGOAL_INQUIRING; - } - } else { - if (Monst->_mAi == AI_LAZHELP) { + if (gbMaxPlayers != 1) { + if (Monst->_mAi == AI_LAZHELP) Monst->mtalkmsg = 0; - } - if (Monst->_mAi != AI_LAZURUS || quests[Q_BETRAYER]._qvar1 <= 3) { if (Monst->mtalkmsg) { Monst->_mgoal = MGOAL_INQUIRING; @@ -707,11 +702,12 @@ void PlaceUniqueMonst(int uniqindex, int miniontype, int unpackfilesize) } else { Monst->_mgoal = MGOAL_NORMAL; } - } + } else if (Monst->mtalkmsg) + Monst->_mgoal = MGOAL_INQUIRING; if (gnDifficulty == DIFF_NIGHTMARE) { - Monst->mLevel += 15; Monst->_mmaxhp = 3 * Monst->_mmaxhp + 64; + Monst->mLevel += 15; Monst->_mhitpoints = Monst->_mmaxhp; Monst->mExp = 2 * (Monst->mExp + 1000); Monst->mMinDamage = 2 * (Monst->mMinDamage + 2); @@ -721,8 +717,8 @@ void PlaceUniqueMonst(int uniqindex, int miniontype, int unpackfilesize) } if (gnDifficulty == DIFF_HELL) { - Monst->mLevel += 30; Monst->_mmaxhp = 4 * Monst->_mmaxhp + 192; + Monst->mLevel += 30; Monst->_mhitpoints = Monst->_mmaxhp; Monst->mExp = 4 * (Monst->mExp + 1000); Monst->mMinDamage = 4 * Monst->mMinDamage + 6; @@ -1138,22 +1134,22 @@ void M_Enemy(int i) for (pnum = 0; pnum < MAX_PLRS; pnum++) { if (!plr[pnum].plractive || currlevel != plr[pnum].plrlevel || plr[pnum]._pLvlChanging || (plr[pnum]._pHitPoints == 0 && gbMaxPlayers != 1)) continue; - if (dTransVal[Monst->_mx][Monst->_my] == dTransVal[plr[pnum].WorldX][plr[pnum].WorldY]) + if (dTransVal[Monst->_mx][Monst->_my] == dTransVal[plr[pnum]._px][plr[pnum]._py]) sameroom = TRUE; else sameroom = FALSE; - if (abs(Monst->_mx - plr[pnum].WorldX) > abs(Monst->_my - plr[pnum].WorldY)) - dist = Monst->_mx - plr[pnum].WorldX; + if (abs(Monst->_mx - plr[pnum]._px) > abs(Monst->_my - plr[pnum]._py)) + dist = Monst->_mx - plr[pnum]._px; else - dist = Monst->_my - plr[pnum].WorldY; + dist = Monst->_my - plr[pnum]._py; dist = abs(dist); if ((sameroom && !bestsameroom) || ((sameroom || !bestsameroom) && dist < best_dist) || (_menemy == -1)) { Monst->_mFlags &= ~MFLAG_TARGETS_MONSTER; _menemy = pnum; - enemyx = plr[pnum]._px; - enemyy = plr[pnum]._py; + enemyx = plr[pnum]._pfutx; + enemyy = plr[pnum]._pfuty; best_dist = dist; bestsameroom = sameroom; } @@ -1169,7 +1165,7 @@ void M_Enemy(int i) continue; if (!(Monst->_mFlags & MFLAG_GOLEM) && ((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; } sameroom = dTransVal[Monst->_mx][Monst->_my] == dTransVal[monster[mi]._mx][monster[mi]._my]; @@ -1469,8 +1465,8 @@ void M_StartHit(int i, int pnum, int dam) if (pnum >= 0) { monster[i]._mFlags &= ~MFLAG_TARGETS_MONSTER; monster[i]._menemy = pnum; - monster[i]._menemyx = plr[pnum]._px; - monster[i]._menemyy = plr[pnum]._py; + monster[i]._menemyx = plr[pnum]._pfutx; + monster[i]._menemyy = plr[pnum]._pfuty; monster[i]._mdir = M_GetDir(i); } if (monster[i].MType->mtype == MT_BLINK) { @@ -1593,6 +1589,7 @@ void M2MStartHit(int mid, int i, int dam) void MonstStartKill(int i, int pnum, BOOL sendmsg) { int md; + MonsterStruct *Monst; if ((DWORD)i >= MAXMONSTERS) { app_fatal("MonstStartKill: Invalid monster %d", i); @@ -1601,19 +1598,20 @@ void MonstStartKill(int i, int pnum, BOOL sendmsg) app_fatal("MonstStartKill: Monster %d \"%s\" MType NULL", i, monster[i].mName); } + Monst = &monster[i]; if (pnum >= 0) - monster[i].mWhoHit |= 1 << pnum; + Monst->mWhoHit |= 1 << pnum; if (pnum < MAX_PLRS && i > MAX_PLRS) - AddPlrMonstExper(monster[i].mLevel, monster[i].mExp, monster[i].mWhoHit); - monstkills[monster[i].MType->mtype]++; - monster[i]._mhitpoints = 0; - SetRndSeed(monster[i]._mRndSeed); - if (QuestStatus(Q_GARBUD) && monster[i].mName == UniqMonst[UMT_GARBUD].mName) { - CreateTypeItem(monster[i]._mx + 1, monster[i]._my + 1, TRUE, ITYPE_MACE, IMISC_NONE, TRUE, FALSE); + AddPlrMonstExper(Monst->mLevel, Monst->mExp, Monst->mWhoHit); + monstkills[Monst->MType->mtype]++; + Monst->_mhitpoints = 0; + SetRndSeed(Monst->_mRndSeed); + if (QuestStatus(Q_GARBUD) && Monst->mName == UniqMonst[UMT_GARBUD].mName) { + CreateTypeItem(Monst->_mx + 1, Monst->_my + 1, TRUE, ITYPE_MACE, IMISC_NONE, TRUE, FALSE); } else if (i > MAX_PLRS - 1) { // Golems should not spawn items - SpawnItem(i, monster[i]._mx, monster[i]._my, sendmsg); + SpawnItem(i, Monst->_mx, Monst->_my, sendmsg); } - if (monster[i].MType->mtype == MT_DIABLO) + if (Monst->MType->mtype == MT_DIABLO) M_DiabloDeath(i, TRUE); else PlayEffect(i, 2); @@ -1621,23 +1619,23 @@ void MonstStartKill(int i, int pnum, BOOL sendmsg) if (pnum >= 0) md = M_GetDir(i); else - md = monster[i]._mdir; - monster[i]._mdir = md; - NewMonsterAnim(i, &monster[i].MType->Anims[MA_DEATH], md); - monster[i]._mmode = MM_DEATH; - monster[i]._mxoff = 0; - monster[i]._myoff = 0; - monster[i]._mVar1 = 0; - monster[i]._mx = monster[i]._moldx; - monster[i]._my = monster[i]._moldy; - monster[i]._mfutx = monster[i]._moldx; - monster[i]._mfuty = monster[i]._moldy; + md = Monst->_mdir; + Monst->_mdir = md; + NewMonsterAnim(i, &Monst->MType->Anims[MA_DEATH], md); + Monst->_mmode = MM_DEATH; + Monst->_mxoff = 0; + Monst->_myoff = 0; + Monst->_mVar1 = 0; + Monst->_mx = Monst->_moldx; + Monst->_my = Monst->_moldy; + Monst->_mfutx = Monst->_moldx; + Monst->_mfuty = Monst->_moldy; M_ClearSquares(i); - dMonster[monster[i]._mx][monster[i]._my] = i + 1; + dMonster[Monst->_mx][Monst->_my] = i + 1; CheckQuestKill(i, sendmsg); - M_FallenFear(monster[i]._mx, monster[i]._my); - if (monster[i].MType->mtype >= MT_NACID && monster[i].MType->mtype <= MT_XACID) - AddMissile(monster[i]._mx, monster[i]._my, 0, 0, 0, MIS_ACIDPUD, 1, i, monster[i]._mint + 1, 0); + M_FallenFear(Monst->_mx, Monst->_my); + if (Monst->MType->mtype >= MT_NACID && Monst->MType->mtype <= MT_XACID) + AddMissile(Monst->_mx, Monst->_my, 0, 0, 0, MIS_ACIDPUD, 1, i, Monst->_mint + 1, 0); } void M2MStartKill(int i, int mid) @@ -2005,8 +2003,8 @@ void M_TryH2HHit(int i, int pnum, int Hit, int MinDam, int MaxDam) } if (plr[pnum]._pHitPoints >> 6 <= 0 || plr[pnum]._pInvincible || plr[pnum]._pSpellFlags & 1) return; - dx = abs(monster[i]._mx - plr[pnum].WorldX); - dy = abs(monster[i]._my - plr[pnum].WorldY); + dx = abs(monster[i]._mx - plr[pnum]._px); + dy = abs(monster[i]._my - plr[pnum]._py); if (dx >= 2 || dy >= 2) return; @@ -2045,7 +2043,7 @@ void M_TryH2HHit(int i, int pnum, int Hit, int MinDam, int MaxDam) if (hper >= hit) return; if (blkper < blk) { - StartPlrBlock(pnum, GetDirection(plr[pnum].WorldX, plr[pnum].WorldY, monster[i]._mx, monster[i]._my)); + StartPlrBlock(pnum, GetDirection(plr[pnum]._px, plr[pnum]._py, monster[i]._mx, monster[i]._my)); return; } if (monster[i].MType->mtype == MT_YZOMBIE && pnum == myplr) { @@ -2109,11 +2107,11 @@ void M_TryH2HHit(int i, int pnum, int Hit, int MinDam, int MaxDam) if (monster[i]._mFlags & MFLAG_KNOCKBACK) { if (plr[pnum]._pmode != PM_GOTHIT) StartPlrHit(pnum, 0, TRUE); - newx = plr[pnum].WorldX + offset_x[monster[i]._mdir]; - newy = plr[pnum].WorldY + offset_y[monster[i]._mdir]; + newx = plr[pnum]._px + offset_x[monster[i]._mdir]; + newy = plr[pnum]._py + offset_y[monster[i]._mdir]; if (PosOkPlayer(pnum, newx, newy)) { - plr[pnum].WorldX = newx; - plr[pnum].WorldY = newy; + plr[pnum]._px = newx; + plr[pnum]._py = newy; FixPlayerLocation(pnum, plr[pnum]._pdir); FixPlrWalkTags(pnum); dPlayer[newx][newy] = pnum + 1; @@ -3598,11 +3596,11 @@ void MAI_Scav(int i) continue; done = dDead[Monst->_mx + x][Monst->_my + y] != 0 && LineClearF( - CheckNoSolid, - Monst->_mx, - Monst->_my, - Monst->_mx + x, - Monst->_my + y); + CheckNoSolid, + Monst->_mx, + Monst->_my, + Monst->_mx + x, + Monst->_my + y); } } x--; @@ -3615,11 +3613,11 @@ void MAI_Scav(int i) continue; done = dDead[Monst->_mx + x][Monst->_my + y] != 0 && LineClearF( - CheckNoSolid, - Monst->_mx, - Monst->_my, - Monst->_mx + x, - Monst->_my + y); + CheckNoSolid, + Monst->_mx, + Monst->_my, + Monst->_mx + x, + Monst->_my + y); } } x++; @@ -4046,8 +4044,8 @@ void MAI_Rhino(int i) v = random_(134, 100); if (v >= 2 * Monst->_mint + 33 && (Monst->_mVar1 != MM_WALK && Monst->_mVar1 != MM_WALK2 && Monst->_mVar1 != MM_WALK3 - || Monst->_mVar2 - || v >= 2 * Monst->_mint + 83)) { + || Monst->_mVar2 + || v >= 2 * Monst->_mint + 83)) { M_StartDelay(i, random_(135, 10) + 10); } else { M_CallWalk(i, md); @@ -4299,7 +4297,7 @@ void MAI_Lazurus(int i) md = M_GetDir(i); if (dFlags[mx][my] & BFLAG_VISIBLE) { if (gbMaxPlayers == 1) { - if (Monst->mtalkmsg == TEXT_VILE13 && Monst->_mgoal == MGOAL_INQUIRING && plr[myplr].WorldX == TEXT_VILE13 && plr[myplr].WorldY == 46) { + if (Monst->mtalkmsg == TEXT_VILE13 && Monst->_mgoal == MGOAL_INQUIRING && plr[myplr]._px == TEXT_VILE13 && plr[myplr]._py == 46) { PlayInGameMovie("gendata\\fprst3.smk"); Monst->_mmode = MM_TALK; quests[Q_BETRAYER]._qvar1 = 5; @@ -4516,12 +4514,12 @@ void ProcessMonsters() if ((DWORD)_menemy >= MAX_PLRS) { app_fatal("Illegal enemy player %d for monster \"%s\"", _menemy, Monst->mName); } - Monst->_menemyx = plr[Monst->_menemy]._px; - Monst->_menemyy = plr[Monst->_menemy]._py; + Monst->_menemyx = plr[Monst->_menemy]._pfutx; + Monst->_menemyy = plr[Monst->_menemy]._pfuty; if (dFlags[mx][my] & BFLAG_VISIBLE) { Monst->_msquelch = 255; - Monst->_lastx = plr[Monst->_menemy]._px; - Monst->_lasty = plr[Monst->_menemy]._py; + Monst->_lastx = plr[Monst->_menemy]._pfutx; + Monst->_lasty = plr[Monst->_menemy]._pfuty; } else if (Monst->_msquelch != 0 && Monst->_mAi != MT_DIABLO) { /// BUGFIX: change '_mAi' to 'MType->mtype' Monst->_msquelch--; } @@ -5109,8 +5107,8 @@ void MissToMonst(int i, int x, int y) newx = oldx + offset_x[Monst->_mdir]; newy = oldy + offset_y[Monst->_mdir]; if (PosOkPlayer(pnum, newx, newy)) { - plr[pnum].WorldX = newx; - plr[pnum].WorldY = newy; + plr[pnum]._px = newx; + plr[pnum]._py = newy; FixPlayerLocation(pnum, plr[pnum]._pdir); FixPlrWalkTags(pnum); dPlayer[newx][newy] = pnum + 1; @@ -5466,19 +5464,20 @@ BOOL CheckMonsterHit(int m, BOOL *ret) } if (monster[m]._mAi == AI_GARG && monster[m]._mFlags & MFLAG_ALLOW_SPECIAL) { - monster[m]._mmode = MM_SATTACK; monster[m]._mFlags &= ~MFLAG_ALLOW_SPECIAL; + monster[m]._mmode = MM_SATTACK; *ret = TRUE; return TRUE; } - if (monster[m].MType->mtype < MT_COUNSLR || monster[m].MType->mtype > MT_ADVOCATE || monster[m]._mgoal == MGOAL_NORMAL) { - return FALSE; - } else { - *ret = FALSE; + if (monster[m].MType->mtype >= MT_COUNSLR && monster[m].MType->mtype <= MT_ADVOCATE) { + if (monster[m]._mgoal != MGOAL_NORMAL) { + *ret = FALSE; + return TRUE; + } } - return TRUE; + return FALSE; } int encode_enemy(int m) @@ -5494,8 +5493,8 @@ void decode_enemy(int m, int enemy) if (enemy < MAX_PLRS) { monster[m]._mFlags &= ~MFLAG_TARGETS_MONSTER; monster[m]._menemy = enemy; - monster[m]._menemyx = plr[enemy]._px; - monster[m]._menemyy = plr[enemy]._py; + monster[m]._menemyx = plr[enemy]._pfutx; + monster[m]._menemyy = plr[enemy]._pfuty; } else { monster[m]._mFlags |= MFLAG_TARGETS_MONSTER; enemy -= MAX_PLRS; diff --git a/Source/monster.h b/Source/monster.h index a868a0da6..d0eaa3683 100644 --- a/Source/monster.h +++ b/Source/monster.h @@ -14,6 +14,7 @@ extern BOOLEAN sgbSaveSoundOn; extern MonsterStruct monster[MAXMONSTERS]; extern int totalmonsters; extern CMonster Monsters[MAX_LVLMTYPES]; +extern BYTE GraphicTable[NUMLEVELS][MAX_LVLMTYPES]; extern int monstimgtot; extern int uniquetrans; extern int nummtypes; diff --git a/Source/mpqapi.cpp b/Source/mpqapi.cpp index 7d3bf88ee..2cba3945e 100644 --- a/Source/mpqapi.cpp +++ b/Source/mpqapi.cpp @@ -244,7 +244,8 @@ struct Archive { return result; } - bool WriteHeaderAndTables() { + bool WriteHeaderAndTables() + { return WriteHeader() && WriteBlockTable() && WriteHashTable(); } @@ -276,17 +277,17 @@ private: bool WriteBlockTable() { - Encrypt(sgpBlockTbl, kBlockEntrySize, Hash("(block table)", 3)); + Encrypt((DWORD *)sgpBlockTbl, kBlockEntrySize, Hash("(block table)", 3)); const bool success = stream.write(reinterpret_cast(sgpBlockTbl), kBlockEntrySize); - Decrypt(sgpBlockTbl, kBlockEntrySize, Hash("(block table)", 3)); + Decrypt((DWORD *)sgpBlockTbl, kBlockEntrySize, Hash("(block table)", 3)); return success; } bool WriteHashTable() { - Encrypt(sgpHashTbl, kHashEntrySize, Hash("(hash table)", 3)); + Encrypt((DWORD *)sgpHashTbl, kHashEntrySize, Hash("(hash table)", 3)); const bool success = stream.write(reinterpret_cast(sgpHashTbl), kHashEntrySize); - Decrypt(sgpHashTbl, kHashEntrySize, Hash("(hash table)", 3)); + Decrypt((DWORD *)sgpHashTbl, kHashEntrySize, Hash("(hash table)", 3)); return success; } }; @@ -560,7 +561,7 @@ BOOL mpqapi_write_file_contents(const char *pszName, const BYTE *pbData, DWORD d if (!cur_archive.stream.write(mpq_buf, len)) return FALSE; sectoroffsettable[cur_sector++] = SwapLE32(destsize); - destsize += len; // compressed length + destsize += len; // compressed length if (dwLen > kSectorSize) dwLen -= kSectorSize; else @@ -661,7 +662,7 @@ BOOL OpenMPQ(const char *pszArchive, DWORD dwChar) if (!cur_archive.stream.read(reinterpret_cast(cur_archive.sgpBlockTbl), kBlockEntrySize)) goto on_error; key = Hash("(block table)", 3); - Decrypt(cur_archive.sgpBlockTbl, kBlockEntrySize, key); + Decrypt((DWORD *)cur_archive.sgpBlockTbl, kBlockEntrySize, key); } cur_archive.sgpHashTbl = new _HASHENTRY[kHashEntrySize / sizeof(_HASHENTRY)]; std::memset(cur_archive.sgpHashTbl, 255, kHashEntrySize); @@ -669,7 +670,7 @@ BOOL OpenMPQ(const char *pszArchive, DWORD dwChar) if (!cur_archive.stream.read(reinterpret_cast(cur_archive.sgpHashTbl), kHashEntrySize)) goto on_error; key = Hash("(hash table)", 3); - Decrypt(cur_archive.sgpHashTbl, kHashEntrySize, key); + Decrypt((DWORD *)cur_archive.sgpHashTbl, kHashEntrySize, key); } #ifndef CAN_SEEKP_BEYOND_EOF diff --git a/Source/mpqapi.h b/Source/mpqapi.h index f39c36509..de809b7f9 100644 --- a/Source/mpqapi.h +++ b/Source/mpqapi.h @@ -7,13 +7,16 @@ #define __MPQAPI_H__ #include +extern BYTE mpq_buf[4096]; +extern BOOL save_archive_modified; +extern BOOLEAN save_archive_open; void mpqapi_remove_hash_entry(const char *pszName); void mpqapi_alloc_block(uint32_t block_offset, uint32_t block_size); _BLOCKENTRY *mpqapi_new_block(int *block_index); int FetchHandle(const char *pszName); int mpqapi_get_hash_index(short index, int hash_a, int hash_b, int locale); -void mpqapi_remove_hash_entries(BOOL(*fnGetName)(DWORD, char *)); +void mpqapi_remove_hash_entries(BOOL (*fnGetName)(DWORD, char *)); BOOL mpqapi_write_file(const char *pszName, const BYTE *pbData, DWORD dwLen); _BLOCKENTRY *mpqapi_add_file(const char *pszName, _BLOCKENTRY *pBlk, int block_index); BOOL mpqapi_write_file_contents(const char *pszName, const BYTE *pbData, DWORD dwLen, _BLOCKENTRY *pBlk); diff --git a/Source/msg.cpp b/Source/msg.cpp index 4b11588dd..6886ab740 100644 --- a/Source/msg.cpp +++ b/Source/msg.cpp @@ -1451,7 +1451,7 @@ DWORD On_GETITEM(TCmd *pCmd, int pnum) if ((currlevel == p->bLevel || p->bPnum == myplr) && p->bMaster != myplr) { if (p->bPnum == myplr) { if (currlevel != p->bLevel) { - ii = SyncPutItem(myplr, plr[myplr].WorldX, plr[myplr].WorldY, 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); if (ii != -1) InvGetItem(myplr, ii); } else @@ -1573,7 +1573,7 @@ DWORD On_AGETITEM(TCmd *pCmd, int pnum) if ((currlevel == p->bLevel || p->bPnum == myplr) && p->bMaster != myplr) { if (p->bPnum == myplr) { if (currlevel != p->bLevel) { - int ii = SyncPutItem(myplr, plr[myplr].WorldX, plr[myplr].WorldY, 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); if (ii != -1) AutoGetItem(myplr, ii); } else @@ -1865,8 +1865,8 @@ DWORD On_ATTACKID(TCmd *pCmd, int pnum) TCmdParam1 *p = (TCmdParam1 *)pCmd; if (gbBufferMsgs != 1 && currlevel == plr[pnum].plrlevel) { - int distx = abs(plr[pnum].WorldX - monster[p->wParam1]._mfutx); - int disty = abs(plr[pnum].WorldY - monster[p->wParam1]._mfuty); + int distx = abs(plr[pnum]._px - monster[p->wParam1]._mfutx); + int disty = abs(plr[pnum]._py - monster[p->wParam1]._mfuty); if (distx > 1 || disty > 1) MakePlrPath(pnum, monster[p->wParam1]._mfutx, monster[p->wParam1]._mfuty, FALSE); plr[pnum].destAction = ACTION_ATTACKMON; @@ -1881,7 +1881,7 @@ DWORD On_ATTACKPID(TCmd *pCmd, int pnum) TCmdParam1 *p = (TCmdParam1 *)pCmd; if (gbBufferMsgs != 1 && currlevel == plr[pnum].plrlevel) { - MakePlrPath(pnum, plr[p->wParam1]._px, plr[p->wParam1]._py, FALSE); + MakePlrPath(pnum, plr[p->wParam1]._pfutx, plr[p->wParam1]._pfuty, FALSE); plr[pnum].destAction = ACTION_ATTACKPLR; plr[pnum].destParam1 = p->wParam1; } @@ -2123,7 +2123,7 @@ DWORD On_AWAKEGOLEM(TCmd *pCmd, int pnum) } } if (addGolem) - AddMissile(plr[pnum].WorldX, plr[pnum].WorldY, p->_mx, p->_my, p->_mdir, MIS_GOLEM, 0, pnum, 0, 1); + AddMissile(plr[pnum]._px, plr[pnum]._py, p->_mx, p->_my, p->_mdir, MIS_GOLEM, 0, pnum, 0, 1); } return sizeof(*p); @@ -2351,8 +2351,8 @@ DWORD On_PLAYER_JOINLEVEL(TCmd *pCmd, int pnum) } if (plr[pnum].plractive && myplr != pnum) { - plr[pnum].WorldX = p->x; - plr[pnum].WorldY = p->y; + plr[pnum]._px = p->x; + plr[pnum]._py = p->y; plr[pnum].plrlevel = p->wParam1; plr[pnum]._pGFXLoad = 0; if (currlevel == plr[pnum].plrlevel) { @@ -2367,10 +2367,10 @@ DWORD On_PLAYER_JOINLEVEL(TCmd *pCmd, int pnum) NewPlrAnim(pnum, plr[pnum]._pDAnim[0], plr[pnum]._pDFrames, 1, plr[pnum]._pDWidth); plr[pnum]._pAnimFrame = plr[pnum]._pAnimLen - 1; plr[pnum]._pVar8 = plr[pnum]._pAnimLen << 1; - dFlags[plr[pnum].WorldX][plr[pnum].WorldY] |= BFLAG_DEAD_PLAYER; + dFlags[plr[pnum]._px][plr[pnum]._py] |= BFLAG_DEAD_PLAYER; } - plr[pnum]._pvid = AddVision(plr[pnum].WorldX, plr[pnum].WorldY, plr[pnum]._pLightRad, pnum == myplr); + plr[pnum]._pvid = AddVision(plr[pnum]._px, plr[pnum]._py, plr[pnum]._pLightRad, pnum == myplr); plr[pnum]._plid = -1; } } diff --git a/Source/multi.cpp b/Source/multi.cpp index 4256241f2..0d71ec625 100644 --- a/Source/multi.cpp +++ b/Source/multi.cpp @@ -93,8 +93,8 @@ void multi_send_packet(void *packet, BYTE dwSize) void NetRecvPlrData(TPkt *pkt) { pkt->hdr.wCheck = 'ip'; - pkt->hdr.px = plr[myplr].WorldX; - pkt->hdr.py = plr[myplr].WorldY; + pkt->hdr.px = plr[myplr]._px; + pkt->hdr.py = plr[myplr]._py; pkt->hdr.targx = plr[myplr]._ptargx; pkt->hdr.targy = plr[myplr]._ptargy; pkt->hdr.php = plr[myplr]._pHitPoints; @@ -328,7 +328,7 @@ void multi_mon_seeds() DWORD l; sgdwGameLoops++; - l = (sgdwGameLoops >> 8) | (sgdwGameLoops << 24); // _rotr(sgdwGameLoops, 8) + l = (sgdwGameLoops >> 8) | (sgdwGameLoops << 24); // _rotr(sgdwGameLoops, 8) for (i = 0; i < MAXMONSTERS; i++) monster[i]._mAISeed = l + i; } @@ -440,31 +440,31 @@ void multi_process_network_packets() plr[dwID]._pBaseDex = pkt->bdex; if (!cond && plr[dwID].plractive && plr[dwID]._pHitPoints) { if (currlevel == plr[dwID].plrlevel && !plr[dwID]._pLvlChanging) { - dx = abs(plr[dwID].WorldX - pkt->px); - dy = abs(plr[dwID].WorldY - pkt->py); + dx = abs(plr[dwID]._px - pkt->px); + dy = abs(plr[dwID]._py - pkt->py); if ((dx > 3 || dy > 3) && dPlayer[pkt->px][pkt->py] == 0) { FixPlrWalkTags(dwID); - plr[dwID]._poldx = plr[dwID].WorldX; - plr[dwID]._poldy = plr[dwID].WorldY; + plr[dwID]._poldx = plr[dwID]._px; + plr[dwID]._poldy = plr[dwID]._py; FixPlrWalkTags(dwID); - plr[dwID].WorldX = pkt->px; - plr[dwID].WorldY = pkt->py; plr[dwID]._px = pkt->px; plr[dwID]._py = pkt->py; - dPlayer[plr[dwID].WorldX][plr[dwID].WorldY] = dwID + 1; + plr[dwID]._pfutx = pkt->px; + plr[dwID]._pfuty = pkt->py; + dPlayer[plr[dwID]._px][plr[dwID]._py] = dwID + 1; } - dx = abs(plr[dwID]._px - plr[dwID].WorldX); - dy = abs(plr[dwID]._py - plr[dwID].WorldY); + dx = abs(plr[dwID]._pfutx - plr[dwID]._px); + dy = abs(plr[dwID]._pfuty - plr[dwID]._py); if (dx > 1 || dy > 1) { - plr[dwID]._px = plr[dwID].WorldX; - plr[dwID]._py = plr[dwID].WorldY; + plr[dwID]._pfutx = plr[dwID]._px; + plr[dwID]._pfuty = plr[dwID]._py; } MakePlrPath(dwID, pkt->targx, pkt->targy, TRUE); } else { - plr[dwID].WorldX = pkt->px; - plr[dwID].WorldY = pkt->py; plr[dwID]._px = pkt->px; plr[dwID]._py = pkt->py; + plr[dwID]._pfutx = pkt->px; + plr[dwID]._pfuty = pkt->py; plr[dwID]._ptargx = pkt->targx; plr[dwID]._ptargy = pkt->targy; } @@ -721,7 +721,7 @@ BOOL NetInit(BOOL bSinglePlayer, BOOL *pfExitProgram) gnDifficulty = sgGameInitInfo.bDiff; SetRndSeed(sgGameInitInfo.dwSeed); - for (i = 0; i < 17; i++) { + for (i = 0; i < NUMLEVELS; i++) { glSeedTbl[i] = GetRndSeed(); gnLevelTypeTbl[i] = InitLevelType(i); } @@ -780,10 +780,10 @@ void SetupLocalCoords() #endif x += plrxoff[myplr]; y += plryoff[myplr]; - plr[myplr].WorldX = x; - plr[myplr].WorldY = y; plr[myplr]._px = x; plr[myplr]._py = y; + plr[myplr]._pfutx = x; + plr[myplr]._pfuty = y; plr[myplr]._ptargx = x; plr[myplr]._ptargy = y; plr[myplr].plrlevel = currlevel; @@ -931,7 +931,7 @@ void recv_plrinfo(int pnum, TCmdPlrInfoHdr *p, BOOL recv) NewPlrAnim(pnum, plr[pnum]._pDAnim[0], plr[pnum]._pDFrames, 1, plr[pnum]._pDWidth); plr[pnum]._pAnimFrame = plr[pnum]._pAnimLen - 1; plr[pnum]._pVar8 = 2 * plr[pnum]._pAnimLen; - dFlags[plr[pnum].WorldX][plr[pnum].WorldY] |= BFLAG_DEAD_PLAYER; + dFlags[plr[pnum]._px][plr[pnum]._py] |= BFLAG_DEAD_PLAYER; } } } diff --git a/Source/objdat.cpp b/Source/objdat.cpp index f332fdfe7..e098dcfe6 100644 --- a/Source/objdat.cpp +++ b/Source/objdat.cpp @@ -3,120 +3,120 @@ DEVILUTION_BEGIN_NAMESPACE /** Maps from dun_object_id to object_id. */ -int ObjTypeConv[113] = { - 0, - 4, - 20, - 21, - 22, - 24, - 11, - 12, - 13, - 0, - 0, - 0, - 0, - 0, - 25, - 41, - 26, - 0, - 8, - 9, - 10, - 80, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 49, - 0, - 0, - 0, - 0, - 0, - 84, - 85, - 3, - 14, - 15, - 16, - 17, - 18, - 19, - 0, - 0, - 0, - 0, - 0, - 0, - 28, - 0, - 53, - 54, - 36, - 37, - 38, - 39, - 40, - 0, - 0, - 0, - 0, - 0, - 27, - 0, - 0, - 0, - 0, - 29, - 30, - 31, - 32, - 33, - 34, - 35, - 5, - 5, - 5, - 6, - 6, - 6, - 7, - 7, - 7, - 0, - 0, - 0, - 0, - 0, - 73, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 83, - 0, - 0, - 89, - 90, - 47, - 46, - 94 +int ObjTypeConv[] = { + OBJ_L1LIGHT, + OBJ_LEVER, + OBJ_CRUX1, + OBJ_CRUX2, + OBJ_CRUX3, + OBJ_ANGEL, + OBJ_BANNERL, + OBJ_BANNERM, + OBJ_BANNERR, + OBJ_L1LIGHT, + OBJ_L1LIGHT, + OBJ_L1LIGHT, + OBJ_L1LIGHT, + OBJ_L1LIGHT, + OBJ_BOOK2L, + OBJ_BOOK2R, + OBJ_BCROSS, + OBJ_L1LIGHT, + OBJ_CANDLE1, + OBJ_CANDLE2, + OBJ_CANDLEO, + OBJ_CAULDRON, + OBJ_L1LIGHT, + OBJ_L1LIGHT, + OBJ_L1LIGHT, + OBJ_L1LIGHT, + OBJ_L1LIGHT, + OBJ_L1LIGHT, + OBJ_L1LIGHT, + OBJ_L1LIGHT, + OBJ_FLAMEHOLE, + OBJ_L1LIGHT, + OBJ_L1LIGHT, + OBJ_L1LIGHT, + OBJ_L1LIGHT, + OBJ_L1LIGHT, + OBJ_MCIRCLE1, + OBJ_MCIRCLE2, + OBJ_SKFIRE, + OBJ_SKPILE, + OBJ_SKSTICK1, + OBJ_SKSTICK2, + OBJ_SKSTICK3, + OBJ_SKSTICK4, + OBJ_SKSTICK5, + OBJ_L1LIGHT, + OBJ_L1LIGHT, + OBJ_L1LIGHT, + OBJ_L1LIGHT, + OBJ_L1LIGHT, + OBJ_L1LIGHT, + OBJ_SWITCHSKL, + OBJ_L1LIGHT, + OBJ_TRAPL, + OBJ_TRAPR, + OBJ_TORTURE1, + OBJ_TORTURE2, + OBJ_TORTURE3, + OBJ_TORTURE4, + OBJ_TORTURE5, + OBJ_L1LIGHT, + OBJ_L1LIGHT, + OBJ_L1LIGHT, + OBJ_L1LIGHT, + OBJ_L1LIGHT, + OBJ_NUDEW2R, + OBJ_L1LIGHT, + OBJ_L1LIGHT, + OBJ_L1LIGHT, + OBJ_L1LIGHT, + OBJ_TNUDEM1, + OBJ_TNUDEM2, + OBJ_TNUDEM3, + OBJ_TNUDEM4, + OBJ_TNUDEW1, + OBJ_TNUDEW2, + OBJ_TNUDEW3, + OBJ_CHEST1, + OBJ_CHEST1, + OBJ_CHEST1, + OBJ_CHEST2, + OBJ_CHEST2, + OBJ_CHEST2, + OBJ_CHEST3, + OBJ_CHEST3, + OBJ_CHEST3, + OBJ_L1LIGHT, + OBJ_L1LIGHT, + OBJ_L1LIGHT, + OBJ_L1LIGHT, + OBJ_L1LIGHT, + OBJ_PEDISTAL, + OBJ_L1LIGHT, + OBJ_L1LIGHT, + OBJ_L1LIGHT, + OBJ_L1LIGHT, + OBJ_L1LIGHT, + OBJ_L1LIGHT, + OBJ_L1LIGHT, + OBJ_L1LIGHT, + OBJ_L1LIGHT, + OBJ_L1LIGHT, + OBJ_L1LIGHT, + OBJ_L1LIGHT, + OBJ_L1LIGHT, + OBJ_ALTBOY, + OBJ_L1LIGHT, + OBJ_L1LIGHT, + OBJ_WARARMOR, + OBJ_WARWEAP, + OBJ_TORCHR2, + OBJ_TORCHL2, + OBJ_MUSHPATCH, }; /** Contains the data related to each object ID. */ diff --git a/Source/objdat.h b/Source/objdat.h index ff879f15c..29c33bc19 100644 --- a/Source/objdat.h +++ b/Source/objdat.h @@ -2,7 +2,7 @@ #ifndef __OBJDAT_H__ #define __OBJDAT_H__ -extern int ObjTypeConv[113]; +extern int ObjTypeConv[]; extern ObjDataStruct AllObjects[99]; extern char *ObjMasterLoadList[56]; diff --git a/Source/objects.cpp b/Source/objects.cpp index c5e153e7c..e46b8de42 100644 --- a/Source/objects.cpp +++ b/Source/objects.cpp @@ -198,12 +198,13 @@ void InitRndLocBigObj(int min, int max, int objtype) void InitRndLocObj5x5(int min, int max, int objtype) { BOOL exit; - int xp, yp, numobjs, i, k, m, n; + int xp, yp, numobjs, i, cnt, m, n; numobjs = min + random_(139, max - min); for (i = 0; i < numobjs; i++) { - k = 0; - for (;;) { + cnt = 0; + exit = FALSE; + while (!exit) { exit = TRUE; xp = random_(139, 80) + 16; yp = random_(139, 80) + 16; @@ -213,11 +214,11 @@ void InitRndLocObj5x5(int min, int max, int objtype) exit = FALSE; } } - if (exit) - break; - k++; - if (k > 20000) - return; + if (!exit) { + cnt++; + if (cnt > 20000) + return; + } } AddObject(objtype, xp, yp); } @@ -288,11 +289,12 @@ void AddCandles() void AddBookLever(int lx1, int ly1, int lx2, int ly2, int x1, int y1, int x2, int y2, int msg) { - BOOL exit; - int xp, yp, ob, k, m, n; + DIABOOL exit; + int xp, yp, ob, cnt, m, n; - k = 0; - for (;;) { + cnt = 0; + exit = FALSE; + while (!exit) { exit = TRUE; xp = random_(139, 80) + 16; yp = random_(139, 80) + 16; @@ -302,11 +304,11 @@ void AddBookLever(int lx1, int ly1, int lx2, int ly2, int x1, int y1, int x2, in exit = FALSE; } } - if (exit) - break; - k++; - if (k > 20000) - return; + if (!exit) { + cnt++; + if (cnt > 20000) + return; + } } if (QuestStatus(Q_BLIND)) @@ -621,7 +623,8 @@ void AddStoryBooks() BOOL done; cnt = 0; - while (TRUE) { + done = FALSE; + while (!done) { done = TRUE; xp = random_(139, 80) + 16; yp = random_(139, 80) + 16; @@ -631,11 +634,11 @@ void AddStoryBooks() done = FALSE; } } - if (done) - break; - cnt++; - if (cnt > 20000) - return; + if (!done) { + cnt++; + if (cnt > 20000) + return; + } } AddObject(OBJ_STORYBOOK, xp, yp); AddObject(OBJ_STORYCANDLE, xp - 2, yp + 1); @@ -709,8 +712,9 @@ void AddLazStand() BOOL found; cnt = 0; - while (TRUE) { - found = 1; + found = FALSE; + while (!found) { + found = TRUE; xp = random_(139, 80) + 16; yp = random_(139, 80) + 16; for (yy = -3; yy <= 3; yy++) { @@ -719,13 +723,12 @@ void AddLazStand() found = FALSE; } } - if (found) - break; - - cnt++; - if (cnt > 10000) { - InitRndLocObj(1, 1, OBJ_LAZSTAND); - return; + if (!found) { + cnt++; + if (cnt > 10000) { + InitRndLocObj(1, 1, OBJ_LAZSTAND); + return; + } } } AddObject(OBJ_LAZSTAND, xp, yp); @@ -831,9 +834,9 @@ void InitObjects() InitRndBarrels(); AddL4Goodies(); } - InitRndLocObj(5, 10, 5); - InitRndLocObj(3, 6, 6); - InitRndLocObj(1, 5, 7); + InitRndLocObj(5, 10, OBJ_CHEST1); + InitRndLocObj(3, 6, OBJ_CHEST2); + InitRndLocObj(1, 5, OBJ_CHEST3); if (leveltype != DTYPE_HELL) AddObjTraps(); if (leveltype > DTYPE_CATHEDRAL) @@ -1106,7 +1109,8 @@ void AddBarrel(int i, int t) void AddShrine(int i) { - int val, j, slist[NUM_SHRINETYPE]; + int val, j; + BOOL slist[NUM_SHRINETYPE]; object[i]._oPreFlag = TRUE; for (j = 0; j < NUM_SHRINETYPE; j++) { @@ -1115,22 +1119,16 @@ void AddShrine(int i) } else { slist[j] = 1; } - if (gbMaxPlayers != 1) { - if (shrineavail[j] == 1) { - slist[j] = 0; - } - } else { - if (shrineavail[j] == 2) { - slist[j] = 0; - } + if (gbMaxPlayers != 1 && shrineavail[j] == 1) { + slist[j] = 0; } - } - while (1) { - val = random_(150, NUM_SHRINETYPE); - if (slist[val]) { - break; + if (gbMaxPlayers == 1 && shrineavail[j] == 2) { + slist[j] = 0; } } + do { + val = random_(150, NUM_SHRINETYPE); + } while (!slist[val]); object[i]._oVar1 = val; if (random_(150, 2)) { @@ -1478,8 +1476,8 @@ void Obj_Light(int i, int lr) for (p = 0; p < MAX_PLRS && !turnon; p++) { if (plr[p].plractive) { if (currlevel == plr[p].plrlevel) { - dx = abs(plr[p].WorldX - ox); - dy = abs(plr[p].WorldY - oy); + dx = abs(plr[p]._px - ox); + dy = abs(plr[p]._py - oy); if (dx < tr && dy < tr) turnon = TRUE; } @@ -1504,8 +1502,8 @@ void Obj_Circle(int i) ox = object[i]._ox; oy = object[i]._oy; - wx = plr[myplr].WorldX; - wy = plr[myplr].WorldY; + wx = plr[myplr]._px; + wy = plr[myplr]._py; if (wx == ox && wy == oy) { if (object[i]._otype == OBJ_MCIRCLE1) object[i]._oAnimFrame = 2; @@ -1523,7 +1521,7 @@ void Obj_Circle(int i) ObjChangeMapResync(object[i]._oVar1, object[i]._oVar2, object[i]._oVar3, object[i]._oVar4); if (quests[Q_BETRAYER]._qactive == QUEST_ACTIVE) quests[Q_BETRAYER]._qvar1 = 4; - AddMissile(plr[myplr].WorldX, plr[myplr].WorldY, 35, 46, plr[myplr]._pdir, MIS_RNDTELEPORT, 0, myplr, 0, 0); + AddMissile(plr[myplr]._px, plr[myplr]._py, 35, 46, plr[myplr]._pdir, MIS_RNDTELEPORT, 0, myplr, 0, 0); track_repeat_walk(FALSE); sgbMouseDown = 0; ClrPlrPath(myplr); @@ -1549,21 +1547,21 @@ void Obj_StopAnim(int i) void Obj_Door(int i) { int dx, dy; + BOOL dok; - if (!object[i]._oVar4) { - object[i]._oMissFlag = FALSE; + if (object[i]._oVar4 == 0) { object[i]._oSelFlag = 3; + object[i]._oMissFlag = FALSE; } else { - dy = object[i]._oy; dx = object[i]._ox; + dy = object[i]._oy; + dok = !dMonster[dx][dy]; + dok = dok & !dItem[dx][dy]; + dok = dok & !dDead[dx][dy]; + dok = dok & !dPlayer[dx][dy]; object[i]._oSelFlag = 2; + object[i]._oVar4 = dok ? 1 : 2; object[i]._oMissFlag = TRUE; - object[i]._oVar4 = (((dItem[dx][dy] == 0 ? 1 : 0) - & (dDead[dx][dy] == 0 ? 1 : 0) - & (dPlayer[dx][dy] == 0 ? 1 : 0) - & (dMonster[dx][dy] == 0 ? 1 : 0)) - == 0) - + 1; } } @@ -1696,7 +1694,7 @@ void Obj_BCrossDamage(int i) if (fire_resist > 0) damage[leveltype - 1] -= fire_resist * damage[leveltype - 1] / 100; - if (plr[myplr].WorldX != object[i]._ox || plr[myplr].WorldY != object[i]._oy - 1) + if (plr[myplr]._px != object[i]._ox || plr[myplr]._py != object[i]._oy - 1) return; plr[myplr]._pHitPoints -= damage[leveltype - 1]; @@ -1705,12 +1703,12 @@ void Obj_BCrossDamage(int i) SyncPlrKill(myplr, 0); } else { if (plr[myplr]._pClass == PC_WARRIOR) { - PlaySfxLoc(PS_WARR68, plr[myplr].WorldX, plr[myplr].WorldY); + PlaySfxLoc(PS_WARR68, plr[myplr]._px, plr[myplr]._py); #ifndef SPAWN } else if (plr[myplr]._pClass == PC_ROGUE) { - PlaySfxLoc(PS_ROGUE68, plr[myplr].WorldX, plr[myplr].WorldY); + PlaySfxLoc(PS_ROGUE68, plr[myplr]._px, plr[myplr]._py); } else if (plr[myplr]._pClass == PC_SORCERER) { - PlaySfxLoc(PS_MAGE68, plr[myplr].WorldX, plr[myplr].WorldY); + PlaySfxLoc(PS_MAGE68, plr[myplr]._px, plr[myplr]._py); #endif } } @@ -1816,12 +1814,12 @@ void ObjSetMicro(int dx, int dy, int pn) if (leveltype != DTYPE_HELL) { v = (WORD *)pLevelPieces + 10 * pn; for (i = 0; i < 10; i++) { - defs->mt[i] = SDL_SwapLE16(v[(i & 1) - (i & 0xE) + 8]); + defs->mt[i] = SDL_SwapLE16(v[(i & 1) - (i & 0xE) + 8]); } } else { v = (WORD *)pLevelPieces + 16 * pn; for (i = 0; i < 16; i++) { - defs->mt[i] = SDL_SwapLE16(v[(i & 1) - (i & 0xE) + 14]); + defs->mt[i] = SDL_SwapLE16(v[(i & 1) - (i & 0xE) + 14]); } } } @@ -1982,7 +1980,7 @@ void RedoPlayerVision() for (p = 0; p < MAX_PLRS; p++) { if (plr[p].plractive && currlevel == plr[p].plrlevel) { - ChangeVisionXY(plr[p]._pvid, plr[p].WorldX, plr[p].WorldY); + ChangeVisionXY(plr[p]._pvid, plr[p]._px, plr[p]._py); } } } @@ -2349,8 +2347,8 @@ void OperateL1Door(int pnum, int i, BOOL sendflag) { int dpx, dpy; - dpx = abs(object[i]._ox - plr[pnum].WorldX); - dpy = abs(object[i]._oy - plr[pnum].WorldY); + dpx = abs(object[i]._ox - plr[pnum]._px); + dpy = abs(object[i]._oy - plr[pnum]._py); if (dpx == 1 && dpy <= 1 && object[i]._otype == OBJ_L1LDOOR) OperateL1LDoor(pnum, i, sendflag); if (dpx <= 1 && dpy == 1 && object[i]._otype == OBJ_L1RDOOR) @@ -2389,6 +2387,7 @@ void OperateBook(int pnum, int i) { int j, oi; int dx, dy; + int otype; BOOL do_add_missile, missile_added; if (object[i]._oSelFlag == 0) @@ -2398,23 +2397,22 @@ void OperateBook(int pnum, int i) missile_added = FALSE; for (j = 0; j < nobjects; j++) { oi = objectactive[j]; - if (object[oi]._otype == OBJ_MCIRCLE2) { - if (object[oi]._oVar6 == 1) { - dx = 27; - dy = 29; - object[oi]._oVar6 = 4; - do_add_missile = TRUE; - } - if (object[oi]._oVar6 == 2) { - dx = 43; - dy = 29; - object[oi]._oVar6 = 4; - do_add_missile = TRUE; - } + otype = object[oi]._otype; + if (otype == OBJ_MCIRCLE2 && object[oi]._oVar6 == 1) { + dx = 27; + dy = 29; + object[oi]._oVar6 = 4; + do_add_missile = TRUE; + } + if (otype == OBJ_MCIRCLE2 && object[oi]._oVar6 == 2) { + dx = 43; + dy = 29; + object[oi]._oVar6 = 4; + do_add_missile = TRUE; } if (do_add_missile) { object[dObject[35][36] - 1]._oVar5++; - AddMissile(plr[pnum].WorldX, plr[pnum].WorldY, dx, dy, plr[pnum]._pdir, MIS_RNDTELEPORT, 0, pnum, 0, 0); + AddMissile(plr[pnum]._px, plr[pnum]._py, dx, dy, plr[pnum]._pdir, MIS_RNDTELEPORT, 0, pnum, 0, 0); missile_added = TRUE; do_add_missile = FALSE; } @@ -2422,8 +2420,8 @@ void OperateBook(int pnum, int i) if (!missile_added) return; } - object[i]._oAnimFrame++; object[i]._oSelFlag = 0; + object[i]._oAnimFrame++; if (!setlevel) return; @@ -2436,8 +2434,8 @@ void OperateBook(int pnum, int i) PlaySfxLoc(IS_QUESTDN, object[i]._ox, object[i]._oy); InitDiabloMsg(EMSG_BONECHAMB); AddMissile( - plr[myplr].WorldX, - plr[myplr].WorldY, + plr[myplr]._px, + plr[myplr]._py, object[i]._ox - 2, object[i]._oy - 4, plr[myplr]._pdir, @@ -2536,8 +2534,8 @@ void OperateChest(int pnum, int i, BOOL sendmsg) if (object[i]._oSelFlag != 0) { if (!deltaload) PlaySfxLoc(IS_CHEST, object[i]._ox, object[i]._oy); - object[i]._oAnimFrame += 2; object[i]._oSelFlag = 0; + object[i]._oAnimFrame += 2; if (!deltaload) { SetRndSeed(object[i]._oRndSeed); if (setlevel) { @@ -2553,7 +2551,7 @@ void OperateChest(int pnum, int i, BOOL sendmsg) } } if (object[i]._oTrapFlag && object[i]._otype >= OBJ_TCHEST1 && object[i]._otype <= OBJ_TCHEST3) { - mdir = GetDirection(object[i]._ox, object[i]._oy, plr[pnum].WorldX, plr[pnum].WorldY); + mdir = GetDirection(object[i]._ox, object[i]._oy, plr[pnum]._px, plr[pnum]._py); switch (object[i]._oVar4) { case 0: mtype = MIS_ARROW; @@ -2565,7 +2563,7 @@ void OperateChest(int pnum, int i, BOOL sendmsg) mtype = MIS_NOVA; break; } - AddMissile(object[i]._ox, object[i]._oy, plr[pnum].WorldX, plr[pnum].WorldY, mdir, mtype, 1, -1, 0, 0); + AddMissile(object[i]._ox, object[i]._oy, plr[pnum]._px, plr[pnum]._py, mdir, mtype, 1, -1, 0, 0); object[i]._oTrapFlag = FALSE; } if (pnum == myplr) @@ -2626,8 +2624,8 @@ void OperateInnSignChest(int pnum, int i) if (object[i]._oSelFlag != 0) { if (!deltaload) PlaySfxLoc(IS_CHEST, object[i]._ox, object[i]._oy); - object[i]._oAnimFrame += 2; object[i]._oSelFlag = 0; + object[i]._oAnimFrame += 2; if (!deltaload) { GetSuperItemLoc(object[i]._ox, object[i]._oy, &x, &y); SpawnQuestItem(IDI_BANNER, x, y, 0, 0); @@ -2644,17 +2642,17 @@ void OperateSlainHero(int pnum, int i, BOOL sendmsg) if (plr[pnum]._pClass == PC_WARRIOR) { CreateMagicArmor(object[i]._ox, object[i]._oy, ITYPE_HARMOR, ICURS_BREAST_PLATE, FALSE, TRUE); #ifndef SPAWN - PlaySfxLoc(PS_WARR9, plr[myplr].WorldX, plr[myplr].WorldY); + PlaySfxLoc(PS_WARR9, plr[myplr]._px, plr[myplr]._py); #endif } else if (plr[pnum]._pClass == PC_ROGUE) { CreateMagicWeapon(object[i]._ox, object[i]._oy, ITYPE_BOW, ICURS_LONG_WAR_BOW, FALSE, TRUE); #ifndef SPAWN - PlaySfxLoc(PS_ROGUE9, plr[myplr].WorldX, plr[myplr].WorldY); + PlaySfxLoc(PS_ROGUE9, plr[myplr]._px, plr[myplr]._py); #endif } else if (plr[pnum]._pClass == PC_SORCERER) { CreateSpellBook(object[i]._ox, object[i]._oy, SPL_LIGHTNING, FALSE, TRUE); #ifndef SPAWN - PlaySfxLoc(PS_MAGE9, plr[myplr].WorldX, plr[myplr].WorldY); + PlaySfxLoc(PS_MAGE9, plr[myplr]._px, plr[myplr]._py); #endif } if (pnum == myplr) @@ -2719,8 +2717,8 @@ void OperateL2Door(int pnum, int i, BOOL sendflag) { int dpx, dpy; - dpx = abs(object[i]._ox - plr[pnum].WorldX); - dpy = abs(object[i]._oy - plr[pnum].WorldY); + dpx = abs(object[i]._ox - plr[pnum]._px); + dpy = abs(object[i]._oy - plr[pnum]._py); if (dpx == 1 && dpy <= 1 && object[i]._otype == OBJ_L2LDOOR) OperateL2LDoor(pnum, i, sendflag); if (dpx <= 1 && dpy == 1 && object[i]._otype == OBJ_L2RDOOR) @@ -2731,8 +2729,8 @@ void OperateL3Door(int pnum, int i, BOOL sendflag) { int dpx, dpy; - dpx = abs(object[i]._ox - plr[pnum].WorldX); - dpy = abs(object[i]._oy - plr[pnum].WorldY); + dpx = abs(object[i]._ox - plr[pnum]._px); + dpy = abs(object[i]._oy - plr[pnum]._py); if (dpx == 1 && dpy <= 1 && object[i]._otype == OBJ_L3RDOOR) OperateL3RDoor(pnum, i, sendflag); if (dpx <= 1 && dpy == 1 && object[i]._otype == OBJ_L3LDOOR) @@ -2996,10 +2994,10 @@ void OperateShrine(int pnum, int i, int sType) if (deltaload) return; AddMissile( - plr[pnum].WorldX, - plr[pnum].WorldY, - plr[pnum].WorldX, - plr[pnum].WorldY, + plr[pnum]._px, + plr[pnum]._py, + plr[pnum]._px, + plr[pnum]._py, plr[pnum]._pdir, MIS_MANASHIELD, -1, @@ -3126,10 +3124,10 @@ void OperateShrine(int pnum, int i, int sType) if (deltaload) return; AddMissile( - plr[pnum].WorldX, - plr[pnum].WorldY, - plr[pnum].WorldX, - plr[pnum].WorldY, + plr[pnum]._px, + plr[pnum]._py, + plr[pnum]._px, + plr[pnum]._py, plr[pnum]._pdir, MIS_NOVA, -1, @@ -3224,7 +3222,7 @@ void OperateShrine(int pnum, int i, int sType) break; lv = dPiece[xx][yy]; } while (nSolidTable[lv] || dObject[xx][yy] || dMonster[xx][yy]); - AddMissile(plr[pnum].WorldX, plr[pnum].WorldY, xx, yy, plr[pnum]._pdir, MIS_RNDTELEPORT, -1, pnum, 0, 2 * leveltype); + AddMissile(plr[pnum]._px, plr[pnum]._py, xx, yy, plr[pnum]._pdir, MIS_RNDTELEPORT, -1, pnum, 0, 2 * leveltype); if (pnum != myplr) return; InitDiabloMsg(EMSG_SHRINE_HOLY); @@ -3424,8 +3422,8 @@ void OperateSkelBook(int pnum, int i, BOOL sendmsg) if (object[i]._oSelFlag != 0) { if (!deltaload) PlaySfxLoc(IS_ISCROL, object[i]._ox, object[i]._oy); - object[i]._oAnimFrame += 2; object[i]._oSelFlag = 0; + object[i]._oAnimFrame += 2; if (!deltaload) { SetRndSeed(object[i]._oRndSeed); if (random_(161, 5)) @@ -3443,8 +3441,8 @@ void OperateBookCase(int pnum, int i, BOOL sendmsg) if (object[i]._oSelFlag != 0) { if (!deltaload) PlaySfxLoc(IS_ISCROL, object[i]._ox, object[i]._oy); - object[i]._oAnimFrame -= 2; object[i]._oSelFlag = 0; + object[i]._oAnimFrame -= 2; if (!deltaload) { SetRndSeed(object[i]._oRndSeed); CreateTypeItem(object[i]._ox, object[i]._oy, FALSE, ITYPE_MISC, IMISC_BOOK, sendmsg, FALSE); @@ -3481,8 +3479,8 @@ void OperateArmorStand(int pnum, int i, BOOL sendmsg) BOOL uniqueRnd; if (object[i]._oSelFlag != 0) { - object[i]._oAnimFrame++; object[i]._oSelFlag = 0; + object[i]._oAnimFrame++; if (!deltaload) { SetRndSeed(object[i]._oRndSeed); uniqueRnd = random_(0, 2); @@ -3603,10 +3601,10 @@ BOOL OperateFountains(int pnum, int i) if (deltaload) return FALSE; AddMissile( - plr[pnum].WorldX, - plr[pnum].WorldY, - plr[pnum].WorldX, - plr[pnum].WorldY, + plr[pnum]._px, + plr[pnum]._py, + plr[pnum]._px, + plr[pnum]._py, plr[pnum]._pdir, MIS_INFRA, -1, @@ -3690,8 +3688,8 @@ void OperateWeaponRack(int pnum, int i, BOOL sendmsg) break; } - object[i]._oAnimFrame++; object[i]._oSelFlag = 0; + object[i]._oAnimFrame++; if (deltaload) return; @@ -3860,9 +3858,7 @@ void SyncOpL1Door(int pnum, int cmd, int i) return; do_sync = FALSE; - if (cmd == CMD_OPENDOOR) { - if (object[i]._oVar4 != 0) - return; + if (cmd == CMD_OPENDOOR && object[i]._oVar4 == 0) { do_sync = TRUE; } if (cmd == CMD_CLOSEDOOR && object[i]._oVar4 == 1) @@ -3883,9 +3879,7 @@ void SyncOpL2Door(int pnum, int cmd, int i) return; do_sync = FALSE; - if (cmd == CMD_OPENDOOR) { - if (object[i]._oVar4 != 0) - return; + if (cmd == CMD_OPENDOOR && object[i]._oVar4 == 0) { do_sync = TRUE; } if (cmd == CMD_CLOSEDOOR && object[i]._oVar4 == 1) @@ -3906,9 +3900,7 @@ void SyncOpL3Door(int pnum, int cmd, int i) return; do_sync = FALSE; - if (cmd == CMD_OPENDOOR) { - if (object[i]._oVar4 != 0) - return; + if (cmd == CMD_OPENDOOR && object[i]._oVar4 == 0) { do_sync = TRUE; } if (cmd == CMD_CLOSEDOOR && object[i]._oVar4 == 1) diff --git a/Source/pack.cpp b/Source/pack.cpp index 359e53047..57515dfb9 100644 --- a/Source/pack.cpp +++ b/Source/pack.cpp @@ -45,8 +45,8 @@ void PackPlayer(PkPlayerStruct *pPack, int pnum, BOOL manashield) pPack->destParam1 = pPlayer->destParam1; pPack->destParam2 = pPlayer->destParam2; pPack->plrlevel = pPlayer->plrlevel; - pPack->px = pPlayer->WorldX; - pPack->py = pPlayer->WorldY; + pPack->px = pPlayer->_px; + pPack->py = pPlayer->_py; pPack->targx = pPlayer->_ptargx; pPack->targy = pPlayer->_ptargy; strcpy(pPack->pName, pPlayer->_pName); @@ -174,10 +174,10 @@ void UnPackPlayer(PkPlayerStruct *pPack, int pnum, BOOL killok) pPlayer = &plr[pnum]; ClearPlrRVars(pPlayer); - pPlayer->WorldX = pPack->px; - pPlayer->WorldY = pPack->py; pPlayer->_px = pPack->px; pPlayer->_py = pPack->py; + pPlayer->_pfutx = pPack->px; + pPlayer->_pfuty = pPack->py; pPlayer->_ptargx = pPack->targx; pPlayer->_ptargy = pPack->targy; pPlayer->plrlevel = pPack->plrlevel; diff --git a/Source/palette.cpp b/Source/palette.cpp index ad2b3a966..ff5043437 100644 --- a/Source/palette.cpp +++ b/Source/palette.cpp @@ -42,8 +42,8 @@ void ApplyGamma(SDL_Color *dst, const SDL_Color *src, int n) void SaveGamma() { - SRegSaveValue("Diablo", "Gamma Correction", 0, gamma_correction); - SRegSaveValue("Diablo", "Color Cycling", FALSE, color_cycling_enabled); + SRegSaveValue(APP_NAME, "Gamma Correction", 0, gamma_correction); + SRegSaveValue(APP_NAME, "Color Cycling", FALSE, color_cycling_enabled); } static void LoadGamma() @@ -52,7 +52,7 @@ static void LoadGamma() int value; value = gamma_correction; - if (!SRegLoadValue("Diablo", "Gamma Correction", 0, &value)) + if (!SRegLoadValue(APP_NAME, "Gamma Correction", 0, &value)) value = 100; gamma_value = value; if (value < 30) { @@ -61,7 +61,7 @@ static void LoadGamma() gamma_value = 100; } gamma_correction = gamma_value - gamma_value % 5; - if (!SRegLoadValue("Diablo", "Color Cycling", 0, &value)) + if (!SRegLoadValue(APP_NAME, "Color Cycling", 0, &value)) value = 1; color_cycling_enabled = value; } diff --git a/Source/player.cpp b/Source/player.cpp index db4fcb316..f8a3002ad 100644 --- a/Source/player.cpp +++ b/Source/player.cpp @@ -351,10 +351,10 @@ DWORD GetPlrGFXSize(char *szCel) #endif for (w = &WepChar[0]; *w; w++) { if (szCel[0] == 'D' && szCel[1] == 'T' && *w != 'N') { - continue; //Death has no weapon + continue; //Death has no weapon } if (szCel[0] == 'B' && szCel[1] == 'L' && (*w != 'U' && *w != 'D' && *w != 'H')) { - continue; //No block without weapon + continue; //No block without weapon } sprintf(Type, "%c%c%c", CharChar[c], *a, *w); sprintf(pszName, "PlrGFX\\%s\\%s\\%s%s.CL2", ClassStrTbl[c], Type, Type, szCel); @@ -845,11 +845,11 @@ void InitPlayer(int pnum, BOOL FirstTime) ClearPlrRVars(&plr[pnum]); if (FirstTime) { + plr[pnum]._pRSplType = RSPLTYPE_INVALID; plr[pnum]._pRSpell = SPL_INVALID; plr[pnum]._pSBkSpell = SPL_INVALID; - plr[pnum]._pSpell = SPL_INVALID; - plr[pnum]._pRSplType = RSPLTYPE_INVALID; - plr[pnum]._pSplType = RSPLTYPE_INVALID; + plr[pnum]._pSpell = plr[pnum]._pRSpell; + plr[pnum]._pSplType = plr[pnum]._pRSplType; if ((plr[pnum]._pgfxnum & 0xF) == ANIM_ID_BOW) { plr[pnum]._pwtype = WT_RANGED; } else { @@ -885,31 +885,31 @@ void InitPlayer(int pnum, BOOL FirstTime) if (pnum == myplr) { if (!FirstTime || currlevel != 0) { - plr[pnum].WorldX = ViewX; - plr[pnum].WorldY = ViewY; + plr[pnum]._px = ViewX; + plr[pnum]._py = ViewY; } - plr[pnum]._ptargx = plr[pnum].WorldX; - plr[pnum]._ptargy = plr[pnum].WorldY; + plr[pnum]._ptargx = plr[pnum]._px; + plr[pnum]._ptargy = plr[pnum]._py; } else { - plr[pnum]._ptargx = plr[pnum].WorldX; - plr[pnum]._ptargy = plr[pnum].WorldY; - for (i = 0; i < 8 && !PosOkPlayer(pnum, plrxoff2[i] + plr[pnum].WorldX, plryoff2[i] + plr[pnum].WorldY); i++) + plr[pnum]._ptargx = plr[pnum]._px; + plr[pnum]._ptargy = plr[pnum]._py; + for (i = 0; i < 8 && !PosOkPlayer(pnum, plrxoff2[i] + plr[pnum]._px, plryoff2[i] + plr[pnum]._py); i++) ; - plr[pnum].WorldX += plrxoff2[i]; - plr[pnum].WorldY += plryoff2[i]; + plr[pnum]._px += plrxoff2[i]; + plr[pnum]._py += plryoff2[i]; } - plr[pnum]._px = plr[pnum].WorldX; - plr[pnum]._py = plr[pnum].WorldY; + plr[pnum]._pfutx = plr[pnum]._px; + plr[pnum]._pfuty = plr[pnum]._py; plr[pnum].walkpath[0] = WALK_NONE; plr[pnum].destAction = ACTION_NONE; if (pnum == myplr) { - plr[pnum]._plid = AddLight(plr[pnum].WorldX, plr[pnum].WorldY, plr[pnum]._pLightRad); + plr[pnum]._plid = AddLight(plr[pnum]._px, plr[pnum]._py, plr[pnum]._pLightRad); } else { plr[pnum]._plid = -1; } - plr[pnum]._pvid = AddVision(plr[pnum].WorldX, plr[pnum].WorldY, plr[pnum]._pLightRad, pnum == myplr); + plr[pnum]._pvid = AddVision(plr[pnum]._px, plr[pnum]._py, plr[pnum]._pLightRad, pnum == myplr); } if (plr[pnum]._pClass == PC_WARRIOR) { @@ -952,8 +952,8 @@ void InitMultiView() app_fatal("InitPlayer: illegal player %d", myplr); } - ViewX = plr[myplr].WorldX; - ViewY = plr[myplr].WorldY; + ViewX = plr[myplr]._px; + ViewY = plr[myplr]._py; } BOOL SolidLoc(int x, int y) @@ -974,8 +974,8 @@ BOOL PlrDirOK(int pnum, int dir) app_fatal("PlrDirOK: illegal player %d", pnum); } - px = plr[pnum].WorldX + offset_x[dir]; - py = plr[pnum].WorldY + offset_y[dir]; + px = plr[pnum]._px + offset_x[dir]; + py = plr[pnum]._py + offset_y[dir]; if (px < 0 || !dPiece[px][py] || !PosOkPlayer(pnum, px, py)) { return FALSE; @@ -1027,8 +1027,8 @@ void SetPlayerOld(int pnum) app_fatal("SetPlayerOld: illegal player %d", pnum); } - plr[pnum]._poldx = plr[pnum].WorldX; - plr[pnum]._poldy = plr[pnum].WorldY; + plr[pnum]._poldx = plr[pnum]._px; + plr[pnum]._poldy = plr[pnum]._py; } void FixPlayerLocation(int pnum, int bDir) @@ -1037,10 +1037,10 @@ void FixPlayerLocation(int pnum, int bDir) app_fatal("FixPlayerLocation: illegal player %d", pnum); } - plr[pnum]._px = plr[pnum].WorldX; - plr[pnum]._py = plr[pnum].WorldY; - plr[pnum]._ptargx = plr[pnum].WorldX; - plr[pnum]._ptargy = plr[pnum].WorldY; + plr[pnum]._pfutx = plr[pnum]._px; + plr[pnum]._pfuty = plr[pnum]._py; + plr[pnum]._ptargx = plr[pnum]._px; + plr[pnum]._ptargy = plr[pnum]._py; plr[pnum]._pxoff = 0; plr[pnum]._pyoff = 0; plr[pnum]._pdir = bDir; @@ -1048,8 +1048,8 @@ void FixPlayerLocation(int pnum, int bDir) ScrollInfo._sxoff = 0; ScrollInfo._syoff = 0; ScrollInfo._sdir = SDIR_NONE; - ViewX = plr[pnum].WorldX; - ViewY = plr[pnum].WorldY; + ViewX = plr[pnum]._px; + ViewY = plr[pnum]._py; } } @@ -1068,7 +1068,7 @@ void StartStand(int pnum, int dir) plr[pnum]._pmode = PM_STAND; FixPlayerLocation(pnum, dir); FixPlrWalkTags(pnum); - dPlayer[plr[pnum].WorldX][plr[pnum].WorldY] = pnum + 1; + dPlayer[plr[pnum]._px][plr[pnum]._py] = pnum + 1; SetPlayerOld(pnum); } else { SyncPlrKill(pnum, -1); @@ -1082,8 +1082,8 @@ void StartWalkStand(int pnum) } plr[pnum]._pmode = PM_STAND; - plr[pnum]._px = plr[pnum].WorldX; - plr[pnum]._py = plr[pnum].WorldY; + plr[pnum]._pfutx = plr[pnum]._px; + plr[pnum]._pfuty = plr[pnum]._py; plr[pnum]._pxoff = 0; plr[pnum]._pyoff = 0; @@ -1091,8 +1091,8 @@ void StartWalkStand(int pnum) ScrollInfo._sxoff = 0; ScrollInfo._syoff = 0; ScrollInfo._sdir = SDIR_NONE; - ViewX = plr[pnum].WorldX; - ViewY = plr[pnum].WorldY; + ViewX = plr[pnum]._px; + ViewY = plr[pnum]._py; } } @@ -1109,7 +1109,7 @@ void PM_ChangeLightOff(int pnum) } // check if issue is upstream - if(plr[pnum]._plid == -1) + if (plr[pnum]._plid == -1) return; l = &LightList[plr[pnum]._plid]; @@ -1158,9 +1158,12 @@ void PM_ChangeOffset(int pnum) plr[pnum]._pxoff = plr[pnum]._pVar6 / 256; plr[pnum]._pyoff = plr[pnum]._pVar7 / 256; + px -= plr[pnum]._pVar6 >> 8; + py -= plr[pnum]._pVar7 >> 8; + if (pnum == myplr && ScrollInfo._sdir) { - ScrollInfo._sxoff += px - plr[pnum]._pxoff; - ScrollInfo._syoff += py - plr[pnum]._pyoff; + ScrollInfo._sxoff += px; + ScrollInfo._syoff += py; } PM_ChangeLightOff(pnum); @@ -1181,19 +1184,19 @@ void StartWalk(int pnum, int xvel, int yvel, int xadd, int yadd, int EndDir, int SetPlayerOld(pnum); - px = xadd + plr[pnum].WorldX; - py = yadd + plr[pnum].WorldY; + px = xadd + plr[pnum]._px; + py = yadd + plr[pnum]._py; if (!PlrDirOK(pnum, EndDir)) { return; } - plr[pnum]._px = px; - plr[pnum]._py = py; + plr[pnum]._pfutx = px; + plr[pnum]._pfuty = py; if (pnum == myplr) { - ScrollInfo._sdx = plr[pnum].WorldX - ViewX; - ScrollInfo._sdy = plr[pnum].WorldY - ViewY; + ScrollInfo._sdx = plr[pnum]._px - ViewX; + ScrollInfo._sdy = plr[pnum]._py - ViewY; } dPlayer[px][py] = -(pnum + 1); @@ -1251,31 +1254,31 @@ void StartWalk2(int pnum, int xvel, int yvel, int xoff, int yoff, int xadd, int } SetPlayerOld(pnum); - px = xadd + plr[pnum].WorldX; - py = yadd + plr[pnum].WorldY; + px = xadd + plr[pnum]._px; + py = yadd + plr[pnum]._py; if (!PlrDirOK(pnum, EndDir)) { return; } - plr[pnum]._px = px; - plr[pnum]._py = py; + plr[pnum]._pfutx = px; + plr[pnum]._pfuty = py; if (pnum == myplr) { - ScrollInfo._sdx = plr[pnum].WorldX - ViewX; - ScrollInfo._sdy = plr[pnum].WorldY - ViewY; + ScrollInfo._sdx = plr[pnum]._px - ViewX; + ScrollInfo._sdy = plr[pnum]._py - ViewY; } - dPlayer[plr[pnum].WorldX][plr[pnum].WorldY] = -1 - pnum; - plr[pnum]._pVar1 = plr[pnum].WorldX; - plr[pnum]._pVar2 = plr[pnum].WorldY; - plr[pnum].WorldX = px; - plr[pnum].WorldY = py; - dPlayer[plr[pnum].WorldX][plr[pnum].WorldY] = pnum + 1; + dPlayer[plr[pnum]._px][plr[pnum]._py] = -1 - pnum; + plr[pnum]._pVar1 = plr[pnum]._px; + plr[pnum]._pVar2 = plr[pnum]._py; + plr[pnum]._px = px; + plr[pnum]._py = py; + dPlayer[plr[pnum]._px][plr[pnum]._py] = pnum + 1; plr[pnum]._pxoff = xoff; plr[pnum]._pyoff = yoff; - ChangeLightXY(plr[pnum]._plid, plr[pnum].WorldX, plr[pnum].WorldY); + ChangeLightXY(plr[pnum]._plid, plr[pnum]._px, plr[pnum]._py); PM_ChangeLightOff(pnum); plr[pnum]._pmode = PM_WALK2; @@ -1327,24 +1330,24 @@ void StartWalk3(int pnum, int xvel, int yvel, int xoff, int yoff, int xadd, int } SetPlayerOld(pnum); - px = xadd + plr[pnum].WorldX; - py = yadd + plr[pnum].WorldY; - x = mapx + plr[pnum].WorldX; - y = mapy + plr[pnum].WorldY; + px = xadd + plr[pnum]._px; + py = yadd + plr[pnum]._py; + x = mapx + plr[pnum]._px; + y = mapy + plr[pnum]._py; if (!PlrDirOK(pnum, EndDir)) { return; } - plr[pnum]._px = px; - plr[pnum]._py = py; + plr[pnum]._pfutx = px; + plr[pnum]._pfuty = py; if (pnum == myplr) { - ScrollInfo._sdx = plr[pnum].WorldX - ViewX; - ScrollInfo._sdy = plr[pnum].WorldY - ViewY; + ScrollInfo._sdx = plr[pnum]._px - ViewX; + ScrollInfo._sdy = plr[pnum]._py - ViewY; } - dPlayer[plr[pnum].WorldX][plr[pnum].WorldY] = -1 - pnum; + dPlayer[plr[pnum]._px][plr[pnum]._py] = -1 - pnum; dPlayer[px][py] = -1 - pnum; plr[pnum]._pVar4 = x; plr[pnum]._pVar5 = y; @@ -1446,7 +1449,7 @@ void StartPlrBlock(int pnum, int dir) return; } - PlaySfxLoc(IS_ISWORD, plr[pnum].WorldX, plr[pnum].WorldY); + PlaySfxLoc(IS_ISWORD, plr[pnum]._px, plr[pnum]._py); if (!(plr[pnum]._pGFXLoad & PFILE_BLOCK)) { LoadPlrGFX(pnum, PFILE_BLOCK); @@ -1491,7 +1494,7 @@ void StartSpell(int pnum, int d, int cx, int cy) } } - PlaySfxLoc(spelldata[plr[pnum]._pSpell].sSFX, plr[pnum].WorldX, plr[pnum].WorldY); + PlaySfxLoc(spelldata[plr[pnum]._pSpell].sSFX, plr[pnum]._px, plr[pnum]._py); plr[pnum]._pmode = PM_SPELL; @@ -1565,12 +1568,12 @@ void StartPlrHit(int pnum, int dam, BOOL forcehit) } if (plr[pnum]._pClass == PC_WARRIOR) { - PlaySfxLoc(PS_WARR69, plr[pnum].WorldX, plr[pnum].WorldY); + PlaySfxLoc(PS_WARR69, plr[pnum]._px, plr[pnum]._py); #ifndef SPAWN } else if (plr[pnum]._pClass == PC_ROGUE) { - PlaySfxLoc(PS_ROGUE69, plr[pnum].WorldX, plr[pnum].WorldY); + PlaySfxLoc(PS_ROGUE69, plr[pnum]._px, plr[pnum]._py); } else if (plr[pnum]._pClass == PC_SORCERER) { - PlaySfxLoc(PS_MAGE69, plr[pnum].WorldX, plr[pnum].WorldY); + PlaySfxLoc(PS_MAGE69, plr[pnum]._px, plr[pnum]._py); #endif } @@ -1587,7 +1590,7 @@ void StartPlrHit(int pnum, int dam, BOOL forcehit) FixPlayerLocation(pnum, pd); plr[pnum]._pVar8 = 1; FixPlrWalkTags(pnum); - dPlayer[plr[pnum].WorldX][plr[pnum].WorldY] = pnum + 1; + dPlayer[plr[pnum]._px][plr[pnum]._py] = pnum + 1; SetPlayerOld(pnum); } } @@ -1628,7 +1631,8 @@ void StartPlayerKill(int pnum, int earflag) ItemStruct ear; ItemStruct *pi; - if (plr[pnum]._pHitPoints <= 0 && plr[pnum]._pmode == PM_DEATH) { + p = &plr[pnum]; + if (p->_pHitPoints <= 0 && p->_pmode == PM_DEATH) { return; } @@ -1643,45 +1647,44 @@ void StartPlayerKill(int pnum, int earflag) } if (plr[pnum]._pClass == PC_WARRIOR) { - PlaySfxLoc(PS_DEAD, plr[pnum].WorldX, plr[pnum].WorldY); // BUGFIX: should use `PS_WARR71` like other classes + PlaySfxLoc(PS_DEAD, p->_px, p->_py); // BUGFIX: should use `PS_WARR71` like other classes #ifndef SPAWN } else if (plr[pnum]._pClass == PC_ROGUE) { - PlaySfxLoc(PS_ROGUE71, plr[pnum].WorldX, plr[pnum].WorldY); + PlaySfxLoc(PS_ROGUE71, p->_px, p->_py); } else if (plr[pnum]._pClass == PC_SORCERER) { - PlaySfxLoc(PS_MAGE71, plr[pnum].WorldX, plr[pnum].WorldY); + PlaySfxLoc(PS_MAGE71, p->_px, p->_py); #endif } - if (plr[pnum]._pgfxnum) { - plr[pnum]._pgfxnum = 0; - plr[pnum]._pGFXLoad = 0; + if (p->_pgfxnum) { + p->_pgfxnum = 0; + p->_pGFXLoad = 0; SetPlrAnims(pnum); } - if (!(plr[pnum]._pGFXLoad & PFILE_DEATH)) { + if (!(p->_pGFXLoad & PFILE_DEATH)) { LoadPlrGFX(pnum, PFILE_DEATH); } - p = &plr[pnum]; - NewPlrAnim(pnum, p->_pDAnim[plr[pnum]._pdir], p->_pDFrames, 1, p->_pDWidth); + NewPlrAnim(pnum, p->_pDAnim[p->_pdir], p->_pDFrames, 1, p->_pDWidth); - plr[pnum]._pBlockFlag = FALSE; - plr[pnum]._pmode = PM_DEATH; - plr[pnum]._pInvincible = TRUE; + p->_pBlockFlag = FALSE; + p->_pmode = PM_DEATH; + p->_pInvincible = TRUE; SetPlayerHitPoints(pnum, 0); - plr[pnum]._pVar8 = 1; + p->_pVar8 = 1; if (pnum != myplr && !earflag && !diablolevel) { for (i = 0; i < NUM_INVLOC; i++) { - plr[pnum].InvBody[i]._itype = ITYPE_NONE; + p->InvBody[i]._itype = ITYPE_NONE; } CalcPlrInv(pnum, FALSE); } if (plr[pnum].plrlevel == currlevel) { - FixPlayerLocation(pnum, plr[pnum]._pdir); + FixPlayerLocation(pnum, p->_pdir); RemovePlrFromMap(pnum); - dFlags[plr[pnum].WorldX][plr[pnum].WorldY] |= BFLAG_DEAD_PLAYER; + dFlags[p->_px][p->_py] |= BFLAG_DEAD_PLAYER; SetPlayerOld(pnum); if (pnum == myplr) { @@ -1689,7 +1692,7 @@ void StartPlayerKill(int pnum, int earflag) deathdelay = 30; if (pcurs >= CURSOR_FIRSTITEM) { - PlrDeadItem(pnum, &plr[pnum].HoldItem, 0, 0); + PlrDeadItem(pnum, &p->HoldItem, 0, 0); SetCursor_(CURSOR_HAND); } @@ -1715,11 +1718,10 @@ void StartPlayerKill(int pnum, int earflag) PlrDeadItem(pnum, &ear, 0, 0); } } else { - pi = &plr[pnum].InvBody[0]; + pi = &p->InvBody[0]; i = NUM_INVLOC; - while (i != 0) { - i--; - pdd = (i + plr[pnum]._pdir) & 7; + while (i--) { + pdd = (i + p->_pdir) & 7; PlrDeadItem(pnum, pi, offset_x[pdd], offset_y[pdd]); pi++; } @@ -1745,8 +1747,8 @@ void PlrDeadItem(int pnum, ItemStruct *itm, int xx, int yy) app_fatal("PlrDeadItem: illegal player %d", pnum); } - x = xx + plr[pnum].WorldX; - y = yy + plr[pnum].WorldY; + x = xx + plr[pnum]._px; + y = yy + plr[pnum]._py; if ((xx || yy) && ItemSpaceOk(x, y)) { RespawnDeadItem(itm, x, y); plr[pnum].HoldItem = *itm; @@ -1756,9 +1758,9 @@ void PlrDeadItem(int pnum, ItemStruct *itm, int xx, int yy) for (k = 1; k < 50; k++) { for (j = -k; j <= k; j++) { - y = j + plr[pnum].WorldY; + y = j + plr[pnum]._py; for (i = -k; i <= k; i++) { - x = i + plr[pnum].WorldX; + x = i + plr[pnum]._px; if (ItemSpaceOk(x, y)) { RespawnDeadItem(itm, x, y); plr[pnum].HoldItem = *itm; @@ -1947,7 +1949,7 @@ void InitLevelChange(int pnum) RemovePlrFromMap(pnum); SetPlayerOld(pnum); if (pnum == myplr) { - dPlayer[plr[myplr].WorldX][plr[myplr].WorldY] = myplr + 1; + dPlayer[plr[myplr]._px][plr[myplr]._py] = myplr + 1; } else { plr[pnum]._pLvlVisited[plr[pnum].plrlevel] = TRUE; } @@ -2056,6 +2058,7 @@ BOOL PM_DoStand(int pnum) BOOL PM_DoWalk(int pnum) { int anim_len; + BOOL rv; if ((DWORD)pnum >= MAX_PLRS) { app_fatal("PM_DoWalk: illegal player %d", pnum); @@ -2064,7 +2067,7 @@ BOOL PM_DoWalk(int pnum) if (plr[pnum]._pAnimFrame == 3 || (plr[pnum]._pWFrames == 8 && plr[pnum]._pAnimFrame == 7) || (plr[pnum]._pWFrames != 8 && plr[pnum]._pAnimFrame == 4)) { - PlaySfxLoc(PS_WALK1, plr[pnum].WorldX, plr[pnum].WorldY); + PlaySfxLoc(PS_WALK1, plr[pnum]._px, plr[pnum]._py); } anim_len = 8; @@ -2073,19 +2076,19 @@ BOOL PM_DoWalk(int pnum) } if (plr[pnum]._pVar8 == anim_len) { - dPlayer[plr[pnum].WorldX][plr[pnum].WorldY] = 0; - plr[pnum].WorldX += plr[pnum]._pVar1; - plr[pnum].WorldY += plr[pnum]._pVar2; - dPlayer[plr[pnum].WorldX][plr[pnum].WorldY] = pnum + 1; + dPlayer[plr[pnum]._px][plr[pnum]._py] = 0; + plr[pnum]._px += plr[pnum]._pVar1; + plr[pnum]._py += plr[pnum]._pVar2; + dPlayer[plr[pnum]._px][plr[pnum]._py] = pnum + 1; if (leveltype != DTYPE_TOWN) { - ChangeLightXY(plr[pnum]._plid, plr[pnum].WorldX, plr[pnum].WorldY); - ChangeVisionXY(plr[pnum]._pvid, plr[pnum].WorldX, plr[pnum].WorldY); + ChangeLightXY(plr[pnum]._plid, plr[pnum]._px, plr[pnum]._py); + ChangeVisionXY(plr[pnum]._pvid, plr[pnum]._px, plr[pnum]._py); } if (pnum == myplr && ScrollInfo._sdir) { - ViewX = plr[pnum].WorldX - ScrollInfo._sdx; - ViewY = plr[pnum].WorldY - ScrollInfo._sdy; + ViewX = plr[pnum]._px - ScrollInfo._sdx; + ViewY = plr[pnum]._py - ScrollInfo._sdy; } if (plr[pnum].walkpath[0] != WALK_NONE) { @@ -2099,17 +2102,19 @@ BOOL PM_DoWalk(int pnum) if (leveltype != DTYPE_TOWN) { ChangeLightOff(plr[pnum]._plid, 0, 0); } - - return TRUE; + rv = TRUE; + } else { + PM_ChangeOffset(pnum); + rv = FALSE; } - PM_ChangeOffset(pnum); - return FALSE; + return rv; } BOOL PM_DoWalk2(int pnum) { int anim_len; + BOOL rv; if ((DWORD)pnum >= MAX_PLRS) { app_fatal("PM_DoWalk2: illegal player %d", pnum); @@ -2118,7 +2123,7 @@ BOOL PM_DoWalk2(int pnum) if (plr[pnum]._pAnimFrame == 3 || (plr[pnum]._pWFrames == 8 && plr[pnum]._pAnimFrame == 7) || (plr[pnum]._pWFrames != 8 && plr[pnum]._pAnimFrame == 4)) { - PlaySfxLoc(PS_WALK1, plr[pnum].WorldX, plr[pnum].WorldY); + PlaySfxLoc(PS_WALK1, plr[pnum]._px, plr[pnum]._py); } anim_len = 8; @@ -2130,13 +2135,13 @@ BOOL PM_DoWalk2(int pnum) dPlayer[plr[pnum]._pVar1][plr[pnum]._pVar2] = 0; if (leveltype != DTYPE_TOWN) { - ChangeLightXY(plr[pnum]._plid, plr[pnum].WorldX, plr[pnum].WorldY); - ChangeVisionXY(plr[pnum]._pvid, plr[pnum].WorldX, plr[pnum].WorldY); + ChangeLightXY(plr[pnum]._plid, plr[pnum]._px, plr[pnum]._py); + ChangeVisionXY(plr[pnum]._pvid, plr[pnum]._px, plr[pnum]._py); } if (pnum == myplr && ScrollInfo._sdir) { - ViewX = plr[pnum].WorldX - ScrollInfo._sdx; - ViewY = plr[pnum].WorldY - ScrollInfo._sdy; + ViewX = plr[pnum]._px - ScrollInfo._sdx; + ViewY = plr[pnum]._py - ScrollInfo._sdy; } if (plr[pnum].walkpath[0] != WALK_NONE) { @@ -2146,21 +2151,22 @@ BOOL PM_DoWalk2(int pnum) } ClearPlrPVars(pnum); - if (leveltype != DTYPE_TOWN) { ChangeLightOff(plr[pnum]._plid, 0, 0); } - - return TRUE; + rv = TRUE; + } else { + PM_ChangeOffset(pnum); + rv = FALSE; } - PM_ChangeOffset(pnum); - return FALSE; + return rv; } BOOL PM_DoWalk3(int pnum) { int anim_len; + BOOL rv; if ((DWORD)pnum >= MAX_PLRS) { app_fatal("PM_DoWalk3: illegal player %d", pnum); @@ -2169,7 +2175,7 @@ BOOL PM_DoWalk3(int pnum) if (plr[pnum]._pAnimFrame == 3 || (plr[pnum]._pWFrames == 8 && plr[pnum]._pAnimFrame == 7) || (plr[pnum]._pWFrames != 8 && plr[pnum]._pAnimFrame == 4)) { - PlaySfxLoc(PS_WALK1, plr[pnum].WorldX, plr[pnum].WorldY); + PlaySfxLoc(PS_WALK1, plr[pnum]._px, plr[pnum]._py); } anim_len = 8; @@ -2178,20 +2184,20 @@ BOOL PM_DoWalk3(int pnum) } if (plr[pnum]._pVar8 == anim_len) { - dPlayer[plr[pnum].WorldX][plr[pnum].WorldY] = 0; + dPlayer[plr[pnum]._px][plr[pnum]._py] = 0; dFlags[plr[pnum]._pVar4][plr[pnum]._pVar5] &= ~BFLAG_PLAYERLR; - plr[pnum].WorldX = plr[pnum]._pVar1; - plr[pnum].WorldY = plr[pnum]._pVar2; - dPlayer[plr[pnum].WorldX][plr[pnum].WorldY] = pnum + 1; + plr[pnum]._px = plr[pnum]._pVar1; + plr[pnum]._py = plr[pnum]._pVar2; + dPlayer[plr[pnum]._px][plr[pnum]._py] = pnum + 1; if (leveltype != DTYPE_TOWN) { - ChangeLightXY(plr[pnum]._plid, plr[pnum].WorldX, plr[pnum].WorldY); - ChangeVisionXY(plr[pnum]._pvid, plr[pnum].WorldX, plr[pnum].WorldY); + ChangeLightXY(plr[pnum]._plid, plr[pnum]._px, plr[pnum]._py); + ChangeVisionXY(plr[pnum]._pvid, plr[pnum]._px, plr[pnum]._py); } if (pnum == myplr && ScrollInfo._sdir) { - ViewX = plr[pnum].WorldX - ScrollInfo._sdx; - ViewY = plr[pnum].WorldY - ScrollInfo._sdy; + ViewX = plr[pnum]._px - ScrollInfo._sdx; + ViewY = plr[pnum]._py - ScrollInfo._sdy; } if (plr[pnum].walkpath[0] != WALK_NONE) { @@ -2205,12 +2211,13 @@ BOOL PM_DoWalk3(int pnum) if (leveltype != DTYPE_TOWN) { ChangeLightOff(plr[pnum]._plid, 0, 0); } - - return TRUE; + rv = TRUE; + } else { + PM_ChangeOffset(pnum); + rv = FALSE; } - PM_ChangeOffset(pnum); - return FALSE; + return rv; } BOOL WeaponDur(int pnum, int durrnd) @@ -2519,7 +2526,7 @@ BOOL PlrHitPlr(int pnum, char p) if (hit < hper) { if (blk < blkper) { - dir = GetDirection(plr[p].WorldX, plr[p].WorldY, plr[pnum].WorldX, plr[pnum].WorldY); + dir = GetDirection(plr[p]._px, plr[p]._py, plr[pnum]._px, plr[pnum]._py); StartPlrBlock(p, dir); } else { mind = plr[pnum]._pIMinDam; @@ -2599,13 +2606,13 @@ BOOL PM_DoAttack(int pnum) plr[pnum]._pAnimFrame += 2; } if (plr[pnum]._pAnimFrame == plr[pnum]._pAFNum - 1) { - PlaySfxLoc(PS_SWING, plr[pnum].WorldX, plr[pnum].WorldY); + PlaySfxLoc(PS_SWING, plr[pnum]._px, plr[pnum]._py); } if (plr[pnum]._pAnimFrame == plr[pnum]._pAFNum) { dir = plr[pnum]._pdir; - dx = plr[pnum].WorldX + offset_x[dir]; - dy = plr[pnum].WorldY + offset_y[dir]; + dx = plr[pnum]._px + offset_x[dir]; + dy = plr[pnum]._py + offset_y[dir]; if (dMonster[dx][dy]) { if (dMonster[dx][dy] > 0) { @@ -2688,8 +2695,8 @@ BOOL PM_DoRangeAttack(int pnum) mistype = MIS_LARROW; } AddMissile( - plr[pnum].WorldX, - plr[pnum].WorldY, + plr[pnum]._px, + plr[pnum]._py, plr[pnum]._pVar1, plr[pnum]._pVar2, plr[pnum]._pdir, @@ -2699,7 +2706,7 @@ BOOL PM_DoRangeAttack(int pnum) 4, 0); - PlaySfxLoc(PS_BFIRE, plr[pnum].WorldX, plr[pnum].WorldY); + PlaySfxLoc(PS_BFIRE, plr[pnum]._px, plr[pnum]._py); if (WeaponDur(pnum, 40)) { StartStand(pnum, plr[pnum]._pdir); @@ -2785,8 +2792,8 @@ BOOL PM_DoSpell(int pnum) CastSpell( pnum, plr[pnum]._pSpell, - plr[pnum].WorldX, - plr[pnum].WorldY, + plr[pnum]._px, + plr[pnum]._py, plr[pnum]._pVar1, plr[pnum]._pVar2, 0, @@ -2931,7 +2938,7 @@ BOOL PM_DoDeath(int pnum) plr[pnum]._pAnimDelay = 10000; plr[pnum]._pAnimFrame = plr[pnum]._pAnimLen; - dFlags[plr[pnum].WorldX][plr[pnum].WorldY] |= BFLAG_DEAD_PLAYER; + dFlags[plr[pnum]._px][plr[pnum]._py] |= BFLAG_DEAD_PLAYER; } if (plr[pnum]._pVar8 < 100) { @@ -2960,7 +2967,7 @@ void CheckNewPath(int pnum) } if (plr[pnum].destAction == ACTION_ATTACKPLR) { - MakePlrPath(pnum, plr[plr[pnum].destParam1]._px, plr[plr[pnum].destParam1]._py, FALSE); + MakePlrPath(pnum, plr[plr[pnum].destParam1]._pfutx, plr[plr[pnum].destParam1]._pfuty, FALSE); } if (plr[pnum].walkpath[0] != WALK_NONE) { @@ -2970,13 +2977,13 @@ void CheckNewPath(int pnum) i = plr[pnum].destParam1; if (plr[pnum].destAction == ACTION_ATTACKMON) { - x = abs(plr[pnum]._px - monster[i]._mfutx); - y = abs(plr[pnum]._py - monster[i]._mfuty); - d = GetDirection(plr[pnum]._px, plr[pnum]._py, monster[i]._mfutx, monster[i]._mfuty); + x = abs(plr[pnum]._pfutx - monster[i]._mfutx); + y = abs(plr[pnum]._pfuty - monster[i]._mfuty); + d = GetDirection(plr[pnum]._pfutx, plr[pnum]._pfuty, monster[i]._mfutx, monster[i]._mfuty); } else { - x = abs(plr[pnum]._px - plr[i]._px); - y = abs(plr[pnum]._py - plr[i]._py); - d = GetDirection(plr[pnum]._px, plr[pnum]._py, plr[i]._px, plr[i]._py); + x = abs(plr[pnum]._pfutx - plr[i]._pfutx); + y = abs(plr[pnum]._pfuty - plr[i]._pfuty); + d = GetDirection(plr[pnum]._pfutx, plr[pnum]._pfuty, plr[i]._pfutx, plr[i]._pfuty); } if (x < 2 && y < 2) { @@ -3049,15 +3056,15 @@ void CheckNewPath(int pnum) if (plr[pnum]._pmode == PM_STAND) { switch (plr[pnum].destAction) { case ACTION_ATTACK: - d = GetDirection(plr[pnum].WorldX, plr[pnum].WorldY, plr[pnum].destParam1, plr[pnum].destParam2); + d = GetDirection(plr[pnum]._px, plr[pnum]._py, plr[pnum].destParam1, plr[pnum].destParam2); StartAttack(pnum, d); break; case ACTION_ATTACKMON: i = plr[pnum].destParam1; - x = abs(plr[pnum].WorldX - monster[i]._mfutx); - y = abs(plr[pnum].WorldY - monster[i]._mfuty); + x = abs(plr[pnum]._px - monster[i]._mfutx); + y = abs(plr[pnum]._py - monster[i]._mfuty); if (x <= 1 && y <= 1) { - d = GetDirection(plr[pnum]._px, plr[pnum]._py, monster[i]._mfutx, monster[i]._mfuty); + d = GetDirection(plr[pnum]._pfutx, plr[pnum]._pfuty, monster[i]._mfutx, monster[i]._mfuty); if (monster[i].mtalkmsg && monster[i].mtalkmsg != TEXT_VILE14) { TalktoMonster(i); } else { @@ -3067,20 +3074,20 @@ void CheckNewPath(int pnum) break; case ACTION_ATTACKPLR: i = plr[pnum].destParam1; - x = abs(plr[pnum].WorldX - plr[i]._px); - y = abs(plr[pnum].WorldY - plr[i]._py); + x = abs(plr[pnum]._px - plr[i]._pfutx); + y = abs(plr[pnum]._py - plr[i]._pfuty); if (x <= 1 && y <= 1) { - d = GetDirection(plr[pnum]._px, plr[pnum]._py, plr[i]._px, plr[i]._py); + d = GetDirection(plr[pnum]._pfutx, plr[pnum]._pfuty, plr[i]._pfutx, plr[i]._pfuty); StartAttack(pnum, d); } break; case ACTION_RATTACK: - d = GetDirection(plr[pnum].WorldX, plr[pnum].WorldY, plr[pnum].destParam1, plr[pnum].destParam2); + d = GetDirection(plr[pnum]._px, plr[pnum]._py, plr[pnum].destParam1, plr[pnum].destParam2); StartRangeAttack(pnum, d, plr[pnum].destParam1, plr[pnum].destParam2); break; case ACTION_RATTACKMON: i = plr[pnum].destParam1; - d = GetDirection(plr[pnum]._px, plr[pnum]._py, monster[i]._mfutx, monster[i]._mfuty); + d = GetDirection(plr[pnum]._pfutx, plr[pnum]._pfuty, monster[i]._mfutx, monster[i]._mfuty); if (monster[i].mtalkmsg && monster[i].mtalkmsg != TEXT_VILE14) { TalktoMonster(i); } else { @@ -3089,11 +3096,11 @@ void CheckNewPath(int pnum) break; case ACTION_RATTACKPLR: i = plr[pnum].destParam1; - d = GetDirection(plr[pnum]._px, plr[pnum]._py, plr[i]._px, plr[i]._py); - StartRangeAttack(pnum, d, plr[i]._px, plr[i]._py); + d = GetDirection(plr[pnum]._pfutx, plr[pnum]._pfuty, plr[i]._pfutx, plr[i]._pfuty); + StartRangeAttack(pnum, d, plr[i]._pfutx, plr[i]._pfuty); break; case ACTION_SPELL: - d = GetDirection(plr[pnum].WorldX, plr[pnum].WorldY, plr[pnum].destParam1, plr[pnum].destParam2); + d = GetDirection(plr[pnum]._px, plr[pnum]._py, plr[pnum].destParam1, plr[pnum].destParam2); StartSpell(pnum, d, plr[pnum].destParam1, plr[pnum].destParam2); plr[pnum]._pVar4 = plr[pnum].destParam3; break; @@ -3104,26 +3111,26 @@ void CheckNewPath(int pnum) break; case ACTION_SPELLMON: i = plr[pnum].destParam1; - d = GetDirection(plr[pnum].WorldX, plr[pnum].WorldY, monster[i]._mfutx, monster[i]._mfuty); + d = GetDirection(plr[pnum]._px, plr[pnum]._py, monster[i]._mfutx, monster[i]._mfuty); StartSpell(pnum, d, monster[i]._mfutx, monster[i]._mfuty); plr[pnum]._pVar4 = plr[pnum].destParam2; break; case ACTION_SPELLPLR: i = plr[pnum].destParam1; - d = GetDirection(plr[pnum].WorldX, plr[pnum].WorldY, plr[i]._px, plr[i]._py); - StartSpell(pnum, d, plr[i]._px, plr[i]._py); + d = GetDirection(plr[pnum]._px, plr[pnum]._py, plr[i]._pfutx, plr[i]._pfuty); + StartSpell(pnum, d, plr[i]._pfutx, plr[i]._pfuty); plr[pnum]._pVar4 = plr[pnum].destParam2; break; case ACTION_OPERATE: i = plr[pnum].destParam1; - x = abs(plr[pnum].WorldX - object[i]._ox); - y = abs(plr[pnum].WorldY - object[i]._oy); + x = abs(plr[pnum]._px - object[i]._ox); + y = abs(plr[pnum]._py - object[i]._oy); if (y > 1 && dObject[object[i]._ox][object[i]._oy - 1] == -1 - i) { - y = abs(plr[pnum].WorldY - object[i]._oy + 1); + y = abs(plr[pnum]._py - object[i]._oy + 1); } if (x <= 1 && y <= 1) { if (object[i]._oBreak == 1) { - d = GetDirection(plr[pnum].WorldX, plr[pnum].WorldY, object[i]._ox, object[i]._oy); + d = GetDirection(plr[pnum]._px, plr[pnum]._py, object[i]._ox, object[i]._oy); StartAttack(pnum, d); } else { OperateObject(pnum, i, FALSE); @@ -3132,14 +3139,14 @@ void CheckNewPath(int pnum) break; case ACTION_DISARM: i = plr[pnum].destParam1; - x = abs(plr[pnum].WorldX - object[i]._ox); - y = abs(plr[pnum].WorldY - object[i]._oy); + x = abs(plr[pnum]._px - object[i]._ox); + y = abs(plr[pnum]._py - object[i]._oy); if (y > 1 && dObject[object[i]._ox][object[i]._oy - 1] == -1 - i) { - y = abs(plr[pnum].WorldY - object[i]._oy + 1); + y = abs(plr[pnum]._py - object[i]._oy + 1); } if (x <= 1 && y <= 1) { if (object[i]._oBreak == 1) { - d = GetDirection(plr[pnum].WorldX, plr[pnum].WorldY, object[i]._ox, object[i]._oy); + d = GetDirection(plr[pnum]._px, plr[pnum]._py, object[i]._ox, object[i]._oy); StartAttack(pnum, d); } else { TryDisarm(pnum, i); @@ -3156,8 +3163,8 @@ void CheckNewPath(int pnum) case ACTION_PICKUPITEM: if (pnum == myplr) { i = plr[pnum].destParam1; - x = abs(plr[pnum].WorldX - item[i]._ix); - y = abs(plr[pnum].WorldY - item[i]._iy); + x = abs(plr[pnum]._px - item[i]._ix); + y = abs(plr[pnum]._py - item[i]._iy); if (x <= 1 && y <= 1 && pcurs == CURSOR_HAND && !item[i]._iRequest) { NetSendCmdGItem(TRUE, CMD_REQUESTGITEM, myplr, myplr, i); item[i]._iRequest = TRUE; @@ -3167,8 +3174,8 @@ void CheckNewPath(int pnum) case ACTION_PICKUPAITEM: if (pnum == myplr) { i = plr[pnum].destParam1; - x = abs(plr[pnum].WorldX - item[i]._ix); - y = abs(plr[pnum].WorldY - item[i]._iy); + x = abs(plr[pnum]._px - item[i]._ix); + y = abs(plr[pnum]._py - item[i]._iy); if (x <= 1 && y <= 1 && pcurs == CURSOR_HAND) { NetSendCmdGItem(TRUE, CMD_REQUESTAGITEM, myplr, myplr, i); } @@ -3189,37 +3196,37 @@ void CheckNewPath(int pnum) if (plr[pnum]._pmode == PM_ATTACK && plr[pnum]._pAnimFrame > plr[myplr]._pAFNum) { if (plr[pnum].destAction == ACTION_ATTACK) { - d = GetDirection(plr[pnum]._px, plr[pnum]._py, plr[pnum].destParam1, plr[pnum].destParam2); + d = GetDirection(plr[pnum]._pfutx, plr[pnum]._pfuty, plr[pnum].destParam1, plr[pnum].destParam2); StartAttack(pnum, d); plr[pnum].destAction = ACTION_NONE; } else if (plr[pnum].destAction == ACTION_ATTACKMON) { i = plr[pnum].destParam1; - x = abs(plr[pnum].WorldX - monster[i]._mfutx); - y = abs(plr[pnum].WorldY - monster[i]._mfuty); + x = abs(plr[pnum]._px - monster[i]._mfutx); + y = abs(plr[pnum]._py - monster[i]._mfuty); if (x <= 1 && y <= 1) { - d = GetDirection(plr[pnum]._px, plr[pnum]._py, monster[i]._mfutx, monster[i]._mfuty); + d = GetDirection(plr[pnum]._pfutx, plr[pnum]._pfuty, monster[i]._mfutx, monster[i]._mfuty); StartAttack(pnum, d); } plr[pnum].destAction = ACTION_NONE; } else if (plr[pnum].destAction == ACTION_ATTACKPLR) { i = plr[pnum].destParam1; - x = abs(plr[pnum].WorldX - plr[i]._px); - y = abs(plr[pnum].WorldY - plr[i]._py); + x = abs(plr[pnum]._px - plr[i]._pfutx); + y = abs(plr[pnum]._py - plr[i]._pfuty); if (x <= 1 && y <= 1) { - d = GetDirection(plr[pnum]._px, plr[pnum]._py, plr[i]._px, plr[i]._py); + d = GetDirection(plr[pnum]._pfutx, plr[pnum]._pfuty, plr[i]._pfutx, plr[i]._pfuty); StartAttack(pnum, d); } plr[pnum].destAction = ACTION_NONE; } else if (plr[pnum].destAction == ACTION_OPERATE) { i = plr[pnum].destParam1; - x = abs(plr[pnum].WorldX - object[i]._ox); - y = abs(plr[pnum].WorldY - object[i]._oy); + x = abs(plr[pnum]._px - object[i]._ox); + y = abs(plr[pnum]._py - object[i]._oy); if (y > 1 && dObject[object[i]._ox][object[i]._oy - 1] == -1 - i) { - y = abs(plr[pnum].WorldY - object[i]._oy + 1); + y = abs(plr[pnum]._py - object[i]._oy + 1); } if (x <= 1 && y <= 1) { if (object[i]._oBreak == 1) { - d = GetDirection(plr[pnum].WorldX, plr[pnum].WorldY, object[i]._ox, object[i]._oy); + d = GetDirection(plr[pnum]._px, plr[pnum]._py, object[i]._ox, object[i]._oy); StartAttack(pnum, d); } else { OperateObject(pnum, i, FALSE); @@ -3230,36 +3237,36 @@ void CheckNewPath(int pnum) if (plr[pnum]._pmode == PM_RATTACK && plr[pnum]._pAnimFrame > plr[myplr]._pAFNum) { if (plr[pnum].destAction == ACTION_RATTACK) { - d = GetDirection(plr[pnum].WorldX, plr[pnum].WorldY, plr[pnum].destParam1, plr[pnum].destParam2); + d = GetDirection(plr[pnum]._px, plr[pnum]._py, plr[pnum].destParam1, plr[pnum].destParam2); StartRangeAttack(pnum, d, plr[pnum].destParam1, plr[pnum].destParam2); plr[pnum].destAction = ACTION_NONE; } else if (plr[pnum].destAction == ACTION_RATTACKMON) { i = plr[pnum].destParam1; - d = GetDirection(plr[pnum].WorldX, plr[pnum].WorldY, monster[i]._mfutx, monster[i]._mfuty); + d = GetDirection(plr[pnum]._px, plr[pnum]._py, monster[i]._mfutx, monster[i]._mfuty); StartRangeAttack(pnum, d, monster[i]._mfutx, monster[i]._mfuty); plr[pnum].destAction = ACTION_NONE; } else if (plr[pnum].destAction == ACTION_RATTACKPLR) { i = plr[pnum].destParam1; - d = GetDirection(plr[pnum].WorldX, plr[pnum].WorldY, plr[i]._px, plr[i]._py); - StartRangeAttack(pnum, d, plr[i]._px, plr[i]._py); + d = GetDirection(plr[pnum]._px, plr[pnum]._py, plr[i]._pfutx, plr[i]._pfuty); + StartRangeAttack(pnum, d, plr[i]._pfutx, plr[i]._pfuty); plr[pnum].destAction = ACTION_NONE; } } if (plr[pnum]._pmode == PM_SPELL && plr[pnum]._pAnimFrame > plr[pnum]._pSFNum) { if (plr[pnum].destAction == ACTION_SPELL) { - d = GetDirection(plr[pnum].WorldX, plr[pnum].WorldY, plr[pnum].destParam1, plr[pnum].destParam2); + d = GetDirection(plr[pnum]._px, plr[pnum]._py, plr[pnum].destParam1, plr[pnum].destParam2); StartSpell(pnum, d, plr[pnum].destParam1, plr[pnum].destParam2); plr[pnum].destAction = ACTION_NONE; } else if (plr[pnum].destAction == ACTION_SPELLMON) { i = plr[pnum].destParam1; - d = GetDirection(plr[pnum].WorldX, plr[pnum].WorldY, monster[i]._mfutx, monster[i]._mfuty); + d = GetDirection(plr[pnum]._px, plr[pnum]._py, monster[i]._mfutx, monster[i]._mfuty); StartSpell(pnum, d, monster[i]._mfutx, monster[i]._mfuty); plr[pnum].destAction = ACTION_NONE; } else if (plr[pnum].destAction == ACTION_SPELLPLR) { i = plr[pnum].destParam1; - d = GetDirection(plr[pnum].WorldX, plr[pnum].WorldY, plr[i]._px, plr[i]._py); - StartSpell(pnum, d, plr[i]._px, plr[i]._py); + d = GetDirection(plr[pnum]._px, plr[pnum]._py, plr[i]._pfutx, plr[i]._pfuty); + StartSpell(pnum, d, plr[i]._pfutx, plr[i]._pfuty); plr[pnum].destAction = ACTION_NONE; } } @@ -3533,11 +3540,11 @@ void MakePlrPath(int pnum, int xx, int yy, BOOL endspace) plr[pnum]._ptargx = xx; plr[pnum]._ptargy = yy; - if (plr[pnum]._px == xx && plr[pnum]._py == yy) { + if (plr[pnum]._pfutx == xx && plr[pnum]._pfuty == yy) { return; } - path = FindPath(PosOkPlayer, pnum, plr[pnum]._px, plr[pnum]._py, xx, yy, plr[pnum].walkpath); + path = FindPath(PosOkPlayer, pnum, plr[pnum]._pfutx, plr[pnum]._pfuty, xx, yy, plr[pnum].walkpath); if (!path) { return; } @@ -3620,17 +3627,17 @@ void CheckPlrSpell() } if (!sgbControllerActive) { - if (pcurs != CURSOR_HAND - || (MouseY >= PANEL_TOP && MouseX >= PANEL_LEFT && MouseX <= RIGHT_PANEL) // inside main panel - || ((chrflag || questlog) && MouseX < SPANEL_WIDTH && MouseY < SPANEL_HEIGHT) // inside left panel - || ((invflag || sbookflag) && MouseX > RIGHT_PANEL && MouseY < SPANEL_HEIGHT) // inside right panel - && rspell != SPL_HEAL - && rspell != SPL_IDENTIFY - && rspell != SPL_REPAIR - && rspell != SPL_INFRA - && rspell != SPL_RECHARGE) { - return; - } + if (pcurs != CURSOR_HAND + || (MouseY >= PANEL_TOP && MouseX >= PANEL_LEFT && MouseX <= RIGHT_PANEL) // inside main panel + || ((chrflag || questlog) && MouseX < SPANEL_WIDTH && MouseY < SPANEL_HEIGHT) // inside left panel + || ((invflag || sbookflag) && MouseX > RIGHT_PANEL && MouseY < SPANEL_HEIGHT) // inside right panel + && rspell != SPL_HEAL + && rspell != SPL_IDENTIFY + && rspell != SPL_REPAIR + && rspell != SPL_INFRA + && rspell != SPL_RECHARGE) { + return; + } } addflag = FALSE; @@ -3649,7 +3656,7 @@ void CheckPlrSpell() if (addflag) { if (plr[myplr]._pRSpell == SPL_FIREWALL) { - sd = GetDirection(plr[myplr].WorldX, plr[myplr].WorldY, cursmx, cursmy); + sd = GetDirection(plr[myplr]._px, plr[myplr]._py, cursmx, cursmy); sl = GetSpellLevel(myplr, plr[myplr]._pRSpell); NetSendCmdLocParam3(TRUE, CMD_SPELLXYD, cursmx, cursmy, plr[myplr]._pRSpell, sd, sl); } else if (pcursmonst != -1) { @@ -3741,16 +3748,16 @@ void SyncInitPlrPos(int pnum) DWORD i; BOOL posOk; - plr[pnum]._ptargx = plr[pnum].WorldX; - plr[pnum]._ptargy = plr[pnum].WorldY; + plr[pnum]._ptargx = plr[pnum]._px; + plr[pnum]._ptargy = plr[pnum]._py; if (gbMaxPlayers == 1 || plr[pnum].plrlevel != currlevel) { return; } for (i = 0; i < 8; i++) { - x = plr[pnum].WorldX + plrxoff2[i]; - y = plr[pnum].WorldY + plryoff2[i]; + x = plr[pnum]._px + plrxoff2[i]; + y = plr[pnum]._py + plryoff2[i]; if (PosOkPlayer(pnum, x, y)) { break; } @@ -3760,9 +3767,9 @@ void SyncInitPlrPos(int pnum) posOk = FALSE; for (range = 1; range < 50 && !posOk; range++) { for (yy = -range; yy <= range && !posOk; yy++) { - y = yy + plr[pnum].WorldY; + y = yy + plr[pnum]._py; for (xx = -range; xx <= range && !posOk; xx++) { - x = xx + plr[pnum].WorldX; + x = xx + plr[pnum]._px; if (PosOkPlayer(pnum, x, y) && !PosOkPortal(currlevel, x, y)) { posOk = TRUE; } @@ -3771,13 +3778,13 @@ void SyncInitPlrPos(int pnum) } } - plr[pnum].WorldX = x; - plr[pnum].WorldY = y; + plr[pnum]._px = x; + plr[pnum]._py = y; dPlayer[x][y] = pnum + 1; if (pnum == myplr) { - plr[pnum]._px = x; - plr[pnum]._py = y; + plr[pnum]._pfutx = x; + plr[pnum]._pfuty = y; plr[pnum]._ptargx = x; plr[pnum]._ptargy = y; ViewX = x; diff --git a/Source/quests.cpp b/Source/quests.cpp index 24093f920..ff1114f17 100644 --- a/Source/quests.cpp +++ b/Source/quests.cpp @@ -10,8 +10,8 @@ int qline; int qlist[MAXQUESTS]; int numqlines; int WaterDone; -int ReturnLvlY; int ReturnLvlX; +int ReturnLvlY; int ReturnLvlT; int ReturnLvl; @@ -180,7 +180,7 @@ void CheckQuests() && nummonsters == 4 && quests[Q_PWATER]._qactive != QUEST_DONE) { quests[Q_PWATER]._qactive = QUEST_DONE; - PlaySfxLoc(IS_QUESTDN, plr[myplr].WorldX, plr[myplr].WorldY); + PlaySfxLoc(IS_QUESTDN, plr[myplr]._px, plr[myplr]._py); LoadPalette("Levels\\L3Data\\L3pwater.pal"); WaterDone = 32; } @@ -193,8 +193,8 @@ void CheckQuests() if (currlevel == quests[i]._qlevel && quests[i]._qslvl != 0 && quests[i]._qactive != QUEST_NOTAVAIL - && plr[myplr].WorldX == quests[i]._qtx - && plr[myplr].WorldY == quests[i]._qty) { + && plr[myplr]._px == quests[i]._qtx + && plr[myplr]._py == quests[i]._qty) { if (quests[i]._qlvltype != DTYPE_NONE) { setlvltype = quests[i]._qlvltype; } diff --git a/Source/quests.h b/Source/quests.h index 3d4ee9ccf..cf52fb578 100644 --- a/Source/quests.h +++ b/Source/quests.h @@ -10,8 +10,8 @@ extern int qline; extern int qlist[MAXQUESTS]; extern int numqlines; extern int WaterDone; -extern int ReturnLvlY; extern int ReturnLvlX; +extern int ReturnLvlY; extern int ReturnLvlT; extern int ALLQUESTS; extern int ReturnLvl; diff --git a/Source/scrollrt.cpp b/Source/scrollrt.cpp index 602e678c6..22df76a74 100644 --- a/Source/scrollrt.cpp +++ b/Source/scrollrt.cpp @@ -139,7 +139,7 @@ static void scrollrt_draw_cursor_item() int i, mx, my, col; BYTE *src, *dst; - assert(! sgdwCursWdt); + assert(!sgdwCursWdt); if (pcurs <= CURSOR_NONE || cursW == 0 || cursH == 0) { return; @@ -433,7 +433,7 @@ void DrawDeadPlayer(int x, int y, int sx, int sy) for (i = 0; i < MAX_PLRS; i++) { p = &plr[i]; - if (p->plractive && !p->_pHitPoints && p->plrlevel == (BYTE)currlevel && p->WorldX == x && p->WorldY == y) { + if (p->plractive && !p->_pHitPoints && p->plrlevel == (BYTE)currlevel && p->_px == x && p->_py == y) { pCelBuff = p->_pAnimData; if (!pCelBuff) { // app_fatal("Drawing dead player %d \"%s\": NULL Cel Buffer", i, p->_pName); @@ -723,7 +723,7 @@ static void scrollrt_draw_dungeon(int sx, int sy, int dx, int dy) DrawObject(sx, sy, dx, dy, 1); DrawItem(sx, sy, dx, dy, 1); if (bFlag & BFLAG_PLAYERLR) { - assert((DWORD)(sy-1) < MAXDUNY); + assert((DWORD)(sy - 1) < MAXDUNY); DrawPlayerHelper(sx, sy, -1, dx, dy); } if (bFlag & BFLAG_MONSTLR && negMon < 0) { @@ -1042,7 +1042,7 @@ void DrawView(int StartX, int StartY) DrawQuestLog(); } if (!chrflag && plr[myplr]._pStatPts != 0 && !spselflag - && (!questlog || SCREEN_HEIGHT >= SPANEL_HEIGHT + PANEL_HEIGHT + 74 || SCREEN_WIDTH >= 4 * SPANEL_WIDTH)) { + && (!questlog || SCREEN_HEIGHT >= SPANEL_HEIGHT + PANEL_HEIGHT + 74 || SCREEN_WIDTH >= 4 * SPANEL_WIDTH)) { DrawLevelUpIcon(); } if (uitemflag) { @@ -1317,7 +1317,7 @@ void scrollrt_draw_game_screen(BOOL draw_cursor) unlock_buf(0); } - DrawMain(hgt, 0, 0, 0, 0, 0); + DrawMain(hgt, FALSE, FALSE, FALSE, FALSE, FALSE); if (draw_cursor) { lock_buf(0); diff --git a/Source/setmaps.cpp b/Source/setmaps.cpp index d3f7da3cd..ac9c371dd 100644 --- a/Source/setmaps.cpp +++ b/Source/setmaps.cpp @@ -3,17 +3,17 @@ DEVILUTION_BEGIN_NAMESPACE // BUGFIX: constant data should be const -BYTE SkelKingTrans1[8] = { +BYTE SkelKingTrans1[] = { 19, 47, 26, 55, 26, 49, 30, 53 }; -BYTE SkelKingTrans2[8] = { +BYTE SkelKingTrans2[] = { 33, 19, 47, 29, 37, 29, 43, 39 }; -BYTE SkelKingTrans3[20] = { +BYTE SkelKingTrans3[] = { 27, 53, 35, 61, 27, 35, 34, 42, 45, 35, 53, 43, @@ -21,7 +21,7 @@ BYTE SkelKingTrans3[20] = { 31, 39, 49, 57 }; -BYTE SkelKingTrans4[28] = { +BYTE SkelKingTrans4[] = { 49, 45, 58, 51, 57, 31, 62, 37, 63, 31, 69, 40, @@ -31,7 +31,7 @@ BYTE SkelKingTrans4[28] = { 79, 43, 89, 53 }; -BYTE SkelChamTrans1[20] = { +BYTE SkelChamTrans1[] = { 43, 19, 50, 26, 51, 19, 59, 26, 35, 27, 42, 34, @@ -39,12 +39,12 @@ BYTE SkelChamTrans1[20] = { 50, 27, 59, 34 }; -BYTE SkelChamTrans2[8] = { +BYTE SkelChamTrans2[] = { 19, 31, 34, 47, 34, 35, 42, 42 }; -BYTE SkelChamTrans3[36] = { +BYTE SkelChamTrans3[] = { 43, 35, 50, 42, 51, 35, 62, 42, 63, 31, 66, 46, @@ -63,7 +63,7 @@ char *quest_level_names[] = { "Bone Chamber", "Maze", "Poisoned Water Supply", - "Archbishop Lazarus' Lair" + "Archbishop Lazarus' Lair", }; int ObjIndex(int x, int y) @@ -142,10 +142,10 @@ void LoadSetMap() LoadPreL1Dungeon("Levels\\L1Data\\SklKng1.DUN", 83, 45); LoadL1Dungeon("Levels\\L1Data\\SklKng2.DUN", 83, 45); LoadPalette("Levels\\L1Data\\L1_2.pal"); - DRLG_AreaTrans(sizeof(SkelKingTrans1) / 4, SkelKingTrans1); - DRLG_ListTrans(sizeof(SkelKingTrans2) / 4, SkelKingTrans2); - DRLG_AreaTrans(sizeof(SkelKingTrans3) / 4, SkelKingTrans3); - DRLG_ListTrans(sizeof(SkelKingTrans4) / 4, SkelKingTrans4); + DRLG_AreaTrans(sizeof(SkelKingTrans1) / 4, &SkelKingTrans1[0]); + DRLG_ListTrans(sizeof(SkelKingTrans2) / 4, &SkelKingTrans2[0]); + DRLG_AreaTrans(sizeof(SkelKingTrans3) / 4, &SkelKingTrans3[0]); + DRLG_ListTrans(sizeof(SkelKingTrans4) / 4, &SkelKingTrans4[0]); AddL1Objs(0, 0, MAXDUNX, MAXDUNY); AddSKingObjs(); InitSKingTriggers(); @@ -154,9 +154,9 @@ void LoadSetMap() LoadPreL2Dungeon("Levels\\L2Data\\Bonecha2.DUN", 69, 39); LoadL2Dungeon("Levels\\L2Data\\Bonecha1.DUN", 69, 39); LoadPalette("Levels\\L2Data\\L2_2.pal"); - DRLG_ListTrans(sizeof(SkelChamTrans1) / 4, SkelChamTrans1); - DRLG_AreaTrans(sizeof(SkelChamTrans2) / 4, SkelChamTrans2); - DRLG_ListTrans(sizeof(SkelChamTrans3) / 4, SkelChamTrans3); + DRLG_ListTrans(sizeof(SkelChamTrans1) / 4, &SkelChamTrans1[0]); + DRLG_AreaTrans(sizeof(SkelChamTrans2) / 4, &SkelChamTrans2[0]); + DRLG_ListTrans(sizeof(SkelChamTrans3) / 4, &SkelChamTrans3[0]); AddL2Objs(0, 0, MAXDUNX, MAXDUNY); AddSChamObjs(); InitSChambTriggers(); diff --git a/Source/spells.cpp b/Source/spells.cpp index 7f9dcd72b..402bb2636 100644 --- a/Source/spells.cpp +++ b/Source/spells.cpp @@ -148,8 +148,8 @@ static void PlacePlayer(int pnum) if (plr[pnum].plrlevel == currlevel) { for (i = 0; i < 8; i++) { - nx = plr[pnum].WorldX + plrxoff2[i]; - ny = plr[pnum].WorldY + plryoff2[i]; + nx = plr[pnum]._px + plrxoff2[i]; + ny = plr[pnum]._py + plryoff2[i]; if (PosOkPlayer(pnum, nx, ny)) { break; @@ -161,10 +161,10 @@ static void PlacePlayer(int pnum) for (max = 1, min = -1; min > -50 && !done; max++, min--) { for (y = min; y <= max && !done; y++) { - ny = plr[pnum].WorldY + y; + ny = plr[pnum]._py + y; for (x = min; x <= max && !done; x++) { - nx = plr[pnum].WorldX + x; + nx = plr[pnum]._px + x; if (PosOkPlayer(pnum, nx, ny)) { done = TRUE; @@ -174,8 +174,8 @@ static void PlacePlayer(int pnum) } } - plr[pnum].WorldX = nx; - plr[pnum].WorldY = ny; + plr[pnum]._px = nx; + plr[pnum]._py = ny; dPlayer[nx][ny] = pnum + 1; @@ -195,7 +195,7 @@ void DoResurrect(int pnum, int rid) int hp; if ((char)rid != -1) { - AddMissile(plr[rid].WorldX, plr[rid].WorldY, plr[rid].WorldX, plr[rid].WorldY, 0, MIS_RESURRECTBEAM, 0, pnum, 0, 0); + AddMissile(plr[rid]._px, plr[rid]._py, plr[rid]._px, plr[rid]._py, 0, MIS_RESURRECTBEAM, 0, pnum, 0, 0); } if (pnum == myplr) { diff --git a/Source/sync.cpp b/Source/sync.cpp index fcf63b4ec..c9a7ddc96 100644 --- a/Source/sync.cpp +++ b/Source/sync.cpp @@ -29,7 +29,7 @@ DWORD sync_all_monsters(const BYTE *pbBuf, DWORD dwMaxLen) pHdr->bLevel = currlevel; pHdr->wLen = 0; SyncPlrInv(pHdr); - /// ASSERT: assert(dwMaxLen <= 0xffff); + assert(dwMaxLen <= 0xffff); sync_one_monster(); for (i = 0; i < nummonsters && dwMaxLen >= sizeof(TSyncMonster); i++) { @@ -57,7 +57,7 @@ void sync_one_monster() for (i = 0; i < nummonsters; i++) { m = monstactive[i]; - sync_word_6AA708[m] = abs(plr[myplr].WorldX - monster[m]._mx) + abs(plr[myplr].WorldY - monster[m]._my); + sync_word_6AA708[m] = abs(plr[myplr]._px - monster[m]._mx) + abs(plr[myplr]._py - monster[m]._my); if (monster[m]._msquelch == 0) { sync_word_6AA708[m] += 0x1000; } else if (sgwLRU[m] != 0) { @@ -170,7 +170,7 @@ void SyncPlrInv(TSyncHeader *pHdr) pHdr->bItemI = -1; } - /// ASSERT: assert((DWORD) sgnSyncPInv < NUM_INVLOC); + assert((DWORD)sgnSyncPInv < NUM_INVLOC); pItem = &plr[myplr].InvBody[sgnSyncPInv]; if (pItem->_itype != ITYPE_NONE) { pHdr->bPInvLoc = sgnSyncPInv; @@ -217,7 +217,7 @@ DWORD sync_update(int pnum, const BYTE *pbBuf) pbBuf += sizeof(TSyncMonster); } - /// ASSERT: assert(wLen == 0); + assert(wLen == 0); return pHdr->wLen + sizeof(*pHdr); } @@ -239,7 +239,7 @@ void sync_monster(int pnum, const TSyncMonster *p) } } - delta = abs(plr[myplr].WorldX - monster[ndx]._mx) + abs(plr[myplr].WorldY - monster[ndx]._my); + delta = abs(plr[myplr]._px - monster[ndx]._mx) + abs(plr[myplr]._py - monster[ndx]._my); if (delta > 255) { delta = 255; } diff --git a/Source/textdat.cpp b/Source/textdat.cpp index 1c0aa3825..0e2dcaedb 100644 --- a/Source/textdat.cpp +++ b/Source/textdat.cpp @@ -785,7 +785,7 @@ const TextDataStruct alltext[] = { 1, 3, PS_NAR9 }, #endif { "Thank goodness you've returned!\nMuch has changed since you lived here, my friend. All was peaceful until the dark riders came and destroyed our village. Many were cut down where they stood, and those who took up arms were slain or dragged away to become slaves - or worse. The church at the edge of town has been desecrated and is being used for dark rituals. The screams that echo in the night are inhuman, but some of our townsfolk may yet survive. Follow the path that lies between my tavern and the blacksmith shop to find the church and save who you can. \n \nPerhaps I can tell you more if we speak again. Good luck.|", - 1, 5, TSFX_TAVERN0 } + 1, 5, TSFX_TAVERN0 }, }; /** unused */ const DWORD gdwAllTextEntries = 259; diff --git a/Source/textdat.h b/Source/textdat.h index 96445a648..2edb4f4ad 100644 --- a/Source/textdat.h +++ b/Source/textdat.h @@ -2,7 +2,7 @@ #ifndef __TEXTDAT_H__ #define __TEXTDAT_H__ -extern const TextDataStruct alltext[259]; +extern const TextDataStruct alltext[]; extern const DWORD gdwAllTextEntries; #endif /* __TEXTDAT_H__ */ diff --git a/Source/themes.cpp b/Source/themes.cpp index e3555bf3f..bc808b6ca 100644 --- a/Source/themes.cpp +++ b/Source/themes.cpp @@ -990,7 +990,7 @@ void UpdateL4Trans() for (j = 0; j < MAXDUNY; j++) { for (i = 0; i < MAXDUNX; i++) { - if (dTransVal[i][j]) { + if (dTransVal[i][j] != 0) { dTransVal[i][j] = 1; } } diff --git a/Source/tmsg.cpp b/Source/tmsg.cpp index 79ca960b4..737051672 100644 --- a/Source/tmsg.cpp +++ b/Source/tmsg.cpp @@ -40,7 +40,7 @@ void tmsg_add(BYTE *pbMsg, BYTE bLen) void tmsg_start() { - assert(! sgpTimedMsgHead); + assert(!sgpTimedMsgHead); } void tmsg_cleanup() diff --git a/Source/towners.cpp b/Source/towners.cpp index 7ddec7c3a..b291f5310 100644 --- a/Source/towners.cpp +++ b/Source/towners.cpp @@ -93,7 +93,7 @@ int TownCowY[3] = { 16, 14, 20 }; int TownCowDir[3] = { 1, 3, 4 }; int cowoffx[8] = { -1, 0, -1, -1, -1, 0, -1, -1 }; int cowoffy[8] = { -1, -1, -1, 0, -1, -1, -1, 0 }; -QuestTalkData Qtalklist[11] = { +QuestTalkData Qtalklist[] = { // clang-format off // _qinfra, _qblkm, _qgarb, _qzhar, _qveil, _qmod, _qbutch, _qbol, _qblind, _qblood, _qanvil, _qwarlrd, _qking, _qpw, _qbone, _qvb { TEXT_INFRA6, TEXT_MUSH6, -1, -1, TEXT_VEIL5, -1, TEXT_BUTCH5, TEXT_BANNER6, TEXT_BLIND5, TEXT_BLOOD5, TEXT_ANVIL6, TEXT_WARLRD5, TEXT_KING7, TEXT_POISON7, TEXT_BONE5, TEXT_VILE9 }, @@ -328,7 +328,7 @@ void InitCows() int x, y, xo, yo; //if ( pCowCels ) - // assertion_failed(__LINE__, __FILE__, "! pCowCels"); + // assertion_failed(__LINE__, __FILE__, "! pCowCels"); pCowCels = LoadFileInMem("Towners\\Animals\\Cow.CEL", NULL); for (i = 0; i < 3; i++) { x = TownCowX[i]; @@ -395,8 +395,8 @@ void TownCtrlMsg(int i) if (towner[i]._tbtcnt) { p = towner[i]._tVar1; - dx = abs(towner[i]._tx - plr[p].WorldX); - dy = abs(towner[i]._ty - plr[p].WorldY); + dx = abs(towner[i]._tx - plr[p]._px); + dy = abs(towner[i]._ty - plr[p]._py); if (dx >= 2 || dy >= 2) towner[i]._tbtcnt = 0; if (!towner[i]._tbtcnt) { @@ -429,12 +429,13 @@ void TownDead() tidx = GetActiveTowner(TOWN_DEADGUY); TownCtrlMsg(tidx); if (!qtextflag) { - if ((quests[Q_BUTCHER]._qactive != QUEST_ACTIVE || quests[Q_BUTCHER]._qlog) && quests[Q_BUTCHER]._qactive != QUEST_INIT) { + if (quests[Q_BUTCHER]._qactive == QUEST_ACTIVE && quests[Q_BUTCHER]._qlog == 0) { + return; + } + if (quests[Q_BUTCHER]._qactive != QUEST_INIT) { towner[tidx]._tAnimDelay = 1000; towner[tidx]._tAnimFrame = 1; strcpy(towner[tidx]._tName, "Slain Townsman"); - } else { - return; } } if (quests[Q_BUTCHER]._qactive != QUEST_INIT) @@ -582,8 +583,8 @@ void TalkToTowner(int p, int t) rv2 = random_(6, 4); /* unused */ rv3 = random_(6, 5); /* unused */ - dx = abs(plr[p].WorldX - towner[t]._tx); - dy = abs(plr[p].WorldY - towner[t]._ty); + dx = abs(plr[p]._px - towner[t]._tx); + dy = abs(plr[p]._py - towner[t]._ty); #ifdef _DEBUG if (!debug_mode_key_d && (dx >= 2 || dy >= 2)) { return; @@ -648,15 +649,17 @@ void TalkToTowner(int p, int t) InitQTextMsg(TEXT_BANNER2); towner[t]._tMsgSaid = TRUE; } - if (quests[Q_LTBANNER]._qvar2 == 1 && PlrHasItem(p, IDI_BANNER, &i) != NULL && !towner[t]._tMsgSaid) { - quests[Q_LTBANNER]._qactive = QUEST_DONE; - quests[Q_LTBANNER]._qvar1 = 3; - RemoveInvItem(p, i); - CreateItem(UITEM_HARCREST, towner[t]._tx, towner[t]._ty + 1); - towner[t]._tbtcnt = 150; - towner[t]._tVar1 = p; - InitQTextMsg(TEXT_BANNER3); - towner[t]._tMsgSaid = TRUE; + if (quests[Q_LTBANNER]._qvar2 == 1 && PlrHasItem(p, IDI_BANNER, &i) != NULL) { + if (!towner[t]._tMsgSaid) { + quests[Q_LTBANNER]._qactive = QUEST_DONE; + quests[Q_LTBANNER]._qvar1 = 3; + RemoveInvItem(p, i); + CreateItem(UITEM_HARCREST, towner[t]._tx, towner[t]._ty + 1); + towner[t]._tbtcnt = 150; + towner[t]._tVar1 = p; + InitQTextMsg(TEXT_BANNER3); + towner[t]._tMsgSaid = TRUE; + } } } if (!qtextflag) { @@ -712,16 +715,18 @@ void TalkToTowner(int p, int t) InitQTextMsg(TEXT_INFRA5); towner[t]._tMsgSaid = TRUE; } - if (quests[Q_ROCK]._qvar2 == 1 && PlrHasItem(p, IDI_ROCK, &i) != NULL && !towner[t]._tMsgSaid) { - quests[Q_ROCK]._qactive = QUEST_DONE; - quests[Q_ROCK]._qvar2 = 2; - quests[Q_ROCK]._qvar1 = 2; - RemoveInvItem(p, i); - CreateItem(UITEM_INFRARING, towner[t]._tx, towner[t]._ty + 1); - towner[t]._tbtcnt = 150; - towner[t]._tVar1 = p; - InitQTextMsg(TEXT_INFRA7); - towner[t]._tMsgSaid = TRUE; + if (quests[Q_ROCK]._qvar2 == 1 && PlrHasItem(p, IDI_ROCK, &i) != NULL) { + if (!towner[t]._tMsgSaid) { + quests[Q_ROCK]._qactive = QUEST_DONE; + quests[Q_ROCK]._qvar2 = 2; + quests[Q_ROCK]._qvar1 = 2; + RemoveInvItem(p, i); + CreateItem(UITEM_INFRARING, towner[t]._tx, towner[t]._ty + 1); + towner[t]._tbtcnt = 150; + towner[t]._tVar1 = p; + InitQTextMsg(TEXT_INFRA7); + towner[t]._tMsgSaid = TRUE; + } } } if (plr[p]._pLvlVisited[9] && quests[Q_ANVIL]._qactive != QUEST_NOTAVAIL) { @@ -877,16 +882,16 @@ void TalkToTowner(int p, int t) towner[t]._tbtcnt = 150; towner[t]._tVar1 = p; InitQTextMsg(TEXT_VILE1); + towner[t]._tMsgSaid = TRUE; quests[Q_BETRAYER]._qactive = QUEST_ACTIVE; quests[Q_BETRAYER]._qlog = TRUE; - towner[t]._tMsgSaid = TRUE; } else if (quests[Q_BETRAYER]._qactive == QUEST_DONE && quests[Q_BETRAYER]._qvar1 == 7) { quests[Q_BETRAYER]._qvar1 = 8; towner[t]._tbtcnt = 150; towner[t]._tVar1 = p; InitQTextMsg(TEXT_VILE3); - quests[Q_DIABLO]._qlog = TRUE; towner[t]._tMsgSaid = TRUE; + quests[Q_DIABLO]._qlog = TRUE; } } if (gbMaxPlayers != 1) { @@ -914,8 +919,9 @@ void TalkToTowner(int p, int t) StartStore(STORE_STORY); } } - } else if (towner[t]._ttype == TOWN_COW && !qtextflag) { - CowSFX(p); + } else if (towner[t]._ttype == TOWN_COW) { + if (!qtextflag) + CowSFX(p); } } @@ -932,7 +938,7 @@ void CowSFX(int pnum) } #else if (sgdwCowClicks >= 8) { - PlaySfxLoc(TSFX_COW1, plr[pnum].WorldX, plr[pnum].WorldY + 5); + PlaySfxLoc(TSFX_COW1, plr[pnum]._px, plr[pnum]._py + 5); sgdwCowClicks = 4; CowPlaying = snSFX[sgnCowMsg][plr[pnum]._pClass]; /* snSFX is local */ sgnCowMsg++; @@ -942,7 +948,7 @@ void CowSFX(int pnum) CowPlaying = sgdwCowClicks == 4 ? TSFX_COW2 : TSFX_COW1; } #endif - PlaySfxLoc(CowPlaying, plr[pnum].WorldX, plr[pnum].WorldY); + PlaySfxLoc(CowPlaying, plr[pnum]._px, plr[pnum]._py); } } diff --git a/Source/towners.h b/Source/towners.h index 310d84e3c..c02191c25 100644 --- a/Source/towners.h +++ b/Source/towners.h @@ -40,6 +40,6 @@ void CowSFX(int pnum); /* data */ -extern QuestTalkData Qtalklist[11]; +extern QuestTalkData Qtalklist[]; #endif /* __TOWNERS_H__ */ diff --git a/Source/trigs.cpp b/Source/trigs.cpp index b34d364e1..683c86f9e 100644 --- a/Source/trigs.cpp +++ b/Source/trigs.cpp @@ -653,7 +653,7 @@ void CheckTriggers() return; for (i = 0; i < numtrigs; i++) { - if (plr[myplr].WorldX != trigs[i]._tx || plr[myplr].WorldY != trigs[i]._ty) { + if (plr[myplr]._px != trigs[i]._tx || plr[myplr]._py != trigs[i]._ty) { continue; } @@ -661,7 +661,7 @@ void CheckTriggers() case WM_DIABNEXTLVL: #ifdef SPAWN if (currlevel >= 2) { - NetSendCmdLoc(TRUE, CMD_WALKXY, plr[myplr].WorldX, plr[myplr].WorldY + 1); + NetSendCmdLoc(TRUE, CMD_WALKXY, plr[myplr]._px, plr[myplr]._py + 1); PlaySFX(PS_WARR18); InitDiabloMsg(EMSG_NOT_IN_SHAREWARE); } else { @@ -687,22 +687,22 @@ void CheckTriggers() if (trigs[i]._tlvl == 5 && plr[myplr]._pLevel < 8) { abort = TRUE; - x = plr[myplr].WorldX; - y = plr[myplr].WorldY + 1; + x = plr[myplr]._px; + y = plr[myplr]._py + 1; abortflag = EMSG_REQUIRES_LVL_8; } if (trigs[i]._tlvl == 9 && plr[myplr]._pLevel < 13) { abort = TRUE; - x = plr[myplr].WorldX + 1; - y = plr[myplr].WorldY; + x = plr[myplr]._px + 1; + y = plr[myplr]._py; abortflag = EMSG_REQUIRES_LVL_13; } if (trigs[i]._tlvl == 13 && plr[myplr]._pLevel < 17) { abort = TRUE; - x = plr[myplr].WorldX; - y = plr[myplr].WorldY + 1; + x = plr[myplr]._px; + y = plr[myplr]._py + 1; abortflag = EMSG_REQUIRES_LVL_17; } diff --git a/Source/wave.cpp b/Source/wave.cpp index f7b6358aa..36f0a6d64 100644 --- a/Source/wave.cpp +++ b/Source/wave.cpp @@ -3,9 +3,9 @@ DEVILUTION_BEGIN_NAMESPACE -BOOL WCloseFile(HANDLE file) +void WCloseFile(HANDLE file) { - return SFileCloseFile(file); + SFileCloseFile(file); } LONG WGetFileSize(HANDLE hsFile, DWORD *lpFileSizeHigh, const char *FileName) diff --git a/Source/wave.h b/Source/wave.h index bfb9fdc4f..1830b95b0 100644 --- a/Source/wave.h +++ b/Source/wave.h @@ -2,7 +2,7 @@ #ifndef __WAVE_H__ #define __WAVE_H__ -BOOL WCloseFile(HANDLE file); +void WCloseFile(HANDLE file); LONG WGetFileSize(HANDLE hsFile, DWORD *lpFileSizeHigh, const char *FileName); void WGetFileArchive(HANDLE hsFile, DWORD *retry, const char *FileName); BOOL WOpenFile(const char *FileName, HANDLE *phsFile, BOOL mayNotExist); diff --git a/SourceT/effects_test.cpp b/SourceT/effects_test.cpp index 4a7f7a2f3..95d3c1303 100644 --- a/SourceT/effects_test.cpp +++ b/SourceT/effects_test.cpp @@ -1,9 +1,10 @@ #include #include "all.h" -TEST(Drlg_l4, calc_snd_position_center) { - dvl::plr[dvl::myplr].WorldX = 50; - dvl::plr[dvl::myplr].WorldY = 50; +TEST(Drlg_l4, calc_snd_position_center) +{ + dvl::plr[dvl::myplr]._px = 50; + dvl::plr[dvl::myplr]._py = 50; int plVolume = 0; int plPan = 0; EXPECT_EQ(dvl::calc_snd_position(50, 50, &plVolume, &plPan), true); @@ -11,9 +12,10 @@ TEST(Drlg_l4, calc_snd_position_center) { EXPECT_EQ(plPan, 0); } -TEST(Drlg_l4, calc_snd_position_near) { - dvl::plr[dvl::myplr].WorldX = 50; - dvl::plr[dvl::myplr].WorldY = 50; +TEST(Drlg_l4, calc_snd_position_near) +{ + dvl::plr[dvl::myplr]._px = 50; + dvl::plr[dvl::myplr]._py = 50; int plVolume = 0; int plPan = 0; EXPECT_EQ(dvl::calc_snd_position(55, 50, &plVolume, &plPan), true); @@ -21,9 +23,10 @@ TEST(Drlg_l4, calc_snd_position_near) { EXPECT_EQ(plPan, 1280); } -TEST(Drlg_l4, calc_snd_position_out_of_range) { - dvl::plr[dvl::myplr].WorldX = 12; - dvl::plr[dvl::myplr].WorldY = 12; +TEST(Drlg_l4, calc_snd_position_out_of_range) +{ + dvl::plr[dvl::myplr]._px = 12; + dvl::plr[dvl::myplr]._py = 12; int plVolume = 0; int plPan = 0; EXPECT_EQ(dvl::calc_snd_position(112, 112, &plVolume, &plPan), false); @@ -31,9 +34,10 @@ TEST(Drlg_l4, calc_snd_position_out_of_range) { EXPECT_EQ(plPan, 0); } -TEST(Drlg_l4, calc_snd_position_extream_right) { - dvl::plr[dvl::myplr].WorldX = 50; - dvl::plr[dvl::myplr].WorldY = 50; +TEST(Drlg_l4, calc_snd_position_extream_right) +{ + dvl::plr[dvl::myplr]._px = 50; + dvl::plr[dvl::myplr]._py = 50; int plVolume = 0; int plPan = 0; EXPECT_EQ(dvl::calc_snd_position(76, 50, &plVolume, &plPan), false); @@ -41,9 +45,10 @@ TEST(Drlg_l4, calc_snd_position_extream_right) { EXPECT_GT(plPan, 6400); } -TEST(Drlg_l4, calc_snd_position_extream_left) { - dvl::plr[dvl::myplr].WorldX = 50; - dvl::plr[dvl::myplr].WorldY = 50; +TEST(Drlg_l4, calc_snd_position_extream_left) +{ + dvl::plr[dvl::myplr]._px = 50; + dvl::plr[dvl::myplr]._py = 50; int plVolume = 0; int plPan = 0; EXPECT_EQ(dvl::calc_snd_position(24, 50, &plVolume, &plPan), false); diff --git a/SourceX/controls/plrctrls.cpp b/SourceX/controls/plrctrls.cpp index d1567fe54..c6325a392 100644 --- a/SourceX/controls/plrctrls.cpp +++ b/SourceX/controls/plrctrls.cpp @@ -44,11 +44,11 @@ int GetRotaryDistance(int x, int y) { int d, d1, d2; - if (plr[myplr]._px == x && plr[myplr]._py == y) + if (plr[myplr]._pfutx == x && plr[myplr]._pfuty == y) return -1; d1 = plr[myplr]._pdir; - d2 = GetDirection(plr[myplr]._px, plr[myplr]._py, x, y); + d2 = GetDirection(plr[myplr]._pfutx, plr[myplr]._pfuty, x, y); d = abs(d1 - d2); if (d > 4) @@ -64,7 +64,7 @@ int GetRotaryDistance(int x, int y) */ int GetMinDistance(int dx, int dy) { - return std::max(abs(plr[myplr]._px - dx), abs(plr[myplr]._py - dy)); + return std::max(abs(plr[myplr]._pfutx - dx), abs(plr[myplr]._pfuty - dy)); } /** @@ -81,7 +81,7 @@ int GetDistance(int dx, int dy, int maxDistance) } char walkpath[MAX_PATH_LENGTH]; - int steps = FindPath(PosOkPlayer, myplr, plr[myplr]._px, plr[myplr]._py, dx, dy, walkpath); + int steps = FindPath(PosOkPlayer, myplr, plr[myplr]._pfutx, plr[myplr]._pfuty, dx, dy, walkpath); if (steps > maxDistance) return 0; @@ -95,16 +95,16 @@ int GetDistance(int dx, int dy, int maxDistance) */ int GetDistanceRanged(int dx, int dy) { - int a = plr[myplr]._px - dx; - int b = plr[myplr]._py - dy; + int a = plr[myplr]._pfutx - dx; + int b = plr[myplr]._pfuty - dy; return sqrt(a * a + b * b); } void FindItemOrObject() { - int mx = plr[myplr]._px; - int my = plr[myplr]._py; + int mx = plr[myplr]._pfutx; + int my = plr[myplr]._pfuty; int rotations = 5; // As the player can not stand on the edge fo the map this is safe from OOB @@ -201,8 +201,8 @@ void FindRangedTarget() // The first MAX_PLRS monsters are reserved for players' golems. for (int mi = MAX_PLRS; mi < MAXMONSTERS; mi++) { const auto &monst = monster[mi]; - const int mx = monst._mx; - const int my = monst._my; + const int mx = monst._mfutx; + const int my = monst._mfuty; if (!CanTargetMonster(mi)) continue; @@ -238,8 +238,8 @@ void FindMeleeTarget() std::list queue; { - const int start_x = plr[myplr]._px; - const int start_y = plr[myplr]._py; + const int start_x = plr[myplr]._pfutx; + const int start_y = plr[myplr]._pfuty; visited[start_x][start_y] = true; queue.push_back({ start_x, start_y, 0 }); } @@ -319,8 +319,8 @@ void CheckPlayerNearby() for (int i = 0; i < MAX_PLRS; i++) { if (i == myplr) continue; - const int mx = plr[i].WorldX; - const int my = plr[i].WorldY; + const int mx = plr[i]._pfutx; + const int my = plr[i]._pfuty; if (dPlayer[mx][my] == 0 || !(dFlags[mx][my] & BFLAG_LIT) || (plr[i]._pHitPoints == 0 && spl != SPL_RESURRECT)) @@ -801,8 +801,8 @@ bool IsPathBlocked(int x, int y, int dir) void WalkInDir(MoveDirection dir) { - const int x = plr[myplr]._px; - const int y = plr[myplr]._py; + const int x = plr[myplr]._pfutx; + const int y = plr[myplr]._pfuty; if (dir.x == MoveDirectionX::NONE && dir.y == MoveDirectionY::NONE) { if (sgbControllerActive && plr[myplr].walkpath[0] != WALK_NONE && plr[myplr].destAction == ACTION_NONE) @@ -872,7 +872,8 @@ struct RightStickAccumulator { } // namespace -bool IsAutomapActive() { +bool IsAutomapActive() +{ return automapflag && leveltype != DTYPE_TOWN; } @@ -1022,8 +1023,8 @@ void UpdateSpellTarget() if (plr[myplr]._pRSpell == SPL_TELEPORT) range = 4; - cursmx = player._px + kOffsets[player._pdir][0] * range; - cursmy = player._py + kOffsets[player._pdir][1] * range; + cursmx = player._pfutx + kOffsets[player._pdir][0] * range; + cursmy = player._pfuty + kOffsets[player._pdir][1] * range; } /** @@ -1031,12 +1032,12 @@ void UpdateSpellTarget() */ bool TryDropItem() { - cursmx = plr[myplr].WorldX + 1; - cursmy = plr[myplr].WorldY; + cursmx = plr[myplr]._pfutx + 1; + cursmy = plr[myplr]._pfuty; if (!DropItemBeforeTrig()) { // Try to drop on the other side - cursmx = plr[myplr].WorldX; - cursmy = plr[myplr].WorldY + 1; + cursmx = plr[myplr]._pfutx; + cursmy = plr[myplr]._pfuty + 1; DropItemBeforeTrig(); } diff --git a/SourceX/sound.cpp b/SourceX/sound.cpp index 004d3b7a6..ef73ee6c7 100644 --- a/SourceX/sound.cpp +++ b/SourceX/sound.cpp @@ -188,7 +188,7 @@ void music_start(int nTrack) { BOOL success; - assert((DWORD) nTrack < NUM_MUSIC); + assert((DWORD)nTrack < NUM_MUSIC); music_stop(); if (gbMusicOn) { success = SFileOpenFile(sgszMusicTracks[nTrack], &sghMusic); diff --git a/defs.h b/defs.h index 4b30f30c8..161810253 100644 --- a/defs.h +++ b/defs.h @@ -4,6 +4,10 @@ * Global definitions and Macros. */ +#define DIABOOL BOOL +#define GAME_NAME "DIABLO" +#define APP_NAME "Diablo" + #define DMAXX 40 #define DMAXY 40 diff --git a/enums.h b/enums.h index 6ea64ad34..7ee99c270 100644 --- a/enums.h +++ b/enums.h @@ -1167,14 +1167,14 @@ typedef enum _sfx_id { } _sfx_id; typedef enum sfx_flag { - SFX_STREAM = 0x01, - SFX_MISC = 0x02, - SFX_UI = 0x04, - SFX_MONK = 0x08, - SFX_ROGUE = 0x10, - SFX_WARRIOR = 0x20, - SFX_SORCEROR = 0x40, - SFX_LOADED = 0x80, + sfx_STREAM = 0x01, + sfx_MISC = 0x02, + sfx_UI = 0x04, + sfx_MONK = 0x08, + sfx_ROGUE = 0x10, + sfx_WARRIOR = 0x20, + sfx_SORCEROR = 0x40, + sfx_LOADED = 0x80, } sfx_flag; typedef enum item_equip_type { @@ -1482,7 +1482,8 @@ typedef enum _monster_id { MT_ADVOCATE = 0x6C, MT_GOLEM = 0x6D, MT_DIABLO = 0x6E, - NUM_MTYPES, + MT_DARKMAGE = 0x6F, + NUM_MTYPES = 0x6F, /// BUGFIX the count is off by one } _monster_id; // this enum contains indexes from UniqMonst array for special unique monsters (usually quest related) @@ -1802,7 +1803,7 @@ typedef enum _speech_id { TEXT_BOOK31 = 0xFF, TEXT_BOOK32 = 0x100, TEXT_BOOK33 = 0x101, - TEXT_INTRO = 0x102 + TEXT_INTRO = 0x102, } _speech_id; typedef enum object_graphic_id { @@ -2545,22 +2546,23 @@ typedef enum _setlevels { } _setlevels; typedef enum quest_id { - Q_ROCK = 0x0, - Q_MUSHROOM = 0x1, - Q_GARBUD = 0x2, - Q_ZHAR = 0x3, - Q_VEIL = 0x4, - Q_DIABLO = 0x5, - Q_BUTCHER = 0x6, - Q_LTBANNER = 0x7, - Q_BLIND = 0x8, - Q_BLOOD = 0x9, - Q_ANVIL = 0xA, - Q_WARLORD = 0xB, - Q_SKELKING = 0xC, - Q_PWATER = 0xD, - Q_SCHAMB = 0xE, - Q_BETRAYER = 0xF + Q_ROCK = 0x0, + Q_MUSHROOM = 0x1, + Q_GARBUD = 0x2, + Q_ZHAR = 0x3, + Q_VEIL = 0x4, + Q_DIABLO = 0x5, + Q_BUTCHER = 0x6, + Q_LTBANNER = 0x7, + Q_BLIND = 0x8, + Q_BLOOD = 0x9, + Q_ANVIL = 0xA, + Q_WARLORD = 0xB, + Q_SKELKING = 0xC, + Q_PWATER = 0xD, + Q_SCHAMB = 0xE, + Q_BETRAYER = 0xF, + Q_INVALID = -1, } quest_id; typedef enum quest_state { @@ -2710,9 +2712,9 @@ typedef enum plr_class { } plr_class; typedef enum _ui_classes { - UI_WARRIOR = 0x0, - UI_ROGUE = 0x1, - UI_SORCERER = 0x2, + UI_WARRIOR = 0x0, + UI_ROGUE = 0x1, + UI_SORCERER = 0x2, UI_NUM_CLASSES, } _ui_classes; diff --git a/structs.h b/structs.h index 19b9ef62f..fe87ff40e 100644 --- a/structs.h +++ b/structs.h @@ -185,10 +185,10 @@ typedef struct PlayerStruct { int destParam3; int destParam4; int plrlevel; - int WorldX; - int WorldY; int _px; int _py; + int _pfutx; + int _pfuty; int _ptargx; int _ptargy; int _pownerx; @@ -1338,7 +1338,7 @@ typedef struct _SNETUIDATA { void (*profilecallback)(); const char **profilefields; void (*profilebitmapcallback)(); - int(*selectnamecallback)( + int (*selectnamecallback)( const struct _SNETPROGRAMDATA *, const struct _SNETPLAYERDATA *, const struct _SNETUIDATA *,