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.109 by root, Sat Apr 21 16:56:32 2007 UTC vs.
Revision 1.115 by root, Thu May 3 10:39:46 2007 UTC

274 && can_merge_slow (op1, op2); 274 && can_merge_slow (op1, op2);
275 } 275 }
276 276
277 MTH void set_owner (object *owner); 277 MTH void set_owner (object *owner);
278 MTH void set_speed (float speed); 278 MTH void set_speed (float speed);
279 MTH void set_weapon (object *ob);
279 280
280 MTH void open_container (object *new_container); 281 MTH void open_container (object *new_container);
281 MTH void close_container () 282 MTH void close_container ()
282 { 283 {
283 open_container (0); 284 open_container (0);
295 MTH void drain_specific_stat (int deplete_stats); 296 MTH void drain_specific_stat (int deplete_stats);
296 MTH void change_luck (int value); 297 MTH void change_luck (int value);
297 298
298 // info must hold 256 * 3 bytes currently 299 // info must hold 256 * 3 bytes currently
299 const char *debug_desc (char *info) const; 300 const char *debug_desc (char *info) const;
300 MTH const char *debug_desc () const; 301 MTH const char *debug_desc () const; // uses at least 3 round-robin buffers
301 const char *debug_desc2 () const; // another debug_desc, pure convinience function
302 const char *flag_desc (char *desc, int len) const; 302 const char *flag_desc (char *desc, int len) const;
303 303
304 int number_of () const 304 int number_of () const
305 { 305 {
306 return nrof ? nrof : 1; 306 return nrof ? nrof : 1;
332 || (flag [FLAG_ALIVE] && !flag [FLAG_GENERATOR] && type != DOOR)) 332 || (flag [FLAG_ALIVE] && !flag [FLAG_GENERATOR] && type != DOOR))
333 && !flag [FLAG_IS_A_TEMPLATE]; } 333 && !flag [FLAG_IS_A_TEMPLATE]; }
334 MTH bool is_arrow () const { return type == ARROW 334 MTH bool is_arrow () const { return type == ARROW
335 || (type == SPELL_EFFECT 335 || (type == SPELL_EFFECT
336 && (subtype == SP_BULLET || subtype == SP_MAGIC_MISSILE)); } 336 && (subtype == SP_BULLET || subtype == SP_MAGIC_MISSILE)); }
337 MTH bool is_range () const { return type == BOW || type == ROD || type == WAND || type == HORN; }
337 338
338 MTH bool has_active_speed () const { return FABS(speed) >= MIN_ACTIVE_SPEED; } 339 MTH bool has_active_speed () const { return FABS(speed) >= MIN_ACTIVE_SPEED; }
339 340
340 // temporary: wether the object can be saved in a map file 341 // temporary: wether the object can be saved in a map file
341 // contr => is a player 342 // contr => is a player
362 MTH object *head_ () 363 MTH object *head_ ()
363 { 364 {
364 return head ? head : this; 365 return head ? head : this;
365 } 366 }
366 367
368 MTH std::string long_desc (object *who = 0);
369 MTH std::string describe_monster (object *who = 0);
370 MTH std::string describe_item (object *who = 0);
371 MTH std::string describe (object *who = 0);
372
367 // If this object has no extra parts but should have them, 373 // If this object has no extra parts but should have them,
368 // add them, effectively expanding heads into multipart 374 // add them, effectively expanding heads into multipart
369 // objects. This method only works on objects not inserted 375 // objects. This method only works on objects not inserted
370 // anywhere. 376 // anywhere.
371 void expand_tail (); 377 MTH void expand_tail ();
378
379 MTH void create_treasure (treasurelist *tl, int flags = 0);
372 380
373 // insert object at same map position as 'where' 381 // insert object at same map position as 'where'
374 // handles both inventory and map "positions" 382 // handles both inventory and map "positions"
375 MTH object *insert_at (object *where, object *originator = 0, int flags = 0); 383 MTH object *insert_at (object *where, object *originator = 0, int flags = 0);
376 384
380 MTH void deactivate_recursive (); 388 MTH void deactivate_recursive ();
381 389
382 // set the givne flag on all objects in the inventory recursively 390 // set the givne flag on all objects in the inventory recursively
383 MTH void set_flag_inv (int flag, int value = 1); 391 MTH void set_flag_inv (int flag, int value = 1);
384 392
385 void enter_exit (object *exit);//PERL 393 void enter_exit (object *exit);//Perl
386 MTH void enter_map (maptile *newmap, int x, int y); 394 MTH void enter_map (maptile *newmap, int x, int y);
387 395
388 // returns the mapspace this object is in 396 // returns the mapspace this object is in
389 mapspace &ms () const; 397 mapspace &ms () const;
390 398

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines