5 #define NUM_TOWN_ITEMS 115
8 #define MOUSE_REGION 0L
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
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
58 short type
,sd1
,sd2
,pic
,m1
,m2
,ex1a
,ex1b
,ex2a
,ex2b
,jumpto
;
62 short personality
,type
;
63 char link1
[4],link2
[4];
68 unsigned char strlens
[200];
69 talking_node_type talk_nodes
[60];
70 } talking_record_type
;
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
;
79 unsigned char monst
[4];
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
;
90 unsigned char terrain
[48][48];
91 location special_locs
[18];
92 unsigned char special_id
[18];
93 location exit_locs
[8];
95 location sign_locs
[8];
96 out_wandering_type wandering
[4],special_enc
[4];
97 location wandering_locs
[4];
99 unsigned char strlens
[180];
100 special_node_type specials
[60];
101 } outdoor_record_type
;
104 unsigned char number
;
105 unsigned char start_attitude
;
107 unsigned char mobile
;
108 unsigned char time_flag
;
109 unsigned char extra1
,extra2
;
111 char spec_enc_code
,time_code
;
112 short monster_time
,personality
;
113 short special_on_kill
,facial_pic
;
115 } creature_start_type
;
119 short variety
, item_level
;
120 char awkward
, bonus
, protection
, charges
, type
;
121 unsigned char graphic_num
,ability
, type_flag
, is_special
;
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
;
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
;
136 unsigned char weight
, special_class
;
138 char full_name
[25], name
[15];
139 unsigned char treas_class
,item_properties
,reserved1
,reserved2
;
144 short item_code
,ability
;
145 unsigned char charges
,always_there
,property
,contained
;
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];
161 location start_locs
[4];
162 location exit_locs
[4];
165 preset_item_type preset_items
[64];
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
;
180 unsigned char terrain
[64][64];
182 creature_start_type creatures
[60];
183 unsigned char lighting
[8][64];
187 unsigned char terrain
[48][48];
189 creature_start_type creatures
[40];
190 unsigned char lighting
[6][48];
194 unsigned char terrain
[32][32];
196 creature_start_type creatures
[30];
197 unsigned char lighting
[4][32];
202 short block_destroy_time
;
203 char block_alignment
;
210 unsigned char ter_type
;
211 unsigned char hollow
;
212 } city_ter_rect_type
;
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
;
221 item_record_type scen_items
[400];
222 char monst_names
[256][20];
223 char ter_names
[256][30];
224 } scen_item_data_type
;
227 short ter_type
,item_num
[10],item_odds
[10],property
;
228 } item_storage_shortcut_type
;
231 unsigned char m_num
,level
,m_name
[26];
232 short health
,m_health
,mp
,max_mp
;
233 unsigned char armor
,skill
;
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
;
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
;
243 } monster_record_type
;
246 short active
,attitude
;
247 unsigned char number
;
249 monster_record_type m_d
;
252 creature_start_type monst_start
;
253 } creature_data_type
;
257 location horse_loc
,horse_loc_in_sec
,horse_sector
;
259 Boolean exists
,property
;
262 location boat_loc
,boat_loc_in_sec
,boat_sector
;
264 Boolean exists
,property
;
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
;
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
;
280 short intro_mess_pic
,intro_mess_len
;
281 location where_start
,out_sec_start
,out_start
;
282 short which_town_start
;
284 short town_data_size
[200][5];
285 short town_to_add_to
[10];
286 short flag_to_add_to_town
[10][2];
288 short out_data_size
[100][2];
289 RECT store_item_rects
[3];
290 short store_item_towns
[3];
292 short special_items
[50];
293 short special_item_special
[50];
294 short rating
,uses_custom_graphics
;
296 monster_record_type scen_monsters
[256];
297 boat_record_type scen_boats
[30];
298 horse_record_type scen_horses
[30];
300 terrain_type_type ter_types
[256];
301 short scenario_timer_times
[20];
302 short scenario_timer_specs
[20];
304 special_node_type scen_specials
[256];
305 item_storage_shortcut_type storage_shortcuts
[10];
307 unsigned char scen_str_len
[300];
309 location last_out_edited
;
310 short last_town_edited
;
312 } scenario_data_type
;
326 creature_data_type dudes
[60];
329 } creature_list_type
;
332 short town_num
, difficulty
;
333 town_record_type town
;
334 char explored
[64][64];
336 creature_list_type monst
;
344 out_wandering_type what_monst
;
345 location which_sector
,m_loc
;
346 } outdoor_creature_type
;
351 unsigned char stuff_done
[310][10],item_taken
[200][8];
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];
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
;
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];
375 long total_m_killed
,total_dam_done
,total_xp_gained
,total_dam_taken
;
380 char town_maps
[100][8][64];
381 } stored_town_maps_type
;
383 char town_strs
[180][256];
384 } piles_of_stuff_dumping_type
;
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
;
391 char talk_strs
[170][256];
392 } piles_of_stuff_dumping_type3
;
394 char out_strs
[9][256];
397 outdoor_strs_type outdoor_text
[2][2];
398 } piles_of_stuff_dumping_type4
;
400 char scen_strs
[160][256];
401 } piles_of_stuff_dumping_type5
;
408 short max_health
,cur_health
,max_sp
,cur_sp
,experience
,skill_pts
,level
;
410 item_record_type items
[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
;
419 unsigned char setup
[4][64][64];
424 item_record_type items
[NUM_TOWN_ITEMS
];
427 typedef struct {short i
;} flag_type
;
429 typedef struct {unsigned char pattern
[9][9];} effect_pat_type
;
432 item_record_type items
[NUM_TOWN_ITEMS
];
433 } stored_items_list_type
;
436 char outdoor_maps
[100][6][48];
437 } stored_outdoor_maps_type
;
440 short s_pow(short x
,short y
);
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
);