--- deliantra/server/include/object.h 2006/12/26 05:44:15 1.69 +++ deliantra/server/include/object.h 2006/12/30 21:18:29 1.76 @@ -269,6 +269,7 @@ } MTH void set_owner (object *owner); + MTH void set_speed (float speed); MTH void instantiate () { @@ -289,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 @@ -304,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. */ @@ -319,6 +329,22 @@ return 0; } + // "temporary" helper function + MTH object *head_ () + { + return head ? head : this; + } + + // insert object at same map position as 'where' + // handles both inventory and map "positions" + MTH object *insert_at (object *where, object *originator = 0, int flags = 0); + + MTH void activate (bool recursive = true); + MTH void deactivate (bool recursive = true); + + 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;