summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/misc.cc
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-01-16 15:42:01 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-01-16 15:42:01 +0000
commit689dba0985490d701f4b9a5ef2e9a1c93f93e999 (patch)
tree5bd5b59ffde7a27214e8f2f6646b8ee8e949566d /crawl-ref/source/misc.cc
parentcf1b4beb2d59596d200bfe2a398d5ba093e88096 (diff)
downloadcrawl-ref-689dba0985490d701f4b9a5ef2e9a1c93f93e999.tar.gz
crawl-ref-689dba0985490d701f4b9a5ef2e9a1c93f93e999.zip
Added level_map_title option per 1598159.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@855 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/misc.cc')
-rw-r--r--crawl-ref/source/misc.cc42
1 files changed, 31 insertions, 11 deletions
diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc
index a709611da4..83573538c4 100644
--- a/crawl-ref/source/misc.cc
+++ b/crawl-ref/source/misc.cc
@@ -1087,10 +1087,34 @@ static char fix_colour(char incol )
return incol;
}
-void new_level(void)
+std::string level_description_string()
{
- const int curr_subdungeon_level = player_branch_depth();
+ if (you.level_type == LEVEL_PANDEMONIUM)
+ return "- Pandemonium";
+
+ if (you.level_type == LEVEL_ABYSS)
+ return "- The Abyss";
+
+ if (you.level_type == LEVEL_LABYRINTH)
+ return "- a Labyrinth";
+
+ // level_type == LEVEL_DUNGEON
+ char buf[200];
+ const int youbranch = you.where_are_you;
+ if ( branches[youbranch].depth == 1 )
+ snprintf(buf, sizeof buf, "- %s", branches[youbranch].longname);
+ else
+ {
+ const int curr_subdungeon_level = player_branch_depth();
+ snprintf(buf, sizeof buf, "%d of %s", curr_subdungeon_level,
+ branches[youbranch].longname);
+ }
+ return buf;
+}
+
+void new_level(void)
+{
textcolor(LIGHTGREY);
gotoxy(46, 12);
@@ -1100,21 +1124,20 @@ void new_level(void)
#endif
take_note(Note(NOTE_DUNGEON_LEVEL_CHANGE));
+ cprintf("%s", level_description_string().c_str());
+
if (you.level_type == LEVEL_PANDEMONIUM)
{
- cprintf("- Pandemonium ");
env.floor_colour = fix_colour(mcolour[env.mons_alloc[9]]);
env.rock_colour = fix_colour(mcolour[env.mons_alloc[8]]);
}
else if (you.level_type == LEVEL_ABYSS)
{
- cprintf("- The Abyss ");
env.floor_colour = fix_colour(mcolour[env.mons_alloc[9]]);
env.rock_colour = fix_colour(mcolour[env.mons_alloc[8]]);
}
else if (you.level_type == LEVEL_LABYRINTH)
{
- cprintf("- a Labyrinth ");
env.floor_colour = LIGHTGREY;
env.rock_colour = BROWN;
}
@@ -1122,12 +1145,6 @@ void new_level(void)
{
// level_type == LEVEL_DUNGEON
const int youbranch = you.where_are_you;
- if ( branches[youbranch].depth == 1 )
- cprintf( "- %s", branches[youbranch].longname );
- else
- cprintf( "%d of %s", curr_subdungeon_level,
- branches[youbranch].longname );
-
env.floor_colour = branches[youbranch].floor_colour;
env.rock_colour = branches[youbranch].rock_colour;
@@ -1138,6 +1155,9 @@ void new_level(void)
LIGHTBLUE, MAGENTA };
const char rockcolours_zot[] = { LIGHTGREY, BLUE, LIGHTBLUE,
MAGENTA, LIGHTMAGENTA };
+
+ const int curr_subdungeon_level = player_branch_depth();
+
if ( curr_subdungeon_level > 5 || curr_subdungeon_level < 1 )
mpr("Odd colouring!");
else