… | |
… | |
175 | arch_ptr ACC (RW, arch); /* Pointer to archetype */ |
175 | arch_ptr ACC (RW, arch); /* Pointer to archetype */ |
176 | arch_ptr ACC (RW, other_arch);/* Pointer used for various things - mostly used for what */ |
176 | arch_ptr ACC (RW, other_arch);/* Pointer used for various things - mostly used for what */ |
177 | |
177 | |
178 | float ACC (RW, speed); /* The overall speed of this object */ |
178 | float ACC (RW, speed); /* The overall speed of this object */ |
179 | float ACC (RW, speed_left); /* How much speed is left to spend this round */ |
179 | float ACC (RW, speed_left); /* How much speed is left to spend this round */ |
180 | uint32 ACC (RW, nrof); /* How many of the objects */ |
180 | sint32 ACC (RW, nrof); /* How many of the objects */ |
181 | |
181 | |
182 | /* This next big block is basically used for monsters and equipment */ |
182 | /* This next big block is basically used for monsters and equipment */ |
183 | uint16 ACC (RW, client_type); /* Public type information. see doc/Developers/objects */ |
183 | uint16 ACC (RW, client_type); /* Public type information. see doc/Developers/objects */ |
184 | |
184 | |
185 | sint16 ACC (RW, resist[NROFATTACKS]); /* Resistance adjustments for attacks */ |
185 | sint16 ACC (RW, resist[NROFATTACKS]); /* Resistance adjustments for attacks */ |
… | |
… | |
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 |
… | |
… | |
465 | /* This return true if object has still randomitems which |
467 | /* This return true if object has still randomitems which |
466 | * could be expanded. |
468 | * could be expanded. |
467 | */ |
469 | */ |
468 | MTH bool has_random_items () const { return randomitems && !flag [FLAG_IS_A_TEMPLATE]; } |
470 | MTH bool has_random_items () const { return randomitems && !flag [FLAG_IS_A_TEMPLATE]; } |
469 | |
471 | |
|
|
472 | MTH bool has_dialogue () const { return *&msg == '@'; } |
|
|
473 | |
470 | // returns the outermost owner, never returns 0 |
474 | // returns the outermost owner, never returns 0 |
471 | MTH object *outer_owner () |
475 | MTH object *outer_owner () |
472 | { |
476 | { |
473 | for (object *op = this; ; op = op->owner) |
477 | for (object *op = this; ; op = op->owner) |
474 | if (!op->owner) |
478 | if (!op->owner) |
… | |
… | |
692 | // support for archetype loading |
696 | // support for archetype loading |
693 | static archetype *read (object_thawer &f); |
697 | static archetype *read (object_thawer &f); |
694 | MTH static void commit_load (); // commit any objects loaded, resolves cyclic dependencies and more |
698 | 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 */ |
699 | static void postpone_arch_ref (arch_ptr &ref, const_utf8_string other_arch); /* postpone other_arch reference */ |
696 | }; |
700 | }; |
|
|
701 | |
|
|
702 | // compatbiility, remove once replaced by ->instance |
|
|
703 | inline object * |
|
|
704 | arch_to_object (archetype *at) |
|
|
705 | { |
|
|
706 | return at->instance (); |
|
|
707 | } |
697 | |
708 | |
698 | inline void |
709 | inline void |
699 | object_freezer::put (keyword k, archetype *v) |
710 | object_freezer::put (keyword k, archetype *v) |
700 | { |
711 | { |
701 | put (k, v ? &v->archname : (const char *)0); |
712 | put (k, v ? &v->archname : (const char *)0); |