… | |
… | |
63 | * where it is known the map is not tiled or the values are known |
63 | * where it is known the map is not tiled or the values are known |
64 | * consistent (eg, op->map, op->x, op->y) |
64 | * consistent (eg, op->map, op->x, op->y) |
65 | */ |
65 | */ |
66 | // all those macros are herewith declared legacy |
66 | // all those macros are herewith declared legacy |
67 | #define GET_MAP_FLAGS(M,X,Y) (M)->at((X),(Y)).flags () |
67 | #define GET_MAP_FLAGS(M,X,Y) (M)->at((X),(Y)).flags () |
68 | #define GET_MAP_LIGHT(M,X,Y) (M)->at((X),(Y)).light |
|
|
69 | #define GET_MAP_OB(M,X,Y) (M)->at((X),(Y)).bot |
68 | #define GET_MAP_OB(M,X,Y) (M)->at((X),(Y)).bot |
70 | #define GET_MAP_TOP(M,X,Y) (M)->at((X),(Y)).top |
69 | #define GET_MAP_TOP(M,X,Y) (M)->at((X),(Y)).top |
71 | #define GET_MAP_FACE_OBJ(M,X,Y,L) (M)->at((X),(Y)).faces_obj[L] |
70 | #define GET_MAP_FACE_OBJ(M,X,Y,L) (M)->at((X),(Y)).faces_obj[L] |
72 | #define GET_MAP_MOVE_BLOCK(M,X,Y) (M)->at((X),(Y)).move_block |
71 | #define GET_MAP_MOVE_BLOCK(M,X,Y) (M)->at((X),(Y)).move_block |
73 | #define GET_MAP_MOVE_SLOW(M,X,Y) (M)->at((X),(Y)).move_slow |
72 | #define GET_MAP_MOVE_SLOW(M,X,Y) (M)->at((X),(Y)).move_slow |
… | |
… | |
134 | |
133 | |
135 | MTH uint8 flags () |
134 | MTH uint8 flags () |
136 | { |
135 | { |
137 | update (); |
136 | update (); |
138 | return flags_; |
137 | return flags_; |
|
|
138 | } |
|
|
139 | |
|
|
140 | MTH void invalidate () |
|
|
141 | { |
|
|
142 | flags_ = 0; |
139 | } |
143 | } |
140 | |
144 | |
141 | MTH object *player () |
145 | MTH object *player () |
142 | { |
146 | { |
143 | object *op; |
147 | object *op; |
… | |
… | |
223 | |
227 | |
224 | bool ACC (RW, per_player); |
228 | bool ACC (RW, per_player); |
225 | bool ACC (RW, per_party); |
229 | bool ACC (RW, per_party); |
226 | bool ACC (RW, outdoor); /* True if an outdoor map */ |
230 | bool ACC (RW, outdoor); /* True if an outdoor map */ |
227 | bool ACC (RW, no_drop); /* avoid auto-dropping (on death) anything on this map */ |
231 | bool ACC (RW, no_drop); /* avoid auto-dropping (on death) anything on this map */ |
228 | uint8 ACC (RW, darkness); /* indicates level of darkness of map */ |
232 | sint8 ACC (RW, darkness); /* indicates level of darkness of map */ |
|
|
233 | static sint8 outdoor_darkness; /* the global darkness level outside */ |
229 | |
234 | |
230 | uint16 ACC (RW, enter_x); /* enter_x and enter_y are default entrance location */ |
235 | uint16 ACC (RW, enter_x); /* enter_x and enter_y are default entrance location */ |
231 | uint16 ACC (RW, enter_y); /* on the map if none are set in the exit */ |
236 | uint16 ACC (RW, enter_y); /* on the map if none are set in the exit */ |
232 | oblinkpt *buttons; /* Linked list of linked lists of buttons */ |
237 | oblinkpt *buttons; /* Linked list of linked lists of buttons */ |
233 | sint16 ACC (RW, temp); /* base temperature of this tile (F) */ |
238 | sint16 ACC (RW, temp); /* base temperature of this tile (F) */ |
… | |
… | |
248 | maptile *ACC (RW, tile_map[4]); /* Next map, linked list */ |
253 | maptile *ACC (RW, tile_map[4]); /* Next map, linked list */ |
249 | shstr ACC (RW, path); /* Filename of the map */ |
254 | shstr ACC (RW, path); /* Filename of the map */ |
250 | int ACC (RW, max_nrof); // maximum nrof of any single item on a mapspace |
255 | int ACC (RW, max_nrof); // maximum nrof of any single item on a mapspace |
251 | uint64 ACC (RW, max_volume); // maximum volume for all items on a mapspace |
256 | uint64 ACC (RW, max_volume); // maximum volume for all items on a mapspace |
252 | |
257 | |
|
|
258 | // the maptile:: is neccessary here for the perl interface to work |
|
|
259 | MTH sint8 darklevel (sint8 outside = maptile::outdoor_darkness) const |
|
|
260 | { |
|
|
261 | return clamp (outdoor ? darkness + outside : darkness, 0, MAX_DARKNESS); |
|
|
262 | } |
|
|
263 | |
|
|
264 | static void adjust_daylight (); |
|
|
265 | |
253 | MTH void activate (); |
266 | MTH void activate (); |
254 | MTH void deactivate (); |
267 | MTH void deactivate (); |
255 | |
268 | |
256 | // allocates all (empty) mapspace |
269 | // allocates all (empty) mapspace |
257 | MTH void alloc (); |
270 | MTH void alloc (); |
… | |
… | |
260 | |
273 | |
261 | MTH void fix_auto_apply (); |
274 | MTH void fix_auto_apply (); |
262 | MTH void do_decay_objects (); |
275 | MTH void do_decay_objects (); |
263 | MTH void update_buttons (); |
276 | MTH void update_buttons (); |
264 | MTH int change_map_light (int change); |
277 | MTH int change_map_light (int change); |
265 | static void change_all_map_light (int change); //PERL |
|
|
266 | MTH void set_darkness_map (); |
|
|
267 | MTH int estimate_difficulty () const; |
278 | MTH int estimate_difficulty () const; |
268 | |
279 | |
269 | MTH void play_sound (faceidx sound, int x, int y) const; |
280 | MTH void play_sound (faceidx sound, int x, int y) const; |
270 | |
281 | |
271 | // set the given flag on all objects in the map |
282 | // set the given flag on all objects in the map |
… | |
… | |
334 | static maptile *find_async (const char *path, maptile *original = 0, bool load = true);//PERL |
345 | static maptile *find_async (const char *path, maptile *original = 0, bool load = true);//PERL |
335 | static maptile *find_sync (const char *path, maptile *original = 0);//PERL |
346 | static maptile *find_sync (const char *path, maptile *original = 0);//PERL |
336 | static maptile *find_style_sync (const char *dir, const char *file = 0);//PERL |
347 | static maptile *find_style_sync (const char *dir, const char *file = 0);//PERL |
337 | object *pick_random_object (rand_gen &gen = rndm) const; |
348 | object *pick_random_object (rand_gen &gen = rndm) const; |
338 | |
349 | |
339 | mapspace const &at (uint32 x, uint32 y) const { return spaces [x * height + y]; } |
350 | mapspace &at (uint32 x, uint32 y) const { return spaces [x * height + y]; } |
340 | mapspace &at (uint32 x, uint32 y) { return spaces [x * height + y]; } |
|
|
341 | }; |
351 | }; |
342 | |
352 | |
343 | /* This is used by get_rangevector to determine where the other |
353 | /* This is used by get_rangevector to determine where the other |
344 | * creature is. get_rangevector takes into account map tiling, |
354 | * creature is. get_rangevector takes into account map tiling, |
345 | * so you just can not look the the map coordinates and get the |
355 | * so you just can not look the the map coordinates and get the |