From dcf7801daff4c7c76e461c5ad08749394e64466b Mon Sep 17 00:00:00 2001 From: zelgadis Date: Sun, 16 Sep 2007 03:39:41 +0000 Subject: Add dump sections for branch/area details for turns and experience/kills, with the section names being turns_by_place and kills_by_place. Also includes a "visits" dump section (included in the "misc" section") a brief description of the number of branches/levels/areas/etc you visited. Breaks savefile compatibility. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2102 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/externs.h | 62 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) (limited to 'crawl-ref/source/externs.h') diff --git a/crawl-ref/source/externs.h b/crawl-ref/source/externs.h index 20bad76b20..3c59a1ece6 100644 --- a/crawl-ref/source/externs.h +++ b/crawl-ref/source/externs.h @@ -416,6 +416,50 @@ private: bool run_grids_changed() const; }; +class PlaceInfo +{ +public: + int level_type; + int branch; + + unsigned long num_visits; + unsigned long levels_seen; + + unsigned long mon_kill_exp; + unsigned long mon_kill_exp_avail; + unsigned long mon_kill_num[KC_NCATEGORIES]; + + long turns_total; + long turns_explore; + long turns_travel; + long turns_interlevel; + long turns_resting; + long turns_other; + + double elapsed_total; + double elapsed_explore; + double elapsed_travel; + double elapsed_interlevel; + double elapsed_resting; + double elapsed_other; + +public: + PlaceInfo(); + + bool is_global() const; + void make_global(); + + void assert_validity() const; + + const std::string short_name() const; + + const PlaceInfo &operator += (const PlaceInfo &other); + const PlaceInfo &operator -= (const PlaceInfo &other); + PlaceInfo operator + (const PlaceInfo &other) const; + PlaceInfo operator - (const PlaceInfo &other) const; +}; + + typedef std::vector delay_queue_type; class KillMaster; @@ -618,6 +662,12 @@ public: std::set uniq_map_tags; std::set uniq_map_names; + PlaceInfo global_info; + +protected: + FixedVector branch_info; + FixedVector non_branch_info; + public: player(); player(const player &other); @@ -743,6 +793,18 @@ public: bool wearing_light_armour(bool with_skill = false) const; void exercise(skill_type skill, int qty); int skill(skill_type skill, bool skill_bump = false) const; + + PlaceInfo& get_place_info() const ; // Current place info + PlaceInfo& get_place_info(branch_type branch, + level_area_type level_type2) const; + PlaceInfo& get_place_info(branch_type branch) const; + PlaceInfo& get_place_info(level_area_type level_type2) const; + + void set_place_info(PlaceInfo info); + // Returns copies of the PlaceInfo; modifying the vector won't + // modify the player object. + std::vector get_all_place_info(bool visited_only = false, + bool dungeon_only = false) const; }; extern player you; -- cgit v1.2.3-54-g00ecf