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.139 by root, Tue Jul 31 17:33:14 2007 UTC vs.
Revision 1.146 by root, Mon Aug 27 06:29:17 2007 UTC

186 uint32 ACC (RW, weapontype); /* type of weapon */ 186 uint32 ACC (RW, weapontype); /* type of weapon */
187 uint32 ACC (RW, tooltype); /* type of tool or build facility */ 187 uint32 ACC (RW, tooltype); /* type of tool or build facility */
188 body_slot slot [NUM_BODY_LOCATIONS]; 188 body_slot slot [NUM_BODY_LOCATIONS];
189 faceidx ACC (RW, face); /* the graphical face */ 189 faceidx ACC (RW, face); /* the graphical face */
190 faceidx ACC (RW, sound); /* the sound face */ 190 faceidx ACC (RW, sound); /* the sound face */
191 faceidx ACC (RW, sound_destroy); /* played on destroy */
191 living ACC (RO, stats); /* Str, Con, Dex, etc */ 192 living ACC (RO, stats); /* Str, Con, Dex, etc */
192 /* See the pod/objects.pod for more info about body locations */ 193 /* See the pod/objects.pod for more info about body locations */
193 194
194 /* Following mostly refers to fields only used for monsters */ 195 /* Following mostly refers to fields only used for monsters */
195 uint32 ACC (RW, hide); /* The object is hidden, not invisible */ 196 uint32 ACC (RW, hide); /* The object is hidden, not invisible */
249 UUID ACC (RW, uuid); // Unique Identifier, survives saves etc. 250 UUID ACC (RW, uuid); // Unique Identifier, survives saves etc.
250 int ACC (RO, count); 251 int ACC (RO, count);
251 object_vector_index ACC (RO, index); // index into objects 252 object_vector_index ACC (RO, index); // index into objects
252 object_vector_index ACC (RO, active); // index into actives 253 object_vector_index ACC (RO, active); // index into actives
253 254
254 player_ptr ACC (RW, contr); /* Pointer to the player which control this object */ 255 player_ptr ACC (RW, contr); /* Pointer to the player which control this object, ALWAYS set *iff* type == PLAYER */
255 256
256 object *ACC (RW, below); /* Pointer to the object stacked below this one */ 257 object *ACC (RW, below); /* Pointer to the object stacked below this one */
257 object *ACC (RW, above); /* Pointer to the object stacked above this one */ 258 object *ACC (RW, above); /* Pointer to the object stacked above this one */
258 /* Note: stacked in the *same* environment */ 259 /* Note: stacked in the *same* environment */
259 object *inv; /* Pointer to the first object in the inventory */ 260 object *inv; /* Pointer to the first object in the inventory */
275 static object *read (object_thawer &f, maptile *map = 0); // map argument due to toal design bogosity, must go. 276 static object *read (object_thawer &f, maptile *map = 0); // map argument due to toal design bogosity, must go.
276 bool write (object_freezer &f); 277 bool write (object_freezer &f);
277 278
278 MTH int slottype () const; 279 MTH int slottype () const;
279 MTH static object *create (); 280 MTH static object *create ();
281 const mapxy &operator =(const mapxy &pos);
280 object &operator =(const object &src); 282 object &operator =(const object &src);
281 MTH void copy_to (object *dst); 283 MTH void copy_to (object *dst);
282 MTH object *clone (); // create + copy_to 284 MTH object *clone (); // create + copy_to
283 void do_destroy (); 285 void do_destroy ();
284 void gather_callbacks (AV *&callbacks, event_type event) const; 286 void gather_callbacks (AV *&callbacks, event_type event) const;
292 void do_remove (); 294 void do_remove ();
293 MTH void remove () 295 MTH void remove ()
294 { 296 {
295 if (!flag [FLAG_REMOVED]) 297 if (!flag [FLAG_REMOVED])
296 do_remove (); 298 do_remove ();
299 }
300
301 void move_to (const mapxy &pos)
302 {
303 remove ();
304 *this = pos;
305 insert_at (this, this);
297 } 306 }
298 307
299 static bool can_merge_slow (object *op1, object *op2); 308 static bool can_merge_slow (object *op1, object *op2);
300 309
301 // this is often used in time-critical code, so optimise 310 // this is often used in time-critical code, so optimise
382 391
383 // temporary: wether the object can be saved in a map file 392 // temporary: wether the object can be saved in a map file
384 // contr => is a player 393 // contr => is a player
385 // head => only save head of a multitile object 394 // head => only save head of a multitile object
386 // owner => can not reference owner yet 395 // owner => can not reference owner yet
387 MTH bool can_map_save () const { return !contr && !head && !owner && !flag [FLAG_NO_MAP_SAVE]; } 396 MTH bool can_map_save () const { return !head && (!owner || owner->contr) && !contr && !flag [FLAG_NO_MAP_SAVE]; }
388 397
389 /* This return true if object has still randomitems which 398 /* This return true if object has still randomitems which
390 * could be expanded. 399 * could be expanded.
391 */ 400 */
392 MTH bool has_random_items () const { return randomitems && !flag [FLAG_IS_A_TEMPLATE]; } 401 MTH bool has_random_items () const { return randomitems && !flag [FLAG_IS_A_TEMPLATE]; }
491 { 500 {
492 return !invisible && type != PLAYER; 501 return !invisible && type != PLAYER;
493 } 502 }
494 503
495 MTH struct region *region () const; 504 MTH struct region *region () const;
505
506 void statusmsg (const char *msg, int color = NDI_BLACK);
507 void failmsg (const char *msg, int color = NDI_RED);
496 508
497protected: 509protected:
498 void link (); 510 void link ();
499 void unlink (); 511 void unlink ();
500 512

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines