… | |
… | |
260 | bool ACC (RW, flag[NUM_FLAGS]); |
260 | bool ACC (RW, flag[NUM_FLAGS]); |
261 | #endif |
261 | #endif |
262 | uint16 ACC (RW, animation_id);/* An index into the animation array */ |
262 | uint16 ACC (RW, animation_id);/* An index into the animation array */ |
263 | uint8 ACC (RW, anim_speed); /* ticks between animation-frames */ |
263 | uint8 ACC (RW, anim_speed); /* ticks between animation-frames */ |
264 | uint8 ACC (RW, last_anim); /* last sequence used to draw face */ |
264 | uint8 ACC (RW, last_anim); /* last sequence used to draw face */ |
265 | sint16 ACC (RW, elevation); /* elevation of this terrain - not currently used */ |
|
|
266 | uint8 ACC (RW, smoothlevel); /* how to smooth this square around */ |
265 | uint8 ACC (RW, smoothlevel); /* how to smooth this square around */ |
267 | uint8 ACC (RW, will_apply); /* See crossfire.doc */ |
266 | uint8 ACC (RW, will_apply); /* See crossfire.doc */ |
|
|
267 | uint16 ACC (RW, cached_sp); /* cached spell points used for a spell, used by esrv_update_spells */ |
|
|
268 | uint16 ACC (RW, cached_grace);/* cached grace points used for a spell, used by esrv_update_spells */ |
|
|
269 | uint16 ACC (RW, cached_eat); /* cached food, used by esrv_update_spells */ |
268 | }; |
270 | }; |
269 | |
271 | |
270 | struct object : zero_initialised, object_copy |
272 | struct object : zero_initialised, object_copy |
271 | { |
273 | { |
272 | // These variables are not changed by ->copy_to |
274 | // These variables are not changed by ->copy_to |
… | |
… | |
693 | static archetype *read (object_thawer &f); |
695 | static archetype *read (object_thawer &f); |
694 | MTH static void commit_load (); // commit any objects loaded, resolves cyclic dependencies and more |
696 | MTH static void commit_load (); // commit any objects loaded, resolves cyclic dependencies and more |
695 | static void postpone_arch_ref (arch_ptr &ref, const_utf8_string other_arch); /* postpone other_arch reference */ |
697 | static void postpone_arch_ref (arch_ptr &ref, const_utf8_string other_arch); /* postpone other_arch reference */ |
696 | }; |
698 | }; |
697 | |
699 | |
|
|
700 | // compatbiility, remove once replaced by ->instance |
|
|
701 | inline object * |
|
|
702 | arch_to_object (archetype *at) |
|
|
703 | { |
|
|
704 | return at->instance (); |
|
|
705 | } |
|
|
706 | |
698 | inline void |
707 | inline void |
699 | object_freezer::put (keyword k, archetype *v) |
708 | object_freezer::put (keyword k, archetype *v) |
700 | { |
709 | { |
701 | put (k, v ? &v->archname : (const char *)0); |
710 | put (k, v ? &v->archname : (const char *)0); |
702 | } |
711 | } |
… | |
… | |
707 | |
716 | |
708 | extern objectvec objects; |
717 | extern objectvec objects; |
709 | extern activevec actives; |
718 | extern activevec actives; |
710 | extern archvec archetypes; |
719 | extern archvec archetypes; |
711 | |
720 | |
|
|
721 | // "safely" iterate over inv in a way such that the current item is removable |
|
|
722 | // quite horrible, thats why its hidden in some macro |
|
|
723 | #define for_inv_removable(op,var) \ |
|
|
724 | for (object *var, *next_ = (op)->inv; (var = next_), var && (next_ = var->below), var; ) |
|
|
725 | |
712 | #define for_all_objects(var) \ |
726 | #define for_all_objects(var) \ |
713 | for (unsigned _i = 0; _i < objects.size (); ++_i) \ |
727 | for (unsigned _i = 0; _i < objects.size (); ++_i) \ |
714 | statementvar (object *, var, objects [_i]) |
728 | statementvar (object *, var, objects [_i]) |
715 | |
729 | |
716 | #define for_all_actives(var) \ |
730 | #define for_all_actives(var) \ |
717 | for (unsigned _i = 0; _i < actives.size (); ++_i) \ |
731 | for (unsigned _i = 0; _i < actives.size (); ++_i) \ |
718 | statementvar (object *, var, actives [_i]) |
732 | statementvar (object *, var, actives [_i]) |
719 | |
733 | |
720 | #define for_all_archetypes(var) \ |
734 | #define for_all_archetypes(var) \ |
721 | for (unsigned _i = 0; _i < archetypes.size (); ++_i) \ |
735 | for (unsigned _i = 0; _i < archetypes.size (); ++_i) \ |
722 | statementvar (archetype *, var, archetypes [_i]) |
736 | statementvar (archetype *, var, archetypes [_i]) |
723 | |
737 | |
724 | /* Used by update_object to know if the object being passed is |
738 | /* Used by update_object to know if the object being passed is |
725 | * being added or removed. |
739 | * being added or removed. |