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.241 by root, Mon Apr 12 05:22:38 2010 UTC vs.
Revision 1.251 by root, Wed Apr 28 11:19:09 2010 UTC

64extern Body_Locations body_locations[NUM_BODY_LOCATIONS]; 64extern 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 */
67extern const char *const coins[NUM_COINS + 1]; 67extern 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);
663 // objects. This method only works on objects not inserted 672 // objects. This method only works on objects not inserted
664 // anywhere. 673 // anywhere.
665 MTH void expand_tail (); 674 MTH void expand_tail ();
666 675
667 MTH void create_treasure (treasurelist *tl, int flags = 0); 676 MTH void create_treasure (treasurelist *tl, int flags = 0);
677
678 // makes sure the player has the named skill,
679 // and also makes it innate if can_use is true.
680 // returns the new skill or 0 if no such skill exists.
681 MTH object *give_skill (shstr_cmp name, bool can_use = false);
682 MTH void become_follower (object *new_god);
668 683
669 // insert object at same map position as 'where' 684 // insert object at same map position as 'where'
670 // handles both inventory and map "positions" 685 // handles both inventory and map "positions"
671 MTH object *insert_at (object *where, object *originator = 0, int flags = 0); 686 MTH object *insert_at (object *where, object *originator = 0, int flags = 0);
672 // check whether we can put this into the map, respect max_nrof, max_volume, max_items 687 // check whether we can put this into the map, respect max_nrof, max_volume, max_items
679 MTH void deactivate_recursive (); 694 MTH void deactivate_recursive ();
680 695
681 // set the given flag on all objects in the inventory recursively 696 // set the given flag on all objects in the inventory recursively
682 MTH void set_flag_inv (int flag, int value = 1); 697 MTH void set_flag_inv (int flag, int value = 1);
683 698
684 void enter_exit (object *exit);//Perl 699 void enter_exit (object *exit); // perl
685 MTH void enter_map (maptile *newmap, int x, int y); 700 MTH bool enter_map (maptile *newmap, int x, int y);
686 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
687 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;
688 705
689 // returns the mapspace this object is in 706 // returns the mapspace this object is in
690 mapspace &ms () const; 707 mapspace &ms () const;
691 708
692 // fully recursive iterator 709 // fully recursive iterator
743 return weight + carrying; 760 return weight + carrying;
744 } 761 }
745 762
746 MTH struct region *region () const; 763 MTH struct region *region () const;
747 764
748 void statusmsg (const_utf8_string msg, int color = NDI_BLACK); 765 MTH void statusmsg (const_utf8_string msg, int color = NDI_BLACK);
749 void failmsg (const_utf8_string msg, int color = NDI_RED); 766 MTH void failmsg (const_utf8_string msg, int color = NDI_RED);
750 void failmsgf (const_utf8_string format, ...); // always NDI_RED... 767 void failmsgf (const_utf8_string format, ...); // always NDI_RED...
751 768
752 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 = "");
753 770
754 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
755 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
756 773
757 // make some noise with given item into direction dir, 774 // make some noise with given item into direction dir,
758 // currently only used for players to make them temporarily visible 775 // currently only used for players to make them temporarily visible
759 // when they are invisible. 776 // when they are invisible.
760 MTH void make_noise (); 777 MTH void make_noise ();
944#define INS_NO_MERGE 0x0001 961#define INS_NO_MERGE 0x0001
945#define INS_ABOVE_FLOOR_ONLY 0x0002 962#define INS_ABOVE_FLOOR_ONLY 0x0002
946#define INS_NO_WALK_ON 0x0004 963#define INS_NO_WALK_ON 0x0004
947#define INS_ON_TOP 0x0008 964#define INS_ON_TOP 0x0008
948#define INS_BELOW_ORIGINATOR 0x0010 965#define INS_BELOW_ORIGINATOR 0x0010
966#define INS_NO_AUTO_EXIT 0x0020 // temporary, fix exits instead
949 967
950//-GPL 968//-GPL
951 969
952#endif 970#endif
953 971

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines