summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2009-07-26 09:25:07 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2009-07-26 09:25:07 +0000
commit5a94ae381f4b58671aace90caac151c020677d95 (patch)
treeaef4aef697075e1989dd2e00fb4845af989ddaef
parent842b9faf031270e18a9ef6bf523a82a32b3c1e60 (diff)
downloadcrawl-ref-5a94ae381f4b58671aace90caac151c020677d95.tar.gz
crawl-ref-5a94ae381f4b58671aace90caac151c020677d95.zip
Trunk->0.5 merge (10417): Record gold found, spent and remaining for tournament banners.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.5@10418 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/source/hiscores.cc15
-rw-r--r--crawl-ref/source/hiscores.h3
2 files changed, 18 insertions, 0 deletions
diff --git a/crawl-ref/source/hiscores.cc b/crawl-ref/source/hiscores.cc
index 31574bc883..1c57caa168 100644
--- a/crawl-ref/source/hiscores.cc
+++ b/crawl-ref/source/hiscores.cc
@@ -622,6 +622,10 @@ void scorefile_entry::init_with_fields()
kills = fields->long_field("kills");
maxed_skills = fields->str_field("maxskills");
+
+ gold = fields->int_field("gold");
+ gold_found = fields->int_field("goldfound");
+ gold_spent = fields->int_field("goldspent");
}
void scorefile_entry::set_base_xlog_fields() const
@@ -688,6 +692,10 @@ void scorefile_entry::set_base_xlog_fields() const
fields->add_field("kills", "%ld", kills);
if (!maxed_skills.empty())
fields->add_field("maxskills", "%s", maxed_skills.c_str());
+
+ fields->add_field("gold", "%d", gold);
+ fields->add_field("goldfound", "%d", gold_found);
+ fields->add_field("goldspent", "%d", gold_spent);
}
void scorefile_entry::set_score_fields() const
@@ -885,6 +893,9 @@ void scorefile_entry::reset()
num_runes = 0;
kills = 0L;
maxed_skills.clear();
+ gold = 0;
+ gold_found = 0;
+ gold_spent = 0;
}
static int _award_modified_experience()
@@ -1075,6 +1086,10 @@ void scorefile_entry::init()
num_turns = you.num_turns;
+ gold = you.gold;
+ gold_found = you.attribute[ATTR_GOLD_FOUND];
+ gold_spent = you.attribute[ATTR_PURCHASES];
+
#ifdef WIZARD
wiz_mode = (you.wizard ? 1 : 0);
#else
diff --git a/crawl-ref/source/hiscores.h b/crawl-ref/source/hiscores.h
index 29c99bb715..a9809a7619 100644
--- a/crawl-ref/source/hiscores.h
+++ b/crawl-ref/source/hiscores.h
@@ -120,6 +120,9 @@ public:
long kills; // number of monsters killed
std::string maxed_skills; // comma-separated list of skills
// at level 27
+ int gold; // Remaining gold.
+ int gold_found; // Gold found.
+ int gold_spent; // Gold spent shopping.
mutable std::auto_ptr<xlog_fields> fields;