… | |
… | |
64 | extern Body_Locations body_locations[NUM_BODY_LOCATIONS]; |
64 | extern Body_Locations body_locations[NUM_BODY_LOCATIONS]; |
65 | |
65 | |
66 | #define NUM_COINS 4 /* number of coin types */ |
66 | #define NUM_COINS 4 /* number of coin types */ |
67 | extern const char *const coins[NUM_COINS + 1]; |
67 | extern const char *const coins[NUM_COINS + 1]; |
68 | |
68 | |
|
|
69 | // restart server when object_count reaches this value |
|
|
70 | #define RESTART_COUNT 0xe0000000 |
|
|
71 | |
69 | /* |
72 | /* |
70 | * Each object (this also means archetypes!) could have a few of these |
73 | * Each object (this also means archetypes!) could have a few of these |
71 | * "dangling" from it; this could also end up containing 'parse errors'. |
74 | * "dangling" from it; this could also end up containing 'parse errors'. |
72 | * |
75 | * |
73 | * key and value are shared-strings. |
76 | * key and value are shared-strings. |
… | |
… | |
567 | |
570 | |
568 | static bool msg_has_dialogue (const char *msg) { return *msg == '@'; } |
571 | static bool msg_has_dialogue (const char *msg) { return *msg == '@'; } |
569 | |
572 | |
570 | MTH bool has_dialogue () const { return msg_has_dialogue (&msg); } |
573 | MTH bool has_dialogue () const { return msg_has_dialogue (&msg); } |
571 | |
574 | |
|
|
575 | /* need_identify returns true if the item should be identified. This |
|
|
576 | * function really should not exist - by default, any item not identified |
|
|
577 | * should need it. |
|
|
578 | */ |
|
|
579 | MTH bool need_identify () const; |
|
|
580 | |
572 | // returns the outermost owner, never returns 0 |
581 | // returns the outermost owner, never returns 0 |
573 | MTH object *outer_owner () |
582 | MTH object *outer_owner () |
574 | { |
583 | { |
575 | object *op; |
584 | object *op; |
576 | |
585 | |
… | |
… | |
643 | MTH bool has_carried_lights () const |
652 | MTH bool has_carried_lights () const |
644 | { |
653 | { |
645 | return glow_radius; |
654 | return glow_radius; |
646 | } |
655 | } |
647 | |
656 | |
648 | // returns the player that cna see this object, if any |
657 | // returns the player that can see this object, if any |
649 | MTH object *visible_to () const; |
658 | MTH object *visible_to () const; |
650 | |
659 | |
651 | MTH std::string long_desc (object *who = 0); // query_name . " " . describe |
660 | MTH std::string long_desc (object *who = 0); // query_name . " " . describe |
652 | MTH std::string describe_monster (object *who = 0); |
661 | MTH std::string describe_monster (object *who = 0); |
653 | MTH std::string describe_item (object *who = 0); |
662 | MTH std::string describe_item (object *who = 0); |
… | |
… | |
685 | MTH void deactivate_recursive (); |
694 | MTH void deactivate_recursive (); |
686 | |
695 | |
687 | // set the given flag on all objects in the inventory recursively |
696 | // set the given flag on all objects in the inventory recursively |
688 | MTH void set_flag_inv (int flag, int value = 1); |
697 | MTH void set_flag_inv (int flag, int value = 1); |
689 | |
698 | |
690 | void enter_exit (object *exit);//Perl |
699 | void enter_exit (object *exit); // perl |
691 | MTH void enter_map (maptile *newmap, int x, int y); |
700 | MTH bool enter_map (maptile *newmap, int x, int y); |
692 | void player_goto (const_utf8_string path, int x, int y); // only for players |
701 | void player_goto (const_utf8_string path, int x, int y); // only for players |
693 | MTH bool apply (object *ob, int aflags = AP_APPLY); // ob may be 0 |
702 | MTH bool apply (object *ob, int aflags = AP_APPLY); // ob may be 0 |
|
|
703 | |
|
|
704 | MTH object *mark () const; |
694 | |
705 | |
695 | // returns the mapspace this object is in |
706 | // returns the mapspace this object is in |
696 | mapspace &ms () const; |
707 | mapspace &ms () const; |
697 | |
708 | |
698 | // fully recursive iterator |
709 | // fully recursive iterator |
… | |
… | |
749 | return weight + carrying; |
760 | return weight + carrying; |
750 | } |
761 | } |
751 | |
762 | |
752 | MTH struct region *region () const; |
763 | MTH struct region *region () const; |
753 | |
764 | |
754 | void statusmsg (const_utf8_string msg, int color = NDI_BLACK); |
765 | MTH void statusmsg (const_utf8_string msg, int color = NDI_BLACK); |
755 | void failmsg (const_utf8_string msg, int color = NDI_RED); |
766 | MTH void failmsg (const_utf8_string msg, int color = NDI_RED); |
756 | void failmsgf (const_utf8_string format, ...); // always NDI_RED... |
767 | void failmsgf (const_utf8_string format, ...); // always NDI_RED... |
757 | |
768 | |
758 | const_utf8_string query_inventory (object *who = 0, const_utf8_string indent = ""); |
769 | MTH const_utf8_string query_inventory (object *who = 0, const_utf8_string indent = ""); |
759 | |
770 | |
760 | MTH const_octet_string ref () const; // creates and returns a consistent persistent object reference |
771 | MTH const_octet_string ref () const; // creates and returns a consistent persistent object reference |
761 | static object *deref (const_octet_string ref); // returns the object from the generated refreence, if possible |
772 | static object *deref (const_octet_string ref); // returns the object from the generated reference, if possible |
762 | |
773 | |
763 | // make some noise with given item into direction dir, |
774 | // make some noise with given item into direction dir, |
764 | // currently only used for players to make them temporarily visible |
775 | // currently only used for players to make them temporarily visible |
765 | // when they are invisible. |
776 | // when they are invisible. |
766 | MTH void make_noise (); |
777 | MTH void make_noise (); |