… | |
… | |
290 | MTH void change_luck (int value); |
290 | MTH void change_luck (int value); |
291 | |
291 | |
292 | // info must hold 256 * 3 bytes currently |
292 | // info must hold 256 * 3 bytes currently |
293 | const char *debug_desc (char *info) const; |
293 | const char *debug_desc (char *info) const; |
294 | MTH const char *debug_desc () const; |
294 | MTH const char *debug_desc () const; |
|
|
295 | const char *flag_desc (char *desc, int len) const; |
295 | |
296 | |
296 | MTH bool is_weapon () const { return type == ARROW || type == BOW || type == WEAPON; } |
297 | MTH bool is_weapon () const { return type == ARROW || type == BOW || type == WEAPON; } |
297 | MTH bool is_armor () const { return type == ARMOUR || type == SHIELD || type == HELMET |
298 | MTH bool is_armor () const { return type == ARMOUR || type == SHIELD || type == HELMET |
298 | || type == CLOAK || type == BOOTS || type == GLOVES |
299 | || type == CLOAK || type == BOOTS || type == GLOVES |
299 | || type == BRACERS || type == GIRDLE; } |
300 | || type == BRACERS || type == GIRDLE; } |
… | |
… | |
303 | && !flag [FLAG_IS_A_TEMPLATE]; } |
304 | && !flag [FLAG_IS_A_TEMPLATE]; } |
304 | MTH bool is_arrow () const { return type == ARROW |
305 | MTH bool is_arrow () const { return type == ARROW |
305 | || (type == SPELL_EFFECT |
306 | || (type == SPELL_EFFECT |
306 | && (subtype == SP_BULLET || subtype == SP_MAGIC_MISSILE)); } |
307 | && (subtype == SP_BULLET || subtype == SP_MAGIC_MISSILE)); } |
307 | |
308 | |
|
|
309 | MTH bool has_active_speed () const { return FABS(speed) >= MIN_ACTIVE_SPEED; } |
|
|
310 | |
308 | // temporary: wether the objetc can be saved in a map file |
311 | // temporary: wether the object can be saved in a map file |
309 | // contr => is a player |
312 | // contr => is a player |
310 | // head => only save head of a multitile object |
313 | // head => only save head of a multitile object |
311 | // owner => can not reference owner yet |
314 | // owner => can not reference owner yet |
312 | MTH bool can_map_save () const { return !contr && !head && !owner; } |
315 | MTH bool can_map_save () const { return !contr && !head && !owner; } |
313 | |
316 | |
… | |
… | |
358 | operator object *() const { return item; } |
361 | operator object *() const { return item; } |
359 | |
362 | |
360 | object *operator ->() const { return item; } |
363 | object *operator ->() const { return item; } |
361 | object &operator * () const { return *item; } |
364 | object &operator * () const { return *item; } |
362 | }; |
365 | }; |
|
|
366 | |
|
|
367 | MTH unsigned int random_seed () const |
|
|
368 | { |
|
|
369 | return (unsigned int)uuid.seq; |
|
|
370 | } |
363 | |
371 | |
364 | // depth-first recursive iterator |
372 | // depth-first recursive iterator |
365 | struct depth_iterator : iterator_base |
373 | struct depth_iterator : iterator_base |
366 | { |
374 | { |
367 | depth_iterator (object *container); |
375 | depth_iterator (object *container); |