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.165 by root, Mon Apr 21 06:35:26 2008 UTC vs.
Revision 1.170 by root, Wed Apr 30 10:31:04 2008 UTC

430 /* This return true if object has still randomitems which 430 /* This return true if object has still randomitems which
431 * could be expanded. 431 * could be expanded.
432 */ 432 */
433 MTH bool has_random_items () const { return randomitems && !flag [FLAG_IS_A_TEMPLATE]; } 433 MTH bool has_random_items () const { return randomitems && !flag [FLAG_IS_A_TEMPLATE]; }
434 434
435 // returns the outermost owner, never returns 0
436 MTH object *outer_owner ()
437 {
438 for (object *op = this; ; op = op->owner)
439 if (!op->owner)
440 return op;
441 }
442
435 // returns the outermost environment, never returns 0 443 // returns the outermost environment, never returns 0
436 MTH object *outer_env () 444 MTH object *outer_env ()
437 { 445 {
438 for (object *op = this; ; op = op->env) 446 for (object *op = this; ; op = op->env)
439 if (!op->env) 447 if (!op->env)
462 470
463 MTH bool is_on_map () const 471 MTH bool is_on_map () const
464 { 472 {
465 return !env && !flag [FLAG_REMOVED]; 473 return !env && !flag [FLAG_REMOVED];
466 } 474 }
475
476 // returns the player that cna see this object, if any
477 MTH object *visible_to () const;
467 478
468 MTH std::string long_desc (object *who = 0); 479 MTH std::string long_desc (object *who = 0);
469 MTH std::string describe_monster (object *who = 0); 480 MTH std::string describe_monster (object *who = 0);
470 MTH std::string describe_item (object *who = 0); 481 MTH std::string describe_item (object *who = 0);
471 MTH std::string describe (object *who = 0); 482 MTH std::string describe (object *who = 0);
536 { 547 {
537 return this; 548 return this;
538 } 549 }
539 550
540 /* This returns TRUE if the object is something that 551 /* This returns TRUE if the object is something that
541 * should be displayed in the floorbox/inventory window 552 * a client might want to know about.
542 */ 553 */
543 MTH bool client_visible () const 554 MTH bool client_visible () const
544 { 555 {
545 return !invisible && type != PLAYER; 556 return !invisible && type != PLAYER;
557 }
558
559 // the client does nrof * this weight
560 MTH sint32 client_weight () const
561 {
562 return weight + carrying;
546 } 563 }
547 564
548 MTH struct region *region () const; 565 MTH struct region *region () const;
549 566
550 void statusmsg (const char *msg, int color = NDI_BLACK); 567 void statusmsg (const char *msg, int color = NDI_BLACK);
621 MTH static archetype *find (const_utf8_string name); 638 MTH static archetype *find (const_utf8_string name);
622 639
623 MTH void link (); 640 MTH void link ();
624 MTH void unlink (); 641 MTH void unlink ();
625 642
643 MTH static object *get (const char *name); // find()->instance()
626 MTH object *instance (); 644 MTH object *instance ();
627 645
628 object_vector_index ACC (RW, archid); // index in archvector 646 object_vector_index ACC (RW, archid); // index in archvector
629 shstr ACC (RW, archname); /* More definite name, like "generate_kobold" */ 647 shstr ACC (RW, archname); /* More definite name, like "generate_kobold" */
630 648

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines