… | |
… | |
567 | |
567 | |
568 | static bool msg_has_dialogue (const char *msg) { return *msg == '@'; } |
568 | static bool msg_has_dialogue (const char *msg) { return *msg == '@'; } |
569 | |
569 | |
570 | MTH bool has_dialogue () const { return msg_has_dialogue (&msg); } |
570 | MTH bool has_dialogue () const { return msg_has_dialogue (&msg); } |
571 | |
571 | |
|
|
572 | /* need_identify returns true if the item should be identified. This |
|
|
573 | * function really should not exist - by default, any item not identified |
|
|
574 | * should need it. |
|
|
575 | */ |
|
|
576 | MTH bool need_identify () const; |
|
|
577 | |
572 | // returns the outermost owner, never returns 0 |
578 | // returns the outermost owner, never returns 0 |
573 | MTH object *outer_owner () |
579 | MTH object *outer_owner () |
574 | { |
580 | { |
575 | object *op; |
581 | object *op; |
576 | |
582 | |
… | |
… | |
643 | MTH bool has_carried_lights () const |
649 | MTH bool has_carried_lights () const |
644 | { |
650 | { |
645 | return glow_radius; |
651 | return glow_radius; |
646 | } |
652 | } |
647 | |
653 | |
648 | // returns the player that cna see this object, if any |
654 | // returns the player that can see this object, if any |
649 | MTH object *visible_to () const; |
655 | MTH object *visible_to () const; |
650 | |
656 | |
651 | MTH std::string long_desc (object *who = 0); // query_name . " " . describe |
657 | MTH std::string long_desc (object *who = 0); // query_name . " " . describe |
652 | MTH std::string describe_monster (object *who = 0); |
658 | MTH std::string describe_monster (object *who = 0); |
653 | MTH std::string describe_item (object *who = 0); |
659 | MTH std::string describe_item (object *who = 0); |
… | |
… | |
668 | |
674 | |
669 | // makes sure the player has the named skill, |
675 | // makes sure the player has the named skill, |
670 | // and also makes it innate if can_use is true. |
676 | // and also makes it innate if can_use is true. |
671 | // returns the new skill or 0 if no such skill exists. |
677 | // returns the new skill or 0 if no such skill exists. |
672 | MTH object *give_skill (shstr_cmp name, bool can_use = false); |
678 | MTH object *give_skill (shstr_cmp name, bool can_use = false); |
|
|
679 | MTH void become_follower (object *new_god); |
673 | |
680 | |
674 | // insert object at same map position as 'where' |
681 | // insert object at same map position as 'where' |
675 | // handles both inventory and map "positions" |
682 | // handles both inventory and map "positions" |
676 | MTH object *insert_at (object *where, object *originator = 0, int flags = 0); |
683 | MTH object *insert_at (object *where, object *originator = 0, int flags = 0); |
677 | // check whether we can put this into the map, respect max_nrof, max_volume, max_items |
684 | // check whether we can put this into the map, respect max_nrof, max_volume, max_items |
… | |
… | |
689 | void enter_exit (object *exit);//Perl |
696 | void enter_exit (object *exit);//Perl |
690 | MTH void enter_map (maptile *newmap, int x, int y); |
697 | MTH void enter_map (maptile *newmap, int x, int y); |
691 | void player_goto (const_utf8_string path, int x, int y); // only for players |
698 | void player_goto (const_utf8_string path, int x, int y); // only for players |
692 | MTH bool apply (object *ob, int aflags = AP_APPLY); // ob may be 0 |
699 | MTH bool apply (object *ob, int aflags = AP_APPLY); // ob may be 0 |
693 | |
700 | |
|
|
701 | MTH object *mark () const; |
|
|
702 | |
694 | // returns the mapspace this object is in |
703 | // returns the mapspace this object is in |
695 | mapspace &ms () const; |
704 | mapspace &ms () const; |
696 | |
705 | |
697 | // fully recursive iterator |
706 | // fully recursive iterator |
698 | struct iterator_base |
707 | struct iterator_base |
… | |
… | |
748 | return weight + carrying; |
757 | return weight + carrying; |
749 | } |
758 | } |
750 | |
759 | |
751 | MTH struct region *region () const; |
760 | MTH struct region *region () const; |
752 | |
761 | |
753 | void statusmsg (const_utf8_string msg, int color = NDI_BLACK); |
762 | MTH void statusmsg (const_utf8_string msg, int color = NDI_BLACK); |
754 | void failmsg (const_utf8_string msg, int color = NDI_RED); |
763 | MTH void failmsg (const_utf8_string msg, int color = NDI_RED); |
755 | void failmsgf (const_utf8_string format, ...); // always NDI_RED... |
764 | void failmsgf (const_utf8_string format, ...); // always NDI_RED... |
756 | |
765 | |
757 | const_utf8_string query_inventory (object *who = 0, const_utf8_string indent = ""); |
766 | MTH const_utf8_string query_inventory (object *who = 0, const_utf8_string indent = ""); |
758 | |
767 | |
759 | MTH const_octet_string ref () const; // creates and returns a consistent persistent object reference |
768 | MTH const_octet_string ref () const; // creates and returns a consistent persistent object reference |
760 | static object *deref (const_octet_string ref); // returns the object from the generated refreence, if possible |
769 | static object *deref (const_octet_string ref); // returns the object from the generated reference, if possible |
761 | |
770 | |
762 | // make some noise with given item into direction dir, |
771 | // make some noise with given item into direction dir, |
763 | // currently only used for players to make them temporarily visible |
772 | // currently only used for players to make them temporarily visible |
764 | // when they are invisible. |
773 | // when they are invisible. |
765 | MTH void make_noise (); |
774 | MTH void make_noise (); |