* Scenario and character editors code tweaked so that it compiles with newer windres.exe version and Code::Blocks IDE. Code::Blocks project files included for both Editor and the sound DLL project (seems like speed optimization breaks the scenario editor : monster and item dialogs doesn't accept any entered value).

* Cleaned unused variable in Scenario and Character editors code.

Chokboyz

git-svn-id: http://openexile.googlecode.com/svn/trunk@139 4ebdad44-0ea0-11de-aab3-ff745001d230
This commit is contained in:
Chokboyz
2009-11-10 01:59:47 +00:00
parent 2889235248
commit a728099839
29 changed files with 4168 additions and 4319 deletions

View File

@@ -9,7 +9,7 @@
#include "math.h"
#include "global.h"
#include "graphics.h"
#include "graphics.h"
#include "editors.h"
#include "edfileio.h"
#include "edsound.h"
@@ -48,12 +48,12 @@ Boolean bgm_on = FALSE,bgm_init = FALSE;
Boolean gInBackground = FALSE;
long start_time;
// Cursors
// Cursors
short current_cursor = 120;
HCURSOR arrow_curs[3][3], sword_curs, boot_curs, key_curs, target_curs,talk_curs,look_curs;
RECT pc_area_buttons[6][4] ; // 0 - whole 1 - pic 2 - name 3 - stat strs 4,5 - later
RECT item_string_rects[24][4]; // 0 - name 1 - drop 2 - id 3 -
RECT item_string_rects[24][4]; // 0 - name 1 - drop 2 - id 3 -
RECT pc_info_rect; // Frame that holds a pc's basic info and items
RECT name_rect; //Holds pc name inside pc_info_rect
RECT info_area_rect;
@@ -157,9 +157,9 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR, int nCm
wndclass.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH);
wndclass.lpszMenuName = MAKEINTRESOURCE(1);
wndclass.lpszClassName = szAppName;
RegisterClass(&wndclass);
wndclass2.style = CS_HREDRAW | CS_VREDRAW | CS_BYTEALIGNWINDOW;
wndclass2.lpfnWndProc = WndProc;
wndclass2.cbClsExtra = 0;
@@ -170,7 +170,7 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR, int nCm
wndclass2.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH);
wndclass2.lpszMenuName = NULL;
wndclass2.lpszClassName = szWinName;
RegisterClass(&wndclass2);
}
@@ -280,7 +280,7 @@ HMENU menu;
check_cd_event(hwnd,message,wParam,lParam);
return 0;
break;
case WM_ACTIVATE:
if (hwnd == mainPtr) {
if ((LOWORD(wParam) == WA_ACTIVE) ||(LOWORD(wParam) == WA_CLICKACTIVE)) {
@@ -306,7 +306,7 @@ HMENU menu;
return 0;
case WM_COMMAND:
case WM_COMMAND:
if (hwnd == mainPtr) {
menu = GetMenu(mainPtr);
@@ -348,11 +348,11 @@ void check_game_done()
Boolean handle_menu (short item, HMENU)
{
short choice,i,j,k;
short i,j,k;
Boolean to_return = FALSE;
item_record_type store_i;
if ((file_in_mem == FALSE) && ((item == 1) || (item == 3) ||
(item >= 40)) && (item != 200) && (item != 100)) {
display_strings(20,5,0,0,"Editing party",57,707,0);
@@ -385,7 +385,7 @@ Boolean handle_menu (short item, HMENU)
edit_gold_or_food(1);
redraw_screen();
break;
case 44:
if (party.stuff_done[304][0] > 0) {
FCD(909,0);
@@ -394,7 +394,7 @@ Boolean handle_menu (short item, HMENU)
FCD(901,0);
leave_town();
break;
case 45:
if (party.stuff_done[304][0] == 0) {
FCD(911,0);
@@ -406,10 +406,10 @@ Boolean handle_menu (short item, HMENU)
party.stuff_done[304][0] = 0;
for (i = 0; i < 6; i++)
if (adven[i].main_status >= 10)
adven[i].main_status -= 10;
adven[i].main_status -= 10;
redraw_screen();
break;
case 48:
display_strings(20,20,0,0,"Editing party",57,707,0);
@@ -483,7 +483,7 @@ Boolean handle_menu (short item, HMENU)
}
display_strings(20,13,0,0,"Editing party",57,715,0);
for (i = 0; i < 96; i++)
for (j = 0; j < 96; j++)
for (j = 0; j < 96; j++)
out_e[i][j] = 1;
for (i = 0; i < 100; i++)
for (j = 0; j < 6; j++)
@@ -536,7 +536,7 @@ Boolean handle_menu (short item, HMENU)
void load_cursors()
{
sword_curs = LoadCursor(store_hInstance,MAKEINTRESOURCE(120));
set_cursor(sword_curs);
current_cursor = 124;
}

View File

@@ -18,11 +18,11 @@ produced by Borland Resource Workshop
#define MENU_1 1
#define Exile 1
Exile MENU
Exile MENU
{
POPUP "&File"
{
MENUITEM "&Open Game\tCtrl+O", 2
MENUITEM "&Open Game\tCtrl+O", 2
MENUITEM "&Save Game\tCtrl+S", 1
MENUITEM "Save As...", 3
MENUITEM SEPARATOR
@@ -109,7 +109,7 @@ Exile MENU
}
ACCELERATORS_1 ACCELERATORS
ACCELERATORS_1 ACCELERATORS
{
"^O", 2, ASCII
@@ -129,7 +129,7 @@ ACCELERATORS_1 ACCELERATORS
35 WAVE "resources/snd34.wav"
38 WAVE "resources/snd37.wav"
STRINGTABLE
STRINGTABLE
{
2101, "Light"
2103, "Spark"
@@ -290,51 +290,51 @@ STRINGTABLE
901 DIALOG 10, 10, 332, 74
STYLE WS_POPUP | WS_DLGFRAME
{
LTEXT "1_63" 1, 252, 48, 58, 20
LTEXT "5_708" 2, 8, 8, 36, 36
LTEXT "Your party will now be outdoors.|Things you have done in the town will not be remembered." 3, 52, 3, 257, 44
LTEXT "1_63", 1, 252, 48, 58, 20
LTEXT "5_708", 2, 8, 8, 36, 36
LTEXT "Your party will now be outdoors.|Things you have done in the town will not be remembered.", 3, 52, 3, 257, 44
}
907 DIALOG 10, 10, 400, 142 //<= future return to start message ?
STYLE WS_POPUP | WS_DLGFRAME
{
LTEXT "1_65" 1, 299, 113, 58, 20
LTEXT "0_64" 2, 231, 113, 58, 20
LTEXT "5_708" 3, 9, 9, 36, 36
LTEXT "This option moves your party to just outside Fort Emergence, where you started. Be careful that you aren't getting yourself stuck in doing this, by, for example, leaving a boat in a place where you can't get back to it." 4, 51, 4, 305, 66
LTEXT "Saving a backup copy of the save file before using this option is recommended. Are you sure you want to do this?" 5, 51, 71, 306, 40
LTEXT "1_65", 1, 299, 113, 58, 20
LTEXT "0_64", 2, 231, 113, 58, 20
LTEXT "5_708", 3, 9, 9, 36, 36
LTEXT "This option moves your party to just outside Fort Emergence, where you started. Be careful that you aren't getting yourself stuck in doing this, by, for example, leaving a boat in a place where you can't get back to it.", 4, 51, 4, 305, 66
LTEXT "Saving a backup copy of the save file before using this option is recommended. Are you sure you want to do this?", 5, 51, 71, 306, 40
}
908 DIALOG 10, 10, 328, 70
STYLE WS_POPUP | WS_DLGFRAME
{
LTEXT "1_63" 1, 255, 37, 58, 20
LTEXT "5_708" 2, 8, 8, 36, 36
LTEXT "You cannot use this option while the party is indoors, in a boat, or on a horse." 3, 52, 3, 261, 32
LTEXT "1_63", 1, 255, 37, 58, 20
LTEXT "5_708", 2, 8, 8, 36, 36
LTEXT "You cannot use this option while the party is indoors, in a boat, or on a horse.", 3, 52, 3, 261, 32
}
909 DIALOG 10, 10, 328, 72
STYLE WS_POPUP | WS_DLGFRAME
{
LTEXT "1_63" 1, 251, 49, 58, 20
LTEXT "5_708" 2, 8, 8, 36, 36
LTEXT "You cannot use this option while the party is split up. Select Reunite party from this menu." 3, 52, 3, 256, 44
LTEXT "1_63", 1, 251, 49, 58, 20
LTEXT "5_708", 2, 8, 8, 36, 36
LTEXT "You cannot use this option while the party is split up. Select Reunite party from this menu.", 3, 52, 3, 256, 44
}
910 DIALOG 10, 10, 344, 110
STYLE WS_POPUP | WS_DLGFRAME
{
LTEXT "1_63" 1, 261, 86, 58, 20
LTEXT "5_708" 2, 8, 8, 36, 36
LTEXT "Your party is now reunited. You are located where you were when you split up. Warning - doing this can trap your party if you didn't do something you needed to do while split up. Be sure to back up your save file before saving this change." 3, 52, 3, 266, 80
LTEXT "1_63", 1, 261, 86, 58, 20
LTEXT "5_708", 2, 8, 8, 36, 36
LTEXT "Your party is now reunited. You are located where you were when you split up. Warning - doing this can trap your party if you didn't do something you needed to do while split up. Be sure to back up your save file before saving this change.", 3, 52, 3, 266, 80
}
911 DIALOG 10, 10, 316, 48
STYLE WS_POPUP | WS_DLGFRAME
{
LTEXT "1_63" 1, 246, 25, 58, 20
LTEXT "5_708" 2, 8, 8, 36, 36
LTEXT "Your party is not split up!" 3, 52, 3, 252, 16
LTEXT "1_63", 1, 246, 25, 58, 20
LTEXT "5_708", 2, 8, 8, 36, 36
LTEXT "Your party is not split up!", 3, 52, 3, 252, 16
}
912 DIALOG 10, 10, 400, 142
@@ -349,10 +349,10 @@ STYLE WS_POPUP | WS_DLGFRAME
915 DIALOG 10, 10, 336, 110
STYLE WS_POPUP | WS_DLGFRAME
{
LTEXT "1_65" 1, 246, 88, 58, 20
LTEXT "0_64" 2, 178, 88, 58, 20
LTEXT "5_708" 3, 9, 9, 36, 36
LTEXT "This will reset all boats and horses to their original positions. Whether you own them or not will remain unchanged. Be careful when using this that you don't strand yourself on an island somewhere! Go ahead?" 4, 51, 4, 253, 82
LTEXT "1_65", 1, 246, 88, 58, 20
LTEXT "0_64", 2, 178, 88, 58, 20
LTEXT "5_708", 3, 9, 9, 36, 36
LTEXT "This will reset all boats and horses to their original positions. Whether you own them or not will remain unchanged. Be careful when using this that you don't strand yourself on an island somewhere! Go ahead?", 4, 51, 4, 253, 82
}
917 DIALOG 10, 10, 352, 172
@@ -377,57 +377,42 @@ STYLE WS_POPUP | WS_DLGFRAME
970 DIALOG 10, 10, 346, 167
STYLE WS_POPUP | WS_DLGFRAME
{
LTEXT "1_0" 1, 251, 107, 70, 20
LTEXT "0_68" 2, 8, 107, 70, 20
LTEXT "5_708" 3, 9, 9, 36, 36
LTEXT "= " 4, 55, 8, 257, 90
LTEXT "1_0", 1, 251, 107, 70, 20
LTEXT "0_68", 2, 8, 107, 70, 20
LTEXT "5_708", 3, 9, 9, 36, 36
LTEXT "= ", 4, 55, 8, 257, 90
}
971 DIALOG 10, 10, 347, 240
STYLE WS_POPUP | WS_DLGFRAME
{
LTEXT "1_0" 1, 248, 212, 70, 20
LTEXT "0_68" 2, 6, 212, 70, 20
LTEXT "5_708" 3, 9, 9, 36, 36
LTEXT "= " 4, 55, 8, 257, 91
LTEXT "= " 5, 55, 107, 257, 98
LTEXT "1_0", 1, 248, 212, 70, 20
LTEXT "0_68", 2, 6, 212, 70, 20
LTEXT "5_708", 3, 9, 9, 36, 36
LTEXT "= ", 4, 55, 8, 257, 91
LTEXT "= ", 5, 55, 107, 257, 98
}
972 DIALOG 10, 10, 350, 164
STYLE WS_POPUP | WS_DLGFRAME
{
LTEXT "1_0" 1, 247, 140, 70, 20
LTEXT "0_68" 2, 8, 140, 70, 20
LTEXT "5_708" 3, 9, 9, 36, 36
LTEXT "= " 4, 53, 38, 257, 92
LTEXT "*" 5, 26, 74, 14, 19
LTEXT "+" 6, 53, 9, 257, 19
LTEXT "1_0", 1, 247, 140, 70, 20
LTEXT "0_68", 2, 8, 140, 70, 20
LTEXT "5_708", 3, 9, 9, 36, 36
LTEXT "= ", 4, 53, 38, 257, 92
LTEXT "*", 5, 26, 74, 14, 19
LTEXT "+", 6, 53, 9, 257, 19
}
973 DIALOG 10, 10, 347, 264
STYLE WS_POPUP | WS_DLGFRAME
{
LTEXT "1_0" 1, 253, 238, 70, 20
LTEXT "0_68" 2, 9, 238, 70, 20
LTEXT "5_708" 3, 9, 9, 36, 36
LTEXT "= " 4, 55, 39, 257, 87
LTEXT "= " 5, 55, 136, 257, 93
LTEXT "+" 6, 55, 9, 257, 19
}
986 DIALOG 10, 10, 491, 374
STYLE WS_POPUP | WS_DLGFRAME
{
LTEXT "0_63" 1, 395, 334, 65, 20
LTEXT "5_716" 2, 6, 6, 36, 36
LTEXT "Welcome to the wonderful world of Exile III! Exile III is a true epic, with an intricate plot, a world that changes as events progress, and an amazing variety of paths your characters can take." 3, 50, 22, 413, 49
LTEXT "Exile III, like most games of its type, is fairly complicated. Fortunately, there are plenty of places to look for help should you get confused. Be sure to read the file _Exile III Instructions/Order Form_ which comes with the game." 4, 50, 72, 411, 58
LTEXT "This file contains not only complete instructions for playing and ordering the game, but a quick guide to getting started and a mini-hint book for the first few quests." 5, 50, 131, 411, 44
LTEXT "Also be sure to look at the Preferences Window (in the Options menu). It can make the game faster, slower, and even easier, change the display, and remove the special effects." 6, 50, 176, 413, 44
LTEXT "Rest assured, if you get stuck, there's plenty of stuff available to help you out. So on with the game, have fun, and watch your back!" 7, 50, 287, 410, 43
LTEXT "Finally, alas, the Macintosh world nowadays is rife with extension conflicts and other problems. If you experience crashes playing Exile III, there is troubleshooting info in the file _READ ME - Game and ASP Info_." 8, 50, 221, 411, 65
LTEXT "WELCOME TO EXILE III: RUINED WORLD!" 9, 136, 4, 265, 16
LTEXT "THIS IS A BETA COPY! DO NOT DISTRIBUTE! IF YOU ARE NOT AUTHORIZED TO HAVE THIS, PLEASE DELETE IT NOW!" 10, 3, 333, 381, 30
LTEXT "1_0", 1, 253, 238, 70, 20
LTEXT "0_68", 2, 9, 238, 70, 20
LTEXT "5_708", 3, 9, 9, 36, 36
LTEXT "= ", 4, 55, 39, 257, 87
LTEXT "= ", 5, 55, 136, 257, 93
LTEXT "+", 6, 55, 9, 257, 19
}
991 DIALOG 10, 10, 514, 338
@@ -506,141 +491,141 @@ STYLE WS_POPUP | WS_DLGFRAME
996 DIALOG 10, 10, 461, 206
STYLE WS_POPUP | WS_DLGFRAME
{
LTEXT "~Alchemy known:" 1, 54, 10, 163, 15
LTEXT "5_720" 2, 6, 6, 36, 36
LTEXT "1_0" 3, 356, 174, 63, 23
LTEXT "2_0" 4, 217, 33, 14, 10
LTEXT "2_0" 5, 217, 47, 14, 10
LTEXT "2_0" 6, 217, 61, 14, 10
LTEXT "2_0" 7, 217, 75, 14, 10
LTEXT "2_0" 8, 217, 89, 14, 10
LTEXT "2_0" 9, 217, 103, 14, 10
LTEXT "2_0" 10, 217, 117, 14, 10
LTEXT "2_0" 11, 217, 131, 14, 10
LTEXT "2_0" 12, 217, 145, 14, 10
LTEXT "2_0" 13, 217, 159, 14, 10
LTEXT "2_0" 14, 402, 33, 14, 10
LTEXT "2_0" 15, 402, 47, 14, 10
LTEXT "2_0" 16, 402, 61, 14, 10
LTEXT "2_0" 17, 402, 75, 14, 10
LTEXT "2_0" 18, 402, 89, 14, 10
LTEXT "2_0" 19, 402, 103, 14, 10
LTEXT "2_0" 20, 402, 117, 14, 10
LTEXT "2_0" 21, 402, 131, 14, 10
LTEXT "2_0" 22, 402, 145, 14, 10
LTEXT "2_0" 23, 402, 159, 14, 10
LTEXT "Number in ( ) is minimum skill to make." 24, 8, 179, 199, 16
LTEXT "~Alchemy known:", 1, 54, 10, 163, 15
LTEXT "5_720", 2, 6, 6, 36, 36
LTEXT "1_0", 3, 356, 174, 63, 23
LTEXT "2_0", 4, 217, 33, 14, 10
LTEXT "2_0", 5, 217, 47, 14, 10
LTEXT "2_0", 6, 217, 61, 14, 10
LTEXT "2_0", 7, 217, 75, 14, 10
LTEXT "2_0", 8, 217, 89, 14, 10
LTEXT "2_0", 9, 217, 103, 14, 10
LTEXT "2_0", 10, 217, 117, 14, 10
LTEXT "2_0", 11, 217, 131, 14, 10
LTEXT "2_0", 12, 217, 145, 14, 10
LTEXT "2_0", 13, 217, 159, 14, 10
LTEXT "2_0", 14, 402, 33, 14, 10
LTEXT "2_0", 15, 402, 47, 14, 10
LTEXT "2_0", 16, 402, 61, 14, 10
LTEXT "2_0", 17, 402, 75, 14, 10
LTEXT "2_0", 18, 402, 89, 14, 10
LTEXT "2_0", 19, 402, 103, 14, 10
LTEXT "2_0", 20, 402, 117, 14, 10
LTEXT "2_0", 21, 402, 131, 14, 10
LTEXT "2_0", 22, 402, 145, 14, 10
LTEXT "2_0", 23, 402, 159, 14, 10
LTEXT "Number in ( ) is minimum skill to make.", 24, 8, 179, 199, 16
}
998 DIALOG 10, 10, 330, 327
STYLE WS_POPUP | WS_DLGFRAME
{
LTEXT "5_0" 1, 8, 9, 28, 36
LTEXT "~Item Info:" 2, 45, 6, 102, 16
LTEXT "+" 3, 101, 33, 141, 16
LTEXT "+" 4, 58, 61, 141, 16
LTEXT "+" 5, 245, 61, 47, 16
LTEXT "+" 6, 58, 89, 25, 15
LTEXT "+" 7, 146, 89, 25, 15
LTEXT "+" 8, 231, 89, 25, 15
LTEXT "+" 9, 65, 117, 25, 16
LTEXT "+" 10, 138, 118, 26, 16
LTEXT "+" 11, 255, 118, 25, 16
LTEXT "+" 12, 61, 168, 230, 16
LTEXT "1_0" 13, 232, 307, 63, 23
LTEXT "0_2" 14, 88, 307, 63, 23
LTEXT "0_3" 15, 157, 307, 63, 23
LTEXT "2_0" 16, 213, 8, 14, 10
LTEXT "2_0" 17, 280, 8, 14, 10
LTEXT "~Description:" 18, 8, 192, 102, 16
LTEXT "=" 19, 8, 210, 286, 87
LTEXT "+" 20, 60, 142, 44, 15
LTEXT "5_0", 1, 8, 9, 28, 36
LTEXT "~Item Info:", 2, 45, 6, 102, 16
LTEXT "+", 3, 101, 33, 141, 16
LTEXT "+", 4, 58, 61, 141, 16
LTEXT "+", 5, 245, 61, 47, 16
LTEXT "+", 6, 58, 89, 25, 15
LTEXT "+", 7, 146, 89, 25, 15
LTEXT "+", 8, 231, 89, 25, 15
LTEXT "+", 9, 65, 117, 25, 16
LTEXT "+", 10, 138, 118, 26, 16
LTEXT "+", 11, 255, 118, 25, 16
LTEXT "+", 12, 61, 168, 230, 16
LTEXT "1_0", 13, 232, 307, 63, 23
LTEXT "0_2", 14, 88, 307, 63, 23
LTEXT "0_3", 15, 157, 307, 63, 23
LTEXT "2_0", 16, 213, 8, 14, 10
LTEXT "2_0", 17, 280, 8, 14, 10
LTEXT "~Description:", 18, 8, 192, 102, 16
LTEXT "=", 19, 8, 210, 286, 87
LTEXT "+", 20, 60, 142, 44, 15
}
1010 DIALOG 10, 10, 570, 391
STYLE WS_POPUP | WS_DLGFRAME
{
LTEXT "~Main statistics:" 1, 38, 99, 133, 17
LTEXT "~Training For:" 2, 56, 8, 110, 16
LTEXT "0_7" 3, 231, 53, 23, 20
LTEXT "0_6" 4, 256, 53, 23, 20
LTEXT "0_7" 5, 231, 75, 23, 20
LTEXT "0_6" 6, 256, 75, 23, 20
LTEXT "0_7" 7, 231, 119, 23, 20
LTEXT "0_6" 8, 256, 119, 23, 20
LTEXT "0_7" 9, 231, 141, 23, 20
LTEXT "0_6" 10, 256, 141, 23, 20
LTEXT "0_7" 11, 231, 163, 23, 20
LTEXT "0_6" 12, 256, 163, 23, 20
LTEXT "0_7" 13, 231, 204, 23, 20
LTEXT "0_6" 14, 256, 204, 23, 20
LTEXT "0_7" 15, 231, 226, 23, 20
LTEXT "0_6" 16, 256, 226, 23, 20
LTEXT "0_7" 17, 231, 248, 23, 20
LTEXT "0_6" 18, 256, 248, 23, 20
LTEXT "0_7" 19, 231, 270, 23, 20
LTEXT "0_6" 20, 256, 270, 23, 20
LTEXT "0_7" 21, 231, 292, 23, 20
LTEXT "0_6" 22, 256, 292, 23, 20
LTEXT "0_7" 23, 231, 314, 23, 20
LTEXT "0_6" 24, 256, 314, 23, 20
LTEXT "0_7" 25, 472, 74, 23, 20
LTEXT "0_6" 26, 497, 74, 23, 20
LTEXT "0_7" 27, 472, 96, 23, 20
LTEXT "0_6" 28, 497, 96, 23, 20
LTEXT "0_7" 29, 472, 118, 23, 20
LTEXT "0_6" 30, 497, 118, 23, 20
LTEXT "0_7" 31, 472, 140, 23, 20
LTEXT "0_6" 32, 497, 140, 23, 20
LTEXT "0_7" 33, 472, 162, 23, 20
LTEXT "0_6" 34, 497, 162, 23, 20
LTEXT "0_7" 35, 472, 206, 23, 20
LTEXT "0_6" 36, 497, 206, 23, 20
LTEXT "0_7" 37, 472, 228, 23, 20
LTEXT "0_6" 38, 497, 228, 23, 20
LTEXT "0_7" 39, 472, 250, 23, 20
LTEXT "0_6" 40, 497, 250, 23, 20
LTEXT "0_7" 41, 472, 272, 23, 20
LTEXT "0_6" 42, 497, 272, 23, 20
LTEXT "0_7" 43, 472, 294, 23, 20
LTEXT "0_6" 44, 497, 294, 23, 20
LTEXT "5_707" 45, 6, 7, 36, 36
LTEXT "" 46, 148, 344, 75, 16
LTEXT "" 47, 300, 344, 75, 16
LTEXT "0_4" 48, 403, 355, 63, 25
LTEXT "0_2" 49, 403, 329, 63, 23
LTEXT "0_3" 50, 470, 329, 63, 23
LTEXT "" 51, 177, 8, 166, 16
LTEXT "" 52, 194, 56, 28, 15
LTEXT "" 53, 194, 77, 28, 15
LTEXT "" 54, 194, 121, 28, 15
LTEXT "" 55, 194, 143, 28, 15
LTEXT "" 56, 194, 165, 28, 15
LTEXT "" 57, 194, 207, 28, 15
LTEXT "" 58, 194, 229, 28, 15
LTEXT "" 59, 194, 251, 28, 15
LTEXT "" 60, 194, 272, 28, 15
LTEXT "" 61, 194, 294, 28, 15
LTEXT "" 62, 194, 316, 28, 15
LTEXT "" 63, 435, 76, 28, 15
LTEXT "" 64, 435, 98, 29, 15
LTEXT "" 65, 435, 121, 29, 15
LTEXT "" 66, 435, 142, 29, 15
LTEXT "" 67, 435, 164, 29, 15
LTEXT "" 68, 434, 208, 29, 15
LTEXT "" 69, 434, 230, 29, 15
LTEXT "" 70, 434, 252, 29, 15
LTEXT "" 71, 434, 274, 29, 15
LTEXT "" 72, 434, 296, 29, 15
LTEXT "1_5" 73, 470, 355, 63, 25
LTEXT "~Skill: Cost: Level:" 74, 56, 32, 228, 16
LTEXT "~Skill: Cost: Level:" 75, 292, 32, 228, 16
LTEXT "~Warrior Skills:" 76, 38, 185, 133, 17
LTEXT "~Magic Skills:" 77, 292, 53, 133, 17
LTEXT "~Other Skills:" 78, 292, 185, 133, 17
LTEXT "*Cost: (Skill pts./Gold) " 79, 6, 365, 382, 16
LTEXT "*Skill Pts.:" 80, 71, 344, 68, 16
LTEXT "*Gold:" 81, 252, 344, 42, 16
LTEXT "~Main statistics:", 1, 38, 99, 133, 17
LTEXT "~Training For:", 2, 56, 8, 110, 16
LTEXT "0_7", 3, 231, 53, 23, 20
LTEXT "0_6", 4, 256, 53, 23, 20
LTEXT "0_7", 5, 231, 75, 23, 20
LTEXT "0_6", 6, 256, 75, 23, 20
LTEXT "0_7", 7, 231, 119, 23, 20
LTEXT "0_6", 8, 256, 119, 23, 20
LTEXT "0_7", 9, 231, 141, 23, 20
LTEXT "0_6", 10, 256, 141, 23, 20
LTEXT "0_7", 11, 231, 163, 23, 20
LTEXT "0_6", 12, 256, 163, 23, 20
LTEXT "0_7", 13, 231, 204, 23, 20
LTEXT "0_6", 14, 256, 204, 23, 20
LTEXT "0_7", 15, 231, 226, 23, 20
LTEXT "0_6", 16, 256, 226, 23, 20
LTEXT "0_7", 17, 231, 248, 23, 20
LTEXT "0_6", 18, 256, 248, 23, 20
LTEXT "0_7", 19, 231, 270, 23, 20
LTEXT "0_6", 20, 256, 270, 23, 20
LTEXT "0_7", 21, 231, 292, 23, 20
LTEXT "0_6", 22, 256, 292, 23, 20
LTEXT "0_7", 23, 231, 314, 23, 20
LTEXT "0_6", 24, 256, 314, 23, 20
LTEXT "0_7", 25, 472, 74, 23, 20
LTEXT "0_6", 26, 497, 74, 23, 20
LTEXT "0_7", 27, 472, 96, 23, 20
LTEXT "0_6", 28, 497, 96, 23, 20
LTEXT "0_7", 29, 472, 118, 23, 20
LTEXT "0_6", 30, 497, 118, 23, 20
LTEXT "0_7", 31, 472, 140, 23, 20
LTEXT "0_6", 32, 497, 140, 23, 20
LTEXT "0_7", 33, 472, 162, 23, 20
LTEXT "0_6", 34, 497, 162, 23, 20
LTEXT "0_7", 35, 472, 206, 23, 20
LTEXT "0_6", 36, 497, 206, 23, 20
LTEXT "0_7", 37, 472, 228, 23, 20
LTEXT "0_6", 38, 497, 228, 23, 20
LTEXT "0_7", 39, 472, 250, 23, 20
LTEXT "0_6", 40, 497, 250, 23, 20
LTEXT "0_7", 41, 472, 272, 23, 20
LTEXT "0_6", 42, 497, 272, 23, 20
LTEXT "0_7", 43, 472, 294, 23, 20
LTEXT "0_6", 44, 497, 294, 23, 20
LTEXT "5_707", 45, 6, 7, 36, 36
LTEXT "", 46, 148, 344, 75, 16
LTEXT "", 47, 300, 344, 75, 16
LTEXT "0_4", 48, 403, 355, 63, 25
LTEXT "0_2", 49, 403, 329, 63, 23
LTEXT "0_3", 50, 470, 329, 63, 23
LTEXT "", 51, 177, 8, 166, 16
LTEXT "", 52, 194, 56, 28, 15
LTEXT "", 53, 194, 77, 28, 15
LTEXT "", 54, 194, 121, 28, 15
LTEXT "", 55, 194, 143, 28, 15
LTEXT "", 56, 194, 165, 28, 15
LTEXT "", 57, 194, 207, 28, 15
LTEXT "", 58, 194, 229, 28, 15
LTEXT "", 59, 194, 251, 28, 15
LTEXT "", 60, 194, 272, 28, 15
LTEXT "", 61, 194, 294, 28, 15
LTEXT "", 62, 194, 316, 28, 15
LTEXT "", 63, 435, 76, 28, 15
LTEXT "", 64, 435, 98, 29, 15
LTEXT "", 65, 435, 121, 29, 15
LTEXT "", 66, 435, 142, 29, 15
LTEXT "", 67, 435, 164, 29, 15
LTEXT "", 68, 434, 208, 29, 15
LTEXT "", 69, 434, 230, 29, 15
LTEXT "", 70, 434, 252, 29, 15
LTEXT "", 71, 434, 274, 29, 15
LTEXT "", 72, 434, 296, 29, 15
LTEXT "1_5", 73, 470, 355, 63, 25
LTEXT "~Skill: Cost: Level:", 74, 56, 32, 228, 16
LTEXT "~Skill: Cost: Level:", 75, 292, 32, 228, 16
LTEXT "~Warrior Skills:", 76, 38, 185, 133, 17
LTEXT "~Magic Skills:", 77, 292, 53, 133, 17
LTEXT "~Other Skills:", 78, 292, 185, 133, 17
LTEXT "*Cost: (Skill pts./Gold) ", 79, 6, 365, 382, 16
LTEXT "*Skill Pts.:", 80, 71, 344, 68, 16
LTEXT "*Gold:", 81, 252, 344, 42, 16
}
1012 DIALOG 10, 10, 290, 94
@@ -655,73 +640,73 @@ STYLE WS_POPUP | WS_DLGFRAME
1013 DIALOG 10, 10, 525, 379
STYLE WS_POPUP | WS_DLGFRAME
{
LTEXT "~Special Characteristics:" 1, 55, 9, 181, 16
LTEXT "5_707" 2, 6, 6, 36, 36
LTEXT "1_0" 3, 423, 349, 63, 23
LTEXT "2_0" 4, 161, 55, 14, 10
LTEXT "2_0" 5, 289, 55, 14, 10
LTEXT "2_0" 6, 447, 55, 14, 11
LTEXT "2_0" 7, 215, 97, 14, 10
LTEXT "2_0" 8, 215, 112, 14, 10
LTEXT "2_0" 9, 215, 127, 14, 10
LTEXT "2_0" 10, 215, 142, 14, 10
LTEXT "2_0" 11, 215, 157, 14, 10
LTEXT "2_0" 12, 416, 97, 14, 10
LTEXT "2_0" 13, 416, 112, 14, 10
LTEXT "2_0" 14, 416, 127, 14, 10
LTEXT "2_0" 15, 416, 142, 14, 10
LTEXT "2_0" 16, 416, 157, 14, 10
LTEXT "~Species:" 17, 55, 30, 65, 18
LTEXT "" 18, 254, 352, 50, 16
LTEXT "=Select species and traits." 19, 15, 282, 469, 59
LTEXT "*Human (%0)" 20, 55, 53, 75, 15
LTEXT "*Nephilim (%12)" 21, 186, 53, 75, 15
LTEXT "*Slithzerikai (%20)" 22, 316, 53, 92, 15
LTEXT "*Toughness (%10)" 23, 55, 95, 75, 15
LTEXT "*Magically Apt. (%20)" 24, 55, 110, 75, 15
LTEXT "*Ambidextrous (%8)" 25, 55, 125, 116, 15
LTEXT "*Nimble Fingers (%10)" 26, 55, 140, 75, 15
LTEXT "*Cave Lore (%4)" 27, 55, 155, 75, 15
LTEXT "*Woodsman (%6)" 28, 236, 95, 126, 15
LTEXT "*Sluggish (%-10) " 29, 55, 197, 116, 15
LTEXT "*Magically Inept (%-8) " 30, 55, 212, 75, 15
LTEXT "*Frail (%-8) " 31, 55, 227, 75, 15
LTEXT "*Chronic Disease (%-20) " 32, 55, 242, 126, 15
LTEXT "Experience needed to gain each level:" 33, 19, 352, 216, 16
LTEXT "~Advantages" 34, 55, 74, 75, 16
LTEXT "~Disadvantages" 35, 55, 178, 75, 16
LTEXT "2_0" 36, 237, 198, 14, 10
LTEXT "2_0" 37, 237, 213, 14, 10
LTEXT "2_0" 38, 237, 228, 14, 10
LTEXT "2_0" 39, 237, 243, 14, 10
LTEXT "2_0" 40, 237, 258, 14, 10
LTEXT "*Good Constitution (%10)" 41, 236, 110, 126, 15
LTEXT "*Highly Alert (%7)" 42, 236, 125, 126, 15
LTEXT "*Exceptional Strength (%12)" 43, 236, 140, 126, 15
LTEXT "*Recuperation (%15)" 44, 236, 155, 126, 15
LTEXT "*Bad Back (%-8) " 45, 55, 257, 126, 15
LTEXT "Number in () is how much having that trait affects the experience you need to gain a level." 46, 289, 223, 204, 43
LTEXT "~Special Characteristics:", 1, 55, 9, 181, 16
LTEXT "5_707", 2, 6, 6, 36, 36
LTEXT "1_0", 3, 423, 349, 63, 23
LTEXT "2_0", 4, 161, 55, 14, 10
LTEXT "2_0", 5, 289, 55, 14, 10
LTEXT "2_0", 6, 447, 55, 14, 11
LTEXT "2_0", 7, 215, 97, 14, 10
LTEXT "2_0", 8, 215, 112, 14, 10
LTEXT "2_0", 9, 215, 127, 14, 10
LTEXT "2_0", 10, 215, 142, 14, 10
LTEXT "2_0", 11, 215, 157, 14, 10
LTEXT "2_0", 12, 416, 97, 14, 10
LTEXT "2_0", 13, 416, 112, 14, 10
LTEXT "2_0", 14, 416, 127, 14, 10
LTEXT "2_0", 15, 416, 142, 14, 10
LTEXT "2_0", 16, 416, 157, 14, 10
LTEXT "~Species:", 17, 55, 30, 65, 18
LTEXT "", 18, 254, 352, 50, 16
LTEXT "=Select species and traits.", 19, 15, 282, 469, 59
LTEXT "*Human (%0)", 20, 55, 53, 75, 15
LTEXT "*Nephilim (%12)", 21, 186, 53, 75, 15
LTEXT "*Slithzerikai (%20)", 22, 316, 53, 92, 15
LTEXT "*Toughness (%10)", 23, 55, 95, 75, 15
LTEXT "*Magically Apt. (%20)", 24, 55, 110, 75, 15
LTEXT "*Ambidextrous (%8)", 25, 55, 125, 116, 15
LTEXT "*Nimble Fingers (%10)", 26, 55, 140, 75, 15
LTEXT "*Cave Lore (%4)", 27, 55, 155, 75, 15
LTEXT "*Woodsman (%6)", 28, 236, 95, 126, 15
LTEXT "*Sluggish (%-10) ", 29, 55, 197, 116, 15
LTEXT "*Magically Inept (%-8) ", 30, 55, 212, 75, 15
LTEXT "*Frail (%-8) ", 31, 55, 227, 75, 15
LTEXT "*Chronic Disease (%-20) ", 32, 55, 242, 126, 15
LTEXT "Experience needed to gain each level:", 33, 19, 352, 216, 16
LTEXT "~Advantages", 34, 55, 74, 75, 16
LTEXT "~Disadvantages", 35, 55, 178, 75, 16
LTEXT "2_0", 36, 237, 198, 14, 10
LTEXT "2_0", 37, 237, 213, 14, 10
LTEXT "2_0", 38, 237, 228, 14, 10
LTEXT "2_0", 39, 237, 243, 14, 10
LTEXT "2_0", 40, 237, 258, 14, 10
LTEXT "*Good Constitution (%10)", 41, 236, 110, 126, 15
LTEXT "*Highly Alert (%7)", 42, 236, 125, 126, 15
LTEXT "*Exceptional Strength (%12)", 43, 236, 140, 126, 15
LTEXT "*Recuperation (%15)", 44, 236, 155, 126, 15
LTEXT "*Bad Back (%-8) ", 45, 55, 257, 126, 15
LTEXT "Number in () is how much having that trait affects the experience you need to gain a level.", 46, 289, 223, 204, 43
}
1018 DIALOG 10, 10, 311, 220
STYLE WS_POPUP | WS_DLGFRAME
{
LTEXT "*Hit a button or type '1'-'6'." 1, 11, 190, 184, 18
LTEXT "5_706" 2, 8, 8, 36, 36
LTEXT "0_11" 3, 69, 31, 58, 20
LTEXT "0_12" 4, 69, 56, 58, 20
LTEXT "0_13" 5, 69, 81, 58, 20
LTEXT "0_14" 6, 69, 106, 58, 20
LTEXT "0_15" 7, 69, 131, 58, 20
LTEXT "0_16" 8, 69, 156, 58, 20
LTEXT "+" 9, 138, 35, 139, 16
LTEXT "+" 10, 138, 60, 139, 16
LTEXT "+ " 11, 138, 85, 139, 16
LTEXT "+" 12, 138, 110, 139, 16
LTEXT "+" 13, 138, 135, 139, 16
LTEXT "+" 14, 138, 160, 139, 16
LTEXT "~Select a PC:" 15, 49, 10, 228, 16
LTEXT "1_5" 16, 214, 187, 63, 25
LTEXT "*Hit a button or type '1'-'6'.", 1, 11, 190, 184, 18
LTEXT "5_706", 2, 8, 8, 36, 36
LTEXT "0_11", 3, 69, 31, 58, 20
LTEXT "0_12", 4, 69, 56, 58, 20
LTEXT "0_13", 5, 69, 81, 58, 20
LTEXT "0_14", 6, 69, 106, 58, 20
LTEXT "0_15", 7, 69, 131, 58, 20
LTEXT "0_16", 8, 69, 156, 58, 20
LTEXT "+", 9, 138, 35, 139, 16
LTEXT "+", 10, 138, 60, 139, 16
LTEXT "+", 11, 138, 85, 139, 16
LTEXT "+", 12, 138, 110, 139, 16
LTEXT "+", 13, 138, 135, 139, 16
LTEXT "+", 14, 138, 160, 139, 16
LTEXT "~Select a PC:", 15, 49, 10, 228, 16
LTEXT "1_5", 16, 214, 187, 63, 25
}
1024 DIALOG 10, 10, 290, 183
@@ -738,9 +723,9 @@ STYLE WS_POPUP | WS_DLGFRAME
1049 DIALOG 10, 10, 338, 60
STYLE WS_POPUP | WS_DLGFRAME
{
LTEXT "1_63" 1, 249, 30, 58, 20
LTEXT "5_702" 2, 8, 8, 36, 36
LTEXT "No room in your inventory." 3, 52, 4, 255, 18
LTEXT "1_63", 1, 249, 30, 58, 20
LTEXT "5_702", 2, 8, 8, 36, 36
LTEXT "No room in your inventory.", 3, 52, 4, 255, 18
}
1062 DIALOG 10, 10, 529, 298
@@ -758,45 +743,45 @@ STYLE WS_POPUP | WS_DLGFRAME
1063 DIALOG 10, 10, 324, 58
STYLE WS_POPUP | WS_DLGFRAME
{
LTEXT "1_63" 1, 246, 31, 58, 20
LTEXT "5_723" 2, 6, 6, 36, 36
LTEXT "This is not a Blades of Exile save file." 3, 50, 6, 254, 16
LTEXT "1_63", 1, 246, 31, 58, 20
LTEXT "5_723", 2, 6, 6, 36, 36
LTEXT "This is not a Blades of Exile save file.", 3, 50, 6, 254, 16
}
1064 DIALOG 10, 10, 322, 68
STYLE WS_POPUP | WS_DLGFRAME
{
LTEXT "1_63" 1, 245, 34, 58, 20
LTEXT "5_723" 2, 6, 6, 36, 36
LTEXT "Loading Blades of Exile save file failed.|" 3, 50, 6, 253, 19
LTEXT "1_63", 1, 245, 34, 58, 20
LTEXT "5_723", 2, 6, 6, 36, 36
LTEXT "Loading Blades of Exile save file failed.|", 3, 50, 6, 253, 19
}
1066 DIALOG 10, 10, 336, 64
STYLE WS_POPUP | WS_DLGFRAME
{
LTEXT "1_84" 1, 230, 31, 80, 20
LTEXT "0_85" 2, 122, 31, 77, 20
LTEXT "0_5" 3, 54, 31, 58, 20
LTEXT "5_723" 4, 9, 9, 36, 36
LTEXT "~Do you want to save before quitting?" 5, 52, 5, 254, 18
LTEXT "1_84", 1, 230, 31, 80, 20
LTEXT "0_85", 2, 122, 31, 77, 20
LTEXT "0_5", 3, 54, 31, 58, 20
LTEXT "5_723", 4, 9, 9, 36, 36
LTEXT "~Do you want to save before quitting?", 5, 52, 5, 254, 18
}
1067 DIALOG 10, 10, 336, 78
STYLE WS_POPUP | WS_DLGFRAME
{
LTEXT "1_84" 1, 233, 41, 80, 20
LTEXT "0_105" 2, 125, 41, 77, 20
LTEXT "0_5" 3, 57, 41, 58, 20
LTEXT "5_723" 4, 9, 9, 36, 36
LTEXT "~Do you want to save before opening a new file?" 5, 52, 5, 262, 33
LTEXT "1_84", 1, 233, 41, 80, 20
LTEXT "0_105", 2, 125, 41, 77, 20
LTEXT "0_5", 3, 57, 41, 58, 20
LTEXT "5_723", 4, 9, 9, 36, 36
LTEXT "~Do you want to save before opening a new file?", 5, 52, 5, 262, 33
}
1069 DIALOG 10, 10, 322, 68
STYLE WS_POPUP | WS_DLGFRAME
{
LTEXT "1_63" 1, 245, 34, 58, 20
LTEXT "5_723" 2, 6, 6, 36, 36
LTEXT "Saving Blades of Exile save file failed.|" 3, 50, 6, 253, 19
LTEXT "1_63", 1, 245, 34, 58, 20
LTEXT "5_723", 2, 6, 6, 36, 36
LTEXT "Saving Blades of Exile save file failed.|", 3, 50, 6, 253, 19
}
900 DIALOG 13, 16, 334, 220

View File

@@ -0,0 +1,63 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
<Option title="Blades Char Editor" />
<Option platforms="Windows;" />
<Option pch_mode="2" />
<Option compiler="gcc" />
<Build>
<Target title="Debug">
<Option platforms="Windows;" />
<Option output="bin\Debug\Blades of Exile Character Editor" prefix_auto="1" extension_auto="1" />
<Option object_output="obj\Debug\" />
<Option type="0" />
<Option compiler="gcc" />
<Compiler>
<Add option="-g" />
</Compiler>
<Linker>
<Add library="libwinmm.a" />
</Linker>
</Target>
<Target title="Release">
<Option platforms="Windows;" />
<Option output="bin\Release\Blades of Exile Character Editor" prefix_auto="1" extension_auto="1" />
<Option object_output="obj\Release\" />
<Option type="0" />
<Option compiler="gcc" />
<Linker>
<Add option="-s" />
<Add library="libwinmm.a" />
</Linker>
</Target>
</Build>
<Compiler>
<Add option="-Wall" />
</Compiler>
<Unit filename="BLADPCED.CPP" />
<Unit filename="BLADPCED.RC">
<Option compilerVar="WINDRES" />
</Unit>
<Unit filename="DLOGTOOL.CPP" />
<Unit filename="DLOGTOOL.H" />
<Unit filename="EDACTION.CPP" />
<Unit filename="EDACTION.H" />
<Unit filename="EDFILEIO.CPP" />
<Unit filename="EDFILEIO.H" />
<Unit filename="EDITORS.CPP" />
<Unit filename="EDITORS.H" />
<Unit filename="EDSOUND.CPP" />
<Unit filename="EDSOUND.H" />
<Unit filename="GLOBAL.CPP" />
<Unit filename="GLOBAL.H" />
<Unit filename="GRAPHICS.CPP" />
<Unit filename="GRAPHICS.H" />
<Unit filename="GRAPHUTL.CPP" />
<Unit filename="GRAPHUTL.H" />
<Extensions>
<code_completion />
<debugger />
</Extensions>
</Project>
</CodeBlocks_project_file>

View File

@@ -76,7 +76,7 @@ HDC dlg_force_dc = NULL; // save HDCs when dealing with dlogs
short store_free_slot,store_dlog_num;
HWND store_parent;
short available_dlog_buttons[NUM_DLOG_B] = {0,63,64,65,1,4,5,8,
short available_dlog_buttons[NUM_DLOG_B] = {0,63,64,65,1,4,5,8,
128,
9,
10, // 10
@@ -136,7 +136,7 @@ char button_def_key[150] = {0,0,20,21,'k', 24,0,0,0,0,
'g','1','2','3','4', '5','6',0,0,0,
0,0,0,0,0,' ',0,22,23,0,
0,0,0,0,0,'1','2','3','4','5',
'6','7','8','9','a', 'b','c','d','e','f',
'6','7','8','9','a', 'b','c','d','e','f',
'g',0,0,0,0,0,0,0,0,0,
0,0,0,0,'y','n',0,'?','r',0,
0,0,0,0,0,0,0,0,0, 0,
@@ -292,7 +292,7 @@ BOOL CALLBACK dummy_dialog_proc(HWND hDlg, UINT message, WPARAM, LPARAM)
RECT dlg_rect;
short win_height = 0, win_width = 0;
short str_offset = 1;
free_slot = store_free_slot;
switch (message) {
@@ -368,7 +368,7 @@ BOOL CALLBACK dummy_dialog_proc(HWND hDlg, UINT message, WPARAM, LPARAM)
type = atoi(item_str);
flag = atoi(item_str+2);
}
free_item = -1;
// find free item
switch (type) {
@@ -409,12 +409,12 @@ BOOL CALLBACK dummy_dialog_proc(HWND hDlg, UINT message, WPARAM, LPARAM)
item_rect[free_item].bottom = item_rect[free_item].bottom / 2;
item_rect[free_item].right = item_rect[free_item].right / 2;
if ((type != 5) && ((store_dlog_num >= 2000) || (store_dlog_num == 986))) {
/*if ((type != 5) && ((store_dlog_num >= 2000) || (store_dlog_num == 986))) {
item_rect[free_item].top =
(item_rect[free_item].top * 11) / 10;
item_rect[free_item].bottom =
(item_rect[free_item].bottom * 11) / 10;
}
}*/
item_flag[free_item] = flag;
item_active[free_item] = 1;
@@ -467,7 +467,7 @@ BOOL CALLBACK dummy_dialog_proc(HWND hDlg, UINT message, WPARAM, LPARAM)
}
item_key[free_item] = 255;
break;
case 6:
case 6:
edit_box = CreateWindow("edit",NULL,WS_CHILD | WS_BORDER | WS_VISIBLE,
item_rect[free_item].left,item_rect[free_item].top,
item_rect[free_item].right - item_rect[free_item].left,
@@ -749,7 +749,7 @@ void cd_set_text_edit_str(short, char *str)
if (edit_box != NULL)
SetWindowText(edit_box,str);
}
void cdsin(short dlog_num, short item_num, short num)
void cdsin(short dlog_num, short item_num, short num)
{
cd_set_item_num( dlog_num, item_num, num);
}
@@ -1180,7 +1180,7 @@ void cd_erase_item(short dlog_num, short item_num)
return;
win_dc = cd_get_dlog_dc(dlg_index);
paint_pattern((HBITMAP)win_dc,2,to_fry,0);
cd_kill_dc(dlg_index,win_dc);
cd_kill_dc(dlg_index,win_dc);
}
void cd_erase_rect(short dlog_num,RECT to_fry)
@@ -1219,13 +1219,13 @@ void cd_press_button(short dlog_num, short item_num)
c[1] = GetNearestPaletteIndex(hpal,colors[1]);
c[2] = GetNearestPaletteIndex(hpal,colors[2]);*/
win_dc = cd_get_dlog_dc(dlg_index);
from_rect.top = button_ul_y[button_type[item_flag[item_index]]];
from_rect.left = button_ul_x[button_type[item_flag[item_index]]];
from_rect.bottom = from_rect.top + button_height[button_type[item_flag[item_index]]];
from_rect.right = from_rect.left + button_width[button_type[item_flag[item_index]]];
OffsetRect(&from_rect,button_width[button_type[item_flag[item_index]]],0);
rect_draw_some_item(dlg_buttons_gworld,from_rect,(HBITMAP) win_dc,item_rect[item_index],0,2);
SelectObject(win_dc,bold_font);
@@ -1238,7 +1238,7 @@ void cd_press_button(short dlog_num, short item_num)
}
else {
char_win_draw_string(win_dc,item_rect[item_index],
(char *) ((item_index < 10) ? text_long_str[item_index] :
(char *) ((item_index < 10) ? text_long_str[item_index] :
text_short_str[item_index - 10]),1,8);
}
if (item_type[item_index] < 2)
@@ -1263,7 +1263,7 @@ void cd_press_button(short dlog_num, short item_num)
}
else {
char_win_draw_string(win_dc,item_rect[item_index],
(char *) ((item_index < 10) ? text_long_str[item_index] :
(char *) ((item_index < 10) ? text_long_str[item_index] :
text_short_str[item_index - 10]),1,8);
}
if (item_type[item_index] < 2)
@@ -1425,8 +1425,8 @@ void draw_dialog_graphic(HWND hDlg, RECT rect, short which_g, Boolean do_frame,s
// 900 + x B&W graphic
// 950 null item
// 1000 + x Talking face
// 1100 - item info help
// 1200 - pc screen help
// 1100 - item info help
// 1200 - pc screen help
// 1300 - combat ap
// 1400-1402 - button help
// 1500 - stat symbols help

View File

@@ -5,10 +5,10 @@
#include "graphics.h"
#include "global.h"
#include "editors.h"
#include "edfileio.h"
#include "edaction.h"
#include "edsound.h"
#include "dlogtool.h"
#include "edfileio.h"
#include "edaction.h"
#include "edsound.h"
#include "dlogtool.h"
#include "graphutl.h"
/* Adventure globals */
@@ -42,7 +42,7 @@ short which_pc_displayed,store_pc_trait_mode,store_which_to_edit;
extern short current_active_pc;
char empty_string[256] = " ";
extern RECT pc_area_buttons[6][4],name_rect; // 0 - whole 1 - pic 2 - name 3 - stat strs 4,5 - later
extern RECT item_string_rects[24][4]; // 0 - name 1 - drop 2 - id 3 -
extern RECT item_string_rects[24][4]; // 0 - name 1 - drop 2 - id 3 -
short store_trait_mode,store_train_pc;
@@ -65,15 +65,12 @@ short skill_bonus[21] = {-3,-3,-2,-1,0,0,1,1,1,2,
pc_record_type *store_xp_pc;
//extern Rect pc_area_buttons[6][6] ; // 0 - whole 1 - pic 2 - name 3 - stat strs 4,5 - later
//extern Rect item_string_rects[24][4]; // 0 - name 1 - drop 2 - id 3 -
//extern Rect item_string_rects[24][4]; // 0 - name 1 - drop 2 - id 3 -
Boolean handle_action(POINT the_point, UINT wparam, LONG lparam )
//short mode; // ignore,
{
short i;
short choice = 4;
Boolean to_return = FALSE;
Boolean ctrl_key = FALSE;
Boolean right_button = FALSE;
@@ -87,7 +84,7 @@ Boolean handle_action(POINT the_point, UINT wparam, LONG lparam )
if (MK_CONTROL & wparam)
ctrl_key = TRUE;
if (file_in_mem == FALSE)
if (file_in_mem == FALSE)
return FALSE;
@@ -110,15 +107,15 @@ Boolean handle_action(POINT the_point, UINT wparam, LONG lparam )
case 1:
display_pc(current_active_pc,1,0);
break;
case 2:
case 2:
pick_race_abil(&adven[current_active_pc],0,0);
break;
case 3:
case 3:
spend_xp(current_active_pc,1,0);
break;
case 4:
case 4:
edit_xp(&adven[current_active_pc]);
break;
}
}
@@ -136,7 +133,7 @@ Boolean handle_action(POINT the_point, UINT wparam, LONG lparam )
adven[current_active_pc].items[i].item_properties = adven[current_active_pc].items[i].item_properties | 1;
draw_items(1);
}
return to_return;
}
@@ -160,7 +157,7 @@ void edit_gold_or_food_event_filter (short)
char get_text[256];
int tmp;
cd_get_text_edit_str((store_which_to_edit == 0) ? 1012 : 947,(char *) get_text);
dialog_answer = 0;
sscanf((char *) get_text,"%d",&tmp);
@@ -176,24 +173,24 @@ void edit_gold_or_food(short which_to_edit)
store_which_to_edit = which_to_edit;
make_cursor_sword();
cd_create_dialog((which_to_edit == 0) ? 1012 : 947,mainPtr);
sprintf((char *) sign_text,"%d",(short) ((which_to_edit == 0) ? party.gold : party.food));
cd_set_text_edit_str((which_to_edit == 0) ? 1012 : 947,(char *) sign_text);
cd_set_edit_focus();
while (dialog_not_toast)
ModalDialog();
ModalDialog();
cd_kill_dialog((which_to_edit == 0) ? 1012 : 947,0);
if (dialog_answer < 0)
dialog_answer = -1;
else dialog_answer = minmax(0,25000,dialog_answer);
if (dialog_answer >= 0) {
if (which_to_edit == 0)
if (which_to_edit == 0)
party.gold = dialog_answer;
else party.food = dialog_answer;
}
@@ -203,7 +200,7 @@ void edit_day_event_filter (short)
{
char get_text[256];
int tmp;
cd_get_text_edit_str(917,(char *) get_text);
sscanf((char *) get_text,"%d",&tmp);
dialog_answer = tmp;
@@ -219,21 +216,21 @@ void edit_day()
make_cursor_sword();
cd_create_dialog(917,mainPtr);
sprintf((char *) sign_text,"%d",(short) ( ((party.age) / 3700) + 1));
cd_set_text_edit_str(917,(char *) sign_text);
cd_set_edit_focus();
while (dialog_not_toast)
ModalDialog();
ModalDialog();
cd_kill_dialog(917,0);
dialog_answer = minmax(1,500,dialog_answer)-1;
party.age = (long) (3700) * (long) (dialog_answer);
}
@@ -273,19 +270,19 @@ Boolean display_pc_event_filter (short item_hit)
pc_num = (pc_num == 5) ? 0 : pc_num + 1;
} while (adven[pc_num].main_status == 0);
which_pc_displayed = pc_num;
put_pc_graphics();
put_pc_graphics();
break;
default:
if (store_trait_mode == 0)
adven[which_pc_displayed].mage_spells[item_hit - 3] =
adven[which_pc_displayed].mage_spells[item_hit - 3] =
1 - adven[which_pc_displayed].mage_spells[item_hit - 3];
else
adven[which_pc_displayed].priest_spells[item_hit - 3] =
adven[which_pc_displayed].priest_spells[item_hit - 3] =
1 - adven[which_pc_displayed].priest_spells[item_hit - 3];
put_pc_graphics();
put_pc_graphics();
break;
}
}
return FALSE;
}
@@ -293,7 +290,7 @@ void display_pc(short pc_num,short mode,short)
{
short i;
char label_str[256];
if (adven[pc_num].main_status == 0) {
for (pc_num = 0; pc_num < 6; pc_num++)
if (adven[pc_num].main_status == 1)
@@ -445,11 +442,11 @@ Boolean spend_xp_event_filter (short item_hit)
dialog_answer = 0;
talk_done = TRUE;
break;
case 3: case 4:
if (((store_h >= 250) && (item_hit == 4)) ||((store_h <= 2) && (item_hit == 3)))
if (((store_h >= 250) && (item_hit == 4)) ||((store_h <= 2) && (item_hit == 3)))
play_sound(0);
else {
if (item_hit == 3) {
@@ -537,7 +534,7 @@ Boolean spend_xp_event_filter (short item_hit)
}
else {
which_skill = (item_hit - 7) / 2;
if (((store_skills[which_skill] >= skill_max[which_skill]) && ((item_hit - 7) % 2 == 1)) ||
((store_skills[which_skill] == 0) && ((item_hit - 7) % 2 == 0) && (which_skill > 2)) ||
((store_skills[which_skill] == 1) && ((item_hit - 7) % 2 == 0) && (which_skill <= 2)))
@@ -564,10 +561,10 @@ Boolean spend_xp_event_filter (short item_hit)
cd_set_item_num(1010,54 + which_skill,store_skills[which_skill]);
draw_xp_skills();
}
}
}
break;
}
store_train_pc = pc_num;
if (talk_done == TRUE) {
dialog_not_toast = FALSE;
@@ -602,12 +599,12 @@ Boolean spend_xp(short pc_num, short, short parent)
cd_add_label(1010,i,(char *) get_text,(i < 63) ? 1075 : 1069);
}
do_xp_draw();
dialog_answer = 0;
while (dialog_not_toast)
ModalDialog();
ModalDialog();
cd_kill_dialog(1010,0);
@@ -618,7 +615,7 @@ void edit_xp_event_filter (short)
{
char get_text[256];
int tmp;
cd_get_text_edit_str(1024,(char *) get_text);
sscanf((char *) get_text,"%d",&tmp);
dialog_answer = tmp;
@@ -635,22 +632,22 @@ void edit_xp(pc_record_type *pc)
store_xp_pc = pc;
make_cursor_sword();
cd_create_dialog(1024,mainPtr);
sprintf((char *) sign_text,"%d",(short)pc->experience);
cd_set_text_edit_str(1024,(char *) sign_text);
item_hit = get_tnl(store_xp_pc);
cdsin(1024,8,item_hit);
while (dialog_not_toast)
ModalDialog();
cd_kill_dialog(1024,0);
if (dialog_answer < 0)
dialog_answer = dialog_answer * -1;
dialog_answer = minmax(0,10000,dialog_answer);
pc->experience = dialog_answer;
}

View File

@@ -66,7 +66,7 @@ while(file_path[i] != '\\')
i--; // find the last '\' in the path to the executable
} // in order to get rid of 'blades of exile.exe'
int j=0; // initialize the second loop
for(j=0;j<i+1;j++)
@@ -114,11 +114,10 @@ void load_file()
Boolean town_restore = FALSE;
Boolean maps_there = FALSE;
Boolean in_scen = FALSE;
char flag_data[8];
DWORD dwByteRead;
UINT count,error;
UINT count;
char *party_ptr;
char *pc_ptr;
@@ -138,7 +137,7 @@ void load_file()
return;
SetCurrentDirectory(file_path_name);
file_id = CreateFile(szFileName, GENERIC_READ, FILE_SHARE_READ, NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (file_id == INVALID_HANDLE_VALUE) return;
@@ -153,13 +152,13 @@ void load_file()
CloseHandle(file_id);
return;
}
if ((flag != flags[i][0]) && (flag != flags[i][1]))
{
CloseHandle(file_id);
FCD(1063,0);
return;
}
}
store_flags[i]=flag;
@@ -168,9 +167,9 @@ void load_file()
if ((i == 2) && (flag == flags[i][1])) maps_there = TRUE;
}
// LOAD PARTY
// LOAD PARTY
party_ptr = (char *) &party;
ReadFile(file_id, &party.age, 4, &dwByteRead, NULL);
ReadFile(file_id, &party.gold, 2, &dwByteRead, NULL);
ReadFile(file_id, &party.food, 2, &dwByteRead, NULL);
@@ -185,7 +184,7 @@ void load_file()
ReadFile(file_id, &party.p_loc.y, 1, &dwByteRead, NULL);
ReadFile(file_id, &party.loc_in_sec.x, 1, &dwByteRead, NULL);
ReadFile(file_id, &party.loc_in_sec.y, 1, &dwByteRead, NULL);
for (i = 0; i < 30; i++)
{
ReadFile(file_id, &party.boats[i].boat_loc.x, 1, &dwByteRead, NULL);
@@ -212,7 +211,7 @@ void load_file()
}
for (i = 0; i < 4; i++)
{
for (j = 0; j < 60; j++)
for (j = 0; j < 60; j++)
{
ReadFile(file_id, &party.creature_save[i].dudes[j].active, 2, &dwByteRead, NULL);
ReadFile(file_id, &party.creature_save[i].dudes[j].attitude, 2, &dwByteRead, NULL);
@@ -282,11 +281,11 @@ void load_file()
ReadFile(file_id, &party.creature_save[i].dudes[j].monst_start.facial_pic, 2, &dwByteRead, NULL);
}
}
ReadFile(file_id, &party.creature_save[i].which_town, 2, &dwByteRead, NULL);
ReadFile(file_id, &party.creature_save[i].friendly, 2, &dwByteRead, NULL);
}
ReadFile(file_id, &party.in_boat, 2, &dwByteRead, NULL);
ReadFile(file_id, &party.in_horse, 2, &dwByteRead, NULL);
for (i = 0; i < 10; i++)
@@ -366,10 +365,10 @@ void load_file()
ReadFile(file_id, &party.total_dam_taken, 4, &dwByteRead, NULL);
ReadFile(file_id, party.scen_name, 256, &dwByteRead, NULL);
for (count = 0; count < sizeof(party_record_type); count++) party_ptr[count] ^= 0x5C;
for (count = 0; count < sizeof(party_record_type); count++) party_ptr[count] ^= 0x5C;
// LOAD SETUP
if (ReadFile(file_id, &setup_save, sizeof(setup_save_type), &dwByteRead, NULL) == FALSE)
{
CloseHandle(file_id);
@@ -378,7 +377,7 @@ void load_file()
}
// LOAD PCS
for (i = 0; i < 6; i++)
{
pc_ptr = (char *) &adven[i];
@@ -388,13 +387,13 @@ void load_file()
FCD(1064,0);
return;
}
for (count = 0; count < sizeof(pc_record_type); count++)
pc_ptr[count] ^= 0x6B;
pc_ptr[count] ^= 0x6B;
}
if (in_scen == TRUE) {
// LOAD OUTDOOR MAP
if (ReadFile(file_id, out_e, sizeof(out_info_type), &dwByteRead, NULL) == FALSE)
{
@@ -403,7 +402,7 @@ void load_file()
return;
}
// LOAD TOWN
// LOAD TOWN
if (town_restore == TRUE)
{
/*if (ReadFile(file_id, &c_town, sizeof(current_town_type), &dwByteRead, NULL) == FALSE)
@@ -412,11 +411,11 @@ void load_file()
FCD(1064,0);
return;
}*/
{
ReadFile(file_id, &c_town.town_num, 2, &dwByteRead, NULL);
ReadFile(file_id, &c_town.difficulty, 2, &dwByteRead, NULL);
ReadFile(file_id, &c_town.town, sizeof(town_record_type), &dwByteRead, NULL);
ReadFile(file_id, c_town.explored, 64 * 64, &dwByteRead, NULL);
ReadFile(file_id, &c_town.hostile, 1, &dwByteRead, NULL);
@@ -498,10 +497,10 @@ void load_file()
ReadFile(file_id, &c_town.in_boat, 1, &dwByteRead, NULL);
ReadFile(file_id, &c_town.p_loc.x, 1, &dwByteRead, NULL);
ReadFile(file_id, &c_town.p_loc.y, 1, &dwByteRead, NULL);
}
if (ReadFile(file_id, &t_d, sizeof(big_tr_type), &dwByteRead, NULL) == FALSE)
{
CloseHandle(file_id);
@@ -517,7 +516,7 @@ void load_file()
}
load_town_strings(c_town.town_num); // load town strings
}
// LOAD STORED ITEMS
@@ -528,7 +527,7 @@ void load_file()
CloseHandle(file_id);
FCD(1064,0);
return;
}
}
}
// LOAD SAVED MAPS
@@ -540,34 +539,34 @@ void load_file()
FCD(1064,0);
return;
}
if (ReadFile(file_id, &o_maps, sizeof(stored_outdoor_maps_type), &dwByteRead, NULL) == FALSE)
{
CloseHandle(file_id);
FCD(1064,0);
return;
}
}
}
// LOAD SFX & MISC_I
if (ReadFile(file_id, &sfx, 64 * 64, &dwByteRead, NULL) == FALSE)
{
CloseHandle(file_id);
FCD(1064,0);
return;
}
}
if (ReadFile(file_id, &misc_i, 64 * 64, &dwByteRead, NULL) == FALSE)
{
CloseHandle(file_id);
FCD(1064,0);
return;
}
}
} // end if_scen
CloseHandle(file_id);
for (i = 0; i < 6; i++)
if (adven[i].main_status > 0) {
current_active_pc = i;
@@ -578,7 +577,7 @@ void load_file()
party_in_scen = in_scen;
item_menus_lock = load_items_list();
redraw_screen();
}
@@ -589,12 +588,12 @@ short load_items_list(){ //LOAD SCENARIO ITEMS LIST
scenario_data_type scenario;
char scen_name[256]="";
if(party_in_scen)
sprintf(scen_name,"scenarios/%s",party.scen_name);
else
sprintf(scen_name,"bladbase.exs");
scen_file_id = CreateFile(scen_name, GENERIC_READ, FILE_SHARE_READ, NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (scen_file_id == INVALID_HANDLE_VALUE)
@@ -604,24 +603,24 @@ short load_items_list(){ //LOAD SCENARIO ITEMS LIST
"File Error",MB_OK | MB_ICONEXCLAMATION);
scen_file_id = CreateFile("bladbase.exs", GENERIC_READ, FILE_SHARE_READ, NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if(scen_file_id == INVALID_HANDLE_VALUE){
CloseHandle(scen_file_id);
if(scen_file_id == INVALID_HANDLE_VALUE){
CloseHandle(scen_file_id);
MessageBox(mainPtr,"Couldn't open bladbase.exs, can't give items.",
"File Error",MB_OK | MB_ICONEXCLAMATION);
return 1;
}
}
if (ReadFile(scen_file_id, &scenario, sizeof(scenario_data_type), &dwScenByteRead, NULL) == FALSE) //get scenario data
{
CloseHandle(scen_file_id);
MessageBox(mainPtr,"Invalid scenario file !",
"File Error",MB_OK | MB_ICONEXCLAMATION);
return 1;
}
}
// item data
if (ReadFile(scen_file_id, &scen_item_list, sizeof(scen_item_data_type), &dwScenByteRead, NULL) == FALSE)
{
CloseHandle(scen_file_id);
@@ -629,13 +628,13 @@ MessageBox(mainPtr,"Couldn't read the scenario item list !",
"File Error",MB_OK | MB_ICONEXCLAMATION);
return 1;
}
if ((scenario.flag1 == 10) && (scenario.flag2 == 20)
&& (scenario.flag3 == 30)
&& (scenario.flag4 == 40)) {
port_item_list(); //Mac scenario, so let's make sure to adjust items properties
}
CloseHandle(scen_file_id);
return 0;
@@ -648,12 +647,12 @@ void load_town_strings(short which_town){ //LOAD TOWNS STRINGS LIST
DWORD dwScenByteRead;
scenario_data_type scenario;
char scen_name[256]="";
int i,j;
sprintf(scen_name,"scenarios/%s",party.scen_name);
scen_file_id = CreateFile(scen_name, GENERIC_READ, FILE_SHARE_READ, NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (scen_file_id == INVALID_HANDLE_VALUE)
@@ -662,7 +661,7 @@ void load_town_strings(short which_town){ //LOAD TOWNS STRINGS LIST
"File Error",MB_OK | MB_ICONEXCLAMATION);
return;
}
if (ReadFile(scen_file_id, &scenario, sizeof(scenario_data_type), &dwScenByteRead, NULL) == FALSE)
{
CloseHandle(scen_file_id);
@@ -670,13 +669,13 @@ if (ReadFile(scen_file_id, &scenario, sizeof(scenario_data_type), &dwScenByteRea
"File Error",MB_OK | MB_ICONEXCLAMATION);
return;
}
if ((scenario.flag1 == 10) && (scenario.flag2 == 20)
&& (scenario.flag3 == 30)
&& (scenario.flag4 == 40)) {
port_scenario(&scenario); //Mac scenario, so let's make sure we can read it properly
}
len_to_jump += sizeof(scen_item_data_type);//now let's jump to the town_strings position
for (i = 0; i < 300; i++)
len_to_jump += (long) scenario.scen_str_len[i];
@@ -707,13 +706,13 @@ if (ReadFile(scen_file_id, &scenario, sizeof(scenario_data_type), &dwScenByteRea
}
// town strings
for (i = 0; i < 140; i++) {
len = (long) (c_town.town.strlens[i]);
ReadFile(scen_file_id, &town_strs[i], len, &dwScenByteRead, NULL);
town_strs[i][len] = 0;
}
CloseHandle(scen_file_id);
}//END TOWNS STRINGS LOADING
@@ -722,7 +721,6 @@ void save_file(short mode)
//short mode; // 0 - normal 1 - save as
{
HANDLE file_id;
UINT error;
short i,j;
@@ -762,40 +760,40 @@ void save_file(short mode)
CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
SetCurrentDirectory(file_path_name);
if (file_id == INVALID_HANDLE_VALUE) return;
store = &flag;
store = &flag;
flag = (town_save == TRUE) ? 1342 : 5790;
if (WriteFile(file_id, store, sizeof(short), &bytes, NULL) == FALSE)
{
CloseHandle(file_id);
FCD(1069,0);
FCD(1069,0);
return;
}
flag = (in_scen == TRUE) ? 100 : 200;
if (WriteFile(file_id, store, sizeof(short), &bytes, NULL) == FALSE)
{
CloseHandle(file_id);
FCD(1069,0);
FCD(1069,0);
return;
}
flag = (save_maps == TRUE) ? 5567 : 3422;
if (WriteFile(file_id, store, sizeof(short), &bytes, NULL) == FALSE)
{
CloseHandle(file_id);
FCD(1069,0);
FCD(1069,0);
return;
}
// SAVE PARTY
party_ptr = &party;
party_ptr = &party;
party_encryptor = (char *) party_ptr;
for (count = 0; count < sizeof(party_record_type); count++)
party_encryptor[count] ^= 0x5C;
WriteFile(file_id, &party.age, 4, &dwByteRead, NULL);
WriteFile(file_id, &party.gold, 2, &dwByteRead, NULL);
WriteFile(file_id, &party.food, 2, &dwByteRead, NULL);
@@ -810,7 +808,7 @@ void save_file(short mode)
WriteFile(file_id, &party.p_loc.y, 1, &dwByteRead, NULL);
WriteFile(file_id, &party.loc_in_sec.x, 1, &dwByteRead, NULL);
WriteFile(file_id, &party.loc_in_sec.y, 1, &dwByteRead, NULL);
for (i = 0; i < 30; i++)
{
WriteFile(file_id, &party.boats[i].boat_loc.x, 1, &dwByteRead, NULL);
@@ -837,7 +835,7 @@ void save_file(short mode)
}
for (i = 0; i < 4; i++)
{
for (j = 0; j < 60; j++)
for (j = 0; j < 60; j++)
{
WriteFile(file_id, &party.creature_save[i].dudes[j].active, 2, &dwByteRead, NULL);
WriteFile(file_id, &party.creature_save[i].dudes[j].attitude, 2, &dwByteRead, NULL);
@@ -907,11 +905,11 @@ void save_file(short mode)
WriteFile(file_id, &party.creature_save[i].dudes[j].monst_start.facial_pic, 2, &dwByteRead, NULL);
}
}
WriteFile(file_id, &party.creature_save[i].which_town, 2, &dwByteRead, NULL);
WriteFile(file_id, &party.creature_save[i].friendly, 2, &dwByteRead, NULL);
}
WriteFile(file_id, &party.in_boat, 2, &dwByteRead, NULL);
WriteFile(file_id, &party.in_horse, 2, &dwByteRead, NULL);
for (i = 0; i < 10; i++)
@@ -990,22 +988,22 @@ void save_file(short mode)
WriteFile(file_id, &party.total_xp_gained, 4, &dwByteRead, NULL);
WriteFile(file_id, &party.total_dam_taken, 4, &dwByteRead, NULL);
WriteFile(file_id, party.scen_name, 256, &dwByteRead, NULL);
for (count = 0; count < sizeof(party_record_type); count++)
party_encryptor[count] ^= 0x5C;
// SAVE SETUP
setup_ptr = &setup_save;
setup_ptr = &setup_save;
if (WriteFile(file_id, &setup_save, sizeof(setup_save_type), &bytes, NULL) == FALSE)
{
CloseHandle(file_id);
FCD(1069,0);
return;
}
// SAVE PCS
// SAVE PCS
for (i = 0; i < 6; i++) {
pc_ptr = &adven[i];
pc_ptr = &adven[i];
party_encryptor = (char *) pc_ptr;
for (count = 0; count < sizeof(pc_record_type); count++)
@@ -1016,24 +1014,24 @@ void save_file(short mode)
for (count = 0; count < sizeof(pc_record_type); count++)
party_encryptor[count] ^= 0x6B;
FCD(1069,0);
MessageBeep(MB_OK);
MessageBeep(MB_OK);
return;
}
for (count = 0; count < sizeof(pc_record_type); count++)
party_encryptor[count] ^= 0x6B;
}
if (party_in_scen == TRUE) {
// SAVE OUT DATA
if (WriteFile(file_id, out_e, sizeof(out_info_type), &bytes, NULL) == FALSE)
{
CloseHandle(file_id);
FCD(1069,0);
FCD(1069,0);
return;
}
if (town_save == TRUE) {
if (town_save == TRUE) {
{
WriteFile(file_id, &c_town.town_num, 2, &dwByteRead, NULL);
WriteFile(file_id, &c_town.difficulty, 2, &dwByteRead, NULL);
@@ -1123,18 +1121,18 @@ void save_file(short mode)
if (WriteFile(file_id, &t_d, sizeof(big_tr_type), &bytes, NULL) == FALSE)
{
CloseHandle(file_id);
FCD(1069,0);
FCD(1069,0);
return;
}
if (WriteFile(file_id, &t_i, sizeof(stored_items_list_type), &bytes, NULL) == FALSE)
{
CloseHandle(file_id);
FCD(1069,0);
FCD(1069,0);
return;
}
}
}
// Save stored items
// Save stored items
for (i = 0; i < 3; i++) {
if (WriteFile(file_id, &stored_items[i], sizeof(stored_items_list_type), &bytes, NULL) == FALSE)
{
@@ -1143,7 +1141,7 @@ void save_file(short mode)
return;
}
}
// If saving maps, save maps
if (save_maps == TRUE) {
if (WriteFile(file_id, &(town_maps), sizeof(stored_town_maps_type), &bytes, NULL) == FALSE)
@@ -1159,8 +1157,8 @@ void save_file(short mode)
FCD(1069,0);
return;
}
}
}
// SAVE SFX and MISC_I
if (WriteFile(file_id, sfx, (64 * 64), &bytes, NULL) == FALSE)
{
@@ -1170,7 +1168,7 @@ void save_file(short mode)
if (WriteFile(file_id, misc_i, (64 * 64), &bytes, NULL) == FALSE)
{
CloseHandle(file_id);
FCD(1069,0);
FCD(1069,0);
return;
}
}
@@ -1192,7 +1190,7 @@ void remove_party_from_scen()
}
void get_reg_data()
{
{
const int BUFFER_LEN = 64;
char buffer[BUFFER_LEN];
const char * iniFile = "./blades.ini";
@@ -1206,7 +1204,7 @@ void get_reg_data()
void port_scenario(scenario_data_type *scenario)
{
short i,j,k,l;
short i,j;
flip_short(&scenario->flag_a);
flip_short(&scenario->flag_b);
@@ -1326,7 +1324,7 @@ void flip_spec_node(special_node_type *spec)
void port_item_list()
{
short i,j,k,l;
short i;
for (i = 0; i < 400; i++) {
flip_short(&(scen_item_list.scen_items[i].variety));

View File

@@ -43,7 +43,7 @@ HBITMAP dlg_buttons_gworld,mixed_gworld,dialog_pattern_gworld,pattern_gworld;
RECT whole_win_rect;
RECT title_from = {41,0,380,70};
extern RECT pc_area_buttons[6][4] ; // 0 - whole 1 - pic 2 - name 3 - stat strs 4,5 - later
extern RECT item_string_rects[24][4]; // 0 - name 1 - drop 2 - id 3 -
extern RECT item_string_rects[24][4]; // 0 - name 1 - drop 2 - id 3 -
extern RECT pc_info_rect; // Frame that holds a pc's basic info and items
extern RECT name_rect;
extern RECT pc_race_rect;
@@ -51,11 +51,11 @@ extern RECT info_area_rect;
extern RECT hp_sp_rect;
extern RECT skill_rect;
extern RECT pc_skills_rect[19];
extern RECT status_rect;
extern RECT pc_status_rect[10];
extern RECT status_rect;
extern RECT pc_status_rect[10];
extern RECT traits_rect;
extern RECT pc_traits_rect[16];
extern RECT edit_rect[5][2];
extern RECT pc_traits_rect[16];
extern RECT edit_rect[5][2];
extern HINSTANCE store_hInstance;
short store_str1a;
@@ -294,7 +294,6 @@ void draw_main_screen()
{
RECT source_rect, dest_rec,dest_rect;
RECT reg_rect;
char temp_str[256];
RECT top_pic_from = {3,16,41,54};
@@ -315,7 +314,7 @@ void draw_main_screen()
dest_rect.left -=5;
SelectObject(main_dc,bold_font);
char_win_draw_string(main_dc,dest_rect,"Your party:",0,10);
dest_rec = whole_win_rect;
InflateRect(&dest_rec,-10,-10);
@@ -345,7 +344,7 @@ void draw_main_screen()
reg_rect.left = reg_rect.right - 170;
reg_rect.top = pc_info_rect.top - 70;
reg_rect.bottom = pc_info_rect.top;
}
void do_button_action(short,short which_button)
@@ -362,13 +361,13 @@ void do_button_action(short,short which_button)
//extern Rect pc_area_buttons[6][6] ; // 0 - whole 1 - pic 2 - name 3 - stat strs 4,5 - later
//extern Rect item_string_rects[24][4]; // 0 - name 1 - drop 2 - id 3 -
//extern Rect item_string_rects[24][4]; // 0 - name 1 - drop 2 - id 3 -
void draw_items(short clear_first)
//short clear_first; // 0 - redraw over, 1 - don't redraw over
{
short i;
char to_draw[256];
RECT d_from = {28,12,42,24},i_from = {42,12,56,24},dest_rect;
RECT d_from = {28,12,42,24},i_from = {42,12,56,24};
if (file_in_mem == FALSE)
return;
@@ -382,10 +381,10 @@ void draw_items(short clear_first)
paint_pattern(NULL,1,item_string_rects[i][0],3);
// paint_pattern(NULL,1,dest_rect,3);
}
// frame_dlog_rect(mainPtr,frame_rect,0);
if (adven[current_active_pc].main_status != 1){
frame_dlog_rect(mainPtr,pc_info_rect,0); // re draw entire frame
frame_dlog_rect(mainPtr,pc_info_rect,0); // re draw entire frame
frame_dlog_rect(mainPtr,info_area_rect,0); // draw the frame
frame_dlog_rect(mainPtr,pc_race_rect,0); // draw the frame
return; // If PC is dead, it has no items
@@ -398,7 +397,7 @@ void draw_items(short clear_first)
else if (adven[current_active_pc].items[i].charges > 0)
sprintf((char *) to_draw, "%d. %s (%d)",i + 1,adven[current_active_pc].items[i].full_name,
adven[current_active_pc].items[i].charges);
else sprintf((char *) to_draw, "%d. %s ",i + 1,adven[current_active_pc].items[i].full_name);
else sprintf((char *) to_draw, "%d. %s ",i + 1,adven[current_active_pc].items[i].full_name);
char_win_draw_string(main_dc,item_string_rects[i][0],(char *) to_draw,0,10);
@@ -466,7 +465,7 @@ void display_party(short,short clear_first)
sprintf(buffer,"Food: %d Gold: %d Day: %d Party in %s",party.food,party.gold,(party.age/3700)+1,town_strs[0]);
}
char_win_draw_string(main_dc,from_rect,buffer,0,10);
/* from_rect = title_from; //town variable
from_rect.top = from_rect.bottom - 10;
from_rect.left += 300;
@@ -492,7 +491,7 @@ void display_party(short,short clear_first)
from_rect.left -= 1;
from_rect.top -= 1;
frame_dlog_rect(mainPtr,from_rect,0);
for (i = 0; i < 6; i++) {
if (i == current_active_pc)
SetTextColor(main_dc,colors[1]);
@@ -503,7 +502,7 @@ void display_party(short,short clear_first)
if ((current_pressed_button < 0) || (current_pressed_button == i))
rect_draw_some_item(buttons_gworld,from_rect,buttons_gworld,pc_area_buttons[i][0],0,1);
SetTextColor(main_dc,colors[0]);
// pc_record_type adven[6] is the records that contains characters
// main_status determins 0 - not exist, 1 - alive, OK, 2 - dead, 3 - stoned, 4 - dust
if (adven[i].main_status != 0) { // PC exists?
@@ -513,7 +512,7 @@ void display_party(short,short clear_first)
rect_draw_some_item(pc_gworld,from_rect,pc_gworld,pc_area_buttons[i][1],0,1);
frame_dlog_rect(mainPtr,pc_area_buttons[i][1],0); // re-draw the frame
//frame_dlog_rect((GrafPtr) mainPtr,pc_area_buttons[i][1],0);
//frame_dlog_rect((GrafPtr) mainPtr,pc_area_buttons[i][1],0);
// draw name
//TextSize(9);
if( (strlen(adven[i].name)) >= 0) {
@@ -553,48 +552,48 @@ void display_party(short,short clear_first)
char_win_draw_string(main_dc,pc_race_rect,"Nephilim ",1,10);
if (adven[i].race == 2)
char_win_draw_string(main_dc,pc_race_rect,"Slithzerikai ",1,10);
// Draw in skills
// Draw in skills
sprintf((char *) to_draw, "Skills:");
win_draw_string(main_dc,skill_rect,to_draw,0,10);
sprintf((char *) to_draw, "Hp: %d/%d Sp: %d/%d",adven[i].cur_health,adven[i].max_health,adven[i].cur_sp,
adven[i].max_sp);
win_draw_string(main_dc,hp_sp_rect,to_draw,0,10);
SelectObject(main_dc,font);
string_num=1;
for( k = 0; k < 19 ; ++k)
{
temp_rect = pc_skills_rect[k];
temp_rect.left = pc_skills_rect[k].left + ((k < 10) ? 90 : 83);
get_str(to_draw,9,string_num);
win_draw_string(main_dc,pc_skills_rect[k],to_draw,0,9);
sprintf((char *) skill_value,"%d",adven[i].skills[k]);
OffsetRect(&temp_rect,-8,0);
temp_rect.right += 10;
win_draw_string(main_dc,temp_rect,skill_value,0,9);
win_draw_string(main_dc,temp_rect,skill_value,0,9);
//frame_dlog_rect((GrafPtr) mainPtr,pc_skills_rect[k],0);
string_num+=2;
}
//end skills
//Write in pc Status
SelectObject(main_dc,bold_font);
sprintf((char *) to_draw, "Status:");
win_draw_string(main_dc,status_rect,to_draw,0,10);
SelectObject(main_dc,font);
//for(k = 0 ; k < 10; k++)
//frame_dlog_rect((GrafPtr) mainPtr,pc_status_rect[k],0);
if (adven[i].status[0] > 0)
if (adven[i].status[0] > 0)
if(cur_rect <= 9) {
char_win_draw_string(main_dc,pc_status_rect[cur_rect],"Poisoned Weap.",0,9);
cur_rect++;
}
if (adven[i].status[1] > 0)
if (adven[i].status[1] > 0)
if(cur_rect <= 9) {
char_win_draw_string(main_dc,pc_status_rect[cur_rect],"Blessed",0,9);
cur_rect++;
@@ -604,12 +603,12 @@ void display_party(short,short clear_first)
char_win_draw_string(main_dc,pc_status_rect[cur_rect],"Cursed",0,9);
cur_rect++;
}
if (adven[i].status[2] > 0)
if (adven[i].status[2] > 0)
if(cur_rect <= 9) {
char_win_draw_string(main_dc,pc_status_rect[cur_rect],"Poisoned",0,9);
cur_rect++;
}
if (adven[i].status[3] > 0)
}
if (adven[i].status[3] > 0)
if(cur_rect <= 9) {
char_win_draw_string(main_dc,pc_status_rect[cur_rect],"Hasted",0,9);
cur_rect++;
@@ -619,126 +618,126 @@ void display_party(short,short clear_first)
char_win_draw_string(main_dc,pc_status_rect[cur_rect],"Slowed",0,9);
cur_rect++;
}
if (adven[i].status[4] > 0)
if (adven[i].status[4] > 0)
if(cur_rect <= 9) {
char_win_draw_string(main_dc,pc_status_rect[cur_rect],"Invulnerable",0,9);
cur_rect++;
}
if (adven[i].status[5] > 0)
if (adven[i].status[5] > 0)
if(cur_rect <= 9) {
char_win_draw_string(main_dc,pc_status_rect[cur_rect],"Magic Resistant",0,9);
cur_rect++;
}
if (adven[i].status[6] > 0)
if (adven[i].status[6] > 0)
if(cur_rect <= 9) {
char_win_draw_string(main_dc,pc_status_rect[cur_rect],"Webbed",0,9);
cur_rect++;
}
if (adven[i].status[7] > 0)
if (adven[i].status[7] > 0)
if(cur_rect <= 9) {
char_win_draw_string(main_dc,pc_status_rect[cur_rect],"Diseased",0,9);
cur_rect++;
}
if (adven[i].status[8] > 0)
if (adven[i].status[8] > 0)
if(cur_rect <= 9) {
char_win_draw_string(main_dc,pc_status_rect[cur_rect],"Sanctury",0,9);
cur_rect++;
}
if (adven[i].status[9] > 0)
if (adven[i].status[9] > 0)
if(cur_rect <= 9) {
char_win_draw_string(main_dc,pc_status_rect[cur_rect],"Dumbfounded",0,9);
cur_rect++;
}
if (adven[i].status[10] > 0)
if (adven[i].status[10] > 0)
if(cur_rect <= 9) {
char_win_draw_string(main_dc,pc_status_rect[cur_rect],"Martyr's Shield",0,9);
cur_rect++;
}
if (adven[i].status[11] > 0)
if (adven[i].status[11] > 0)
if(cur_rect <= 9) {
char_win_draw_string(main_dc,pc_status_rect[cur_rect],"Asleep",0,9);
cur_rect++;
}
if (adven[i].status[12] > 0)
if (adven[i].status[12] > 0)
if(cur_rect <= 9) {
char_win_draw_string(main_dc,pc_status_rect[cur_rect],"Paralyzed",0,9);
cur_rect++;
}
if (adven[i].status[13] > 0)
if (adven[i].status[13] > 0)
if(cur_rect <= 9) {
char_win_draw_string(main_dc,pc_status_rect[cur_rect],"Acid",0,9);
cur_rect++;
}
//end pc status section
//Write in Traits
SelectObject(main_dc,bold_font);
sprintf((char *) to_draw, "Traits:");
win_draw_string(main_dc,traits_rect,to_draw,0,10);
SelectObject(main_dc,font);
cur_rect=0;
if (adven[i].traits[0] == 1)
if (adven[i].traits[0] == 1)
if(cur_rect <= 15) {
char_win_draw_string(main_dc,pc_traits_rect[cur_rect],"Toughness",0,9);
cur_rect++;
}
if (adven[i].traits[1] == 1)
if (adven[i].traits[1] == 1)
if(cur_rect <= 15) {
char_win_draw_string(main_dc,pc_traits_rect[cur_rect],"Magically Apt",0,9);
cur_rect++;
}
if (adven[i].traits[2] == 1)
}
if (adven[i].traits[2] == 1)
if(cur_rect <= 15) {
char_win_draw_string(main_dc,pc_traits_rect[cur_rect],"Ambidextrous",0,9);
cur_rect++;
}
if (adven[i].traits[3] == 1)
if (adven[i].traits[3] == 1)
if(cur_rect <= 15) {
char_win_draw_string(main_dc,pc_traits_rect[cur_rect],"Nimble Fingers",0,9);
cur_rect++;
}
if (adven[i].traits[4] == 1)
if (adven[i].traits[4] == 1)
if(cur_rect <= 15) {
char_win_draw_string(main_dc,pc_traits_rect[cur_rect],"Cave Lore",0,9);
cur_rect++;
}
if (adven[i].traits[5] == 1)
if (adven[i].traits[5] == 1)
if(cur_rect <= 15) {
char_win_draw_string(main_dc,pc_traits_rect[cur_rect],"Woodsman",0,9);
cur_rect++;
}
if (adven[i].traits[6] == 1)
if (adven[i].traits[6] == 1)
if(cur_rect <= 15) {
char_win_draw_string(main_dc,pc_traits_rect[cur_rect],"Good Constitution",0,9);
cur_rect++;
}
if (adven[i].traits[7] == 1)
}
if (adven[i].traits[7] == 1)
if(cur_rect <= 15) {
char_win_draw_string(main_dc,pc_traits_rect[cur_rect],"Highly Alert",0,9);
cur_rect++;
}
if (adven[i].traits[8] == 1)
if (adven[i].traits[8] == 1)
if(cur_rect <= 15) {
char_win_draw_string(main_dc,pc_traits_rect[cur_rect],"Exceptional Str.",0,9);
cur_rect++;
}
if (adven[i].traits[9] == 1)
if (adven[i].traits[9] == 1)
if(cur_rect <= 15) {
char_win_draw_string(main_dc,pc_traits_rect[cur_rect],"Recuperation",0,9);
cur_rect++;
}
if (adven[i].traits[10] == 1)
if (adven[i].traits[10] == 1)
if(cur_rect <= 15) {
char_win_draw_string(main_dc,pc_traits_rect[cur_rect],"Sluggish",0,9);
cur_rect++;
}
if (adven[i].traits[11] == 1)
if (adven[i].traits[11] == 1)
if(cur_rect <= 15) {
char_win_draw_string(main_dc,pc_traits_rect[cur_rect],"Magically Inept",0,9);
cur_rect++;
}
if (adven[i].traits[12] == 1)
}
if (adven[i].traits[12] == 1)
if(cur_rect <= 14) {
char_win_draw_string(main_dc,pc_traits_rect[cur_rect],"Frail",0,9);
cur_rect++;
@@ -753,10 +752,10 @@ void display_party(short,short clear_first)
char_win_draw_string(main_dc,pc_traits_rect[cur_rect],"Bad Back",0,9);
cur_rect++;
}
//end traits
SetTextColor(main_dc,colors[0]);
SelectObject(main_dc,bold_font);
char_win_draw_string(main_dc,pc_area_buttons[i][3],"Alive ",1,10);
@@ -812,19 +811,19 @@ void display_party(short,short clear_first)
break;
}
}
//frame_dlog_rect((GrafPtr) mainPtr,pc_area_buttons[i][0],0);
//frame_dlog_rect((GrafPtr) mainPtr,pc_area_buttons[i][0],0);
}
} // Closes the for i=6 loop
SetTextColor(main_dc,colors[0]);
for(i = 0; i < 5; i++)
if ((current_pressed_button < 0) || (current_pressed_button == i + 10)) {
for(i = 0; i < 5; i++)
if ((current_pressed_button < 0) || (current_pressed_button == i + 10)) {
if (clear_first == 1) { // first erase what's already there
paint_pattern(NULL,1,edit_rect[i][0],3);
}
}
from_rect = (current_pressed_button == i + 10) ? ed_buttons_from[1] : ed_buttons_from[0];
rect_draw_some_item(buttons_gworld,from_rect,buttons_gworld,edit_rect[i][0],0,1);
@@ -849,7 +848,7 @@ void display_party(short,short clear_first)
break;
}
SetTextColor(main_dc,colors[0]);
}
}
@@ -860,7 +859,7 @@ void display_strings_event_filter (short item_hit)
{
switch (item_hit) {
case 1:
dialog_not_toast = FALSE;
@@ -878,12 +877,12 @@ void display_strings(short str1a,short str1b,short str2a,short str2b,
make_cursor_sword();
store_str1a = str1a;
store_str1b = str1b;
store_str2a = str2a;
store_str2b = str2b;
if ((str1a <= 0) || (str1b <= 0))
return;
store_which_string_dlog = 970;
@@ -892,11 +891,11 @@ void display_strings(short str1a,short str1b,short str2a,short str2b,
if ((str2a > 0) && (str2b > 0))
store_which_string_dlog++;
cd_create_dialog_parent_num(store_which_string_dlog,parent_num);
cd_activate_item(store_which_string_dlog,2,0);
csp(store_which_string_dlog,store_which_string_dlog,graphic_num);
get_str(sign_text,str1a,str1b);
csit(store_which_string_dlog,4,(char *) sign_text);
if ((str2a > 0) && (str2b > 0)) {
@@ -909,8 +908,8 @@ void display_strings(short str1a,short str1b,short str2a,short str2b,
if (sound_num >= 0)
play_sound(sound_num);
while (dialog_not_toast)
ModalDialog();
ModalDialog();
cd_kill_dialog(store_which_string_dlog,0);
}
@@ -922,7 +921,7 @@ void get_str(char *str,short i, short j)
void char_win_draw_string(HDC dest_window,RECT dest_rect,char *str,short mode,short line_height)
{
char store_s[256];
strcpy((char *) store_s,str);
win_draw_string( dest_window, dest_rect,store_s, mode, line_height);
@@ -959,7 +958,7 @@ void win_draw_string(HDC dest_hdc,RECT dest_rect,char *str,short mode,short)
DT_LEFT | DT_VCENTER | DT_NOCLIP | DT_SINGLELINE); break;
}
// not yet done adjusts for 1, 2, 3
}
short string_length(char *str,HDC hdc)
@@ -967,10 +966,10 @@ short string_length(char *str,HDC hdc)
short text_len[257];
short total_width = 0,i,len;
char p_str[256];
for (i = 0; i < 257; i++)
text_len[i]= 0;
strcpy((char *) p_str,str);
MeasureText(256,p_str,text_len,hdc);
len = strlen((char *)str);
@@ -1029,7 +1028,7 @@ void GetIndString(char *str,short i, short j) {
}
void make_cursor_sword()
void make_cursor_sword()
{
SetCursor(sword_curs);
}

View File

@@ -66,14 +66,14 @@ HBITMAP load_pict(short pict_num,HDC model_hdc)
case 1400: got_bitmap = ReadBMP("images/STSCICON.BMP"); break;
case 1401: got_bitmap = ReadBMP("images/HELPPICS.BMP"); break;
case 1402: got_bitmap = ReadBMP("images/APPIC.BMP"); break;
case 1500: case 1501: case 1502: case 1503: case 1504: case 1505: case 1506: case 1507:
case 1500: case 1501: case 1502: case 1503: case 1504: case 1505: case 1506: case 1507:
got_bitmap = ReadBMP("images/BIGMAPS.BMP"); break;
case 2000: got_bitmap = ReadBMP("images/DLOGBTNS.BMP"); break;
case 3000: got_bitmap = ReadBMP("images/START.BMP"); break;
case 3001: got_bitmap = ReadBMP("images/SPIDLOGO.BMP"); break;
case 5000: got_bitmap = ReadBMP("images/BLEDTITL.BMP"); break;
case 5001: got_bitmap = ReadBMP("images/PCEDBTNS.BMP"); break;
default: got_bitmap = NULL;
}
return got_bitmap;
@@ -86,7 +86,6 @@ void rect_draw_some_item(HBITMAP src,RECT src_rect,HBITMAP dest,RECT dest_rect,
COLORREF white = RGB(255,255,255),oldcolor;
HBRUSH hbrush,old_brush;
COLORREF x = RGB(17,17,17);
UINT c;
HBITMAP store,store2;
Boolean dlog_draw = FALSE;
@@ -173,7 +172,7 @@ void rect_draw_some_item(HBITMAP src,RECT src_rect,HBITMAP dest,RECT dest_rect,
src_rect.bottom - src_rect.top,SRCINVERT);
DeleteDC(hdcMem3);
DeleteDC(hdcMem2);
DeleteObject(transbmp);
}
else {
@@ -228,7 +227,7 @@ void DisposeGWorld(HBITMAP bitmap)
DeleteObject(bitmap);
}
void SectRect(RECT *a, RECT *b, RECT *c)
void SectRect(RECT *a, RECT *b, RECT *c)
{
IntersectRect(c,a,b);
}

View File

@@ -26,9 +26,6 @@
<Option object_output="obj\Release\" />
<Option type="0" />
<Option compiler="gcc" />
<Compiler>
<Add option="-O2" />
</Compiler>
<Linker>
<Add option="-s" />
<Add library="libwinmm.a" />

File diff suppressed because it is too large Load Diff

View File

@@ -12,9 +12,9 @@
short get_ran (short times,short min,short max){
long int store;
short i, to_ret = 0;
if(max < min) max = min;
for (i = 1; i < times + 1; i++) {
store = rand();
to_ret += min + (store % (max - min + 1));//min + (((store + 32767) * (max - min + 1)) / 65536);
@@ -67,4 +67,4 @@ short gcd(short a, short b){ // Grabbed from Wikipedia and translated to C code
a = t;
}
return a;
}
}

View File

@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
<Option title="Boesounds DLL" />
<Option pch_mode="2" />
<Option compiler="gcc" />
<Build>
<Target title="Debug">
<Option output="bin\Debug\boesounds" prefix_auto="1" extension_auto="1" />
<Option object_output="obj\Debug\" />
<Option type="3" />
<Option compiler="gcc" />
<Option createDefFile="1" />
<Option createStaticLib="1" />
<Compiler>
<Add option="-g" />
</Compiler>
</Target>
<Target title="Release">
<Option output="bin\Release\boesounds" prefix_auto="1" extension_auto="1" />
<Option object_output="obj\Release\" />
<Option type="3" />
<Option compiler="gcc" />
<Option createDefFile="1" />
<Option createStaticLib="1" />
<Linker>
<Add option="-s" />
</Linker>
</Target>
</Build>
<Compiler>
<Add option="-Wall" />
</Compiler>
<Unit filename="BOESOUNDS.RC">
<Option compilerVar="WINDRES" />
</Unit>
<Unit filename="dllmain.cpp" />
<Extensions>
<code_completion />
<debugger />
</Extensions>
</Project>
</CodeBlocks_project_file>

View File

@@ -89,13 +89,13 @@ char last_file_printed = 0;
char szBladBase[128];
void loadSettingsFromFile()
{
{
const int BUFFER_LEN = 64;
char buffer[BUFFER_LEN];
const char * iniFile = "./blades.ini";
const char * section = "Scenario Editor";
GetPrivateProfileString(section, "bladbase.exs", "bladbase.exs",
szBladBase, 126, iniFile);
szBladBase[127] = 0;
@@ -113,7 +113,6 @@ void loadSettingsFromFile()
void saveSettingsToFile()
{
char tmp[] = "?";
const char * iniFile = "./blades.ini";
const char * section = "Scenario Editor";
@@ -134,7 +133,7 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,LPSTR, int nCmd
MSG msg;
WNDCLASS wndclass,wndclass2;
short i,seed;
short seed;
if (!hPrevInstance) {
wndclass.style = CS_HREDRAW | CS_VREDRAW | CS_BYTEALIGNWINDOW;
@@ -160,7 +159,7 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,LPSTR, int nCmd
wndclass2.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH);
wndclass2.lpszMenuName = NULL;
wndclass2.lpszClassName = szWinName;
RegisterClass(&wndclass2);
}
@@ -247,10 +246,10 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,LPSTR, int nCmd
}
}
}
delete data_store;
saveSettingsToFile();
return msg.wParam;
}
@@ -258,14 +257,12 @@ long CALLBACK WndProc (HWND hwnd, UINT message,WPARAM wParam, LPARAM lParam)
{
HDC hdc;
PAINTSTRUCT ps;
RECT rect;
//RECT s_rect = {0,0,30,30},d_rect = {0,0,30,30},d2 = {0,0,420,216},s2 = {0,0,420,216};
POINT press;
short handled = 0,sbar_pos = 0,old_setting;
long which_sbar;
int min = 0, max = 0;
HMENU menu;
RECT wind_rect;
POINT p;
RECT r;
@@ -473,7 +470,7 @@ void check_game_done()
Boolean handle_menu (short item, HMENU menu)
{
short i,j;
short i;
Boolean to_return = FALSE;
short item_hit;
Boolean need_redraw = FALSE;
@@ -533,7 +530,7 @@ Boolean handle_menu (short item, HMENU menu)
case 106: overall_mode = 47;
set_string("Select party starting location.","");
break;
case 109:
case 109:
lpsi.fMask = SIF_POS;
lpsi.nPos = 0;
SetScrollInfo(right_sbar,SB_CTL,&lpsi,TRUE);
@@ -619,7 +616,7 @@ Boolean handle_menu (short item, HMENU menu)
redraw_screen();
}
break;
case 121:
if (fancy_choice_dialog(867,0) == 1) {
last_file_printed = 2;
@@ -660,25 +657,25 @@ Boolean handle_menu (short item, HMENU menu)
case 208: if (fancy_choice_dialog(863,0) == 2) // add random
break;
place_items_in_town();
break;
break;
case 209: for (i = 0; i < 64; i++) // set not prop
town.preset_items[i].property = 0;
fancy_choice_dialog(861,0);
draw_terrain();
break;
break;
case 210: if (fancy_choice_dialog(862,0) == 2) // clear all items
break;
for (i = 0; i < 64; i++)
town.preset_items[i].item_code = -1;
draw_terrain();
break;
case 213:
break;
case 213:
lpsi.fMask = SIF_POS;
lpsi.nPos = 0;
SetScrollInfo(right_sbar,SB_CTL,&lpsi,TRUE);
//SetScrollPos(right_sbar,SB_CTL,0,TRUE);
start_special_editing(2,0); break;
case 214:
case 214:
lpsi.fMask = SIF_POS;
lpsi.nPos = 0;
SetScrollInfo(right_sbar,SB_CTL,&lpsi,TRUE);
@@ -691,13 +688,13 @@ Boolean handle_menu (short item, HMENU menu)
for (i = 0; i < 60; i++) {
t_d.creatures[i].number = 0;
t_d.creatures[i].start_loc.x = 0;
t_d.creatures[i].start_loc.y = 0;
t_d.creatures[i].start_loc.y = 0;
t_d.creatures[i].spec_enc_code = 0;
t_d.creatures[i].time_flag = 0;
t_d.creatures[i].spec1 = -1;
t_d.creatures[i].spec2 = -1;
t_d.creatures[i].spec2 = -1;
}
break;
break;
case 218: if (fancy_choice_dialog(873,0) == 2) // clear all special encounters
break;
for (i = 0; i < 50; i++) {
@@ -705,7 +702,7 @@ Boolean handle_menu (short item, HMENU menu)
town.special_locs[i].y = 0;
town.spec_id[i] = 255;
}
break;
break;
case 219: if (fancy_choice_dialog(874,0) == 2) // clear all fields
break;
for (i = 0; i < 50; i++)
@@ -714,7 +711,7 @@ Boolean handle_menu (short item, HMENU menu)
town.preset_fields[i].field_loc.x = 0;
town.preset_fields[i].field_loc.y = 0;
}
break;
break;
case 220: if (fancy_choice_dialog(876,0) == 2) // clear all stains
break;
@@ -731,7 +728,7 @@ Boolean handle_menu (short item, HMENU menu)
start_town_data_dump();
}
break;
case 222:
start_dialogue_editing(0);
break;
@@ -752,7 +749,7 @@ Boolean handle_menu (short item, HMENU menu)
current_terrain.special_id[i] = 255;
}
case 311:
case 311:
lpsi.fMask = SIF_POS;
lpsi.nPos = 0;
SetScrollInfo(right_sbar,SB_CTL,&lpsi,TRUE);
@@ -764,7 +761,7 @@ Boolean handle_menu (short item, HMENU menu)
SetScrollInfo(right_sbar,SB_CTL,&lpsi,TRUE);
//SetScrollPos(right_sbar,SB_CTL,0,TRUE);
start_string_editing(1,0); break;
break;
break;
case 313:
if (fancy_choice_dialog(879,0) == 1) {
@@ -773,17 +770,17 @@ Boolean handle_menu (short item, HMENU menu)
}
break;
case 401:
start_town_edit();
case 401:
start_town_edit();
break;
case 402:
start_out_edit();
case 402:
start_out_edit();
break;
case 403:
case 403:
short x, y;
location spot_hit;
if (editing_town == false) {
if (editing_town == false) {
if (change_made == TRUE) {
if (save_check(859) == FALSE)
@@ -795,34 +792,34 @@ Boolean handle_menu (short item, HMENU menu)
spot_hit.y = x % 100;
load_outdoors(spot_hit,0);
augment_terrain(spot_hit);
start_out_edit();
start_out_edit();
}
}
else {
else {
if (change_made == TRUE) {
if (save_check(859) == FALSE)
break;
break;
}
x = pick_town_num(855,cur_town);
if (x >= 0) {
load_town(x);
start_town_edit();
start_town_edit();
}
}
break;
case 404:
case 404:
set_up_main_screen();
start_terrain_editing();
break;
case 405:
set_up_main_screen();
case 405:
set_up_main_screen();
start_monster_editing(0);
break;
case 406:
case 406:
start_item_editing(0);
break;
case 407:
case 407:
set_up_main_screen();
break;
@@ -860,7 +857,7 @@ Boolean handle_menu (short item, HMENU menu)
start_out_edit();
}
break;
case 410: // load next town/outdoor zone
if (editing_town == true) {
if (cur_town + 1 == scenario.num_towns)
@@ -888,7 +885,7 @@ Boolean handle_menu (short item, HMENU menu)
start_out_edit();
}
break;
case 411: // MENUITEM "Terrain Animations Play", 411
HMENU menu,big_menu;
@@ -940,7 +937,7 @@ Boolean handle_menu (short item, HMENU menu)
augment_terrain(spot_hit);
start_out_edit();
break;
case 414: // Repeat print of last file printed
switch (last_file_printed){
case 0:
@@ -954,11 +951,11 @@ Boolean handle_menu (short item, HMENU menu)
case 2:
start_shopping_data_dump();
break;
case 3:
start_monst_data_dump();
break;
case 4:
start_spec_data_dump();
break;
@@ -966,11 +963,11 @@ Boolean handle_menu (short item, HMENU menu)
case 5:
start_town_data_dump();
break;
case 6:
start_outdoor_data_dump();
break;
case 7:
object_scenario_data_dump();
break;
@@ -984,10 +981,10 @@ Boolean handle_menu (short item, HMENU menu)
case 802: fancy_choice_dialog(986,0); break; // started
case 803: fancy_choice_dialog(1000,0); break; // testing
case 804: fancy_choice_dialog(1001,0); break; // distributing
case 805:
fancy_choice_dialog(1062,0);
case 805:
fancy_choice_dialog(1062,0);
break;
default:
if ((overall_mode >= 60) || (editing_town == FALSE)) {
give_error("You can only place items and individual monsters in town sections, not outdoors.","",0);

View File

@@ -17,9 +17,14 @@
#define CURSOR_7 7
#define CURSOR_8 8
#define ICON_1 1
#ifndef _INCLUDED_RC //Resource files conditional inclusion to allow Code::Block compliance
#define _INCLUDED_RC
#include "GAMEDLOG.RC"
#include "STRINGS.RC"
#endif
Exile MENU
Exile MENU
{
POPUP "&File"
{
@@ -206,7 +211,7 @@ POPUP "&I1"
}
ACCELERATORS_1 ACCELERATORS
ACCELERATORS_1 ACCELERATORS
{
VK_F1, 801, VIRTKEY
"^O", 1, ASCII
@@ -217,10 +222,10 @@ ACCELERATORS_1 ACCELERATORS
"^U", 311, ASCII
"^T", 401, ASCII
"^R", 402, ASCII
"^L", 403, ASCII
"^L", 403, ASCII
"^E", 404, ASCII
"^F", 405, ASCII
"^G", 406, ASCII
"^G", 406, ASCII
"^M", 407, ASCII
"^I", 408, ASCII
"^J", 409, ASCII

View File

@@ -12,7 +12,7 @@ extern RECT right_sbar_rect;
extern RECT right_buttons[NRSONPAGE];
extern short current_rs_top;
extern short left_button_status[NLS]; // 0 - clear, 1 - text, 2 - title text, 3 - tabbed text, +10 - button
extern short right_button_status[NRS];
extern short right_button_status[NRS];
extern HWND right_sbar;
// 0 - clear
// 1000 + x - terrain type x
@@ -42,7 +42,7 @@ void init_lb() {
void reset_lb() {
short i;
for (i = 0; i < NLS; i++) {
for (i = 0; i < NLS; i++) {
left_button_status[i] = 0;
draw_lb_slot(i,0);
}
@@ -50,10 +50,10 @@ void reset_lb() {
// is slot >= 0, force that slot
// if -1, use 1st free slot
void set_lb(short slot, short mode, char *label, short do_draw)
void set_lb(short slot, short mode, char *label, short do_draw)
{
short i;
if (slot < 0) {
for (i = 0; i < NLS; i++)
if (left_button_status[i] == 0) {
@@ -73,10 +73,10 @@ void set_lb(short slot, short mode, char *label, short do_draw)
void init_rb()
void init_rb()
{
short i;
lpsi.fMask = SIF_POS;
lpsi.nPos = 0;
SetScrollInfo(right_sbar,SB_CTL,&lpsi,FALSE);
@@ -91,10 +91,10 @@ void init_rb()
}
}
void reset_rb()
void reset_rb()
{
short i;
for (i = 0; i < NRS; i++) {
right_button_status[i] = 0;
}
@@ -107,10 +107,10 @@ void reset_rb()
// is slot >= 0, force that slot
// if -1, use 1st free slot
void set_rb(short slot, short mode, char *label, short do_draw)
void set_rb(short slot, short mode, char *label, short do_draw)
{
short i;
if (slot < 0) {
for (i = 0; i < NRS; i++)
if (right_button_status[i] == 0) {

View File

@@ -0,0 +1,75 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
<Option title="Blades Scenario Editor" />
<Option platforms="Windows;" />
<Option pch_mode="2" />
<Option compiler="gcc" />
<Build>
<Target title="Debug">
<Option platforms="Windows;" />
<Option output="bin\Debug\Blades of Exile Scenario Editor" prefix_auto="1" extension_auto="1" />
<Option object_output="obj\Debug\" />
<Option type="0" />
<Option compiler="gcc" />
<Compiler>
<Add option="-g" />
</Compiler>
<Linker>
<Add library="libwinmm.a" />
</Linker>
</Target>
<Target title="Release">
<Option platforms="Windows;" />
<Option output="bin\Release\Blades of Exile Scenario Editor" prefix_auto="1" extension_auto="1" />
<Option object_output="obj\Release\" />
<Option type="0" />
<Option compiler="gcc" />
<Linker>
<Add option="-s" />
<Add library="libwinmm.a" />
</Linker>
</Target>
</Build>
<Compiler>
<Add option="-Wall" />
</Compiler>
<Unit filename="BLSCENED.CPP" />
<Unit filename="BLSCENED.RC">
<Option compilerVar="WINDRES" />
</Unit>
<Unit filename="BUTTONMG.CPP" />
<Unit filename="BUTTONMG.H" />
<Unit filename="DLOGTOOL.CPP" />
<Unit filename="DLOGTOOL.H" />
<Unit filename="EDSOUND.CPP" />
<Unit filename="EDSOUND.H" />
<Unit filename="GAMEDLOG.RC">
<Option compilerVar="WINDRES" />
</Unit>
<Unit filename="GLOBAL.CPP" />
<Unit filename="GLOBAL.H" />
<Unit filename="GRAPHICS.CPP" />
<Unit filename="GRAPHICS.H" />
<Unit filename="GRAPHUTL.CPP" />
<Unit filename="GRAPHUTL.H" />
<Unit filename="KEYDLGS.CPP" />
<Unit filename="KEYDLGS.H" />
<Unit filename="SCENARIO.CPP" />
<Unit filename="SCENARIO.H" />
<Unit filename="STRINGS.RC">
<Option compilerVar="WINDRES" />
</Unit>
<Unit filename="TACTIONS.CPP" />
<Unit filename="TACTIONS.H" />
<Unit filename="TFILEIO.CPP" />
<Unit filename="TFILEIO.H" />
<Unit filename="townout.cpp" />
<Unit filename="townout.h" />
<Extensions>
<code_completion />
<debugger />
</Extensions>
</Project>
</CodeBlocks_project_file>

View File

@@ -72,7 +72,7 @@ HDC dlg_force_dc = NULL; // save HDCs when dealing with dlogs
short store_free_slot,store_dlog_num;
HWND store_parent;
short available_dlog_buttons[NUM_DLOG_B] = {0,63,64,65,1,4,5,8,
short available_dlog_buttons[NUM_DLOG_B] = {0,63,64,65,1,4,5,8,
128,
9,10,11,12,13,
14,15,16,17,29, 51,60,61,62,
@@ -139,8 +139,8 @@ char button_def_key[140] = {0,0,20,21,'k', 24,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,'o',0,0,0,0,0
};
// specials ... 20 - <- 21 - -> 22 up 23 down 24 esc
// 25-30 ctrl 1-6 31 - return\
/* specials ... 20 - <- 21 - -> 22 up 23 down 24 esc
25-30 ctrl 1-6 31 - return\ */
short button_ul_x[15] = {0,46,0,126,0, 0,126,126,126,138, 166,0,0,126,172};
short button_ul_y[15] = {0,0,132,23,46, 69,46,69,36,36, 36,23,92,92,0};
@@ -222,7 +222,7 @@ long CALLBACK fresh_edit_proc(HWND hwnd, UINT message, UINT wParam, LONG lParam)
SetFocus(edit_box[first_edit_box]);
return TRUE;
}
break;
break;
}
return CallWindowProc((WNDPROC) old_edit_proc[cur_box],hwnd,message,wParam,lParam);
@@ -245,13 +245,9 @@ short cd_create_dialog_parent_num(short dlog_num,short parent)
short cd_create_dialog(short dlog_num,HWND parent)
{
short i,j,free_slot = -1,free_item = -1;
short i,free_slot = -1;
HWND dlg;
char item_str[256];
short type,flag;
HDC win_dc;
if (parent != NULL) {
if (IsWindowEnabled(parent) == 0)
return -1;
@@ -318,7 +314,7 @@ BOOL CALLBACK dummy_dialog_proc (HWND hDlg, UINT message, WPARAM wParam, LPARAM
switch (message)
{
case WM_INITDIALOG:
// now, make a window, matching dialog
GetWindowRect(hDlg,&dlg_rect);
dlgs[store_free_slot] = CreateWindow (szWinName,
@@ -332,17 +328,17 @@ BOOL CALLBACK dummy_dialog_proc (HWND hDlg, UINT message, WPARAM wParam, LPARAM
NULL,
store_hInstance,
NULL);
// Now, give the window its items
for (i = 0; i < 200; i++)
if (GetDlgItem(hDlg,i) != NULL)
if (GetDlgItem(hDlg,i) != NULL)
{
GetDlgItemText(hDlg,i,item_str,256);
str_offset = 1;
dlg_highest_item[free_slot] = i;
str_stored = FALSE;
if (strlen((char *)item_str) == 0)
{
sprintf((char *) item_str, "+");
@@ -386,17 +382,17 @@ BOOL CALLBACK dummy_dialog_proc (HWND hDlg, UINT message, WPARAM wParam, LPARAM
flag = 1;
str_stored = TRUE;
}
else
else
{
//sscanf(item_str,"%d_%d",&type,&flag);
type = atoi(item_str);
flag = atoi(item_str+2);
}
free_item = -1;
// find free item
switch (type)
switch (type)
{
case 0: case 1: case 2: case 5: case 6:
for (j = 150; j < NI; j++)
@@ -435,7 +431,7 @@ BOOL CALLBACK dummy_dialog_proc (HWND hDlg, UINT message, WPARAM wParam, LPARAM
item_rect[free_item].left = item_rect[free_item].left / 2;
item_rect[free_item].bottom = item_rect[free_item].bottom / 2;
item_rect[free_item].right = item_rect[free_item].right / 2;
item_flag[free_item] = flag;
item_active[free_item] = 1;
item_label[free_item] = 0;
@@ -529,15 +525,15 @@ BOOL CALLBACK dummy_dialog_proc (HWND hDlg, UINT message, WPARAM wParam, LPARAM
MoveWindow(dlgs[free_slot],0,0,win_width,win_height,FALSE);
EndDialog(hDlg, 0);
return TRUE;
} /* end of switch(message) */
return TRUE;
}
void cd_set_edit_focus(short which_win)
{
{
short i;
for (i = 0; i < 80; i++)
if (store_edit_parent_num[i] == which_win) {
if (edit_box[i] != NULL)
@@ -779,10 +775,8 @@ void cd_get_item_text(short dlog_num, short item_num, char *str)
void cd_retrieve_text_edit_str(short dlog_num, short item_num, char *str)
{
short dlg_index,item_index,i;
short the_type;
RECT the_rect;
short i;
for (i = 0; i < 80; i++)
if ((store_edit_parent_num[i] == dlog_num) && (store_edit_item[i] == item_num)
&& (edit_box[i] != NULL)) {
@@ -790,14 +784,13 @@ void cd_retrieve_text_edit_str(short dlog_num, short item_num, char *str)
return;
}
}
short cd_retrieve_text_edit_num(short dlog_num, short item_num)
{
short dlg_index,item_index,i;
short the_type,num_given;
RECT the_rect;
short i;
short num_given;
char str[256];
for (i = 0; i < 80; i++)
if ((store_edit_parent_num[i] == dlog_num) && (store_edit_item[i] == item_num)
&& (edit_box[i] != NULL)) {
@@ -806,17 +799,15 @@ short cd_retrieve_text_edit_num(short dlog_num, short item_num)
return (short) num_given;
}
return -1;
}
}
// NOTE!!! Expects a c string
void cd_set_text_edit_str(short dlog_num, short item_num, char *str)
{
short dlg_index,item_index,i;
short the_type;
RECT the_rect;
short i;
for (i = 0; i < 80; i++)
if ((store_edit_parent_num[i] == dlog_num) && (store_edit_item[i] == item_num)
&& (edit_box[i] != NULL))
@@ -826,11 +817,9 @@ void cd_set_text_edit_str(short dlog_num, short item_num, char *str)
// NOTE!!! Expects a c string
void cd_set_text_edit_num(short dlog_num, short item_num, short num)
{
short dlg_index,item_index,i;
short the_type;
RECT the_rect;
short i;
char store_ptr[256];
sprintf(store_ptr,"%d",num);
for (i = 0; i < 80; i++)
if ((store_edit_parent_num[i] == dlog_num) && (store_edit_item[i] == item_num)
@@ -838,7 +827,7 @@ void cd_set_text_edit_num(short dlog_num, short item_num, short num)
SetWindowText(edit_box[i],store_ptr);
}
void cdsin(short dlog_num, short item_num, short num)
void cdsin(short dlog_num, short item_num, short num)
{
cd_set_item_num( dlog_num, item_num, num);
}
@@ -933,7 +922,7 @@ void cd_flip_led(short dlog_num,short item_num,short item_hit)
void cd_set_led_range(short dlog_num,short first_led,short last_led,short which_to_set)
{
short i;
for (i = first_led; i <= last_led; i++) {
if (i - first_led == which_to_set)
cd_set_led(dlog_num,i,1);
@@ -946,7 +935,7 @@ void cd_set_led_range(short dlog_num,short first_led,short last_led,short which_
void cd_hit_led_range(short dlog_num,short first_led,short last_led,short which_to_set)
{
short i;
if ((which_to_set < first_led) || (which_to_set > last_led))
return;
for (i = first_led; i <= last_led; i++) {
@@ -958,7 +947,7 @@ void cd_hit_led_range(short dlog_num,short first_led,short last_led,short which_
short cd_get_led_range(short dlog_num,short first_led,short last_led)
{
short i;
for (i = first_led; i <= last_led; i++) {
if (cd_get_led(dlog_num,i) == 1)
return i - first_led;
@@ -1099,7 +1088,7 @@ void cd_draw_item(short dlog_num,short item_num)
else draw_dialog_graphic(dlgs[dlg_index], item_rect[item_index],
item_flag[item_index],(item_flag[item_index] >= 2000) ? FALSE : TRUE,0);
break;
}
}
@@ -1212,8 +1201,6 @@ void cd_erase_item(short dlog_num, short item_num)
short i,dlg_index,item_index,store_label;
RECT to_fry;
HDC win_dc;
HBRUSH old_brush;
HPEN old_pen;
Boolean just_label = FALSE;
if (item_num >= 100) {
@@ -1272,7 +1259,7 @@ void cd_erase_item(short dlog_num, short item_num)
win_dc = cd_get_dlog_dc(dlg_index);
paint_pattern((HBITMAP)win_dc,2,to_fry,0);
cd_kill_dc(dlg_index,win_dc);
cd_kill_dc(dlg_index,win_dc);
@@ -1285,7 +1272,7 @@ void cd_press_button(short dlog_num, short item_num)
short dlg_index,item_index;
long dummy;
HDC win_dc;
RECT from_rect,to_rect;
RECT from_rect;
COLORREF colors[3] = {RGB(0,0,0),RGB(0,0,112),RGB(0,255,255)};
if (cd_get_indices(dlog_num,item_num,&dlg_index,&item_index) < 0)
@@ -1298,13 +1285,13 @@ void cd_press_button(short dlog_num, short item_num)
win_dc = cd_get_dlog_dc(dlg_index);
from_rect.top = button_ul_y[button_type[item_flag[item_index]]];
from_rect.left = button_ul_x[button_type[item_flag[item_index]]];
from_rect.bottom = from_rect.top + button_height[button_type[item_flag[item_index]]];
from_rect.right = from_rect.left + button_width[button_type[item_flag[item_index]]];
OffsetRect(&from_rect,button_width[button_type[item_flag[item_index]]],0);
rect_draw_some_item(dlg_buttons_gworld,from_rect,(HBITMAP)win_dc,item_rect[item_index],0,2);
SelectObject(win_dc,bold_font);
@@ -1317,7 +1304,7 @@ void cd_press_button(short dlog_num, short item_num)
}
else {
char_win_draw_string(win_dc,item_rect[item_index],
(char *) ((item_index < 10) ? text_long_str[item_index] :
(char *) ((item_index < 10) ? text_long_str[item_index] :
text_short_str[item_index - 10]),1,8);
}
if (item_type[item_index] < 2)
@@ -1341,7 +1328,7 @@ void cd_press_button(short dlog_num, short item_num)
}
else {
char_win_draw_string(win_dc,item_rect[item_index],
(char *) ((item_index < 10) ? text_long_str[item_index] :
(char *) ((item_index < 10) ? text_long_str[item_index] :
text_short_str[item_index - 10]),1,8);
}
if (item_type[item_index] < 2)
@@ -1451,7 +1438,6 @@ void frame_dlog_rect(HWND hDlg, RECT rect, short val)
HDC hdc;
HPEN dpen,lpen,old_pen;
COLORREF x = RGB(0,204,255),y = RGB(0,204,255);//y = RGB(119,119,119);
UINT c;
Boolean keep_dc = FALSE;
InflateRect(&rect,val,val);
@@ -1490,24 +1476,15 @@ void frame_dlog_rect(HWND hDlg, RECT rect, short val)
void draw_custom_dialog_graphic(HWND hDlg, RECT rect, short which_g, Boolean do_frame,short win_or_gworld){
short picnum;
RECT from1 = {0,0,36,28},from2 = {0,0,36,36},from3 = {0,0,72,72},tiny_obj_rect = {0,0,18,18};
RECT from_rect = {0,0,28, 36};
RECT face_from = {0,0,32,32};
RECT death_to = {6,6,78,78};
RECT to_rect = {6,6,42,42};
RECT m_to_rect = {10,6,38,42};
RECT pc_info_from = {0,127,106,157};
RECT item_info_from = {174,0,312,112};
RECT stat_symbols_from = {0,0,386,94}; /**/
HBITMAP from_gworld;
short draw_dest = 2,m_start_pic;
HDC hdc;
HBRUSH old_brush;
RECT small_monst_rect = {0,0,14,18};
if (win_or_gworld == 1)
draw_dest = 0;
@@ -1532,9 +1509,9 @@ void draw_custom_dialog_graphic(HWND hDlg, RECT rect, short which_g, Boolean do_
rect_draw_some_item(from_gworld,from_rect,(HBITMAP) ((win_or_gworld == 1) ? (HBITMAP) (hDlg): (HBITMAP)hdc)
,rect,0,draw_dest);
break;
case 2: //custom 2x1 monster
rect.right = rect.left + 28; rect.bottom = rect.top + 36;
if (win_or_gworld == 0) {
old_brush = (HBRUSH)SelectObject(hdc,GetStockObject(BLACK_BRUSH));
@@ -1586,8 +1563,8 @@ void draw_custom_dialog_graphic(HWND hDlg, RECT rect, short which_g, Boolean do_
else rect_draw_some_item(from_gworld,from_rect,(HBITMAP)hdc,small_monst_rect,0,draw_dest);
break;
case 4: //custom 2x2 monster
case 4: //custom 2x2 monster
rect.right = rect.left + 28; rect.bottom = rect.top + 36;
if (win_or_gworld == 0) {
old_brush = (HBRUSH)SelectObject(hdc,GetStockObject(BLACK_BRUSH));
@@ -1620,7 +1597,7 @@ void draw_custom_dialog_graphic(HWND hDlg, RECT rect, short which_g, Boolean do_
if (win_or_gworld == 1)
rect_draw_some_item(from_gworld,from_rect,(HBITMAP) hDlg,small_monst_rect,0,0);
else rect_draw_some_item(from_gworld,from_rect,(HBITMAP)hdc,small_monst_rect,0,draw_dest);
m_start_pic = which_g + 3;
from_gworld = spec_scen_g;
from_rect = calc_rect(m_start_pic % 10, m_start_pic / 10);
@@ -1630,7 +1607,7 @@ void draw_custom_dialog_graphic(HWND hDlg, RECT rect, short which_g, Boolean do_
rect_draw_some_item(from_gworld,from_rect,(HBITMAP) hDlg,small_monst_rect,0,0);
else rect_draw_some_item(from_gworld,from_rect,(HBITMAP)hdc,small_monst_rect,0,draw_dest);
break;
case 5: // animated custom terrain
from_gworld = spec_scen_g;
@@ -1665,24 +1642,20 @@ void draw_dialog_graphic(HWND hDlg, RECT rect, short which_g, Boolean do_frame,s
// 900 + x B&W graphic
// 950 null item
// 1000 + x Talking face
// 1100 - item info help
// 1200 - pc screen help
// 1100 - item info help
// 1200 - pc screen help
// 1300 - combat ap
// 1400-1402 - button help
// 1500 - stat symbols help
// 1600 + x - B&W maps
// 1700 + x - anim graphic
{
short picnum;
RECT from1 = {0,0,36,28},from2 = {0,0,36,36},from3 = {0,0,72,72},tiny_obj_rect = {0,0,18,18};
RECT from2 = {0,0,36,36}, tiny_obj_rect = {0,0,18,18};
RECT from_rect = {0,0,28, 36};
RECT face_from = {0,0,32,32};
RECT death_to = {6,6,78,78};
RECT to_rect = {6,6,42,42};
RECT m_to_rect = {10,6,38,42};
RECT pc_info_from = {0,127,106,157};
RECT item_info_from = {174,0,312,112};
RECT stat_symbols_from = {0,0,386,94}; /**/
HBITMAP from_gworld;
short draw_dest = 2,m_start_pic;

View File

@@ -86,7 +86,7 @@ void load_sounds ()
{
short i,t,err;
HRSRC h;
char snd_name[20],str[60];
char snd_name[20];
WAVEOUTCAPS wavecaps;
t = waveOutGetNumDevs();
@@ -150,14 +150,11 @@ void play_sound(short which) // if < 0, play asynch
void force_play_sound(short which)
{
short i,err,num_fails = 0;
char snd_name[30],str[60];
Boolean asyn = FALSE,a_sound_did_get_played = FALSE,sound_played_nostop = FALSE;
short i,num_fails = 0;
char snd_name[30];
Boolean asyn = FALSE,a_sound_did_get_played = FALSE;
Boolean check_sound;
long dummy;
HRSRC h;
char *snd;
DWORD size;
if ((sounds_fucked == TRUE) || (play_sounds == FALSE))
return;

File diff suppressed because it is too large Load Diff

View File

@@ -31,7 +31,7 @@ RECT16::RECT16 (const RECT & tmp)
right = tmp.right;
bottom = tmp.bottom;
}
RECT16 & RECT16::operator=(const RECT & tmp)
{
left = tmp.left;
@@ -44,12 +44,12 @@ RECT16 & RECT16::operator=(const RECT & tmp)
POINT MAKEPOINT(LONG lParam)
{
POINT point;
point.x = LOWORD(lParam);
point.y = HIWORD(lParam);
return point;
}
}
short get_ran (short times,short min,short max)
{

View File

@@ -47,7 +47,7 @@ extern RECT right_sbar_rect;
extern Boolean left_buttons_active,right_buttons_active;
extern short left_button_status[NLS]; // 0 - clear, 1 - text, 2 - title text, +10 - button
extern short right_button_status[NRS];
extern short right_button_status[NRS];
extern unsigned char m_pic_index[200];
extern char *button_strs[140];
extern location cur_out;
@@ -109,10 +109,10 @@ short map_pats[220] = {50,50,1,1,1,6,6,6,6,6,
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, // 200
0,0,0,0,0,0,0,0,0,0
0,0,0,0,0,0,0,0,0,0
};
unsigned char small_what_drawn[64][64];
extern Boolean small_any_drawn;
@@ -134,15 +134,15 @@ void Set_up_win ()
palette_buttons[i][j].right++;
}
for (i = 0; i < 8; i++)
for (j = 2; j < 6; j++)
for (j = 2; j < 6; j++)
OffsetRect(&palette_buttons[i][j],0,3);
for (i = 0; i < 8; i++)
for (j = 3; j < 6; j++)
for (j = 3; j < 6; j++)
OffsetRect(&palette_buttons[i][j],0,3);
for (i = 0; i < 8; i++)
for (j = 4; j < 6; j++)
for (j = 4; j < 6; j++)
OffsetRect(&palette_buttons[i][j],0,3);
for (i = 0; i < NLS; i++) {
left_buttons[i][0] = left_button_base;
OffsetRect(&left_buttons[i][0],0,i * 16);
@@ -151,7 +151,7 @@ void Set_up_win ()
left_buttons[i][1].bottom -= 1;
left_buttons[i][1].left += 0;
left_buttons[i][1].right = left_buttons[i][1].left + 16;
}
}
right_button_base.left = RIGHT_AREA_UL_X + 1;
right_button_base.top = RIGHT_AREA_UL_Y + 1;
right_button_base.bottom = right_button_base.top + 12;
@@ -159,7 +159,7 @@ void Set_up_win ()
for (i = 0; i < NRSONPAGE; i++) {
right_buttons[i] = right_button_base;
OffsetRect(&right_buttons[i],0,i * 12);
}
}
load_main_screen();
}
@@ -191,7 +191,7 @@ void run_startup_g()
void load_main_screen()
{
short i,j;
short i;
RECT map_from_orig = {372,0,380,8},map_from,brush_to = {0,0,8,8};
main_dc = GetDC(mainPtr);
@@ -216,9 +216,9 @@ void load_main_screen()
OffsetRect(&world_screen,TER_RECT_UL_X,TER_RECT_UL_Y);
for (i = 0; i < 10; i++)
monst_gworld[i] = load_pict(1100 + i);
monst_gworld[i] = load_pict(1100 + i);
for (i = 0; i < 6; i++)
terrain_gworld[i] = load_pict(800 + i);
terrain_gworld[i] = load_pict(800 + i);
small_terrain_gworld = load_pict(904);
editor_mixed = load_pict(906);
anim_gworld = load_pict(820);
@@ -255,11 +255,9 @@ void redraw_screen()
void draw_main_screen()
{
short i;
RECT draw_rect,big_rect = {-1,-1,582,414};
HBRUSH old_brush,new_brush;
HBRUSH new_brush;
COLORREF y = RGB(128,128,128);//y = RGB(119,119,119);
UINT c;
// draw left buttons (always active)
draw_lb();
@@ -291,15 +289,15 @@ void draw_main_screen()
if ((overall_mode < 60) || (overall_mode == 62)) {
place_location();
}
}
void draw_lb()
{
RECT temp_rect;
short i;
temp_rect = windRect;
temp_rect.right = RIGHT_AREA_UL_X - 2;
paint_pattern(NULL,1,temp_rect,3);
@@ -308,11 +306,11 @@ void draw_lb()
}
// mode 0 normal 1 click
void draw_lb_slot (short which,short mode)
void draw_lb_slot (short which,short mode)
{
RECT text_rect,from_rect;
COLORREF colors = RGB(0,0,102),colors2 = RGB(0,0,0);
paint_pattern(NULL,1,left_buttons[which][0],3);
if (left_button_status[which] == 0)
return;
@@ -324,7 +322,7 @@ void draw_lb_slot (short which,short mode)
OffsetRect(&from_rect,from_rect.right - from_rect.left,0);
rect_draw_some_item(editor_mixed,from_rect,editor_mixed,left_buttons[which][1],0,1);
}
if (left_button_status[which] % 10 == 3)
if (left_button_status[which] % 10 == 3)
text_rect.left += 16;
if (left_button_status[which] % 10 == 2) {
SelectObject(main_dc,bold_font);
@@ -343,23 +341,23 @@ void draw_lb_slot (short which,short mode)
void draw_rb()
{
short i,pos;
pos = GetScrollPos(right_sbar,SB_CTL);
for (i = pos; i < pos + NRSONPAGE; i++)
draw_rb_slot(i,0);
}
// mode 0 normal 1 pressed
void draw_rb_slot (short which,short mode)
void draw_rb_slot (short which,short mode)
{
RECT text_rect;
short pos;
COLORREF colors = RGB(255,0,0),colors2 = RGB(0,0,0);
pos = GetScrollPos(right_sbar,SB_CTL);
if ((which < pos) || (which >= pos + NRSONPAGE))
return;
text_rect = right_buttons[which - pos];
text_rect.right += 2;
text_rect.bottom += 2;
@@ -378,16 +376,16 @@ void draw_rb_slot (short which,short mode)
void set_up_terrain_buttons()
{
short i,pic,small_i;
RECT ter_from,ter_to,ter_from_base = {0,0,28,36};
RECT tiny_from,tiny_to;
RECT ter_from,ter_from_base = {0,0,28,36};
RECT tiny_from,tiny_to;
HDC hdc;
RECT palette_from = {0,0,0,0},palette_to;
HBITMAP store_bmp;
COLORREF y = RGB(128,128,128);//y = RGB(119,119,119);
HBRUSH new_brush;
paint_pattern(terrain_buttons_gworld,0,terrain_buttons_rect,1);
hdc = CreateCompatibleDC(main_dc);
SetBkMode(hdc,TRANSPARENT);
@@ -453,7 +451,7 @@ void set_up_terrain_buttons()
tiny_from,terrain_buttons_gworld,tiny_to,0,0);
}
}
if (overall_mode < 60) {
palette_to.left = 5;
palette_to.top = terrain_rects[255].bottom + 5;
@@ -476,9 +474,9 @@ void set_up_terrain_buttons()
void draw_terrain()
{
short q,r,x,y,i,small_i;
short q,r,x,i,small_i;
location which_pt,where_draw;
RECT draw_rect,clipping_rect = {8,8,260,332};
RECT draw_rect,clipping_rect = {8,8,260,332};
unsigned char t_to_draw;
RECT tiny_to,tiny_to_base = {29,37,36,44},tiny_from,from_rect,to_rect;
HBITMAP store_bmp;
@@ -736,24 +734,20 @@ void draw_monsts(HDC hdc)
{
short i,k,width,height,m_start_pic;
GWorldPtr from_gworld;
RECT source_rect,draw_rect;
RECT source_rect;
location where_draw,store_loc;
COLORREF y = RGB(128,128,128),red = RGB(255,0,0),white = RGB(255,255,255);//y = RGB(119,119,119);
HBITMAP store_bmp;
UINT c;
HBRUSH new_brush;
for (i = 0; i < 60; i++)
if (t_d.creatures[i].number != 0) {
where_draw.x = t_d.creatures[i].start_loc.x - cen_x + 4;
where_draw.y = t_d.creatures[i].start_loc.y - cen_y + 4;
width = scenario.scen_monsters[t_d.creatures[i].number].x_width;
height = scenario.scen_monsters[t_d.creatures[i].number].y_width;
for (k = 0; k < width * height; k++) {
store_loc = where_draw;
if ((where_draw.x == minmax(0,8,where_draw.x)) &&
(where_draw.y == minmax(0,8,where_draw.y)) &&
if ((where_draw.x == minmax(0,8,where_draw.x)) &&
(where_draw.y == minmax(0,8,where_draw.y)) &&
(scenario.scen_monsters[t_d.creatures[i].number].picture_num >= 1000)) {
source_rect = get_custom_rect((scenario.scen_monsters[t_d.creatures[i].number].picture_num + k) % 1000);
store_loc.x += k % width;
@@ -764,10 +758,10 @@ void draw_monsts(HDC hdc)
m_start_pic = m_pic_index[scenario.scen_monsters[t_d.creatures[i].number].picture_num] + k;
from_gworld = monst_gworld[m_start_pic / 20];
m_start_pic = m_start_pic % 20;
source_rect = calc_rect(2 * (m_start_pic / 10), m_start_pic % 10);
source_rect = calc_rect(2 * (m_start_pic / 10), m_start_pic % 10);
store_loc.x += k % width;
store_loc.y += k / width;
Draw_Some_Item(from_gworld, source_rect, ter_draw_gworld, store_loc, 1, 0);
Draw_Some_Item(from_gworld, source_rect, ter_draw_gworld, store_loc, 1, 0);
}
}
}
@@ -778,7 +772,7 @@ void draw_monsts(HDC hdc)
RECT get_item_template_rect (short type_wanted)
{
RECT store_rect;
if (type_wanted < 45) {
store_rect.top = (type_wanted / 5) * BITMAP_HEIGHT;
store_rect.bottom = store_rect.top + BITMAP_HEIGHT;
@@ -789,9 +783,9 @@ RECT get_item_template_rect (short type_wanted)
store_rect.top = (type_wanted / 10) * 18;
store_rect.bottom = store_rect.top + 18;
store_rect.left = (type_wanted % 10) * 18;
store_rect.right = store_rect.left + 18;
store_rect.right = store_rect.left + 18;
}
return store_rect;
}
@@ -801,11 +795,7 @@ void draw_items(HDC hdc)
RECT source_rect,draw_rect;
location where_draw;
short pic_num;
COLORREF y = RGB(128,128,128),red = RGB(255,0,0),blue = RGB(0,0,255);//y = RGB(119,119,119);
HBITMAP store_bmp;
UINT c;
HBRUSH new_brush;
for (i = 0; i < 64; i++) {
if (town.preset_items[i].item_code >= 0) {
where_draw.x = town.preset_items[i].item_loc.x - cen_x + 4;
@@ -813,7 +803,7 @@ void draw_items(HDC hdc)
pic_num = scen_item_list.scen_items[town.preset_items[i].item_code].graphic_num;
if ((where_draw.x >= 0) && (where_draw.x <= 8) &&
(where_draw.y >= 0) && (where_draw.y <= 8)) {
if (pic_num >= 150) {
source_rect = get_custom_rect(pic_num - 150);
draw_rect = calc_rect(where_draw.x,where_draw.y);
@@ -850,12 +840,12 @@ void draw_one_terrain_spot (short i,short j,unsigned char terrain_to_draw)
short picture_wanted;
GWorldPtr source_gworld;
short k;
picture_wanted = scenario.ter_types[terrain_to_draw].picture;
where_draw.x = (char) i;
where_draw.y = (char) j;
if ((picture_wanted >= 2000) && (spec_scen_g != NULL)) {
source_gworld = spec_scen_g;
source_rect = get_custom_rect(picture_wanted % 2000);
@@ -903,8 +893,8 @@ void draw_one_tiny_terrain_spot (short i,short j,unsigned char terrain_to_draw,H
{
location where_draw;
RECT source_rect,dest_rect = {0,0,5,5},from_rect = {0,0,4,4},orig_draw_rect = {0,0,4,4};
short picture_wanted,k;
RECT dest_rect = {0,0,5,5},from_rect = {0,0,4,4},orig_draw_rect = {0,0,4,4};
short picture_wanted;
GWorldPtr source_gworld;
HBITMAP store_bmp;
HBRUSH old_brush;
@@ -1008,8 +998,8 @@ RECT destrec;
destrec.left = 8 + BITMAP_WIDTH * target.x;
destrec.right = destrec.left + BITMAP_WIDTH;
destrec.top = 8 + BITMAP_HEIGHT * target.y;
destrec.bottom = destrec.top + BITMAP_HEIGHT;
destrec.bottom = destrec.top + BITMAP_HEIGHT;
destrec.left = destrec.right - (src_rect.right - src_rect.left);
destrec.top = destrec.bottom - (src_rect.bottom - src_rect.top);
@@ -1060,14 +1050,13 @@ void discard_graphics()
}
}
/* Input terrain currently trying to draw. Get back RECT in terrain template containing
/* Input terrain currently trying to draw. Get back RECT in terrain template containing
desired pixmap, or RECT to darkness if desired map not present */
RECT get_template_rect (unsigned char type_wanted)
{
RECT store_rect;
short i,j;
short picture_wanted;
picture_wanted = scenario.ter_types[type_wanted].picture;
if (picture_wanted >= 1000)
picture_wanted = 0;
@@ -1083,14 +1072,10 @@ RECT get_template_rect (unsigned char type_wanted)
void place_location()
{
RECT text_rect = {367,290,384,510};
char draw_str[256];
RECT from_rect,draw_rect,source_rect,erase_rect;
RECT draw_rect,source_rect,erase_rect;
short picture_wanted;
HBITMAP store_bmp;
COLORREF y = RGB(128,128,128),red = RGB(255,0,0),white = RGB(255,255,255);//y = RGB(119,119,119);
UINT c;
HBRUSH new_brush;
HDC hdc;
erase_rect.left = terrain_rects[255].left + 17;
@@ -1113,11 +1098,11 @@ void place_location()
draw_rect.left = terrain_rects[255].left + 20;
draw_rect.top = terrain_rects[255].top;
if (overall_mode < 60)
sprintf((char *) draw_str,"Center: x = %d, y = %d ",(short) cen_x, (short) cen_y);
sprintf( draw_str,"Center: x = %d, y = %d ", cen_x, cen_y);
else {
draw_rect.left = 5;
draw_rect.top = terrain_rects[255].top + 28;
sprintf((char *) draw_str,"Click terrain to edit. ",cen_x,cen_y);
sprintf(draw_str,"Click terrain to edit. ");
}
draw_rect.bottom = draw_rect.top + 14;
@@ -1179,14 +1164,9 @@ void place_location()
// klugde for speed ...exactly like place location above, but just writes location
void place_just_location()
{
RECT text_rect = {367,290,384,510};
char draw_str[256];
RECT from_rect,draw_rect,source_rect,erase_rect;
short picture_wanted;
RECT from_rect,draw_rect,erase_rect;
HBITMAP store_bmp;
COLORREF y = RGB(128,128,128),red = RGB(255,0,0),white = RGB(255,255,255);//y = RGB(119,119,119);
UINT c;
HBRUSH new_brush;
HDC hdc;
erase_rect.left = terrain_rects[255].left + 17;
@@ -1200,22 +1180,22 @@ void place_just_location()
SetBkMode(hdc,TRANSPARENT);
SelectObject(hdc,small_bold_font);
store_bmp = (HBITMAP)SelectObject(hdc,terrain_buttons_gworld);
draw_rect.left = terrain_rects[255].left + 20;
draw_rect.top = terrain_rects[255].top;
if (overall_mode < 60)
sprintf((char *) draw_str,"Center: x = %d, y = %d ",cen_x,cen_y);
sprintf(draw_str,"Center: x = %d, y = %d ",cen_x,cen_y);
else {
draw_rect.left = 5;
draw_rect.top = terrain_rects[255].top + 28;
sprintf((char *) draw_str,"Click terrain to edit. ",cen_x,cen_y);
sprintf(draw_str,"Click terrain to edit. ");
}
draw_rect.bottom = draw_rect.top + 14;
draw_rect.right = draw_rect.left + 200;
win_draw_string(hdc,draw_rect,draw_str,0,12);
SelectObject(hdc,store_bmp);
from_rect = terrain_buttons_rect;
from_rect.top = erase_rect.top;
@@ -1237,7 +1217,7 @@ void set_string(char *string,char *string2)
Boolean is_special(short i,short j)
{
short k;
if (editing_town == TRUE)
for (k = 0; k < 50; k++)
if ((town.special_locs[k].x == i) && (town.special_locs[k].y == j))
@@ -1253,7 +1233,7 @@ Boolean is_special(short i,short j)
Boolean is_field_type(short i,short j,short field_type)
{
short k;
for (k = 0; k < 50; k++)
if ((town.preset_fields[k].field_type == field_type) &&
(town.preset_fields[k].field_loc.x == i) &&
@@ -1282,7 +1262,7 @@ void make_field_type(short i,short j,short field_type)
void take_field_type(short i,short j,short field_type)
{
short k;
for (k = 0; k < 50; k++)
if ((town.preset_fields[k].field_type == field_type) &&
(town.preset_fields[k].field_loc.x == i) &&
@@ -1389,9 +1369,7 @@ void take_quickfire(short i,short j)
Boolean container_there(location l)
{
unsigned char ter;
if (editing_town == FALSE)
return FALSE;
if (scenario.ter_types[t_d.terrain[l.x][l.y]].special == 14)
@@ -1400,14 +1378,14 @@ Boolean container_there(location l)
return TRUE;
if (is_crate(l.x,l.y) == TRUE)
return TRUE;
return 0;
return 0;
}
void char_win_draw_string(HDC dest_window,RECT dest_rect,char *str,short mode,short line_height)
{
char store_s[256];
strcpy((char *) store_s,str);
win_draw_string( dest_window, dest_rect,store_s, mode, line_height);
@@ -1431,7 +1409,7 @@ void win_draw_string(HDC dest_hdc,RECT dest_rect,char *str,short mode,short line
// if dest is main window, add ulx, uly
if (dest_hdc == main_dc)
OffsetRect(&dest_rect,ulx,uly);
switch (mode) {
case 0:
dest_rect.bottom += 6;
@@ -1446,7 +1424,7 @@ void win_draw_string(HDC dest_hdc,RECT dest_rect,char *str,short mode,short line
DT_LEFT | DT_VCENTER | DT_NOCLIP | DT_SINGLELINE); break;
}
// not yet done adjusts for 1, 2, 3
}
// Note ... this expects a str len of at most 256 and
@@ -1454,7 +1432,7 @@ void win_draw_string(HDC dest_hdc,RECT dest_rect,char *str,short mode,short line
void MeasureText(short str_len,char *str, short *len_array,HDC hdc)
{
short text_len[257];
short total_width = 0,i,len;
short i;
char p_str[257];
SIZE val_returned;
char *store_array;

View File

@@ -41,7 +41,7 @@ short current_pattern = -1;
char buffer[128];
int i=strlen(szFileName),j=0;
while(szFileName[i] != '\\')
i--;
@@ -106,14 +106,14 @@ HBITMAP load_pict(short pict_num)
case 1400: got_bitmap = ReadBMP("Images/STSCICON.BMP"); break;
case 1401: got_bitmap = ReadBMP("Images/HELPPICS.BMP"); break;
case 1402: got_bitmap = ReadBMP("Images/APPIC.BMP"); break;
case 1500: case 1501: case 1502: case 1503: case 1504: case 1505: case 1506: case 1507:
case 1500: case 1501: case 1502: case 1503: case 1504: case 1505: case 1506: case 1507:
got_bitmap = ReadBMP("Images/BIGMAPS.BMP"); break;
case 2000: got_bitmap = ReadBMP("Images/DLOGBTNS.BMP"); break;
case 3000: got_bitmap = ReadBMP("Images/START.BMP"); break;
case 3001: got_bitmap = ReadBMP("Images/SPIDLOGO.BMP"); break;
case 3002: got_bitmap = ReadBMP("Images/EDSTART.BMP"); break;
case 5000: got_bitmap = ReadBMP("Images/E3EDTITL.BMP"); break;
default: got_bitmap = NULL;
}
return got_bitmap;
@@ -121,10 +121,9 @@ HBITMAP load_pict(short pict_num)
void rect_draw_some_item(HBITMAP src,RECT src_rect,HBITMAP dest,RECT dest_rect,
short trans, short main_win) {
HDC hdcMem,hdcMem2,hdcMem3,destDC,storeDC;
HDC hdcMem,hdcMem2,hdcMem3,destDC;
HBITMAP transbmp;
COLORREF white = RGB(255,255,255),black = RGB(0,0,0),oldcolor;
RECT debug = {0,0,200,20};
COLORREF white = RGB(255,255,255),oldcolor;
HBRUSH hbrush,old_brush;
COLORREF x = RGB(17,17,17);
HBITMAP store,store2;

View File

@@ -108,7 +108,7 @@ char edit_spec_mess_mess[256] = {
1,1,1,1,1,1,1,1,1,3,
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,0,0};
char edit_pict_mess[256] = {
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
@@ -163,8 +163,8 @@ char edit_jumpto_mess[256] = {
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};
void fancy_choice_dialog_event_filter (short item_hit)
{
dialog_not_toast = FALSE;
@@ -174,12 +174,11 @@ void fancy_choice_dialog_event_filter (short item_hit)
short fancy_choice_dialog(short which_dlog,short parent)
// ignore parent in Mac version
{
short item_hit,i,store_dialog_answer;
char temp_str[256];
short i,store_dialog_answer;
store_dialog_answer = dialog_answer;
//make_cursor_sword();
cd_create_dialog_parent_num(which_dlog,parent);
@@ -191,19 +190,19 @@ short fancy_choice_dialog(short which_dlog,short parent)
i = dialog_answer;
dialog_answer = store_dialog_answer;
return i;
}
//cre = check range error
Boolean cre(short val,short min,short max,char *text1, char *text2,short parent_num)
Boolean cre(short val,short min,short max,char *text1, char *text2,short parent_num)
{
if ((val < min) || (val > max)) {
give_error(text1,text2,parent_num);
return TRUE;
}
}
return FALSE;
}
@@ -214,9 +213,6 @@ void give_error(char *text1, char *text2,short parent_num)
void display_strings_event_filter (short item_hit)
{
short i;
Boolean had1 = FALSE, had2 = FALSE;
switch (item_hit) {
case 1:
dialog_not_toast = FALSE;
@@ -229,13 +225,8 @@ void display_strings(char *text1, char *text2,
char *title,short sound_num,short graphic_num,short parent_num)
{
short item_hit;
char sign_text[256];
location view_loc;
Boolean sound_done = FALSE;
//make_cursor_sword();
if ((text1 == NULL) && (text2 == NULL))
return;
store_which_string_dlog = 970;
@@ -244,9 +235,9 @@ void display_strings(char *text1, char *text2,
if ((text2 != NULL) && (text2[0] != 0))
store_which_string_dlog++;
cd_create_dialog_parent_num(store_which_string_dlog,parent_num);
csp(store_which_string_dlog,store_which_string_dlog,graphic_num);
csit(store_which_string_dlog,4,(char *) text1);
if (text2 != NULL) {
csit(store_which_string_dlog,5,(char *) text2);
@@ -256,16 +247,15 @@ void display_strings(char *text1, char *text2,
csp(store_which_string_dlog,3,graphic_num);
while (dialog_not_toast)
ModalDialog();
ModalDialog();
cd_kill_dialog(store_which_string_dlog,0);
}
void choose_graphic_event_filter (short item_hit)
{
short i;
Boolean had1 = FALSE, had2 = FALSE;
switch (item_hit) {
case 1:
dialog_answer = store_cur_pic;
@@ -285,12 +275,12 @@ void choose_graphic_event_filter (short item_hit)
if (which_page == (store_last_g - store_first_g) / 36)
which_page = 0;
else which_page++;
put_choice_pics();
put_choice_pics();
break;
default:
if ((item_hit >= 5) && (item_hit <= 40)) {
store_cur_pic = 36 * which_page + item_hit - 5 + store_first_g;
for (i = 5; i <= 40; i++)
for (i = 5; i <= 40; i++)
cd_set_led(819,i,(i == item_hit) ? 1 : 0);
}
break;
@@ -300,7 +290,7 @@ void choose_graphic_event_filter (short item_hit)
void put_choice_pics()
{
short i;
for (i = 0; i < 36; i++) {
if (store_first_g + which_page * 36 + i > store_last_g) {
csp(819,41 + i,950);
@@ -308,7 +298,7 @@ void put_choice_pics()
}
else {
csp(819,41 + i,store_first_g + 36 * which_page + i);
cd_activate_item(819,5 + i,1);
cd_activate_item(819,5 + i,1);
}
if (which_page * 36 + i == store_cur_pic - store_first_g)
cd_set_led(819,5 + i,1);
@@ -320,12 +310,8 @@ void put_choice_pics()
short choose_graphic(short first_g,short last_g,short cur_choice,short parent_num)
{
short item_hit;
location view_loc;
Boolean sound_done = FALSE;
//make_cursor_sword();
store_first_g = first_g;
store_last_g = last_g;
if ((cur_choice >= first_g) && (cur_choice <= last_g))
@@ -340,22 +326,21 @@ short choose_graphic(short first_g,short last_g,short cur_choice,short parent_nu
cd_activate_item(819,78,0);
}
put_choice_pics();
while (dialog_not_toast)
ModalDialog();
ModalDialog();
cd_kill_dialog(819,0);
do_choose_anim = FALSE;
return dialog_answer;
}
void choose_text_res_event_filter (short item_hit)
{
short i;
Boolean had1 = FALSE, had2 = FALSE;
switch (item_hit) {
case 2:
dialog_answer = store_cur_t;
@@ -375,12 +360,12 @@ void choose_text_res_event_filter (short item_hit)
if (which_page == (store_last_t - store_first_t) / 40)
which_page = 0;
else which_page++;
put_text_res();
put_text_res();
break;
default:
if ((item_hit >= 9) && (item_hit <= 87)) {
store_cur_t = 40 * which_page + (item_hit - 9) / 2 + store_first_t;
for (i = 9; i <= 87; i += 2)
for (i = 9; i <= 87; i += 2)
cd_set_led(820,i,(i == item_hit) ? 1 : 0);
}
break;
@@ -389,9 +374,9 @@ void choose_text_res_event_filter (short item_hit)
void put_text_res()
{
short item_hit,i;
short i;
char str[256];
for (i = 0; i < 40; i++) {
if (store_first_t + which_page * 40 + i > store_last_t) {
csit(820,8 + i * 2,"");
@@ -412,11 +397,6 @@ void put_text_res()
short choose_text_res(short res_list,short first_t,short last_t,short cur_choice,short parent_num,char *title)
{
short item_hit;
char sign_text[256];
location view_loc;
Boolean sound_done = FALSE;
//make_cursor_sword();
store_res_list = res_list;
store_first_t = first_t;
@@ -434,23 +414,21 @@ short choose_text_res(short res_list,short first_t,short last_t,short cur_choice
cd_activate_item(820,6,0);
}
put_text_res();
while (dialog_not_toast)
ModalDialog();
ModalDialog();
cd_kill_dialog(820,0);
return dialog_answer;
}
void edit_text_event_filter (short item_hit)
{
char str[256];
short i;
short num_strs[3] = {260,108,140};
if (store_str_mode == 0)
CDGT(816,2,(store_which_str >= 160) ?
CDGT(816,2,(store_which_str >= 160) ?
scen_strs2[store_which_str - 160] : scen_strs[store_which_str]);
if (store_str_mode == 1)
CDGT(816,2,data_store->out_strs[store_which_str]);
@@ -458,7 +436,7 @@ void edit_text_event_filter (short item_hit)
CDGT(816,2,town_strs[store_which_str]);
switch (item_hit) {
case 9:
dialog_not_toast = FALSE;
dialog_not_toast = FALSE;
break;
case 4:
@@ -472,7 +450,7 @@ void edit_text_event_filter (short item_hit)
}
cdsin(816,5,store_which_str);
if (store_str_mode == 0)
CDST(816,2,(store_which_str >= 160) ?
CDST(816,2,(store_which_str >= 160) ?
scen_strs2[store_which_str - 160] : scen_strs[store_which_str]);
if (store_str_mode)
CDST(816,2,data_store->out_strs[store_which_str]);
@@ -484,17 +462,14 @@ void edit_text_event_filter (short item_hit)
void edit_text_str(short which_str,short mode)
// ignore parent in Mac version
{
short text_hit,i,store_dialog_answer,item_hit;
char temp_str[256];
store_which_str = which_str;
store_str_mode = mode;
cd_create_dialog_parent_num(816,0);
cdsin(816,5,store_which_str);
if (mode == 0)
CDST(816,2,(which_str >= 160) ?
CDST(816,2,(which_str >= 160) ?
scen_strs2[which_str - 160] : scen_strs[which_str]);
if (mode == 1)
CDST(816,2,data_store->out_strs[which_str]);
@@ -503,7 +478,7 @@ void edit_text_str(short which_str,short mode)
cd_attach_key(816,3,0);
cd_attach_key(816,4,0);
while (dialog_not_toast)
ModalDialog();
ModalDialog();
cd_kill_dialog(816,0);
}
@@ -511,12 +486,11 @@ void edit_text_str(short which_str,short mode)
void edit_area_rect_event_filter (short item_hit)
{
char str[256];
short i;
switch (item_hit) {
case 6:
dialog_answer = TRUE;
dialog_not_toast = FALSE;
dialog_not_toast = FALSE;
CDGT(840,2,(char *) str);
if (store_str_mode == 0)
sprintf(data_store->out_strs[store_which_str + 1],"%-29.29s",(char *) str);
@@ -525,7 +499,7 @@ void edit_area_rect_event_filter (short item_hit)
case 3:
dialog_answer = FALSE;
dialog_not_toast = FALSE;
dialog_not_toast = FALSE;
break;
}
}
@@ -534,31 +508,25 @@ void edit_area_rect_event_filter (short item_hit)
Boolean edit_area_rect_str(short which_str,short mode)
// ignore parent in Mac version
{
short area_rect_hit,i,store_dialog_answer,item_hit;
char temp_str[256];
store_which_str = which_str;
store_str_mode = mode;
cd_create_dialog_parent_num(840,0);
if (store_str_mode == 0)
CDST(840,2,data_store->out_strs[store_which_str + 1]);
else CDST(840,2,town_strs[store_which_str + 1]);
while (dialog_not_toast)
ModalDialog();
ModalDialog();
cd_kill_dialog(840,0);
return dialog_answer;
}
Boolean save_spec_enc()
{
char str[256];
short i;
store_spec_node.sd1 = CDGN(822,2);
store_spec_node.sd2 = CDGN(822,3);
store_spec_node.m1 = CDGN(822,4);
@@ -578,7 +546,7 @@ Boolean save_spec_enc()
if (cre(store_spec_node.sd2,-1,9,"The second part of a Stuff Done flag must be from 0 to 9 (or -1 if the Stuff Done flag is ignored.",
"",822) > 0) return FALSE;
}
if (store_which_mode == 0)
scenario.scen_specials[store_which_node] = store_spec_node;
if (store_which_mode == 1)
@@ -596,11 +564,11 @@ void put_spec_enc_in_dlog()
cdsin(822,15,store_which_node);
get_str(str,22,store_spec_node.type + 1);
csit(822,27,(char *) str);
if (last_node[0] == -1)
cd_activate_item(822,14,0);
else cd_activate_item(822,14,1);
CDSN(822,2,store_spec_node.sd1);
CDSN(822,3,store_spec_node.sd2);
switch (edit_spec_stuff_done_mess[store_spec_node.type]) {
@@ -613,23 +581,23 @@ void put_spec_enc_in_dlog()
case 6: csit(822,20,"Switch this ter. type"); csit(822,21,"with this ter. type"); break;
case 7: csit(822,20,"Chance of placing (0 - 100)"); csit(822,21,"What to place (see docs.)"); break;
case 8: csit(822,20,"Chance of placing (0 - 100)"); csit(822,21,"0 - web, 1 - barrel, 2 - crate"); break;
}
}
CDSN(822,4,store_spec_node.m1);
CDSN(822,5,store_spec_node.m2);
switch (edit_spec_mess_mess[store_spec_node.type]) {
case 0: csit(822,22,"Unused."); csit(822,23,"Unused."); cd_activate_item(822,49,0); break;
case 1: csit(822,22,"First part of message"); csit(822,23,"Second part of message");
case 1: csit(822,22,"First part of message"); csit(822,23,"Second part of message");
cd_activate_item(822,49,1); break;
case 2: csit(822,22,"Number of first message in dialog"); csit(822,23,"Unused");
case 2: csit(822,22,"Number of first message in dialog"); csit(822,23,"Unused");
cd_activate_item(822,49,1); break;
case 3: csit(822,22,"Name of Store"); csit(822,23,"Unused");
case 3: csit(822,22,"Name of Store"); csit(822,23,"Unused");
cd_activate_item(822,49,1); break;
case 4: csit(822,22,"Number of first message in dialog");
csit(822,23,"1 - add 'Leave'/'OK' button, else no");
case 4: csit(822,22,"Number of first message in dialog");
csit(822,23,"1 - add 'Leave'/'OK' button, else no");
cd_activate_item(822,49,1); break;
case 5: csit(822,22,"Number of first message in dialog");
csit(822,23,"Num. of spec. item to give (-1 none)");
case 5: csit(822,22,"Number of first message in dialog");
csit(822,23,"Num. of spec. item to give (-1 none)");
cd_activate_item(822,49,1); break;
}
@@ -652,7 +620,7 @@ void put_spec_enc_in_dlog()
for (i = 0 ; i < 12; i++)
if (store_spec_node.type == ex1a_choose[i])
cd_activate_item(822,47,1);
CDSN(822,8,store_spec_node.ex1b);
get_str(str,31,store_spec_node.type + 1);
csit(822,26,(char *) str);
@@ -668,7 +636,7 @@ void put_spec_enc_in_dlog()
for (i = 0 ; i < 18; i++)
if (store_spec_node.type == ex2a_choose[i])
cd_activate_item(822,48,1);
CDSN(822,10,store_spec_node.ex2b);
get_str(str,33,store_spec_node.type + 1);
csit(822,29,(char *) str);
@@ -689,18 +657,17 @@ void put_spec_enc_in_dlog()
void edit_spec_enc_event_filter (short item_hit)
{
char str[256];
short i,node_to_change_to = -1,spec;
switch (item_hit) {
case 12:
if (save_spec_enc() == TRUE)
dialog_not_toast = FALSE;
dialog_not_toast = FALSE;
break;
case 14: //go_back
if (save_spec_enc() == FALSE)
break;
for (i = 0; i < 256; i++)
break;
for (i = 0; i < 256; i++)
if (last_node[i] < 0) {
node_to_change_to = last_node[i - 1];
if (i > 0)
@@ -708,7 +675,7 @@ void edit_spec_enc_event_filter (short item_hit)
i = 256;
}
break;
case 13:
case 13:
if (last_node[0] != -1) {
give_error("You can't cancel out of making a special until you're back at the beginning of the special chain.",
"Press the Go Back button until it disappears.",822);
@@ -717,7 +684,7 @@ void edit_spec_enc_event_filter (short item_hit)
dialog_not_toast = FALSE; break;
case 43: case 44: case 45: // 1b, 2b, jump to spec
if (save_spec_enc() == FALSE)
break;
break;
if (item_hit == 43)
spec = CDGN(822,8);
if (item_hit == 44)
@@ -745,27 +712,27 @@ void edit_spec_enc_event_filter (short item_hit)
CDSN(822,11,spec);
}
if (save_spec_enc() == FALSE)
break;
break;
if ((item_hit == 43) && (store_spec_node.type == 13))
node_to_change_to = spec;
else if ((item_hit == 45) && (store_spec_node.type == 21))
node_to_change_to = spec;
else node_to_change_to = store_which_mode * 1000 + spec;
for (i = 0; i < 256; i++)
for (i = 0; i < 256; i++)
if (last_node[i] < 0) {
last_node[i] = store_which_mode * 1000 + store_which_node;
i = 256;
}
}
break;
case 47: // 1a choose
switch (store_spec_node.type) {
case 19: case 50: case 58: case 59: case 60:
case 19: case 50: case 58: case 59: case 60:
i = choose_text_res(-2,0,399,store_spec_node.ex1a,822,"Give which item?"); break;
case 229:
case 229:
i = choose_text_res(-2,0,399,store_spec_node.ex1a,822,"First item in store?"); break;
case 55: case 56: case 57:
i = choose_text_res(-3,0,NUM_DLOG_B - 1,store_spec_node.ex1a,822,"Which button label?"); break;
case 182:
case 182:
i = choose_text_res(-1,1,255,store_spec_node.ex1a,822,"Choose Which Monster:"); break;
}
store_spec_node.ex1a = i;
@@ -773,11 +740,11 @@ void edit_spec_enc_event_filter (short item_hit)
break;
case 48: // 2a choose
switch (store_spec_node.type) {
case 19: case 50: case 192: case 229:
case 19: case 50: case 192: case 229:
i = choose_text_res(-2,0,399,store_spec_node.ex2a,822,"Give which item?"); break;
case 55: case 56: case 57: case 58: case 59: case 60:
case 55: case 56: case 57: case 58: case 59: case 60:
i = choose_text_res(-3,0,NUM_DLOG_B - 1,store_spec_node.ex2a,822,"Which button label?"); break;
case 181:
case 181:
i = choose_text_res(-1,1,255,store_spec_node.ex2a,822,"Choose Which Monster:"); break;
case 135: case 136: case 171: case 172: case 226:
i = choose_text_res(-4,0,255,store_spec_node.ex2a,822,"Which Terrain?"); break;
@@ -787,23 +754,23 @@ void edit_spec_enc_event_filter (short item_hit)
break;
case 49: // message
if (save_spec_enc() == TRUE)
dialog_not_toast = FALSE;
dialog_not_toast = FALSE;
if ((edit_spec_mess_mess[store_spec_node.type] == 2) ||
(edit_spec_mess_mess[store_spec_node.type] == 4) ||
(edit_spec_mess_mess[store_spec_node.type] == 5)) {
edit_dialog_text(store_which_mode,&store_spec_node.m1,822);
put_spec_enc_in_dlog();
put_spec_enc_in_dlog();
}
else if ((edit_spec_mess_mess[store_spec_node.type] == 1) ||
(edit_spec_mess_mess[store_spec_node.type] == 3)) {
edit_spec_text(store_which_mode,&store_spec_node.m1,
&store_spec_node.m2,822);
put_spec_enc_in_dlog();
put_spec_enc_in_dlog();
}
break;
case 46: // pict
if (save_spec_enc() == TRUE)
dialog_not_toast = FALSE;
dialog_not_toast = FALSE;
i = -1;
switch (edit_pict_mess[store_spec_node.type]) {
case 1: i = choose_graphic(700,731,store_spec_node.pic,822); break;
@@ -812,61 +779,61 @@ void edit_spec_enc_event_filter (short item_hit)
}
if (i >= 0) {
store_spec_node.pic = i;
put_spec_enc_in_dlog();
put_spec_enc_in_dlog();
}
break;
case 37: // 1st spec type
if (save_spec_enc() == TRUE)
dialog_not_toast = FALSE;
dialog_not_toast = FALSE;
i = choose_text_res(22,1,29,store_spec_node.type + 1,822,"Choose General Use Special:");
if (i >= 0) {
store_spec_node.type = i - 1;
}
put_spec_enc_in_dlog();
put_spec_enc_in_dlog();
break;
case 38: // 2 spec type
if (save_spec_enc() == TRUE)
dialog_not_toast = FALSE;
dialog_not_toast = FALSE;
i = choose_text_res(22,51,64,store_spec_node.type + 1,822,"Choose One-Shot Special:");
if (i >= 0) {
store_spec_node.type = i - 1;
store_spec_node.sd1 = -1;
store_spec_node.sd2 = -1;
store_spec_node.sd1 = -1;
store_spec_node.sd2 = -1;
if ((store_spec_node.type >= 55) && (store_spec_node.type <= 57))
store_spec_node.m2 = 1;
}
put_spec_enc_in_dlog();
put_spec_enc_in_dlog();
break;
case 39: // 3 spec type
if (save_spec_enc() == TRUE)
dialog_not_toast = FALSE;
dialog_not_toast = FALSE;
i = choose_text_res(22,81,107,store_spec_node.type + 1,822,"Choose Affect Party Special:");
if (i >= 0) store_spec_node.type = i - 1;
put_spec_enc_in_dlog();
put_spec_enc_in_dlog();
break;
case 40: // 4 spec type
if (save_spec_enc() == TRUE)
dialog_not_toast = FALSE;
dialog_not_toast = FALSE;
i = choose_text_res(22,131,157,store_spec_node.type + 1,822,"Choose If-Then Special:");
if (i >= 0) {
store_spec_node.type = i - 1;
}
put_spec_enc_in_dlog();
put_spec_enc_in_dlog();
break;
case 41: // 5 spec type
if (save_spec_enc() == TRUE)
dialog_not_toast = FALSE;
dialog_not_toast = FALSE;
i = choose_text_res(22,171,219,store_spec_node.type + 1,822,"Choose Town Special:");
if (i >= 0) store_spec_node.type = i - 1;
put_spec_enc_in_dlog();
put_spec_enc_in_dlog();
break;
case 42: // 6 spec type
if (save_spec_enc() == TRUE)
dialog_not_toast = FALSE;
dialog_not_toast = FALSE;
i = choose_text_res(22,226,230,store_spec_node.type + 1,822,"Choose Outdoor Special:");
if (i >= 0) store_spec_node.type = i - 1;
put_spec_enc_in_dlog();
put_spec_enc_in_dlog();
break;
}
/*if ((item_hit >= 37) && (item_hit <= 42)) {
@@ -887,16 +854,15 @@ void edit_spec_enc_event_filter (short item_hit)
if (store_spec_node.pic < 0)
store_spec_node.pic = 0;
put_spec_enc_in_dlog();
}
}
}
// mode - 0 scen 1 - out 2 - town
void edit_spec_enc(short which_node,short mode,short parent_num)
// ignore parent in Mac version
{
short spec_enc_hit,i,store_dialog_answer;
char temp_str[256];
short i;
store_which_mode = mode;
store_which_node = which_node;
for (i = 0; i < 256; i++)
@@ -910,12 +876,12 @@ void edit_spec_enc(short which_node,short mode,short parent_num)
store_spec_node = town.specials[store_which_node];
if (store_spec_node.pic < 0)
store_spec_node.pic = 0;
cd_create_dialog_parent_num(822,parent_num);
cd_activate_item(822,14,0);
put_spec_enc_in_dlog();
while (dialog_not_toast)
ModalDialog();
cd_kill_dialog(822,0);
@@ -925,7 +891,7 @@ short get_fresh_spec(short which_mode)
{
short i;
special_node_type store_node;
for (i = 0; i < num_specs[which_mode]; i++) {
if (which_mode == 0)
store_node = scenario.scen_specials[i];
@@ -936,7 +902,7 @@ short get_fresh_spec(short which_mode)
if ((store_node.type == 0) && (store_node.jumpto == -1) && (store_node.pic == -1))
return i;
}
return -1;
}
@@ -944,10 +910,10 @@ void edit_spec_text_event_filter (short item_hit)
{
char str[256];
short i;
switch (item_hit) {
case 7:
dialog_not_toast = FALSE;
dialog_not_toast = FALSE;
break;
case 6:
@@ -976,7 +942,7 @@ void edit_spec_text_event_filter (short item_hit)
i = 500;
}
break;
}
if (i < 500) {
give_error("There are no more free message slots.",
@@ -988,13 +954,13 @@ void edit_spec_text_event_filter (short item_hit)
switch (store_spec_str_mode) {
case 0:
strcpy(scen_strs2[*store_str1],(char *) str);
break;
break;
case 1:
strcpy(data_store->out_strs[*store_str1 + 10],(char *) str);
break;
break;
case 2:
strcpy(town_strs[*store_str1 + 20],(char *) str);
break;
break;
}
}
}
@@ -1023,7 +989,7 @@ void edit_spec_text_event_filter (short item_hit)
i = 500;
}
break;
}
if (i < 500) {
give_error("There are no more free message slots.",
@@ -1035,13 +1001,13 @@ void edit_spec_text_event_filter (short item_hit)
switch (store_spec_str_mode) {
case 0:
strcpy(scen_strs2[*store_str2],(char *) str);
break;
break;
case 1:
strcpy(data_store->out_strs[*store_str2 + 10],(char *) str);
break;
break;
case 2:
strcpy(town_strs[*store_str2 + 20],(char *) str);
break;
break;
}
}
}
@@ -1053,16 +1019,14 @@ void edit_spec_text_event_filter (short item_hit)
// mode 0 - scen 1 - out 2 - town
void edit_spec_text(short mode,short *str1,short *str2,short parent)
{
short text_hit,i,store_dialog_answer,item_hit;
char temp_str[256];
short num_s_strs[3] = {100,90,100};
store_str1 = str1;
store_str2 = str2;
store_spec_str_mode = mode;
cd_create_dialog_parent_num(826,parent);
if (*str1 >= num_s_strs[mode])
*str1 = -1;
if (*str1 >= 0){
@@ -1083,9 +1047,9 @@ void edit_spec_text(short mode,short *str1,short *str2,short parent)
if (mode == 2)
CDST(826,3,town_strs[*str2 + 20]);
}
while (dialog_not_toast)
ModalDialog();
ModalDialog();
cd_kill_dialog(826,0);
}
@@ -1094,10 +1058,10 @@ void edit_dialog_text_event_filter (short item_hit)
{
char str[256];
short i;
switch (item_hit) {
case 9:
dialog_not_toast = FALSE;
dialog_not_toast = FALSE;
break;
case 8:
@@ -1106,13 +1070,13 @@ void edit_dialog_text_event_filter (short item_hit)
switch (store_spec_str_mode) {
case 0:
strcpy(scen_strs2[*store_str1 + i],(char *) str);
break;
break;
case 1:
strcpy(data_store->out_strs[*store_str1 + 10 + i],(char *) str);
break;
break;
case 2:
strcpy(town_strs[*store_str1 + 20 + i],(char *) str);
break;
break;
}
}
dialog_not_toast = FALSE;
@@ -1123,13 +1087,12 @@ void edit_dialog_text_event_filter (short item_hit)
// mode 0 - scen 1 - out 2 - town
void edit_dialog_text(short mode,short *str1,short parent)
{
short text_hit,i,j,store_dialog_answer,item_hit;
char temp_str[256];
short i,j;
short num_s_strs[3] = {100,90,100};
store_str1 = str1;
store_spec_str_mode = mode;
if (*str1 >= num_s_strs[mode] - 6)
*str1 = -1;
// first, assign the 6 strs for the dialog.
@@ -1171,30 +1134,30 @@ void edit_dialog_text(short mode,short *str1,short parent)
}
}
break;
}
if (*str1 >= 0)
for (i = *str1; i < *str1 + 6; i++) {
switch (store_spec_str_mode) {
case 0:
sprintf(scen_strs2[i],"");
break;
break;
case 1:
sprintf(data_store->out_strs[10 + i],"");
break;
break;
case 2:
sprintf(town_strs[20 + i],"");
break;
}
break;
}
}
}
if (*str1 < 0) {
give_error("To create a dialog, you need 6 consecutive unused messages. To free up 6 messages, select Edit Out/Town/Scenario Text from the menus.","",parent);
return;
}
cd_create_dialog_parent_num(842,parent);
if (*str1 >= 0){
for (i = 0; i < 6; i++) {
if (mode == 0)
@@ -1205,22 +1168,21 @@ void edit_dialog_text(short mode,short *str1,short parent)
CDST(842,2 + i,town_strs[*str1 + 20 + i]);
}
}
while (dialog_not_toast)
ModalDialog();
ModalDialog();
cd_kill_dialog(842,0);
}
void edit_special_num_event_filter (short item_hit)
{
char str[256];
short i;
switch (item_hit) {
case 8:
dialog_answer = -1;
dialog_not_toast = FALSE;
dialog_not_toast = FALSE;
break;
case 4:
@@ -1237,28 +1199,24 @@ void edit_special_num_event_filter (short item_hit)
short edit_special_num(short mode,short what_start)
{
short text_hit,i,j,store_dialog_answer,item_hit;
char temp_str[256];
store_spec_mode = mode;
cd_create_dialog_parent_num(825,0);
CDSN(825,2,what_start);
while (dialog_not_toast)
ModalDialog();
ModalDialog();
cd_kill_dialog(825,0);
return dialog_answer;
}
void edit_scen_intro_event_filter (short item_hit)
{
char str[256];
short i;
switch (item_hit) {
case 9:
scenario.intro_pic = CDGN(804,8);
@@ -1268,10 +1226,10 @@ void edit_scen_intro_event_filter (short item_hit)
}
for (i = 0; i < 6; i++)
CDGT(804, 2 + i,scen_strs[4 + i]);
dialog_not_toast = FALSE;
dialog_not_toast = FALSE;
break;
case 10:
dialog_not_toast = FALSE;
case 10:
dialog_not_toast = FALSE;
break;
case 16:
@@ -1287,25 +1245,22 @@ void edit_scen_intro_event_filter (short item_hit)
void edit_scen_intro()
{
short text_hit,i,j,store_dialog_answer,item_hit;
char temp_str[256];
short num_s_strs[3] = {100,90,100};
short i;
cd_create_dialog_parent_num(804,0);
CDSN(804,8,scenario.intro_pic);
for (i = 0; i < 6; i++)
CDST(804, 2 + i,scen_strs[4 + i]);
csp(804,11,scenario.intro_pic + 1600);
while (dialog_not_toast)
ModalDialog();
ModalDialog();
cd_kill_dialog(804,0);
}
void set_cursor(short which_c)
void set_cursor(short which_c)
{
short i;

File diff suppressed because it is too large Load Diff

View File

@@ -4,7 +4,14 @@ ex1a text : 9000 + x +1
ex1b text : 9300 + x +1
ex2a text : 9600 + x +1
ex2b text : 9900 + x +1
*/
*/
#ifndef _INCLUDED_RC //Resource files conditional inclusion to allow Code::Block compliance
#define _INCLUDED_RC
#include "BLSCENED.RC"
#include "GAMEDLOG.RC"
#endif
STRINGTABLE
{
6001, "No special ability"
@@ -202,7 +209,7 @@ STRINGTABLE
6626, "Have a Rest"
6627, "Wandering will fight"
6628, "End Scenario"
6629, "Display Picture"
6629, "Display Picture"
6651, "Give Item"
6652, "Give Special Item"
6653, "One-Time Do Nothing"

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -34,7 +34,7 @@ Scenario Editor :
-Inverted/Skewed Values <20> many things in the BOE editor have the wrong value to start off with. Crystal Wand and Prismatic Wand are inverted. Many monsters are this way as well <20> One of the Unicorns begins the game as reptile. (Thanks to <20>A Short Term Effect<63> for pointing this one out.)
If you change these values in Bladbase.exs, they will remain changed in any new scenarios you create, saving you the trouble of fixing these in every new scenario you create. => should be done.
/************************** Uncheked Facts *********************************/
/************************** Unchecked Facts *********************************/
First, I was reading a section under the BOE FAQ, and it mentioned something
along the lines of a lock-picking sword. Which would presumably be a weapon
@@ -93,7 +93,7 @@ properly.
23) At high levels, casting the bless spell once will make your character
impossible to be hit by physical attacks.
24) Using the refresh jobs/shops debug option while shoping in one of the
24) Using the refresh jobs/shops debug option while shopping in one of the
Magic Shops will produce strange results. Also there are no jobs, so
souldn't it be called just refresh shops instead of refresh jobs/shops?
/***********************************************************************/