summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2009-07-25 18:36:19 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2009-07-25 18:36:19 +0000
commitd9f0ddab344ee7667c0e1f6dfb63b6af8b30bd5a (patch)
tree83aafef843bbc7c27f6fc2db4dfa5780183aa67d /crawl-ref
parent58d9aa06f0acd93c64fd31de10fb1ec438e09de3 (diff)
downloadcrawl-ref-d9f0ddab344ee7667c0e1f6dfb63b6af8b30bd5a.tar.gz
crawl-ref-d9f0ddab344ee7667c0e1f6dfb63b6af8b30bd5a.zip
Trunk->0.5 merge (10405-10406): Milestone and logfile additions for 2009 tournament.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.5@10408 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/Kills.cc15
-rw-r--r--crawl-ref/source/Kills.h2
-rw-r--r--crawl-ref/source/dat/clua/ziggurat.lua9
-rw-r--r--crawl-ref/source/hiscores.cc23
-rw-r--r--crawl-ref/source/hiscores.h3
-rw-r--r--crawl-ref/source/religion.cc12
6 files changed, 60 insertions, 4 deletions
diff --git a/crawl-ref/source/Kills.cc b/crawl-ref/source/Kills.cc
index bc61b59af5..34111138e7 100644
--- a/crawl-ref/source/Kills.cc
+++ b/crawl-ref/source/Kills.cc
@@ -107,6 +107,21 @@ void KillMaster::record_kill(const monsters *mon, int killer, bool ispet)
categorized_kills[kc].record_kill(mon);
}
+long KillMaster::total_kills() const
+{
+ long grandtotal = 0L;
+ for (int i = KC_YOU; i < KC_NCATEGORIES; ++i)
+ {
+ if (categorized_kills[i].empty())
+ continue;
+
+ std::vector<kill_exp> kills;
+ long count = categorized_kills[i].get_kills(kills);
+ grandtotal += count;
+ }
+ return (grandtotal);
+}
+
std::string KillMaster::kill_info() const
{
if (empty())
diff --git a/crawl-ref/source/Kills.h b/crawl-ref/source/Kills.h
index 71cab6bd45..cff0c3525a 100644
--- a/crawl-ref/source/Kills.h
+++ b/crawl-ref/source/Kills.h
@@ -176,6 +176,8 @@ public:
// Number of kills, any category.
long num_kills(const monsters *mon) const;
+ long total_kills() const;
+
std::string kill_info() const;
private:
const char *category_name(kill_category kc) const;
diff --git a/crawl-ref/source/dat/clua/ziggurat.lua b/crawl-ref/source/dat/clua/ziggurat.lua
index 4a4679ba58..831ed7b13b 100644
--- a/crawl-ref/source/dat/clua/ziggurat.lua
+++ b/crawl-ref/source/dat/clua/ziggurat.lua
@@ -29,6 +29,9 @@ end
function cleanup_ziggurat()
return one_way_stair {
onclimb = function()
+ crawl.mark_milestone("zig.exit",
+ "left a Ziggurat at level " ..
+ zig().depth .. ".")
dgn.persist.ziggurat = { }
end,
dstplace = zig().origin_level
@@ -134,12 +137,10 @@ end
function ziggurat_milestone()
local depth = zig().depth
- if util.contains({ 1, 9, 15, 21, 24, 27 }, depth) then
- crawl.mark_milestone(depth < 27 and "br.enter" or "br.end",
+ crawl.mark_milestone(depth == 1 and "zig.enter" or "zig",
(depth == 1 and "entered a Ziggurat" or
("reached level " .. depth .. " of a Ziggurat"))
.. ".")
- end
end
function ziggurat_build_level(e)
@@ -859,4 +860,4 @@ local ziggurat_builders = util.keys(ziggurat_builder_map)
function ziggurat_choose_builder()
return util.random_from(ziggurat_builders)
-end
+end \ No newline at end of file
diff --git a/crawl-ref/source/hiscores.cc b/crawl-ref/source/hiscores.cc
index 8332427ba9..31574bc883 100644
--- a/crawl-ref/source/hiscores.cc
+++ b/crawl-ref/source/hiscores.cc
@@ -43,6 +43,7 @@ REVISION("$Rev$");
#include "itemname.h"
#include "itemprop.h"
#include "items.h"
+#include "Kills.h"
#include "libutil.h"
#include "message.h"
#include "mon-util.h"
@@ -520,6 +521,8 @@ void scorefile_entry::init_from(const scorefile_entry &se)
num_turns = se.num_turns;
num_diff_runes = se.num_diff_runes;
num_runes = se.num_runes;
+ kills = se.kills;
+ maxed_skills = se.maxed_skills;
}
bool scorefile_entry::parse(const std::string &line)
@@ -616,6 +619,9 @@ void scorefile_entry::init_with_fields()
num_diff_runes = fields->int_field("urune");
num_runes = fields->int_field("nrune");
+
+ kills = fields->long_field("kills");
+ maxed_skills = fields->str_field("maxskills");
}
void scorefile_entry::set_base_xlog_fields() const
@@ -678,6 +684,10 @@ void scorefile_entry::set_base_xlog_fields() const
if (num_runes)
fields->add_field("nrune", "%d", num_runes);
+
+ fields->add_field("kills", "%ld", kills);
+ if (!maxed_skills.empty())
+ fields->add_field("maxskills", "%s", maxed_skills.c_str());
}
void scorefile_entry::set_score_fields() const
@@ -873,6 +883,8 @@ void scorefile_entry::reset()
num_turns = -1;
num_diff_runes = 0;
num_runes = 0;
+ kills = 0L;
+ maxed_skills.clear();
}
static int _award_modified_experience()
@@ -1022,6 +1034,17 @@ void scorefile_entry::init()
best_skill = ::best_skill( SK_FIGHTING, NUM_SKILLS - 1, 99 );
best_skill_lvl = you.skills[ best_skill ];
+ // Note all skills at level 27.
+ for (int sk = 0; sk < NUM_SKILLS; ++sk) {
+ if (you.skills[sk] == 27) {
+ if (!maxed_skills.empty())
+ maxed_skills += ",";
+ maxed_skills += skill_name(sk);
+ }
+ }
+
+ kills = you.kills->total_kills();
+
final_hp = you.hp;
final_max_hp = you.hp_max;
final_max_max_hp = get_real_hp(true, true);
diff --git a/crawl-ref/source/hiscores.h b/crawl-ref/source/hiscores.h
index 39308f0e2c..29c99bb715 100644
--- a/crawl-ref/source/hiscores.h
+++ b/crawl-ref/source/hiscores.h
@@ -117,6 +117,9 @@ public:
long num_turns; // number of turns taken
int num_diff_runes; // number of rune types in inventory
int num_runes; // total number of runes in inventory
+ long kills; // number of monsters killed
+ std::string maxed_skills; // comma-separated list of skills
+ // at level 27
mutable std::auto_ptr<xlog_fields> fields;
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index a2db4083ba..a0ed40c4d4 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -37,6 +37,7 @@ REVISION("$Rev$");
#include "fight.h"
#include "files.h"
#include "food.h"
+#include "hiscores.h"
#include "invent.h"
#include "it_use2.h"
#include "itemname.h"
@@ -5922,6 +5923,7 @@ void excommunication(god_type new_god)
{
const god_type old_god = you.religion;
ASSERT(old_god != new_god);
+ ASSERT(old_god != GOD_NO_GOD);
const bool was_haloed = you.haloed();
const int old_piety = you.piety;
@@ -5940,6 +5942,10 @@ void excommunication(god_type new_god)
mpr("You have lost your religion!");
more();
+#ifdef DGL_MILESTONES
+ mark_milestone("god.renounce", "abandoned " + god_name(old_god) + ".");
+#endif
+
if (god_hates_your_god(old_god, new_god))
{
simple_god_message(
@@ -6708,6 +6714,12 @@ void god_pitch(god_type which_god)
#ifdef DGL_WHEREIS
whereis_record();
#endif
+
+#ifdef DGL_MILESTONES
+ mark_milestone("god.worship", "became a worshipper of "
+ + god_name(you.religion) + ".");
+#endif
+
simple_god_message(
make_stringf(" welcomes you%s!",
you.worshipped[which_god] ? " back" : "").c_str());