… | |
… | |
23 | */ |
23 | */ |
24 | |
24 | |
25 | #ifndef OBJECT_H |
25 | #ifndef OBJECT_H |
26 | #define OBJECT_H |
26 | #define OBJECT_H |
27 | |
27 | |
28 | #include <bitset> |
|
|
29 | |
|
|
30 | #include "cfperl.h" |
28 | #include "cfperl.h" |
31 | #include "shstr.h" |
29 | #include "shstr.h" |
32 | |
30 | |
33 | //+GPL |
31 | //+GPL |
34 | |
32 | |
… | |
… | |
381 | destroy (); |
379 | destroy (); |
382 | } |
380 | } |
383 | |
381 | |
384 | // recursively destroy all objects in inventory, optionally dropping them to the ground instead |
382 | // recursively destroy all objects in inventory, optionally dropping them to the ground instead |
385 | MTH void destroy_inv (bool drop_to_ground = false); |
383 | MTH void destroy_inv (bool drop_to_ground = false); |
|
|
384 | MTH void destroy_inv_fast (); // like destroy_inv (false), but only works when *this is destroyed, too |
386 | MTH object *insert (object *item); // insert into inventory |
385 | MTH object *insert (object *item); // insert into inventory |
387 | MTH void play_sound (faceidx sound) const; |
386 | MTH void play_sound (faceidx sound) const; |
388 | MTH void say_msg (const_utf8_string msg) const; |
387 | MTH void say_msg (const_utf8_string msg) const; |
389 | |
388 | |
390 | void do_remove (); |
389 | void do_remove (); |
… | |
… | |
533 | || (type == SPELL_EFFECT |
532 | || (type == SPELL_EFFECT |
534 | && (subtype == SP_BULLET || subtype == SP_MAGIC_MISSILE)); } |
533 | && (subtype == SP_BULLET || subtype == SP_MAGIC_MISSILE)); } |
535 | MTH bool is_range () const { return type == BOW || type == ROD || type == WAND || type == HORN; } |
534 | MTH bool is_range () const { return type == BOW || type == ROD || type == WAND || type == HORN; } |
536 | |
535 | |
537 | MTH bool is_dragon () const; |
536 | MTH bool is_dragon () const; |
|
|
537 | |
|
|
538 | MTH bool is_immunity () const { return invisible && type == SIGN; } |
538 | |
539 | |
539 | MTH bool has_active_speed () const { return speed >= MIN_ACTIVE_SPEED; } |
540 | MTH bool has_active_speed () const { return speed >= MIN_ACTIVE_SPEED; } |
540 | |
541 | |
541 | // temporary: wether the object can be saved in a map file |
542 | // temporary: wether the object can be saved in a map file |
542 | // contr => is a player |
543 | // contr => is a player |