--- deliantra/server/include/object.h 2007/04/30 04:25:30 1.112 +++ deliantra/server/include/object.h 2007/05/07 03:05:58 1.116 @@ -32,7 +32,7 @@ typedef int tag_t; -#define NUM_BODY_LOCATIONS 12 +#define NUM_BODY_LOCATIONS 14 #define BODY_ARMS 1 /* See common/item.c */ @@ -92,6 +92,12 @@ * e.g. ->copy_to () */ +struct body_slot +{ + sint8 info:4; /* body info as loaded from the file */ + sint8 used:4; /* Calculated value based on items equipped */ +}; + INTERFACE_CLASS (object) // these are being copied struct object_copy : attachable @@ -160,8 +166,7 @@ sint64 ACC (RW, perm_exp); /* Permanent exp */ uint32 ACC (RW, weapontype); /* type of weapon */ uint32 ACC (RW, tooltype); /* type of tool or build facility */ - sint8 ACC (RW, body_info[NUM_BODY_LOCATIONS]); /* body info as loaded from the file */ - sint8 ACC (RW, body_used[NUM_BODY_LOCATIONS]); /* Calculated value based on items equipped */ + body_slot slot [NUM_BODY_LOCATIONS]; faceidx ACC (RW, face); /* Face with colors */ living ACC (RO, stats); /* Str, Con, Dex, etc */ /* See the pod/objects.pod for more info about body locations */ @@ -276,6 +281,7 @@ MTH void set_owner (object *owner); MTH void set_speed (float speed); + MTH void set_weapon (object *ob); MTH void open_container (object *new_container); MTH void close_container () @@ -297,8 +303,7 @@ // info must hold 256 * 3 bytes currently const char *debug_desc (char *info) const; - MTH const char *debug_desc () const; - const char *debug_desc2 () const; // another debug_desc, pure convinience function + MTH const char *debug_desc () const; // uses at least 3 round-robin buffers const char *flag_desc (char *desc, int len) const; int number_of () const @@ -334,6 +339,7 @@ MTH bool is_arrow () const { return type == ARROW || (type == SPELL_EFFECT && (subtype == SP_BULLET || subtype == SP_MAGIC_MISSILE)); } + MTH bool is_range () const { return type == BOW || type == ROD || type == WAND || type == HORN; } MTH bool has_active_speed () const { return FABS(speed) >= MIN_ACTIVE_SPEED; }