|
|
|
@ -142,12 +142,12 @@ void run_game_loop(unsigned int uMsg) |
|
|
|
gbGameLoopStartup = TRUE; |
|
|
|
gbGameLoopStartup = TRUE; |
|
|
|
nthread_ignore_mutex(FALSE); |
|
|
|
nthread_ignore_mutex(FALSE); |
|
|
|
|
|
|
|
|
|
|
|
while(gbRunGame) { |
|
|
|
while (gbRunGame) { |
|
|
|
diablo_color_cyc_logic(); |
|
|
|
diablo_color_cyc_logic(); |
|
|
|
if(PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE)) { |
|
|
|
if (PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE)) { |
|
|
|
SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL); |
|
|
|
SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL); |
|
|
|
while(PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { |
|
|
|
while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { |
|
|
|
if(msg.message == WM_QUIT) { |
|
|
|
if (msg.message == WM_QUIT) { |
|
|
|
gbRunGameResult = FALSE; |
|
|
|
gbRunGameResult = FALSE; |
|
|
|
gbRunGame = FALSE; |
|
|
|
gbRunGame = FALSE; |
|
|
|
break; |
|
|
|
break; |
|
|
|
@ -157,10 +157,10 @@ void run_game_loop(unsigned int uMsg) |
|
|
|
} |
|
|
|
} |
|
|
|
bLoop = gbRunGame && nthread_has_500ms_passed(FALSE); |
|
|
|
bLoop = gbRunGame && nthread_has_500ms_passed(FALSE); |
|
|
|
SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_NORMAL); |
|
|
|
SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_NORMAL); |
|
|
|
if(!bLoop) { |
|
|
|
if (!bLoop) { |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
} else if(!nthread_has_500ms_passed(FALSE)) { |
|
|
|
} else if (!nthread_has_500ms_passed(FALSE)) { |
|
|
|
#ifdef SLEEPFIX |
|
|
|
#ifdef SLEEPFIX |
|
|
|
Sleep(1); |
|
|
|
Sleep(1); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
@ -173,7 +173,7 @@ void run_game_loop(unsigned int uMsg) |
|
|
|
DrawAndBlit(); |
|
|
|
DrawAndBlit(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(gbMaxPlayers > 1) { |
|
|
|
if (gbMaxPlayers > 1) { |
|
|
|
pfile_write_hero(); |
|
|
|
pfile_write_hero(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -187,7 +187,7 @@ void run_game_loop(unsigned int uMsg) |
|
|
|
/// ASSERT: assert(saveProc == GM_Game);
|
|
|
|
/// ASSERT: assert(saveProc == GM_Game);
|
|
|
|
free_game(); |
|
|
|
free_game(); |
|
|
|
|
|
|
|
|
|
|
|
if(cineflag) { |
|
|
|
if (cineflag) { |
|
|
|
cineflag = FALSE; |
|
|
|
cineflag = FALSE; |
|
|
|
DoEnding(); |
|
|
|
DoEnding(); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -323,24 +323,24 @@ void diablo_parse_flags(char *args) |
|
|
|
int i; |
|
|
|
int i; |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
while(*args != '\0') { |
|
|
|
while (*args != '\0') { |
|
|
|
while(isspace(*args)) { |
|
|
|
while (isspace(*args)) { |
|
|
|
args++; |
|
|
|
args++; |
|
|
|
} |
|
|
|
} |
|
|
|
if(_strnicmp("dd_emulate", args, strlen("dd_emulate")) == 0) { |
|
|
|
if (_strnicmp("dd_emulate", args, strlen("dd_emulate")) == 0) { |
|
|
|
gbEmulate = 1; |
|
|
|
gbEmulate = 1; |
|
|
|
args += strlen("dd_emulate"); |
|
|
|
args += strlen("dd_emulate"); |
|
|
|
} else if(_strnicmp("dd_backbuf", args, strlen("dd_backbuf")) == 0) { |
|
|
|
} else if (_strnicmp("dd_backbuf", args, strlen("dd_backbuf")) == 0) { |
|
|
|
gbBackBuf = 1; |
|
|
|
gbBackBuf = 1; |
|
|
|
args += strlen("dd_backbuf"); |
|
|
|
args += strlen("dd_backbuf"); |
|
|
|
} else if(_strnicmp("ds_noduplicates", args, strlen("ds_noduplicates")) == 0) { |
|
|
|
} else if (_strnicmp("ds_noduplicates", args, strlen("ds_noduplicates")) == 0) { |
|
|
|
gbDupSounds = 0; |
|
|
|
gbDupSounds = 0; |
|
|
|
args += strlen("ds_noduplicates"); |
|
|
|
args += strlen("ds_noduplicates"); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
c = tolower(*args); |
|
|
|
c = tolower(*args); |
|
|
|
args++; |
|
|
|
args++; |
|
|
|
#ifdef _DEBUG |
|
|
|
#ifdef _DEBUG |
|
|
|
switch(c) { |
|
|
|
switch (c) { |
|
|
|
case '^': |
|
|
|
case '^': |
|
|
|
debug_mode_key_inverted_v = 1; |
|
|
|
debug_mode_key_inverted_v = 1; |
|
|
|
break; |
|
|
|
break; |
|
|
|
@ -348,7 +348,7 @@ void diablo_parse_flags(char *args) |
|
|
|
debug_mode_dollar_sign = 1; |
|
|
|
debug_mode_dollar_sign = 1; |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 'b': |
|
|
|
case 'b': |
|
|
|
/*
|
|
|
|
/*
|
|
|
|
debug_mode_key_b = 1; |
|
|
|
debug_mode_key_b = 1; |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
break; |
|
|
|
break; |
|
|
|
@ -363,7 +363,7 @@ void diablo_parse_flags(char *args) |
|
|
|
debug_mode_key_i = 1; |
|
|
|
debug_mode_key_i = 1; |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 'j': |
|
|
|
case 'j': |
|
|
|
/*
|
|
|
|
/*
|
|
|
|
while(isspace(*args)) { |
|
|
|
while(isspace(*args)) { |
|
|
|
args++; |
|
|
|
args++; |
|
|
|
} |
|
|
|
} |
|
|
|
@ -378,20 +378,20 @@ void diablo_parse_flags(char *args) |
|
|
|
case 'l': |
|
|
|
case 'l': |
|
|
|
setlevel = 0; |
|
|
|
setlevel = 0; |
|
|
|
leveldebug = 1; |
|
|
|
leveldebug = 1; |
|
|
|
while(isspace(*args)) { |
|
|
|
while (isspace(*args)) { |
|
|
|
args++; |
|
|
|
args++; |
|
|
|
} |
|
|
|
} |
|
|
|
i = 0; |
|
|
|
i = 0; |
|
|
|
while(isdigit(*args)) { |
|
|
|
while (isdigit(*args)) { |
|
|
|
i = *args + 10 * i - '0'; |
|
|
|
i = *args + 10 * i - '0'; |
|
|
|
args++; |
|
|
|
args++; |
|
|
|
} |
|
|
|
} |
|
|
|
leveltype = i; |
|
|
|
leveltype = i; |
|
|
|
while(isspace(*args)) { |
|
|
|
while (isspace(*args)) { |
|
|
|
args++; |
|
|
|
args++; |
|
|
|
} |
|
|
|
} |
|
|
|
i = 0; |
|
|
|
i = 0; |
|
|
|
while(isdigit(*args)) { |
|
|
|
while (isdigit(*args)) { |
|
|
|
i = *args + 10 * i - '0'; |
|
|
|
i = *args + 10 * i - '0'; |
|
|
|
args++; |
|
|
|
args++; |
|
|
|
} |
|
|
|
} |
|
|
|
@ -400,11 +400,11 @@ void diablo_parse_flags(char *args) |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 'm': |
|
|
|
case 'm': |
|
|
|
monstdebug = 1; |
|
|
|
monstdebug = 1; |
|
|
|
while(isspace(*args)) { |
|
|
|
while (isspace(*args)) { |
|
|
|
args++; |
|
|
|
args++; |
|
|
|
} |
|
|
|
} |
|
|
|
i = 0; |
|
|
|
i = 0; |
|
|
|
while(isdigit(*args)) { |
|
|
|
while (isdigit(*args)) { |
|
|
|
i = *args + 10 * i - '0'; |
|
|
|
i = *args + 10 * i - '0'; |
|
|
|
args++; |
|
|
|
args++; |
|
|
|
} |
|
|
|
} |
|
|
|
@ -414,22 +414,22 @@ void diablo_parse_flags(char *args) |
|
|
|
showintrodebug = 0; |
|
|
|
showintrodebug = 0; |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 'q': |
|
|
|
case 'q': |
|
|
|
while(isspace(*args)) { |
|
|
|
while (isspace(*args)) { |
|
|
|
args++; |
|
|
|
args++; |
|
|
|
} |
|
|
|
} |
|
|
|
i = 0; |
|
|
|
i = 0; |
|
|
|
while(isdigit(*args)) { |
|
|
|
while (isdigit(*args)) { |
|
|
|
i = *args + 10 * i - '0'; |
|
|
|
i = *args + 10 * i - '0'; |
|
|
|
args++; |
|
|
|
args++; |
|
|
|
} |
|
|
|
} |
|
|
|
questdebug = i; |
|
|
|
questdebug = i; |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 'r': |
|
|
|
case 'r': |
|
|
|
while(isspace(*args)) { |
|
|
|
while (isspace(*args)) { |
|
|
|
args++; |
|
|
|
args++; |
|
|
|
} |
|
|
|
} |
|
|
|
i = 0; |
|
|
|
i = 0; |
|
|
|
while(isdigit(*args)) { |
|
|
|
while (isdigit(*args)) { |
|
|
|
i = *args + 10 * i - '0'; |
|
|
|
i = *args + 10 * i - '0'; |
|
|
|
args++; |
|
|
|
args++; |
|
|
|
} |
|
|
|
} |
|
|
|
@ -441,11 +441,11 @@ void diablo_parse_flags(char *args) |
|
|
|
case 't': |
|
|
|
case 't': |
|
|
|
leveldebug = 1; |
|
|
|
leveldebug = 1; |
|
|
|
setlevel = 1; |
|
|
|
setlevel = 1; |
|
|
|
while(isspace(*args)) { |
|
|
|
while (isspace(*args)) { |
|
|
|
args++; |
|
|
|
args++; |
|
|
|
} |
|
|
|
} |
|
|
|
i = 0; |
|
|
|
i = 0; |
|
|
|
while(isdigit(*args)) { |
|
|
|
while (isdigit(*args)) { |
|
|
|
i = *args + 10 * i - '0'; |
|
|
|
i = *args + 10 * i - '0'; |
|
|
|
args++; |
|
|
|
args++; |
|
|
|
} |
|
|
|
} |
|
|
|
@ -525,29 +525,29 @@ void diablo_reload_process(HINSTANCE hInstance) |
|
|
|
|
|
|
|
|
|
|
|
GetModuleFileName(hInstance, szFileName, sizeof(szFileName)); |
|
|
|
GetModuleFileName(hInstance, szFileName, sizeof(szFileName)); |
|
|
|
wsprintf(szReload, "Reload-%s", szFileName); |
|
|
|
wsprintf(szReload, "Reload-%s", szFileName); |
|
|
|
for(s = szReload; *s != '\0'; s++) { |
|
|
|
for (s = szReload; *s != '\0'; s++) { |
|
|
|
if(*s == '\\') { |
|
|
|
if (*s == '\\') { |
|
|
|
*s = '/'; |
|
|
|
*s = '/'; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
GetSystemInfo(&sinf); |
|
|
|
GetSystemInfo(&sinf); |
|
|
|
dwSize = sinf.dwPageSize; |
|
|
|
dwSize = sinf.dwPageSize; |
|
|
|
if(dwSize < 4096) { |
|
|
|
if (dwSize < 4096) { |
|
|
|
dwSize = 4096; |
|
|
|
dwSize = 4096; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
hMap = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, SEC_COMMIT | PAGE_READWRITE, 0, dwSize, szReload); |
|
|
|
hMap = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, SEC_COMMIT | PAGE_READWRITE, 0, dwSize, szReload); |
|
|
|
bNoExist = GetLastError() != ERROR_ALREADY_EXISTS; |
|
|
|
bNoExist = GetLastError() != ERROR_ALREADY_EXISTS; |
|
|
|
if(hMap == NULL) { |
|
|
|
if (hMap == NULL) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
plMap = (long *)MapViewOfFile(hMap, FILE_MAP_ALL_ACCESS, 0, 0, dwSize); |
|
|
|
plMap = (long *)MapViewOfFile(hMap, FILE_MAP_ALL_ACCESS, 0, 0, dwSize); |
|
|
|
if(plMap == NULL) { |
|
|
|
if (plMap == NULL) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(bNoExist) { |
|
|
|
if (bNoExist) { |
|
|
|
plMap[0] = -1; |
|
|
|
plMap[0] = -1; |
|
|
|
plMap[1] = 0; |
|
|
|
plMap[1] = 0; |
|
|
|
memset(&si, 0, sizeof(si)); |
|
|
|
memset(&si, 0, sizeof(si)); |
|
|
|
@ -556,7 +556,7 @@ void diablo_reload_process(HINSTANCE hInstance) |
|
|
|
WaitForInputIdle(pi.hProcess, INFINITE); |
|
|
|
WaitForInputIdle(pi.hProcess, INFINITE); |
|
|
|
CloseHandle(pi.hThread); |
|
|
|
CloseHandle(pi.hThread); |
|
|
|
CloseHandle(pi.hProcess); |
|
|
|
CloseHandle(pi.hProcess); |
|
|
|
while(plMap[0] < 0) { |
|
|
|
while (plMap[0] < 0) { |
|
|
|
Sleep(1000); |
|
|
|
Sleep(1000); |
|
|
|
} |
|
|
|
} |
|
|
|
UnmapViewOfFile(plMap); |
|
|
|
UnmapViewOfFile(plMap); |
|
|
|
@ -564,26 +564,26 @@ void diablo_reload_process(HINSTANCE hInstance) |
|
|
|
ExitProcess(0); |
|
|
|
ExitProcess(0); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(InterlockedIncrement(plMap) == 0) { |
|
|
|
if (InterlockedIncrement(plMap) == 0) { |
|
|
|
plMap[1] = GetCurrentProcessId(); |
|
|
|
plMap[1] = GetCurrentProcessId(); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
hPrev = GetForegroundWindow(); |
|
|
|
hPrev = GetForegroundWindow(); |
|
|
|
hWnd = hPrev; |
|
|
|
hWnd = hPrev; |
|
|
|
while(1) { |
|
|
|
while (1) { |
|
|
|
hPrev = GetWindow(hPrev, GW_HWNDPREV); |
|
|
|
hPrev = GetWindow(hPrev, GW_HWNDPREV); |
|
|
|
if(hPrev == NULL) { |
|
|
|
if (hPrev == NULL) { |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
hWnd = hPrev; |
|
|
|
hWnd = hPrev; |
|
|
|
} |
|
|
|
} |
|
|
|
while(1) { |
|
|
|
while (1) { |
|
|
|
GetWindowThreadProcessId(hWnd, &dwProcessId); |
|
|
|
GetWindowThreadProcessId(hWnd, &dwProcessId); |
|
|
|
if(dwProcessId == plMap[1]) { |
|
|
|
if (dwProcessId == plMap[1]) { |
|
|
|
SetForegroundWindow(hWnd); |
|
|
|
SetForegroundWindow(hWnd); |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
hWnd = GetWindow(hWnd, GW_HWNDNEXT); |
|
|
|
hWnd = GetWindow(hWnd, GW_HWNDNEXT); |
|
|
|
if(hWnd == NULL) { |
|
|
|
if (hWnd == NULL) { |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
@ -829,7 +829,7 @@ BOOL LeftMouseDown(int wParam) |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
if (!talkflag && !dropGoldFlag && !gmenu_exception()) |
|
|
|
if (!talkflag && !dropGoldFlag && !gmenu_exception()) |
|
|
|
CheckInvScrn(); |
|
|
|
CheckInvScrn(); |
|
|
|
DoPanBtn(); |
|
|
|
DoPanBtn(); |
|
|
|
if (pcurs > CURSOR_HAND && pcurs < CURSOR_FIRSTITEM) |
|
|
|
if (pcurs > CURSOR_HAND && pcurs < CURSOR_FIRSTITEM) |
|
|
|
SetCursor_(CURSOR_HAND); |
|
|
|
SetCursor_(CURSOR_HAND); |
|
|
|
@ -897,47 +897,47 @@ BOOL LeftMouseCmd(BOOL bShift) |
|
|
|
|
|
|
|
|
|
|
|
BOOL TryIconCurs() |
|
|
|
BOOL TryIconCurs() |
|
|
|
{ |
|
|
|
{ |
|
|
|
if(pcurs == CURSOR_RESURRECT) { |
|
|
|
if (pcurs == CURSOR_RESURRECT) { |
|
|
|
NetSendCmdParam1(TRUE, CMD_RESURRECT, pcursplr); |
|
|
|
NetSendCmdParam1(TRUE, CMD_RESURRECT, pcursplr); |
|
|
|
return TRUE; |
|
|
|
return TRUE; |
|
|
|
} else if(pcurs == CURSOR_HEALOTHER) { |
|
|
|
} else if (pcurs == CURSOR_HEALOTHER) { |
|
|
|
NetSendCmdParam1(TRUE, CMD_HEALOTHER, pcursplr); |
|
|
|
NetSendCmdParam1(TRUE, CMD_HEALOTHER, pcursplr); |
|
|
|
return TRUE; |
|
|
|
return TRUE; |
|
|
|
} else if(pcurs == CURSOR_TELEKINESIS) { |
|
|
|
} else if (pcurs == CURSOR_TELEKINESIS) { |
|
|
|
DoTelekinesis(); |
|
|
|
DoTelekinesis(); |
|
|
|
return TRUE; |
|
|
|
return TRUE; |
|
|
|
} else if(pcurs == CURSOR_IDENTIFY) { |
|
|
|
} else if (pcurs == CURSOR_IDENTIFY) { |
|
|
|
if(pcursinvitem != -1) { |
|
|
|
if (pcursinvitem != -1) { |
|
|
|
CheckIdentify(myplr, pcursinvitem); |
|
|
|
CheckIdentify(myplr, pcursinvitem); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
SetCursor_(CURSOR_HAND); |
|
|
|
SetCursor_(CURSOR_HAND); |
|
|
|
} |
|
|
|
} |
|
|
|
return TRUE; |
|
|
|
return TRUE; |
|
|
|
} else if(pcurs == CURSOR_REPAIR) { |
|
|
|
} else if (pcurs == CURSOR_REPAIR) { |
|
|
|
if(pcursinvitem != -1) { |
|
|
|
if (pcursinvitem != -1) { |
|
|
|
DoRepair(myplr, pcursinvitem); |
|
|
|
DoRepair(myplr, pcursinvitem); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
SetCursor_(CURSOR_HAND); |
|
|
|
SetCursor_(CURSOR_HAND); |
|
|
|
} |
|
|
|
} |
|
|
|
return TRUE; |
|
|
|
return TRUE; |
|
|
|
} else if(pcurs == CURSOR_RECHARGE) { |
|
|
|
} else if (pcurs == CURSOR_RECHARGE) { |
|
|
|
if(pcursinvitem != -1) { |
|
|
|
if (pcursinvitem != -1) { |
|
|
|
DoRecharge(myplr, pcursinvitem); |
|
|
|
DoRecharge(myplr, pcursinvitem); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
SetCursor_(CURSOR_HAND); |
|
|
|
SetCursor_(CURSOR_HAND); |
|
|
|
} |
|
|
|
} |
|
|
|
return TRUE; |
|
|
|
return TRUE; |
|
|
|
} else if(pcurs == CURSOR_TELEPORT) { |
|
|
|
} else if (pcurs == CURSOR_TELEPORT) { |
|
|
|
if(pcursmonst != -1) { |
|
|
|
if (pcursmonst != -1) { |
|
|
|
NetSendCmdParam3(TRUE, CMD_TSPELLID, pcursmonst, plr[myplr]._pTSpell, GetSpellLevel(myplr, plr[myplr]._pTSpell)); |
|
|
|
NetSendCmdParam3(TRUE, CMD_TSPELLID, pcursmonst, plr[myplr]._pTSpell, GetSpellLevel(myplr, plr[myplr]._pTSpell)); |
|
|
|
} else if(pcursplr != -1) { |
|
|
|
} else if (pcursplr != -1) { |
|
|
|
NetSendCmdParam3(TRUE, CMD_TSPELLPID, pcursplr, plr[myplr]._pTSpell, GetSpellLevel(myplr, plr[myplr]._pTSpell)); |
|
|
|
NetSendCmdParam3(TRUE, CMD_TSPELLPID, pcursplr, plr[myplr]._pTSpell, GetSpellLevel(myplr, plr[myplr]._pTSpell)); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
NetSendCmdLocParam2(TRUE, CMD_TSPELLXY, cursmx, cursmy, plr[myplr]._pTSpell, GetSpellLevel(myplr, plr[myplr]._pTSpell)); |
|
|
|
NetSendCmdLocParam2(TRUE, CMD_TSPELLXY, cursmx, cursmy, plr[myplr]._pTSpell, GetSpellLevel(myplr, plr[myplr]._pTSpell)); |
|
|
|
} |
|
|
|
} |
|
|
|
SetCursor_(CURSOR_HAND); |
|
|
|
SetCursor_(CURSOR_HAND); |
|
|
|
return TRUE; |
|
|
|
return TRUE; |
|
|
|
} else if(pcurs == CURSOR_DISARM && pcursobj == -1) { |
|
|
|
} else if (pcurs == CURSOR_DISARM && pcursobj == -1) { |
|
|
|
SetCursor_(CURSOR_HAND); |
|
|
|
SetCursor_(CURSOR_HAND); |
|
|
|
return TRUE; |
|
|
|
return TRUE; |
|
|
|
} |
|
|
|
} |
|
|
|
@ -1007,15 +1007,15 @@ void diablo_hotkey_msg(DWORD dwMsg) |
|
|
|
char szFileName[MAX_PATH]; |
|
|
|
char szFileName[MAX_PATH]; |
|
|
|
char szMsg[MAX_SEND_STR_LEN]; |
|
|
|
char szMsg[MAX_SEND_STR_LEN]; |
|
|
|
|
|
|
|
|
|
|
|
if(gbMaxPlayers == 1) { |
|
|
|
if (gbMaxPlayers == 1) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
if(GetModuleFileName(ghInst, szFileName, sizeof(szFileName)) == 0) { |
|
|
|
if (GetModuleFileName(ghInst, szFileName, sizeof(szFileName)) == 0) { |
|
|
|
app_fatal("Can't get program name"); |
|
|
|
app_fatal("Can't get program name"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
s = strrchr(szFileName, '\\'); |
|
|
|
s = strrchr(szFileName, '\\'); |
|
|
|
if(s != NULL) { |
|
|
|
if (s != NULL) { |
|
|
|
*s = '\0'; |
|
|
|
*s = '\0'; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -1036,64 +1036,64 @@ void ReleaseKey(int vkey) |
|
|
|
|
|
|
|
|
|
|
|
void PressKey(int vkey) |
|
|
|
void PressKey(int vkey) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if(gmenu_presskeys(vkey) || control_presskeys(vkey)) { |
|
|
|
if (gmenu_presskeys(vkey) || control_presskeys(vkey)) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(deathflag) { |
|
|
|
if (deathflag) { |
|
|
|
if(sgnTimeoutCurs != 0) { |
|
|
|
if (sgnTimeoutCurs != 0) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
if(vkey == VK_F9) { |
|
|
|
if (vkey == VK_F9) { |
|
|
|
diablo_hotkey_msg(0); |
|
|
|
diablo_hotkey_msg(0); |
|
|
|
} |
|
|
|
} |
|
|
|
if(vkey == VK_F10) { |
|
|
|
if (vkey == VK_F10) { |
|
|
|
diablo_hotkey_msg(1); |
|
|
|
diablo_hotkey_msg(1); |
|
|
|
} |
|
|
|
} |
|
|
|
if(vkey == VK_F11) { |
|
|
|
if (vkey == VK_F11) { |
|
|
|
diablo_hotkey_msg(2); |
|
|
|
diablo_hotkey_msg(2); |
|
|
|
} |
|
|
|
} |
|
|
|
if(vkey == VK_F12) { |
|
|
|
if (vkey == VK_F12) { |
|
|
|
diablo_hotkey_msg(3); |
|
|
|
diablo_hotkey_msg(3); |
|
|
|
} |
|
|
|
} |
|
|
|
if(vkey == VK_RETURN) { |
|
|
|
if (vkey == VK_RETURN) { |
|
|
|
control_type_message(); |
|
|
|
control_type_message(); |
|
|
|
} |
|
|
|
} |
|
|
|
if(vkey != VK_ESCAPE) { |
|
|
|
if (vkey != VK_ESCAPE) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if(vkey == VK_ESCAPE) { |
|
|
|
if (vkey == VK_ESCAPE) { |
|
|
|
if(!PressEscKey()) { |
|
|
|
if (!PressEscKey()) { |
|
|
|
track_repeat_walk(0); |
|
|
|
track_repeat_walk(0); |
|
|
|
gamemenu_previous(); |
|
|
|
gamemenu_previous(); |
|
|
|
} |
|
|
|
} |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(sgnTimeoutCurs != 0 || dropGoldFlag) { |
|
|
|
if (sgnTimeoutCurs != 0 || dropGoldFlag) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
if(vkey == VK_PAUSE) { |
|
|
|
if (vkey == VK_PAUSE) { |
|
|
|
diablo_pause_game(); |
|
|
|
diablo_pause_game(); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
if(PauseMode == 2) { |
|
|
|
if (PauseMode == 2) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(vkey == VK_RETURN) { |
|
|
|
if (vkey == VK_RETURN) { |
|
|
|
if(stextflag) { |
|
|
|
if (stextflag) { |
|
|
|
STextEnter(); |
|
|
|
STextEnter(); |
|
|
|
} else if(questlog) { |
|
|
|
} else if (questlog) { |
|
|
|
QuestlogEnter(); |
|
|
|
QuestlogEnter(); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
control_type_message(); |
|
|
|
control_type_message(); |
|
|
|
} |
|
|
|
} |
|
|
|
} else if(vkey == VK_F1) { |
|
|
|
} else if (vkey == VK_F1) { |
|
|
|
if(helpflag) { |
|
|
|
if (helpflag) { |
|
|
|
helpflag = 0; |
|
|
|
helpflag = 0; |
|
|
|
} else if(stextflag) { |
|
|
|
} else if (stextflag) { |
|
|
|
ClearPanel(); |
|
|
|
ClearPanel(); |
|
|
|
AddPanelString("No help available", TRUE); /// BUGFIX: message isn't displayed
|
|
|
|
AddPanelString("No help available", TRUE); /// BUGFIX: message isn't displayed
|
|
|
|
AddPanelString("while in stores", TRUE); |
|
|
|
AddPanelString("while in stores", TRUE); |
|
|
|
@ -1103,7 +1103,7 @@ void PressKey(int vkey) |
|
|
|
chrflag = 0; |
|
|
|
chrflag = 0; |
|
|
|
sbookflag = 0; |
|
|
|
sbookflag = 0; |
|
|
|
spselflag = 0; |
|
|
|
spselflag = 0; |
|
|
|
if(qtextflag && leveltype == DTYPE_TOWN) { |
|
|
|
if (qtextflag && leveltype == DTYPE_TOWN) { |
|
|
|
qtextflag = 0; |
|
|
|
qtextflag = 0; |
|
|
|
sfx_stop(); |
|
|
|
sfx_stop(); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -1116,18 +1116,18 @@ void PressKey(int vkey) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
#ifdef _DEBUG |
|
|
|
#ifdef _DEBUG |
|
|
|
else if(vkey == VK_F2) { |
|
|
|
else if (vkey == VK_F2) { |
|
|
|
} |
|
|
|
} |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
#ifdef _DEBUG |
|
|
|
#ifdef _DEBUG |
|
|
|
else if(vkey == VK_F3) { |
|
|
|
else if (vkey == VK_F3) { |
|
|
|
if(pcursitem != -1) { |
|
|
|
if (pcursitem != -1) { |
|
|
|
sprintf( |
|
|
|
sprintf( |
|
|
|
tempstr, |
|
|
|
tempstr, |
|
|
|
"IDX = %i : Seed = %i : CF = %i", |
|
|
|
"IDX = %i : Seed = %i : CF = %i", |
|
|
|
item[pcursitem].IDidx, |
|
|
|
item[pcursitem].IDidx, |
|
|
|
item[pcursitem]._iSeed, |
|
|
|
item[pcursitem]._iSeed, |
|
|
|
item[pcursitem]._iCreateInfo); |
|
|
|
item[pcursitem]._iCreateInfo); |
|
|
|
NetSendCmdString(1 << myplr, tempstr); |
|
|
|
NetSendCmdString(1 << myplr, tempstr); |
|
|
|
} |
|
|
|
} |
|
|
|
sprintf(tempstr, "Numitems : %i", numitems); |
|
|
|
sprintf(tempstr, "Numitems : %i", numitems); |
|
|
|
@ -1135,85 +1135,85 @@ void PressKey(int vkey) |
|
|
|
} |
|
|
|
} |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
#ifdef _DEBUG |
|
|
|
#ifdef _DEBUG |
|
|
|
else if(vkey == VK_F4) { |
|
|
|
else if (vkey == VK_F4) { |
|
|
|
PrintDebugQuest(); |
|
|
|
PrintDebugQuest(); |
|
|
|
} |
|
|
|
} |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
else if(vkey == VK_F5) { |
|
|
|
else if (vkey == VK_F5) { |
|
|
|
if(spselflag) { |
|
|
|
if (spselflag) { |
|
|
|
SetSpeedSpell(0); |
|
|
|
SetSpeedSpell(0); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
ToggleSpell(0); |
|
|
|
ToggleSpell(0); |
|
|
|
} |
|
|
|
} |
|
|
|
} else if(vkey == VK_F6) { |
|
|
|
} else if (vkey == VK_F6) { |
|
|
|
if(spselflag) { |
|
|
|
if (spselflag) { |
|
|
|
SetSpeedSpell(1); |
|
|
|
SetSpeedSpell(1); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
ToggleSpell(1); |
|
|
|
ToggleSpell(1); |
|
|
|
} |
|
|
|
} |
|
|
|
} else if(vkey == VK_F7) { |
|
|
|
} else if (vkey == VK_F7) { |
|
|
|
if(spselflag) { |
|
|
|
if (spselflag) { |
|
|
|
SetSpeedSpell(2); |
|
|
|
SetSpeedSpell(2); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
ToggleSpell(2); |
|
|
|
ToggleSpell(2); |
|
|
|
} |
|
|
|
} |
|
|
|
} else if(vkey == VK_F8) { |
|
|
|
} else if (vkey == VK_F8) { |
|
|
|
if(spselflag) { |
|
|
|
if (spselflag) { |
|
|
|
SetSpeedSpell(3); |
|
|
|
SetSpeedSpell(3); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
ToggleSpell(3); |
|
|
|
ToggleSpell(3); |
|
|
|
} |
|
|
|
} |
|
|
|
} else if(vkey == VK_F9) { |
|
|
|
} else if (vkey == VK_F9) { |
|
|
|
diablo_hotkey_msg(0); |
|
|
|
diablo_hotkey_msg(0); |
|
|
|
} else if(vkey == VK_F10) { |
|
|
|
} else if (vkey == VK_F10) { |
|
|
|
diablo_hotkey_msg(1); |
|
|
|
diablo_hotkey_msg(1); |
|
|
|
} else if(vkey == VK_F11) { |
|
|
|
} else if (vkey == VK_F11) { |
|
|
|
diablo_hotkey_msg(2); |
|
|
|
diablo_hotkey_msg(2); |
|
|
|
} else if(vkey == VK_F12) { |
|
|
|
} else if (vkey == VK_F12) { |
|
|
|
diablo_hotkey_msg(3); |
|
|
|
diablo_hotkey_msg(3); |
|
|
|
} else if(vkey == VK_UP) { |
|
|
|
} else if (vkey == VK_UP) { |
|
|
|
if(stextflag) { |
|
|
|
if (stextflag) { |
|
|
|
STextUp(); |
|
|
|
STextUp(); |
|
|
|
} else if(questlog) { |
|
|
|
} else if (questlog) { |
|
|
|
QuestlogUp(); |
|
|
|
QuestlogUp(); |
|
|
|
} else if(helpflag) { |
|
|
|
} else if (helpflag) { |
|
|
|
HelpScrollUp(); |
|
|
|
HelpScrollUp(); |
|
|
|
} else if(automapflag) { |
|
|
|
} else if (automapflag) { |
|
|
|
AutomapUp(); |
|
|
|
AutomapUp(); |
|
|
|
} |
|
|
|
} |
|
|
|
} else if(vkey == VK_DOWN) { |
|
|
|
} else if (vkey == VK_DOWN) { |
|
|
|
if(stextflag) { |
|
|
|
if (stextflag) { |
|
|
|
STextDown(); |
|
|
|
STextDown(); |
|
|
|
} else if(questlog) { |
|
|
|
} else if (questlog) { |
|
|
|
QuestlogDown(); |
|
|
|
QuestlogDown(); |
|
|
|
} else if(helpflag) { |
|
|
|
} else if (helpflag) { |
|
|
|
HelpScrollDown(); |
|
|
|
HelpScrollDown(); |
|
|
|
} else if(automapflag) { |
|
|
|
} else if (automapflag) { |
|
|
|
AutomapDown(); |
|
|
|
AutomapDown(); |
|
|
|
} |
|
|
|
} |
|
|
|
} else if(vkey == VK_PRIOR) { |
|
|
|
} else if (vkey == VK_PRIOR) { |
|
|
|
if(stextflag) { |
|
|
|
if (stextflag) { |
|
|
|
STextPrior(); |
|
|
|
STextPrior(); |
|
|
|
} |
|
|
|
} |
|
|
|
} else if(vkey == VK_NEXT) { |
|
|
|
} else if (vkey == VK_NEXT) { |
|
|
|
if(stextflag) { |
|
|
|
if (stextflag) { |
|
|
|
STextNext(); |
|
|
|
STextNext(); |
|
|
|
} |
|
|
|
} |
|
|
|
} else if(vkey == VK_LEFT) { |
|
|
|
} else if (vkey == VK_LEFT) { |
|
|
|
if(automapflag && !talkflag) { |
|
|
|
if (automapflag && !talkflag) { |
|
|
|
AutomapLeft(); |
|
|
|
AutomapLeft(); |
|
|
|
} |
|
|
|
} |
|
|
|
} else if(vkey == VK_RIGHT) { |
|
|
|
} else if (vkey == VK_RIGHT) { |
|
|
|
if(automapflag && !talkflag) { |
|
|
|
if (automapflag && !talkflag) { |
|
|
|
AutomapRight(); |
|
|
|
AutomapRight(); |
|
|
|
} |
|
|
|
} |
|
|
|
} else if(vkey == VK_TAB) { |
|
|
|
} else if (vkey == VK_TAB) { |
|
|
|
DoAutoMap(); |
|
|
|
DoAutoMap(); |
|
|
|
} else if(vkey == VK_SPACE) { |
|
|
|
} else if (vkey == VK_SPACE) { |
|
|
|
if(!chrflag && invflag && MouseX < 480 && MouseY < VIEWPORT_HEIGHT) { |
|
|
|
if (!chrflag && invflag && MouseX < 480 && MouseY < VIEWPORT_HEIGHT) { |
|
|
|
SetCursorPos(MouseX + 160, MouseY); |
|
|
|
SetCursorPos(MouseX + 160, MouseY); |
|
|
|
} |
|
|
|
} |
|
|
|
if(!invflag && chrflag && MouseX > 160 && MouseY < VIEWPORT_HEIGHT) { |
|
|
|
if (!invflag && chrflag && MouseX > 160 && MouseY < VIEWPORT_HEIGHT) { |
|
|
|
SetCursorPos(MouseX - 160, MouseY); |
|
|
|
SetCursorPos(MouseX - 160, MouseY); |
|
|
|
} |
|
|
|
} |
|
|
|
helpflag = 0; |
|
|
|
helpflag = 0; |
|
|
|
@ -1221,7 +1221,7 @@ void PressKey(int vkey) |
|
|
|
chrflag = 0; |
|
|
|
chrflag = 0; |
|
|
|
sbookflag = 0; |
|
|
|
sbookflag = 0; |
|
|
|
spselflag = 0; |
|
|
|
spselflag = 0; |
|
|
|
if(qtextflag && leveltype == DTYPE_TOWN) { |
|
|
|
if (qtextflag && leveltype == DTYPE_TOWN) { |
|
|
|
qtextflag = 0; |
|
|
|
qtextflag = 0; |
|
|
|
sfx_stop(); |
|
|
|
sfx_stop(); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -1260,26 +1260,26 @@ void diablo_pause_game() |
|
|
|
/* NOTE: `return` must be used instead of `break` to be bin exact as C++ */ |
|
|
|
/* NOTE: `return` must be used instead of `break` to be bin exact as C++ */ |
|
|
|
void PressChar(int vkey) |
|
|
|
void PressChar(int vkey) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if(gmenu_exception() || control_talk_last_key(vkey) || sgnTimeoutCurs != 0 || deathflag) { |
|
|
|
if (gmenu_exception() || control_talk_last_key(vkey) || sgnTimeoutCurs != 0 || deathflag) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
if((char)vkey == 'p' || (char)vkey == 'P') { |
|
|
|
if ((char)vkey == 'p' || (char)vkey == 'P') { |
|
|
|
diablo_pause_game(); |
|
|
|
diablo_pause_game(); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
if(PauseMode == 2) { |
|
|
|
if (PauseMode == 2) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
if(doomflag) { |
|
|
|
if (doomflag) { |
|
|
|
doom_close(); |
|
|
|
doom_close(); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
if(dropGoldFlag) { |
|
|
|
if (dropGoldFlag) { |
|
|
|
control_drop_gold(vkey); |
|
|
|
control_drop_gold(vkey); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
switch(vkey) { |
|
|
|
switch (vkey) { |
|
|
|
case 'G': |
|
|
|
case 'G': |
|
|
|
case 'g': |
|
|
|
case 'g': |
|
|
|
DecreaseGamma(); |
|
|
|
DecreaseGamma(); |
|
|
|
@ -1290,15 +1290,15 @@ void PressChar(int vkey) |
|
|
|
return; |
|
|
|
return; |
|
|
|
case 'I': |
|
|
|
case 'I': |
|
|
|
case 'i': |
|
|
|
case 'i': |
|
|
|
if(!stextflag) { |
|
|
|
if (!stextflag) { |
|
|
|
sbookflag = 0; |
|
|
|
sbookflag = 0; |
|
|
|
invflag = invflag == 0; |
|
|
|
invflag = invflag == 0; |
|
|
|
if(!invflag || chrflag) { |
|
|
|
if (!invflag || chrflag) { |
|
|
|
if(MouseX < 480 && MouseY < VIEWPORT_HEIGHT) { |
|
|
|
if (MouseX < 480 && MouseY < VIEWPORT_HEIGHT) { |
|
|
|
SetCursorPos(MouseX + 160, MouseY); |
|
|
|
SetCursorPos(MouseX + 160, MouseY); |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
if(MouseX > 160 && MouseY < VIEWPORT_HEIGHT) { |
|
|
|
if (MouseX > 160 && MouseY < VIEWPORT_HEIGHT) { |
|
|
|
SetCursorPos(MouseX - 160, MouseY); |
|
|
|
SetCursorPos(MouseX - 160, MouseY); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
@ -1306,15 +1306,15 @@ void PressChar(int vkey) |
|
|
|
return; |
|
|
|
return; |
|
|
|
case 'C': |
|
|
|
case 'C': |
|
|
|
case 'c': |
|
|
|
case 'c': |
|
|
|
if(!stextflag) { |
|
|
|
if (!stextflag) { |
|
|
|
questlog = FALSE; |
|
|
|
questlog = FALSE; |
|
|
|
chrflag = chrflag == 0; |
|
|
|
chrflag = chrflag == 0; |
|
|
|
if(!chrflag || invflag) { |
|
|
|
if (!chrflag || invflag) { |
|
|
|
if(MouseX > 160 && MouseY < VIEWPORT_HEIGHT) { |
|
|
|
if (MouseX > 160 && MouseY < VIEWPORT_HEIGHT) { |
|
|
|
SetCursorPos(MouseX - 160, MouseY); |
|
|
|
SetCursorPos(MouseX - 160, MouseY); |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
if(MouseX < 480 && MouseY < VIEWPORT_HEIGHT) { |
|
|
|
if (MouseX < 480 && MouseY < VIEWPORT_HEIGHT) { |
|
|
|
SetCursorPos(MouseX + 160, MouseY); |
|
|
|
SetCursorPos(MouseX + 160, MouseY); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
@ -1322,9 +1322,9 @@ void PressChar(int vkey) |
|
|
|
return; |
|
|
|
return; |
|
|
|
case 'Q': |
|
|
|
case 'Q': |
|
|
|
case 'q': |
|
|
|
case 'q': |
|
|
|
if(!stextflag) { |
|
|
|
if (!stextflag) { |
|
|
|
chrflag = 0; |
|
|
|
chrflag = 0; |
|
|
|
if(!questlog) { |
|
|
|
if (!questlog) { |
|
|
|
StartQuestlog(); |
|
|
|
StartQuestlog(); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
questlog = FALSE; |
|
|
|
questlog = FALSE; |
|
|
|
@ -1337,9 +1337,9 @@ void PressChar(int vkey) |
|
|
|
return; |
|
|
|
return; |
|
|
|
case 'S': |
|
|
|
case 'S': |
|
|
|
case 's': |
|
|
|
case 's': |
|
|
|
if(!stextflag) { |
|
|
|
if (!stextflag) { |
|
|
|
invflag = 0; |
|
|
|
invflag = 0; |
|
|
|
if(!spselflag) { |
|
|
|
if (!spselflag) { |
|
|
|
DoSpeedBook(); |
|
|
|
DoSpeedBook(); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
spselflag = 0; |
|
|
|
spselflag = 0; |
|
|
|
@ -1349,20 +1349,20 @@ void PressChar(int vkey) |
|
|
|
return; |
|
|
|
return; |
|
|
|
case 'B': |
|
|
|
case 'B': |
|
|
|
case 'b': |
|
|
|
case 'b': |
|
|
|
if(!stextflag) { |
|
|
|
if (!stextflag) { |
|
|
|
invflag = 0; |
|
|
|
invflag = 0; |
|
|
|
sbookflag = sbookflag == 0; |
|
|
|
sbookflag = sbookflag == 0; |
|
|
|
} |
|
|
|
} |
|
|
|
return; |
|
|
|
return; |
|
|
|
case '+': |
|
|
|
case '+': |
|
|
|
case '=': |
|
|
|
case '=': |
|
|
|
if(automapflag) { |
|
|
|
if (automapflag) { |
|
|
|
AutomapZoomIn(); |
|
|
|
AutomapZoomIn(); |
|
|
|
} |
|
|
|
} |
|
|
|
return; |
|
|
|
return; |
|
|
|
case '-': |
|
|
|
case '-': |
|
|
|
case '_': |
|
|
|
case '_': |
|
|
|
if(automapflag) { |
|
|
|
if (automapflag) { |
|
|
|
AutomapZoomOut(); |
|
|
|
AutomapZoomOut(); |
|
|
|
} |
|
|
|
} |
|
|
|
return; |
|
|
|
return; |
|
|
|
@ -1374,95 +1374,95 @@ void PressChar(int vkey) |
|
|
|
return; |
|
|
|
return; |
|
|
|
case '!': |
|
|
|
case '!': |
|
|
|
case '1': |
|
|
|
case '1': |
|
|
|
if(plr[myplr].SpdList[0]._itype != -1 && plr[myplr].SpdList[0]._itype != 11) { |
|
|
|
if (plr[myplr].SpdList[0]._itype != -1 && plr[myplr].SpdList[0]._itype != 11) { |
|
|
|
UseInvItem(myplr, 47); |
|
|
|
UseInvItem(myplr, 47); |
|
|
|
} |
|
|
|
} |
|
|
|
return; |
|
|
|
return; |
|
|
|
case '@': |
|
|
|
case '@': |
|
|
|
case '2': |
|
|
|
case '2': |
|
|
|
if(plr[myplr].SpdList[1]._itype != -1 && plr[myplr].SpdList[1]._itype != 11) { |
|
|
|
if (plr[myplr].SpdList[1]._itype != -1 && plr[myplr].SpdList[1]._itype != 11) { |
|
|
|
UseInvItem(myplr, 48); |
|
|
|
UseInvItem(myplr, 48); |
|
|
|
} |
|
|
|
} |
|
|
|
return; |
|
|
|
return; |
|
|
|
case '#': |
|
|
|
case '#': |
|
|
|
case '3': |
|
|
|
case '3': |
|
|
|
if(plr[myplr].SpdList[2]._itype != -1 && plr[myplr].SpdList[2]._itype != 11) { |
|
|
|
if (plr[myplr].SpdList[2]._itype != -1 && plr[myplr].SpdList[2]._itype != 11) { |
|
|
|
UseInvItem(myplr, 49); |
|
|
|
UseInvItem(myplr, 49); |
|
|
|
} |
|
|
|
} |
|
|
|
return; |
|
|
|
return; |
|
|
|
case '$': |
|
|
|
case '$': |
|
|
|
case '4': |
|
|
|
case '4': |
|
|
|
if(plr[myplr].SpdList[3]._itype != -1 && plr[myplr].SpdList[3]._itype != 11) { |
|
|
|
if (plr[myplr].SpdList[3]._itype != -1 && plr[myplr].SpdList[3]._itype != 11) { |
|
|
|
UseInvItem(myplr, 50); |
|
|
|
UseInvItem(myplr, 50); |
|
|
|
} |
|
|
|
} |
|
|
|
return; |
|
|
|
return; |
|
|
|
case '%': |
|
|
|
case '%': |
|
|
|
case '5': |
|
|
|
case '5': |
|
|
|
if(plr[myplr].SpdList[4]._itype != -1 && plr[myplr].SpdList[4]._itype != 11) { |
|
|
|
if (plr[myplr].SpdList[4]._itype != -1 && plr[myplr].SpdList[4]._itype != 11) { |
|
|
|
UseInvItem(myplr, 51); |
|
|
|
UseInvItem(myplr, 51); |
|
|
|
} |
|
|
|
} |
|
|
|
return; |
|
|
|
return; |
|
|
|
case '^': |
|
|
|
case '^': |
|
|
|
case '6': |
|
|
|
case '6': |
|
|
|
if(plr[myplr].SpdList[5]._itype != -1 && plr[myplr].SpdList[5]._itype != 11) { |
|
|
|
if (plr[myplr].SpdList[5]._itype != -1 && plr[myplr].SpdList[5]._itype != 11) { |
|
|
|
UseInvItem(myplr, 52); |
|
|
|
UseInvItem(myplr, 52); |
|
|
|
} |
|
|
|
} |
|
|
|
return; |
|
|
|
return; |
|
|
|
case '&': |
|
|
|
case '&': |
|
|
|
case '7': |
|
|
|
case '7': |
|
|
|
if(plr[myplr].SpdList[6]._itype != -1 && plr[myplr].SpdList[6]._itype != 11) { |
|
|
|
if (plr[myplr].SpdList[6]._itype != -1 && plr[myplr].SpdList[6]._itype != 11) { |
|
|
|
UseInvItem(myplr, 53); |
|
|
|
UseInvItem(myplr, 53); |
|
|
|
} |
|
|
|
} |
|
|
|
return; |
|
|
|
return; |
|
|
|
case '*': |
|
|
|
case '*': |
|
|
|
case '8': |
|
|
|
case '8': |
|
|
|
#ifdef _DEBUG |
|
|
|
#ifdef _DEBUG |
|
|
|
if(debug_mode_key_inverted_v || debug_mode_key_w) { |
|
|
|
if (debug_mode_key_inverted_v || debug_mode_key_w) { |
|
|
|
NetSendCmd(TRUE, CMD_CHEAT_EXPERIENCE); |
|
|
|
NetSendCmd(TRUE, CMD_CHEAT_EXPERIENCE); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
if(plr[myplr].SpdList[7]._itype != -1 && plr[myplr].SpdList[7]._itype != 11) { |
|
|
|
if (plr[myplr].SpdList[7]._itype != -1 && plr[myplr].SpdList[7]._itype != 11) { |
|
|
|
UseInvItem(myplr, 54); |
|
|
|
UseInvItem(myplr, 54); |
|
|
|
} |
|
|
|
} |
|
|
|
return; |
|
|
|
return; |
|
|
|
#ifdef _DEBUG |
|
|
|
#ifdef _DEBUG |
|
|
|
case ')': |
|
|
|
case ')': |
|
|
|
case '0': |
|
|
|
case '0': |
|
|
|
if(debug_mode_key_inverted_v) { |
|
|
|
if (debug_mode_key_inverted_v) { |
|
|
|
if(arrowdebug > 2) { |
|
|
|
if (arrowdebug > 2) { |
|
|
|
arrowdebug = 0; |
|
|
|
arrowdebug = 0; |
|
|
|
} |
|
|
|
} |
|
|
|
if(arrowdebug == 0) { |
|
|
|
if (arrowdebug == 0) { |
|
|
|
plr[myplr]._pIFlags &= ~ISPL_FIRE_ARROWS; |
|
|
|
plr[myplr]._pIFlags &= ~ISPL_FIRE_ARROWS; |
|
|
|
plr[myplr]._pIFlags &= ~ISPL_LIGHT_ARROWS; |
|
|
|
plr[myplr]._pIFlags &= ~ISPL_LIGHT_ARROWS; |
|
|
|
} |
|
|
|
} |
|
|
|
if(arrowdebug == 1) { |
|
|
|
if (arrowdebug == 1) { |
|
|
|
plr[myplr]._pIFlags |= ISPL_FIRE_ARROWS; |
|
|
|
plr[myplr]._pIFlags |= ISPL_FIRE_ARROWS; |
|
|
|
} |
|
|
|
} |
|
|
|
if(arrowdebug == 2) { |
|
|
|
if (arrowdebug == 2) { |
|
|
|
plr[myplr]._pIFlags |= ISPL_LIGHT_ARROWS; |
|
|
|
plr[myplr]._pIFlags |= ISPL_LIGHT_ARROWS; |
|
|
|
} |
|
|
|
} |
|
|
|
arrowdebug++; |
|
|
|
arrowdebug++; |
|
|
|
} |
|
|
|
} |
|
|
|
return; |
|
|
|
return; |
|
|
|
case ':': |
|
|
|
case ':': |
|
|
|
if(currlevel == 0 && debug_mode_key_w) { |
|
|
|
if (currlevel == 0 && debug_mode_key_w) { |
|
|
|
SetAllSpellsCheat(); |
|
|
|
SetAllSpellsCheat(); |
|
|
|
} |
|
|
|
} |
|
|
|
return; |
|
|
|
return; |
|
|
|
case '[': |
|
|
|
case '[': |
|
|
|
if(currlevel == 0 && debug_mode_key_w) { |
|
|
|
if (currlevel == 0 && debug_mode_key_w) { |
|
|
|
TakeGoldCheat(); |
|
|
|
TakeGoldCheat(); |
|
|
|
} |
|
|
|
} |
|
|
|
return; |
|
|
|
return; |
|
|
|
case ']': |
|
|
|
case ']': |
|
|
|
if(currlevel == 0 && debug_mode_key_w) { |
|
|
|
if (currlevel == 0 && debug_mode_key_w) { |
|
|
|
MaxSpellsCheat(); |
|
|
|
MaxSpellsCheat(); |
|
|
|
} |
|
|
|
} |
|
|
|
return; |
|
|
|
return; |
|
|
|
case 'a': |
|
|
|
case 'a': |
|
|
|
if(debug_mode_key_inverted_v) { |
|
|
|
if (debug_mode_key_inverted_v) { |
|
|
|
spelldata[SPL_TELEPORT].sTownSpell = 1; |
|
|
|
spelldata[SPL_TELEPORT].sTownSpell = 1; |
|
|
|
plr[myplr]._pSplLvl[plr[myplr]._pSpell]++; |
|
|
|
plr[myplr]._pSplLvl[plr[myplr]._pSpell]++; |
|
|
|
} |
|
|
|
} |
|
|
|
@ -1474,14 +1474,14 @@ void PressChar(int vkey) |
|
|
|
PrintDebugPlayer(FALSE); |
|
|
|
PrintDebugPlayer(FALSE); |
|
|
|
return; |
|
|
|
return; |
|
|
|
case 'e': |
|
|
|
case 'e': |
|
|
|
if(debug_mode_key_d) { |
|
|
|
if (debug_mode_key_d) { |
|
|
|
sprintf(tempstr, "EFlag = %i", plr[myplr]._peflag); |
|
|
|
sprintf(tempstr, "EFlag = %i", plr[myplr]._peflag); |
|
|
|
NetSendCmdString(1 << myplr, tempstr); |
|
|
|
NetSendCmdString(1 << myplr, tempstr); |
|
|
|
} |
|
|
|
} |
|
|
|
return; |
|
|
|
return; |
|
|
|
case 'L': |
|
|
|
case 'L': |
|
|
|
case 'l': |
|
|
|
case 'l': |
|
|
|
if(debug_mode_key_inverted_v) { |
|
|
|
if (debug_mode_key_inverted_v) { |
|
|
|
ToggleLighting(); |
|
|
|
ToggleLighting(); |
|
|
|
} |
|
|
|
} |
|
|
|
return; |
|
|
|
return; |
|
|
|
@ -1502,7 +1502,7 @@ void PressChar(int vkey) |
|
|
|
return; |
|
|
|
return; |
|
|
|
case 'T': |
|
|
|
case 'T': |
|
|
|
case 't': |
|
|
|
case 't': |
|
|
|
if(debug_mode_key_inverted_v) { |
|
|
|
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].WorldX, plr[myplr].WorldY); |
|
|
|
NetSendCmdString(1 << myplr, tempstr); |
|
|
|
NetSendCmdString(1 << myplr, tempstr); |
|
|
|
sprintf(tempstr, "CX = %i CY = %i DP = %i", cursmx, cursmy, dungeon[cursmx][cursmy]); |
|
|
|
sprintf(tempstr, "CX = %i CY = %i DP = %i", cursmx, cursmy, dungeon[cursmx][cursmy]); |
|
|
|
@ -1510,12 +1510,12 @@ void PressChar(int vkey) |
|
|
|
} |
|
|
|
} |
|
|
|
return; |
|
|
|
return; |
|
|
|
case '|': |
|
|
|
case '|': |
|
|
|
if(currlevel == 0 && debug_mode_key_w) { |
|
|
|
if (currlevel == 0 && debug_mode_key_w) { |
|
|
|
GiveGoldCheat(); |
|
|
|
GiveGoldCheat(); |
|
|
|
} |
|
|
|
} |
|
|
|
return; |
|
|
|
return; |
|
|
|
case '~': |
|
|
|
case '~': |
|
|
|
if(currlevel == 0 && debug_mode_key_w) { |
|
|
|
if (currlevel == 0 && debug_mode_key_w) { |
|
|
|
StoresCheat(); |
|
|
|
StoresCheat(); |
|
|
|
} |
|
|
|
} |
|
|
|
return; |
|
|
|
return; |
|
|
|
@ -1533,7 +1533,7 @@ void LoadLvlGFX() |
|
|
|
{ |
|
|
|
{ |
|
|
|
/// ASSERT: assert(! pDungeonCels);
|
|
|
|
/// ASSERT: assert(! pDungeonCels);
|
|
|
|
|
|
|
|
|
|
|
|
switch((unsigned char)leveltype) { |
|
|
|
switch ((unsigned char)leveltype) { |
|
|
|
case DTYPE_TOWN: |
|
|
|
case DTYPE_TOWN: |
|
|
|
pDungeonCels = LoadFileInMem("Levels\\TownData\\Town.CEL", 0); |
|
|
|
pDungeonCels = LoadFileInMem("Levels\\TownData\\Town.CEL", 0); |
|
|
|
pMegaTiles = LoadFileInMem("Levels\\TownData\\Town.TIL", 0); |
|
|
|
pMegaTiles = LoadFileInMem("Levels\\TownData\\Town.TIL", 0); |
|
|
|
@ -1584,7 +1584,7 @@ void LoadAllGFX() |
|
|
|
|
|
|
|
|
|
|
|
void CreateLevel(int lvldir) |
|
|
|
void CreateLevel(int lvldir) |
|
|
|
{ |
|
|
|
{ |
|
|
|
switch(leveltype) { |
|
|
|
switch (leveltype) { |
|
|
|
case DTYPE_TOWN: |
|
|
|
case DTYPE_TOWN: |
|
|
|
CreateTown(lvldir); |
|
|
|
CreateTown(lvldir); |
|
|
|
InitTownTriggers(); |
|
|
|
InitTownTriggers(); |
|
|
|
@ -1859,25 +1859,25 @@ void game_loop(BOOL bStartup) |
|
|
|
|
|
|
|
|
|
|
|
void game_logic() |
|
|
|
void game_logic() |
|
|
|
{ |
|
|
|
{ |
|
|
|
if(PauseMode == 2) { |
|
|
|
if (PauseMode == 2) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
if(PauseMode == 1) { |
|
|
|
if (PauseMode == 1) { |
|
|
|
PauseMode = 2; |
|
|
|
PauseMode = 2; |
|
|
|
} |
|
|
|
} |
|
|
|
if(gbMaxPlayers == 1 && gmenu_exception()) { |
|
|
|
if (gbMaxPlayers == 1 && gmenu_exception()) { |
|
|
|
drawpanflag |= 1; |
|
|
|
drawpanflag |= 1; |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(!gmenu_exception() && sgnTimeoutCurs == 0) { |
|
|
|
if (!gmenu_exception() && sgnTimeoutCurs == 0) { |
|
|
|
CheckCursMove(); |
|
|
|
CheckCursMove(); |
|
|
|
track_process(); |
|
|
|
track_process(); |
|
|
|
} |
|
|
|
} |
|
|
|
if(gbProcessPlayers) { |
|
|
|
if (gbProcessPlayers) { |
|
|
|
ProcessPlayers(); |
|
|
|
ProcessPlayers(); |
|
|
|
} |
|
|
|
} |
|
|
|
if(leveltype != DTYPE_TOWN) { |
|
|
|
if (leveltype != DTYPE_TOWN) { |
|
|
|
ProcessMonsters(); |
|
|
|
ProcessMonsters(); |
|
|
|
ProcessObjects(); |
|
|
|
ProcessObjects(); |
|
|
|
ProcessMissiles(); |
|
|
|
ProcessMissiles(); |
|
|
|
@ -1891,7 +1891,7 @@ void game_logic() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#ifdef _DEBUG |
|
|
|
#ifdef _DEBUG |
|
|
|
if(debug_mode_key_inverted_v && GetAsyncKeyState(VK_SHIFT) & 0x8000) { |
|
|
|
if (debug_mode_key_inverted_v && GetAsyncKeyState(VK_SHIFT) & 0x8000) { |
|
|
|
ScrollView(); |
|
|
|
ScrollView(); |
|
|
|
} |
|
|
|
} |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|