--- deliantra/server/include/object.h 2006/12/26 20:04:09 1.71 +++ deliantra/server/include/object.h 2007/01/03 20:08:04 1.79 @@ -242,8 +242,8 @@ object *head; /* Points to the main object of a large body */ // NO ACC, perl semantics are different client_container *seen_by; // seen by which player/container currently? - static vector active; // active objects, not yet used - static vector objects; // not used yet, use first->next->... + //static vector active_list; // active objects, not yet used + //static vector object_list; // not used yet, use first->next->... static object *first; // will be replaced by "objects" MTH static object *create (); @@ -290,8 +290,9 @@ MTH void change_luck (int value); // info must hold 256 * 3 bytes currently - MTH const char *debug_desc (char *info) const; + const char *debug_desc (char *info) const; MTH const char *debug_desc () const; + const char *flag_desc (char *desc, int len) const; MTH bool is_weapon () const { return type == ARROW || type == BOW || type == WEAPON; } MTH bool is_armor () const { return type == ARMOUR || type == SHIELD || type == HELMET @@ -305,6 +306,14 @@ || (type == SPELL_EFFECT && (subtype == SP_BULLET || subtype == SP_MAGIC_MISSILE)); } + MTH bool has_active_speed () const { return FABS(speed) >= MIN_ACTIVE_SPEED; } + + // temporary: wether the object can be saved in a map file + // contr => is a player + // head => only save head of a multitile object + // owner => can not reference owner yet + MTH bool can_map_save () const { return !contr && !head && !owner; } + /* This return true if object has still randomitems which * could be expanded. */ @@ -330,6 +339,18 @@ // handles both inventory and map "positions" MTH object *insert_at (object *where, object *originator = 0, int flags = 0); + MTH bool active () const; + MTH void activate (); + MTH void deactivate (); + MTH void activate_recursive (); + MTH void deactivate_recursive (); + + // set the givne flag on all objects in the inventory recursively + MTH void set_flag_inv (int flag, int value = 1); + + void enter_exit (object *exit);//PERL + MTH void enter_map (maptile *newmap, int x, int y); + // returns the mapspace this object is in mapspace &ms () const; @@ -349,6 +370,11 @@ object &operator * () const { return *item; } }; + MTH unsigned int random_seed () const + { + return (unsigned int)uuid.seq; + } + // depth-first recursive iterator struct depth_iterator : iterator_base {