ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/include/object.h
(Generate patch)

Comparing deliantra/server/include/object.h (file contents):
Revision 1.56 by root, Mon Dec 18 02:35:01 2006 UTC vs.
Revision 1.61 by root, Thu Dec 21 01:33:50 2006 UTC

120 * This is typically the container that the object is in. 120 * This is typically the container that the object is in.
121 */ 121 */
122 object *ACC (RW, more); /* Pointer to the rest of a large body of objects */ 122 object *ACC (RW, more); /* Pointer to the rest of a large body of objects */
123 object *head; /* Points to the main object of a large body */ // NO ACC, perl semantics are different 123 object *head; /* Points to the main object of a large body */ // NO ACC, perl semantics are different
124 maptile *ACC (RW, map); /* Pointer to the map in which this object is present */ 124 maptile *ACC (RW, map); /* Pointer to the map in which this object is present */
125 client_container *seen_by; // seen by which player/container currently?
125}; 126};
126 127
127// these are being copied 128// these are being copied
128struct object_copy : attachable<object> 129struct object_copy : attachable<object>
129{ 130{
285 286
286 // info must hold 256 * 3 bytes currently 287 // info must hold 256 * 3 bytes currently
287 const char *debug_desc (char *info) const; 288 const char *debug_desc (char *info) const;
288 const char *debug_desc () const; 289 const char *debug_desc () const;
289 290
291 bool is_weapon () const { return type == ARROW || type == BOW || type == WEAPON; }
292 bool is_armor () const { return type == ARMOUR || type == SHIELD || type == HELMET
293 || type == CLOAK || type == BOOTS || type == GLOVES
294 || type == BRACERS || type == GIRDLE; }
295 bool is_alive () const { return (type == PLAYER
296 || flags [FLAG_MONSTER]
297 || (flags [FLAG_ALIVE] && !flags [FLAG_GENERATOR] && type != DOOR))
298 && !flags [FLAG_IS_A_TEMPLATE]; }
299 bool is_arrow () const { return type == ARROW
300 || (type == SPELL_EFFECT
301 && (subtype == SP_BULLET || subtype == SP_MAGIC_MISSILE)); }
302
303 /* This return true if object has still randomitems which
304 * could be expanded.
305 */
306 bool has_random_items () const { return randomitems && !flags [FLAG_IS_A_TEMPLATE]; }
307
308 // returns the player that has this object in his inventory, or 0
309 object *in_player () const
310 {
311 for (object *op = env; op; op = op->env)
312 if (op->type == PLAYER)
313 return op;
314
315 return 0;
316 }
317
318 // returns the mapspace this object is in
319 mapspace &ms () const;
320
290 // fully recursive iterator 321 // fully recursive iterator
291 struct iterator_base 322 struct iterator_base
292 { 323 {
293 object *item; 324 object *item;
294 325
382extern int nrofallocobjects; 413extern int nrofallocobjects;
383 414
384/* This returns TRUE if the object is something that 415/* This returns TRUE if the object is something that
385 * should be displayed in the look window 416 * should be displayed in the look window
386 */ 417 */
387#define LOOK_OBJ(ob) (!ob->invisible && ob->type!=PLAYER && ob->type!=EVENT_CONNECTOR) 418#define LOOK_OBJ(ob) (!ob->invisible && ob->type != PLAYER && ob->type != EVENT_CONNECTOR)
388 419
389/* Used by update_object to know if the object being passed is 420/* Used by update_object to know if the object being passed is
390 * being added or removed. 421 * being added or removed.
391 */ 422 */
392#define UP_OBJ_INSERT 1 423#define UP_OBJ_INSERT 1

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines