… | |
… | |
59 | wall_blocked (maptile *m, int x, int y) |
59 | wall_blocked (maptile *m, int x, int y) |
60 | { |
60 | { |
61 | if (OUT_OF_REAL_MAP (m, x, y)) |
61 | if (OUT_OF_REAL_MAP (m, x, y)) |
62 | return 1; |
62 | return 1; |
63 | |
63 | |
|
|
64 | m->at (x, y).update (); |
64 | int r = GET_MAP_MOVE_BLOCK (m, x, y) & ~MOVE_BLOCK_DEFAULT; |
65 | return GET_MAP_MOVE_BLOCK (m, x, y) & MOVE_WALK; |
65 | return r; |
|
|
66 | } |
66 | } |
67 | |
67 | |
68 | /* place treasures in the map, given the |
68 | /* place treasures in the map, given the |
69 | map, (required) |
69 | map, (required) |
70 | layout, (required) |
70 | layout, (required) |
… | |
… | |
239 | treasurelist *tlist = find_treasurelist (RP->treasurestyle); |
239 | treasurelist *tlist = find_treasurelist (RP->treasurestyle); |
240 | |
240 | |
241 | if (tlist != NULL) |
241 | if (tlist != NULL) |
242 | for (ti = 0; ti < n_treasures; ti++) |
242 | for (ti = 0; ti < n_treasures; ti++) |
243 | { /* use the treasure list */ |
243 | { /* use the treasure list */ |
244 | object *new_treasure = pick_random_object (style_map); |
244 | object *new_treasure = style_map->pick_random_object (); |
245 | |
245 | |
246 | insert_ob_in_ob (arch_to_object (new_treasure->arch), the_chest); |
246 | insert_ob_in_ob (arch_to_object (new_treasure->arch), the_chest); |
247 | } |
247 | } |
248 | else |
248 | else |
249 | { /* use the style map */ |
249 | { /* use the style map */ |
250 | the_chest->randomitems = tlist; |
250 | the_chest->randomitems = tlist; |
251 | the_chest->stats.hp = n_treasures; |
251 | the_chest->stats.hp = n_treasures; |
252 | } |
252 | } |
253 | #endif |
253 | #endif |
254 | { /* neither style_map no treasure list given */ |
254 | { /* neither style_map no treasure list given */ |
255 | treasurelist *tlist = find_treasurelist ("chest"); |
255 | treasurelist *tlist = treasurelist::find ("chest"); |
256 | |
256 | |
257 | the_chest->randomitems = tlist; |
257 | the_chest->randomitems = tlist; |
258 | the_chest->stats.hp = n_treasures; |
258 | the_chest->stats.hp = n_treasures; |
259 | } |
259 | } |
260 | |
260 | |
… | |
… | |
264 | maptile *trap_map = find_style ("/styles/trapstyles", "traps", -1); |
264 | maptile *trap_map = find_style ("/styles/trapstyles", "traps", -1); |
265 | object *the_trap; |
265 | object *the_trap; |
266 | |
266 | |
267 | if (trap_map) |
267 | if (trap_map) |
268 | { |
268 | { |
269 | the_trap = pick_random_object (trap_map); |
269 | the_trap = trap_map->pick_random_object (); |
270 | the_trap->stats.Cha = 10 + RP->difficulty; |
270 | the_trap->stats.Cha = 10 + RP->difficulty; |
271 | the_trap->level = bc_random ((3 * RP->difficulty) / 2); |
271 | the_trap->level = bc_random ((3 * RP->difficulty) / 2); |
272 | if (the_trap) |
272 | if (the_trap) |
273 | { |
273 | { |
274 | object *new_trap; |
274 | object *new_trap; |
… | |
… | |
698 | it'll remove any monsters it finds.*/ |
698 | it'll remove any monsters it finds.*/ |
699 | object ** |
699 | object ** |
700 | surround_by_doors (maptile *map, char **layout, int x, int y, int opts) |
700 | surround_by_doors (maptile *map, char **layout, int x, int y, int opts) |
701 | { |
701 | { |
702 | int i; |
702 | int i; |
703 | char *doors[2]; |
703 | const char *doors[2]; |
704 | object **doorlist; |
704 | object **doorlist; |
705 | int ndoors_made = 0; |
705 | int ndoors_made = 0; |
706 | doorlist = (object **) calloc (9, sizeof (object *)); /* 9 doors so we can hold termination null */ |
706 | doorlist = (object **) calloc (9, sizeof (object *)); /* 9 doors so we can hold termination null */ |
707 | |
707 | |
708 | /* this is a list we pick from, for horizontal and vertical doors */ |
708 | /* this is a list we pick from, for horizontal and vertical doors */ |