summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/notes.cc
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2012-04-13 15:27:56 +0200
committerAdam Borowski <kilobyte@angband.pl>2012-04-13 15:32:52 +0200
commit83487eae2bf0d4d6a3b372671c58429dfae5da9e (patch)
treed84af6dc358424eccdd64668fa5059487c9ef3e3 /crawl-ref/source/notes.cc
parentc93c868ff4430e2a9b529e46f4255843f607476f (diff)
downloadcrawl-ref-83487eae2bf0d4d6a3b372671c58429dfae5da9e.tar.gz
crawl-ref-83487eae2bf0d4d6a3b372671c58429dfae5da9e.zip
Ziggurats: use common code with other branches for milestones.
For compatibility, I left the special-casing of milestone type as "zig.enter" instead of "br.enter", and "zig" instead of "br.mid" and "br.end" (other branches don't have milestones for every level).
Diffstat (limited to 'crawl-ref/source/notes.cc')
-rw-r--r--crawl-ref/source/notes.cc13
1 files changed, 10 insertions, 3 deletions
diff --git a/crawl-ref/source/notes.cc b/crawl-ref/source/notes.cc
index 0973ce9b91..0a39345486 100644
--- a/crawl-ref/source/notes.cc
+++ b/crawl-ref/source/notes.cc
@@ -458,13 +458,18 @@ void Note::check_milestone() const
if (br != -1)
{
+ ASSERT(br >= 0 && br < NUM_BRANCHES);
std::string branch = place_name(packed_place, true, false).c_str();
if (branch.find("The ") == 0)
branch[0] = tolower(branch[0]);
if (dep == 1)
- mark_milestone("br.enter", "entered " + branch + ".", true);
- else if (dep == _dungeon_branch_depth(br) || dep == 14)
+ {
+ mark_milestone(br == BRANCH_ZIGGURAT ? "zig.enter" : "br.enter",
+ "entered " + branch + ".", true);
+ }
+ else if (dep == _dungeon_branch_depth(br) || dep == 14
+ || br == BRANCH_ZIGGURAT)
{
std::string level = place_name(packed_place, true, true);
if (level.find("Level ") == 0)
@@ -472,7 +477,9 @@ void Note::check_milestone() const
std::ostringstream branch_finale;
branch_finale << "reached " << level << ".";
- mark_milestone(dep == 14 ? "br.mid" : "br.end", branch_finale.str());
+ mark_milestone(br == BRANCH_ZIGGURAT ? "zig" :
+ dep == 14 ? "br.mid" : "br.end",
+ branch_finale.str());
}
}
}