--- deliantra/server/include/object.h 2009/01/08 19:23:44 1.197 +++ deliantra/server/include/object.h 2009/05/05 04:51:56 1.200 @@ -1,7 +1,7 @@ /* * This file is part of Deliantra, the Roguelike Realtime MMORPG. * - * Copyright (©) 2005,2006,2007,2008 Marc Alexander Lehmann / Robin Redeker / the Deliantra team + * Copyright (©) 2005,2006,2007,2008,2009 Marc Alexander Lehmann / Robin Redeker / the Deliantra team * Copyright (©) 2001,2007 Mark Wedel & Crossfire Development Team * Copyright (©) 1992,2007 Frank Tore Johansen * @@ -293,6 +293,11 @@ shstr ACC (RW, custom_name); /* Custom name assigned by player */ }; +const char *query_weight (const object *op); +const char *query_short_name (const object *op); +const char *query_name (const object *op); +const char *query_base_name (const object *op, int plural); + struct object : zero_initialised, object_copy { // These variables are not changed by ->copy_to @@ -419,6 +424,7 @@ MTH void set_owner (object *owner); MTH void set_speed (float speed); + MTH void set_glow_radius (sint8 rad); MTH bool change_weapon (object *ob); MTH bool change_skill (object *ob); @@ -589,6 +595,11 @@ MTH std::string describe_item (object *who = 0); MTH std::string describe (object *who = 0); + MTH const char *query_weight () { return ::query_weight (this); } + MTH const char *query_name () { return ::query_name (this); } + MTH const char *query_short_name () { return ::query_short_name (this); } + MTH const char *query_base_name (bool plural) { return ::query_base_name (this, plural); } + // If this object has no extra parts but should have them, // add them, effectively expanding heads into multipart // objects. This method only works on objects not inserted @@ -686,6 +697,19 @@ // when they are invisible. MTH void make_noise (); + /* animation */ + bool has_anim () { return animation_id; } + const animation &anim () const { return animations [animation_id]; } + faceidx get_anim_frame (int frame) const { return anim ().faces [frame]; } + void set_anim_frame (int frame) { face = get_anim_frame (frame); } + /* anim_frames () returns the number of animations allocated. The last + * usuable animation will be anim_frames () - 1 (for example, if an object + * has 8 animations, anim_frames () will return 8, but the values will + * range from 0 through 7. + */ + int anim_frames () const { return anim ().num_animations; } + int anim_facings () const { return anim ().facings; } + protected: void link (); void unlink ();