summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/externs.h
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2007-09-16 03:39:41 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2007-09-16 03:39:41 +0000
commitdcf7801daff4c7c76e461c5ad08749394e64466b (patch)
treeec4411652736ce6267b0a1a9c07782dd4a089497 /crawl-ref/source/externs.h
parentcf87ca267353855c40cc29c08eb40b646693e3e2 (diff)
downloadcrawl-ref-dcf7801daff4c7c76e461c5ad08749394e64466b.tar.gz
crawl-ref-dcf7801daff4c7c76e461c5ad08749394e64466b.zip
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
Diffstat (limited to 'crawl-ref/source/externs.h')
-rw-r--r--crawl-ref/source/externs.h62
1 files changed, 62 insertions, 0 deletions
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_item> delay_queue_type;
class KillMaster;
@@ -618,6 +662,12 @@ public:
std::set<std::string> uniq_map_tags;
std::set<std::string> uniq_map_names;
+ PlaceInfo global_info;
+
+protected:
+ FixedVector<PlaceInfo, NUM_BRANCHES> branch_info;
+ FixedVector<PlaceInfo, NUM_LEVEL_AREA_TYPES - 1> 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<PlaceInfo> get_all_place_info(bool visited_only = false,
+ bool dungeon_only = false) const;
};
extern player you;