… | |
… | |
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 has_active_speed () const { return fabs (speed) >= MIN_ACTIVE_SPEED; } |
523 | MTH bool has_active_speed () const { return speed >= MIN_ACTIVE_SPEED; } |
524 | |
524 | |
525 | // temporary: wether the object can be saved in a map file |
525 | // temporary: wether the object can be saved in a map file |
526 | // contr => is a player |
526 | // contr => is a player |
527 | // head => only save head of a multitile object |
527 | // head => only save head of a multitile object |
528 | // owner => can not reference owner yet |
528 | // owner => can not reference owner yet |
… | |
… | |
814 | // support for archetype loading |
814 | // support for archetype loading |
815 | static archetype *read (object_thawer &f); |
815 | static archetype *read (object_thawer &f); |
816 | MTH static void commit_load (); // commit any objects loaded, resolves cyclic dependencies and more |
816 | 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 */ |
817 | static void postpone_arch_ref (arch_ptr &ref, const_utf8_string other_arch); /* postpone other_arch reference */ |
818 | }; |
818 | }; |
819 | |
|
|
820 | // compatbiility, remove once replaced by ->instance |
|
|
821 | inline object * |
|
|
822 | arch_to_object (archetype *at) |
|
|
823 | { |
|
|
824 | return at->instance (); |
|
|
825 | } |
|
|
826 | |
819 | |
827 | inline void |
820 | inline void |
828 | object_freezer::put (const keyword_string k, archetype *v) |
821 | object_freezer::put (const keyword_string k, archetype *v) |
829 | { |
822 | { |
830 | if (expect_true (v)) |
823 | if (expect_true (v)) |