added worldarea -> will be responsible for world map rendering
[dboe.git] / global.h
blob4ac545346b811cdc939f7a49461651eb00a5de67
1 #include "types.h"
3 #define T_M 60
5 #define NUM_TOWN_ITEMS 115
7 #define SLEEP_TICKS 0L
8 #define MOUSE_REGION 0L
9 #define DRAG_EDGE 15
11 #define DISPLAY_LEFT 23
12 #define DISPLAY_TOP 23
13 #define BITMAP_WIDTH 28
14 #define BITMAP_HEIGHT 36
16 #define STORED_GRAPHICS 240
18 #define PC_WIN_UL_X 291
19 #define PC_WIN_UL_Y 5
20 #define ITEM_WIN_UL_X 291
21 #define ITEM_WIN_UL_Y 130
22 #define TEXT_WIN_UL_X 291
23 #define TEXT_WIN_UL_Y 283
24 #define NUM_BUTTONS 15
25 #define ASB add_string_to_buf
26 #define PSD party.stuff_done
27 #define DES display_enc_string
28 #define FCD fancy_choice_dialog
29 #define D2ES display_2_enc_string
30 #define NUM_MONST_G 173
32 #define DOOR_LIGHT can_enter = run_trap(7,&PSD[c_town.town_num][which],4220,0); break;
33 #define DOOR_HEAVY can_enter = run_trap(7,&PSD[c_town.town_num][which],4220,20); break;
34 #define DOOR_ALARM can_enter = run_trap(7,&PSD[c_town.town_num][which],4220,11); break;
35 #define DRESSER_LIGHT can_enter = run_trap(7,&PSD[c_town.town_num][which],4221,0); break;
36 #define DRESSER_HEAVY can_enter = run_trap(7,&PSD[c_town.town_num][which],4221,20); break;
37 #define DRESSER_ALARM can_enter = run_trap(7,&PSD[c_town.town_num][which],4221,11); break;
38 #define FLOOR_LIGHT can_enter = run_trap(7,&PSD[c_town.town_num][which],4222,0); break;
39 #define FLOOR_HEAVY can_enter = run_trap(7,&PSD[c_town.town_num][which],4222,20); break;
40 #define FLOOR_ALARM can_enter = run_trap(7,&PSD[c_town.town_num][which],4222,11); break;
41 #define CHEST_LIGHT can_enter = run_trap(7,&PSD[c_town.town_num][which],3450,0); break;
42 #define CHEST_HEAVY can_enter = run_trap(7,&PSD[c_town.town_num][which],3450,20); break;
43 #define CHEST_ALARM can_enter = run_trap(7,&PSD[c_town.town_num][which],3450,11); break;
45 #define CDGT cd_retrieve_text_edit_str
46 #define CDGN cd_retrieve_text_edit_num
47 #define CDST cd_set_text_edit_str
48 #define CDSN cd_set_text_edit_num
51 typedef struct {
52 char x,y;
53 } location;
54 typedef struct {
55 short x,y;} shortloc;
57 typedef struct {
58 short type,sd1,sd2,pic,m1,m2,ex1a,ex1b,ex2a,ex2b,jumpto;
59 } special_node_type;
61 typedef struct {
62 short personality,type;
63 char link1[4],link2[4];
64 short extras[4];
65 } talking_node_type;
67 typedef struct {
68 unsigned char strlens[200];
69 talking_node_type talk_nodes[60];
70 } talking_record_type;
72 typedef struct {
73 short picture;
74 unsigned char blockage,flag1,flag2,special,trans_to_what,fly_over,boat_over;
75 unsigned char block_horse,light_radius,step_sound,shortcut_key,res1,res2,res3;
76 } terrain_type_type;
78 typedef struct {
79 unsigned char monst[4];
80 } wandering_type;
82 typedef struct {
83 unsigned char monst[7];
84 unsigned char friendly[3];
85 short spec_on_meet,spec_on_win,spec_on_flee,cant_flee;
86 short end_spec1,end_spec2;
87 } out_wandering_type;
89 typedef struct {
90 unsigned char terrain[48][48];
91 location special_locs[18];
92 unsigned char special_id[18];
93 location exit_locs[8];
94 char exit_dests[8];
95 location sign_locs[8];
96 out_wandering_type wandering[4],special_enc[4];
97 location wandering_locs[4];
98 RECT info_rect[8];
99 unsigned char strlens[180];
100 special_node_type specials[60];
101 } outdoor_record_type;
103 typedef struct {
104 unsigned char number;
105 unsigned char start_attitude;
106 location start_loc;
107 unsigned char mobile;
108 unsigned char time_flag;
109 unsigned char extra1,extra2;
110 short spec1, spec2;
111 char spec_enc_code,time_code;
112 short monster_time,personality;
113 short special_on_kill,facial_pic;
115 } creature_start_type;
118 typedef struct {
119 short variety, item_level;
120 char awkward, bonus, protection, charges, type;
121 unsigned char graphic_num,ability, type_flag, is_special;
122 short value;
123 Boolean identified, magic;
124 unsigned char weight, description_flag;
125 char full_name[25], name[15];
126 unsigned char reserved1,reserved2;
127 unsigned char magic_use_type, ability_strength, treas_class, real_abil;
128 } short_item_record_type;
131 typedef struct {
132 short variety, item_level;
133 char awkward, bonus, protection, charges, type, magic_use_type;
134 unsigned char graphic_num,ability, ability_strength,type_flag, is_special,a;
135 short value;
136 unsigned char weight, special_class;
137 location item_loc;
138 char full_name[25], name[15];
139 unsigned char treas_class,item_properties,reserved1,reserved2;
140 } item_record_type;
142 typedef struct {
143 location item_loc;
144 short item_code,ability;
145 unsigned char charges,always_there,property,contained;
146 } preset_item_type;
148 typedef struct {
149 location field_loc;
150 short field_type;
151 } preset_field_type;
153 typedef struct {
154 short town_chop_time,town_chop_key;
155 wandering_type wandering[4];
156 location wandering_locs[4];
157 location special_locs[50];
158 unsigned char spec_id[50];
159 location sign_locs[15];
160 short lighting;
161 location start_locs[4];
162 location exit_locs[4];
163 short exit_specs[4];
164 RECT in_town_rect;
165 preset_item_type preset_items[64];
166 short max_num_monst;
167 preset_field_type preset_fields[50];
168 short spec_on_entry,spec_on_entry_if_dead;
169 short timer_spec_times[8];
170 short timer_specs[8];
171 unsigned char strlens[180];
172 special_node_type specials[100];
173 unsigned char specials1,specials2,res1,res2;
174 short difficulty;
175 } town_record_type;
179 typedef struct {
180 unsigned char terrain[64][64];
181 RECT room_rect[16];
182 creature_start_type creatures[60];
183 unsigned char lighting[8][64];
184 } big_tr_type;
186 typedef struct {
187 unsigned char terrain[48][48];
188 RECT room_rect[16];
189 creature_start_type creatures[40];
190 unsigned char lighting[6][48];
191 } ave_tr_type;
193 typedef struct {
194 unsigned char terrain[32][32];
195 RECT room_rect[16];
196 creature_start_type creatures[30];
197 unsigned char lighting[4][32];
198 } tiny_tr_type;
200 typedef struct {
201 short block_type;
202 short block_destroy_time;
203 char block_alignment;
204 char block_key_time;
205 location block_loc;
206 } city_block_type;
208 typedef struct {
209 RECT what_rect;
210 unsigned char ter_type;
211 unsigned char hollow;
212 } city_ter_rect_type;
214 typedef struct {
215 creature_start_type creatures[30];
216 city_block_type city_block[15];
217 city_ter_rect_type city_ter_rect[10];
218 } template_town_type;
220 typedef struct {
221 item_record_type scen_items[400];
222 char monst_names[256][20];
223 char ter_names[256][30];
224 } scen_item_data_type;
226 typedef struct {
227 short ter_type,item_num[10],item_odds[10],property;
228 } item_storage_shortcut_type;
230 typedef struct {
231 unsigned char m_num,level,m_name[26];
232 short health,m_health,mp,max_mp;
233 unsigned char armor,skill;
234 short a[3];
235 unsigned char a1_type,a23_type,m_type,speed,ap,mu,cl,breath,breath_type,treasure,spec_skill,poison;
236 short morale,m_morale;
237 short corpse_item,corpse_item_chance;
238 short status[15];
239 unsigned char direction,immunities,x_width,y_width,radiate_1,radiate_2;
240 unsigned char default_attitude,summon_type,default_facial_pic,res1,res2,res3;
241 short picture_num;
243 } monster_record_type;
245 typedef struct {
246 short active,attitude;
247 unsigned char number;
248 location m_loc;
249 monster_record_type m_d;
250 Boolean mobile;
251 short summoned;
252 creature_start_type monst_start;
253 } creature_data_type;
256 typedef struct {
257 location horse_loc,horse_loc_in_sec,horse_sector;
258 short which_town;
259 Boolean exists,property;
260 } horse_record_type;
261 typedef struct {
262 location boat_loc,boat_loc_in_sec,boat_sector;
263 short which_town;
264 Boolean exists,property;
265 } boat_record_type;
267 typedef struct {
268 unsigned char flag1, flag2, flag3, flag4;
269 unsigned char ver[3],min_run_ver,prog_make_ver[3],num_towns;
270 unsigned char out_width,out_height,difficulty,intro_pic,default_ground;
271 } scen_header_type;
273 typedef struct {
274 unsigned char flag1, flag2, flag3, flag4;
275 unsigned char ver[3],min_run_ver,prog_make_ver[3],num_towns;
276 unsigned char out_width,out_height,difficulty,intro_pic,default_ground;
277 unsigned char town_size[200];
278 unsigned char town_hidden[200],a;
279 short flag_a;
280 short intro_mess_pic,intro_mess_len;
281 location where_start,out_sec_start,out_start;
282 short which_town_start;
283 short flag_b;
284 short town_data_size[200][5];
285 short town_to_add_to[10];
286 short flag_to_add_to_town[10][2];
287 short flag_c;
288 short out_data_size[100][2];
289 RECT store_item_rects[3];
290 short store_item_towns[3];
291 short flag_e;
292 short special_items[50];
293 short special_item_special[50];
294 short rating,uses_custom_graphics;
295 short flag_f;
296 monster_record_type scen_monsters[256];
297 boat_record_type scen_boats[30];
298 horse_record_type scen_horses[30];
299 short flag_g;
300 terrain_type_type ter_types[256];
301 short scenario_timer_times[20];
302 short scenario_timer_specs[20];
303 short flag_h;
304 special_node_type scen_specials[256];
305 item_storage_shortcut_type storage_shortcuts[10];
306 short flag_d;
307 unsigned char scen_str_len[300];
308 short flag_i;
309 location last_out_edited;
310 short last_town_edited;
312 } scenario_data_type;
314 // for game
315 typedef struct {
316 short personality;
317 short town_num;
318 short str1,str2;
319 } talk_save_type;
325 typedef struct {
326 creature_data_type dudes[60];
327 short which_town;
328 short friendly;
329 } creature_list_type;
331 typedef struct {
332 short town_num, difficulty;
333 town_record_type town;
334 char explored[64][64];
335 Boolean hostile;
336 creature_list_type monst;
337 Boolean in_boat;
338 location p_loc;
339 } current_town_type;
341 typedef struct {
342 Boolean exists;
343 short direction;
344 out_wandering_type what_monst;
345 location which_sector,m_loc;
346 } outdoor_creature_type;
348 typedef struct {
349 long age;
350 short gold,food;
351 unsigned char stuff_done[310][10],item_taken[200][8];
352 short light_level;
353 location outdoor_corner,i_w_c,p_loc,loc_in_sec;
354 boat_record_type boats[30];
355 horse_record_type horses[30];
356 creature_list_type creature_save[4];
357 short in_boat,in_horse;
358 outdoor_creature_type out_c[10];
359 item_record_type magic_store_items[5][10];
360 short imprisoned_monst[4];
361 char m_seen[256];
362 char journal_str[50];
363 short journal_day[50];
364 short special_notes_str[140][2];
365 talk_save_type talk_save[120];
366 short direction,at_which_save_slot;
367 char alchemy[20];
368 Boolean can_find_town[200];
369 short key_times[100];
370 short party_event_timers[30];
371 short global_or_town[30];
372 short node_to_call[30];
373 char spec_items[50],help_received[120];
374 short m_killed[200];
375 long total_m_killed,total_dam_done,total_xp_gained,total_dam_taken;
376 char scen_name[256];
377 } party_record_type;
379 typedef struct {
380 char town_maps[100][8][64];
381 } stored_town_maps_type;
382 typedef struct {
383 char town_strs[180][256];
384 } piles_of_stuff_dumping_type;
385 typedef struct {
386 char scen_header_strs[25][3][80];
387 char scen_names[25][256];
388 scen_item_data_type scen_item_list;
389 } piles_of_stuff_dumping_type2;
390 typedef struct {
391 char talk_strs[170][256];
392 } piles_of_stuff_dumping_type3;
393 typedef struct {
394 char out_strs[9][256];
395 } outdoor_strs_type;
396 typedef struct {
397 outdoor_strs_type outdoor_text[2][2];
398 } piles_of_stuff_dumping_type4;
399 typedef struct {
400 char scen_strs[160][256];
401 } piles_of_stuff_dumping_type5;
404 typedef struct {
405 short main_status;
406 char name[20];
407 short skills[30];
408 short max_health,cur_health,max_sp,cur_sp,experience,skill_pts,level;
409 short status[15];
410 item_record_type items[24];
411 Boolean equip[24];
412 Boolean priest_spells[62],mage_spells[62];
413 short which_graphic,weap_poisoned;
414 Boolean advan[15],traits[15];
415 short race,exp_adj,direction;
416 } pc_record_type;
418 typedef struct {
419 unsigned char setup[4][64][64];
420 } setup_save_type;
423 typedef struct {
424 item_record_type items[NUM_TOWN_ITEMS];
425 } town_item_list;
427 typedef struct {short i;} flag_type;
429 typedef struct {unsigned char pattern[9][9];} effect_pat_type;
431 typedef struct {
432 item_record_type items[NUM_TOWN_ITEMS];
433 } stored_items_list_type;
435 typedef struct {
436 char outdoor_maps[100][6][48];
437 } stored_outdoor_maps_type;
440 short s_pow(short x,short y);
441 short a_v(short x);
442 short ex_abs(short x);
443 short get_ran (short times,short min,short max);
444 Boolean same_point(location p1,location p2);
445 //void pause(short length);
446 short minmax(short min,short max,short k);
447 short min(short a,short b);
448 short max(short a,short b);
449 short move_to_zero(short val);
450 void Delay(short val,long *dummy);
451 void alter_rect(RECT *r) ;
452 Boolean sd_legit(short a, short b);