… | |
… | |
41 | |
41 | |
42 | /* clear map completely of all objects: a rectangular area of xsize, ysize |
42 | /* clear map completely of all objects: a rectangular area of xsize, ysize |
43 | is cleared with the top left corner at xstart, ystart */ |
43 | is cleared with the top left corner at xstart, ystart */ |
44 | |
44 | |
45 | void |
45 | void |
46 | nuke_map_region (mapstruct *map, int xstart, int ystart, int xsize, int ysize) |
46 | nuke_map_region (maptile *map, int xstart, int ystart, int xsize, int ysize) |
47 | { |
47 | { |
48 | int i, j; |
48 | int i, j; |
49 | object *tmp; |
49 | object *tmp; |
50 | |
50 | |
51 | for (i = xstart; i < xstart + xsize; i++) |
51 | for (i = xstart; i < xstart + xsize; i++) |
… | |
… | |
71 | |
71 | |
72 | /* copy in_map into dest_map at point x,y */ |
72 | /* copy in_map into dest_map at point x,y */ |
73 | |
73 | |
74 | |
74 | |
75 | void |
75 | void |
76 | include_map_in_map (mapstruct *dest_map, mapstruct *in_map, int x, int y) |
76 | include_map_in_map (maptile *dest_map, maptile *in_map, int x, int y) |
77 | { |
77 | { |
78 | int i, j; |
78 | int i, j; |
79 | object *tmp; |
79 | object *tmp; |
80 | object *new_ob; |
80 | object *new_ob; |
81 | |
81 | |
… | |
… | |
101 | } |
101 | } |
102 | } |
102 | } |
103 | } |
103 | } |
104 | |
104 | |
105 | int |
105 | int |
106 | find_spot_for_submap (mapstruct *map, char **layout, int *ix, int *iy, int xsize, int ysize) |
106 | find_spot_for_submap (maptile *map, char **layout, int *ix, int *iy, int xsize, int ysize) |
107 | { |
107 | { |
108 | int tries; |
108 | int tries; |
109 | int i = 0, j = 0; /* initialization may not be needed but prevents compiler warnings */ |
109 | int i = 0, j = 0; /* initialization may not be needed but prevents compiler warnings */ |
110 | int is_occupied = 0; |
110 | int is_occupied = 0; |
111 | int l, m; |
111 | int l, m; |
… | |
… | |
153 | return 1; |
153 | return 1; |
154 | } |
154 | } |
155 | |
155 | |
156 | |
156 | |
157 | void |
157 | void |
158 | place_fountain_with_specials (mapstruct *map) |
158 | place_fountain_with_specials (maptile *map) |
159 | { |
159 | { |
160 | int ix, iy, i = -1, tries = 0; |
160 | int ix, iy, i = -1, tries = 0; |
161 | mapstruct *fountain_style = find_style ("/styles/misc", "fountains", -1); |
161 | maptile *fountain_style = find_style ("/styles/misc", "fountains", -1); |
162 | object *fountain = get_archetype ("fountain"); |
162 | object *fountain = get_archetype ("fountain"); |
163 | object *potion = get_object (); |
163 | object *potion = get_object (); |
164 | |
164 | |
165 | copy_object (pick_random_object (fountain_style), potion); |
165 | copy_object (pick_random_object (fountain_style), potion); |
166 | while (i < 0 && tries < 10) |
166 | while (i < 0 && tries < 10) |
… | |
… | |
191 | insert_ob_in_map (potion, map, NULL, 0); |
191 | insert_ob_in_map (potion, map, NULL, 0); |
192 | |
192 | |
193 | } |
193 | } |
194 | |
194 | |
195 | void |
195 | void |
196 | place_special_exit (mapstruct *map, int hole_type, RMParms * RP) |
196 | place_special_exit (maptile *map, int hole_type, RMParms * RP) |
197 | { |
197 | { |
198 | int ix, iy, i = -1; |
198 | int ix, iy, i = -1; |
199 | char buf[HUGE_BUF], *style, *decor, *mon; |
199 | char buf[HUGE_BUF], *style, *decor, *mon; |
200 | mapstruct *exit_style = find_style ("/styles/misc", "obscure_exits", -1); |
200 | maptile *exit_style = find_style ("/styles/misc", "obscure_exits", -1); |
201 | int g_xsize, g_ysize; |
201 | int g_xsize, g_ysize; |
202 | |
202 | |
203 | object *the_exit = get_object (); |
203 | object *the_exit = get_object (); |
204 | |
204 | |
205 | if (!exit_style) |
205 | if (!exit_style) |
… | |
… | |
278 | insert_ob_in_map (the_exit, map, NULL, 0); |
278 | insert_ob_in_map (the_exit, map, NULL, 0); |
279 | } |
279 | } |
280 | |
280 | |
281 | |
281 | |
282 | void |
282 | void |
283 | place_specials_in_map (mapstruct *map, char **layout, RMParms * RP) |
283 | place_specials_in_map (maptile *map, char **layout, RMParms * RP) |
284 | { |
284 | { |
285 | mapstruct *special_map; |
285 | maptile *special_map; |
286 | int ix, iy; /* map insertion locatons */ |
286 | int ix, iy; /* map insertion locatons */ |
287 | int special_type; /* type of special to make */ |
287 | int special_type; /* type of special to make */ |
288 | |
288 | |
289 | |
289 | |
290 | special_type = RANDOM () % NUM_OF_SPECIAL_TYPES; |
290 | special_type = RANDOM () % NUM_OF_SPECIAL_TYPES; |