… | |
… | |
518 | MTH bool is_arrow () const { return type == ARROW |
518 | MTH bool is_arrow () const { return type == ARROW |
519 | || (type == SPELL_EFFECT |
519 | || (type == SPELL_EFFECT |
520 | && (subtype == SP_BULLET || subtype == SP_MAGIC_MISSILE)); } |
520 | && (subtype == SP_BULLET || subtype == SP_MAGIC_MISSILE)); } |
521 | MTH bool is_range () const { return type == BOW || type == ROD || type == WAND || type == HORN; } |
521 | MTH bool is_range () const { return type == BOW || type == ROD || type == WAND || type == HORN; } |
522 | |
522 | |
|
|
523 | MTH bool is_dragon () const; |
|
|
524 | |
523 | MTH bool has_active_speed () const { return speed >= MIN_ACTIVE_SPEED; } |
525 | MTH bool has_active_speed () const { return speed >= MIN_ACTIVE_SPEED; } |
524 | |
526 | |
525 | // temporary: wether the object can be saved in a map file |
527 | // temporary: wether the object can be saved in a map file |
526 | // contr => is a player |
528 | // contr => is a player |
527 | // head => only save head of a multitile object |
529 | // head => only save head of a multitile object |
… | |
… | |
814 | // support for archetype loading |
816 | // support for archetype loading |
815 | static archetype *read (object_thawer &f); |
817 | static archetype *read (object_thawer &f); |
816 | MTH static void commit_load (); // commit any objects loaded, resolves cyclic dependencies and more |
818 | MTH static void commit_load (); // commit any objects loaded, resolves cyclic dependencies and more |
817 | static void postpone_arch_ref (arch_ptr &ref, const_utf8_string other_arch); /* postpone other_arch reference */ |
819 | static void postpone_arch_ref (arch_ptr &ref, const_utf8_string other_arch); /* postpone other_arch reference */ |
818 | }; |
820 | }; |
|
|
821 | |
|
|
822 | // returns whether the objetc is a dragon player, which are often specialcased |
|
|
823 | inline bool |
|
|
824 | object::is_dragon () const |
|
|
825 | { |
|
|
826 | return arch->race == shstr_dragon && is_player (); |
|
|
827 | } |
819 | |
828 | |
820 | inline void |
829 | inline void |
821 | object_freezer::put (const keyword_string k, archetype *v) |
830 | object_freezer::put (const keyword_string k, archetype *v) |
822 | { |
831 | { |
823 | if (expect_true (v)) |
832 | if (expect_true (v)) |