summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/misc.cc
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2008-11-25 12:05:29 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2008-11-25 12:05:29 +0000
commit4779ce0e5239186180f9139678ef090b0fc7b856 (patch)
treecc4271a3bcd6315c2ea12fb46d6a465e82dda5dd /crawl-ref/source/misc.cc
parentea472cc73c9521ecd702fc3f42e2c709f817eda8 (diff)
downloadcrawl-ref-4779ce0e5239186180f9139678ef090b0fc7b856.tar.gz
crawl-ref-4779ce0e5239186180f9139678ef090b0fc7b856.zip
The "Place:" for ziggurats now displays as "Ziggurat:1"/"Ziggurat:2"/etc
instead of "A Ziggurat". Notes now remember which type of portal you entered: 153 | Portal | Entered level 1 of a ziggurat. 168 | Portal | Entered level 2 of a ziggurat. 189 | Bazaar | Entered a bazaar. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7606 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/misc.cc')
-rw-r--r--crawl-ref/source/misc.cc36
1 files changed, 35 insertions, 1 deletions
diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc
index c5e0878a52..d7d8fb9c1b 100644
--- a/crawl-ref/source/misc.cc
+++ b/crawl-ref/source/misc.cc
@@ -1356,6 +1356,7 @@ static void leaving_level_now()
const std::string newtype =
env.markers.property_at(you.pos(), MAT_ANY, "dst");
+ const std::string oldname = you.level_type_name;
std::string newname =
env.markers.property_at(you.pos(), MAT_ANY, "dstname");
@@ -1367,6 +1368,10 @@ static void leaving_level_now()
dungeon_events.fire_position_event(DET_PLAYER_CLIMBS, you.pos());
dungeon_events.fire_event(DET_LEAVING_LEVEL);
+ // Lua scripts explicitly set level_type_na,e so use that.
+ if (you.level_type_name != oldname)
+ newname = you.level_type_name;
+
// Lua scripts explicitly set level_type_origin, so use that.
if (!you.level_type_origin.empty())
neworigin = you.level_type_origin;
@@ -2400,7 +2405,36 @@ void trackers_init_new_level(bool transit)
void new_level(void)
{
- take_note(Note(NOTE_DUNGEON_LEVEL_CHANGE));
+ if (you.level_type == LEVEL_PORTAL_VAULT)
+ {
+ std::string name = "Portal";
+ if (you.level_type_name.length() <= 7
+ && you.level_type_name.find(":") == std::string::npos)
+ {
+ name = uppercase_first(you.level_type_name);
+ }
+ else if (you.level_type_tag.length() <= 7)
+ {
+ name = uppercase_first(you.level_type_tag);
+ name = replace_all(name, "_", " ");
+ }
+
+ // If there's more than one word in level_type_origin then skip
+ // the first, since it's most likely a preposition.
+ std::string desc = "Entered ";
+ size_t space = you.level_type_origin.find(" ");
+ if (space == std::string::npos)
+ desc += you.level_type_origin;
+ else
+ desc += you.level_type_origin.substr(space + 1);
+ desc += ".";
+
+ take_note(Note(NOTE_DUNGEON_LEVEL_CHANGE, 0, 0, name.c_str(),
+ desc.c_str()));
+ }
+ else
+ take_note(Note(NOTE_DUNGEON_LEVEL_CHANGE));
+
print_stats_level();
#ifdef DGL_WHEREIS
whereis_record();