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.70 by root, Tue Dec 26 08:54:59 2006 UTC vs.
Revision 1.77 by root, Sun Dec 31 10:28:36 2006 UTC

288 MTH void drain_stat (); 288 MTH void drain_stat ();
289 MTH void drain_specific_stat (int deplete_stats); 289 MTH void drain_specific_stat (int deplete_stats);
290 MTH void change_luck (int value); 290 MTH void change_luck (int value);
291 291
292 // info must hold 256 * 3 bytes currently 292 // info must hold 256 * 3 bytes currently
293 MTH const char *debug_desc (char *info) const; 293 const char *debug_desc (char *info) const;
294 MTH const char *debug_desc () const; 294 MTH const char *debug_desc () const;
295 const char *flag_desc (char *desc, int len) const;
295 296
296 MTH bool is_weapon () const { return type == ARROW || type == BOW || type == WEAPON; } 297 MTH bool is_weapon () const { return type == ARROW || type == BOW || type == WEAPON; }
297 MTH bool is_armor () const { return type == ARMOUR || type == SHIELD || type == HELMET 298 MTH bool is_armor () const { return type == ARMOUR || type == SHIELD || type == HELMET
298 || type == CLOAK || type == BOOTS || type == GLOVES 299 || type == CLOAK || type == BOOTS || type == GLOVES
299 || type == BRACERS || type == GIRDLE; } 300 || type == BRACERS || type == GIRDLE; }
303 && !flag [FLAG_IS_A_TEMPLATE]; } 304 && !flag [FLAG_IS_A_TEMPLATE]; }
304 MTH bool is_arrow () const { return type == ARROW 305 MTH bool is_arrow () const { return type == ARROW
305 || (type == SPELL_EFFECT 306 || (type == SPELL_EFFECT
306 && (subtype == SP_BULLET || subtype == SP_MAGIC_MISSILE)); } 307 && (subtype == SP_BULLET || subtype == SP_MAGIC_MISSILE)); }
307 308
309 MTH bool has_active_speed () const { return FABS(speed) >= MIN_ACTIVE_SPEED; }
310
311 // temporary: wether the object can be saved in a map file
312 // contr => is a player
313 // head => only save head of a multitile object
314 // owner => can not reference owner yet
315 MTH bool can_map_save () const { return !contr && !head && !owner; }
316
308 /* This return true if object has still randomitems which 317 /* This return true if object has still randomitems which
309 * could be expanded. 318 * could be expanded.
310 */ 319 */
311 MTH bool has_random_items () const { return randomitems && !flag [FLAG_IS_A_TEMPLATE]; } 320 MTH bool has_random_items () const { return randomitems && !flag [FLAG_IS_A_TEMPLATE]; }
312 321
318 return op; 327 return op;
319 328
320 return 0; 329 return 0;
321 } 330 }
322 331
332 // "temporary" helper function
333 MTH object *head_ ()
334 {
335 return head ? head : this;
336 }
337
338 // insert object at same map position as 'where'
339 // handles both inventory and map "positions"
340 MTH object *insert_at (object *where, object *originator = 0, int flags = 0);
341
342 MTH void activate (bool recursive = true);
343 MTH void deactivate (bool recursive = true);
344
345 void enter_exit (object *exit);//PERL
346 MTH void enter_map (maptile *newmap, int x, int y);
347
323 // returns the mapspace this object is in 348 // returns the mapspace this object is in
324 mapspace &ms () const; 349 mapspace &ms () const;
325 350
326 // fully recursive iterator 351 // fully recursive iterator
327 struct iterator_base 352 struct iterator_base
336 operator object *() const { return item; } 361 operator object *() const { return item; }
337 362
338 object *operator ->() const { return item; } 363 object *operator ->() const { return item; }
339 object &operator * () const { return *item; } 364 object &operator * () const { return *item; }
340 }; 365 };
366
367 MTH unsigned int random_seed () const
368 {
369 return (unsigned int)uuid.seq;
370 }
341 371
342 // depth-first recursive iterator 372 // depth-first recursive iterator
343 struct depth_iterator : iterator_base 373 struct depth_iterator : iterator_base
344 { 374 {
345 depth_iterator (object *container); 375 depth_iterator (object *container);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines