diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2006-11-22 08:41:20 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2006-11-22 08:41:20 +0000 |
commit | 1d0f57cbceb778139ca215cc4fcfd1584951f6dd (patch) | |
tree | cafd60c944c51fcce778aa5d6912bc548c518339 /crawl-ref/source/overmap.cc | |
parent | 6f5e187a9e5cd348296dba2fd89d2e206e775a01 (diff) | |
download | crawl-ref-1d0f57cbceb778139ca215cc4fcfd1584951f6dd.tar.gz crawl-ref-1d0f57cbceb778139ca215cc4fcfd1584951f6dd.zip |
Merged stone_soup r15:451 into trunk.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@452 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/overmap.cc')
-rw-r--r-- | crawl-ref/source/overmap.cc | 55 |
1 files changed, 43 insertions, 12 deletions
diff --git a/crawl-ref/source/overmap.cc b/crawl-ref/source/overmap.cc index e271a25fdf..2e4a236156 100644 --- a/crawl-ref/source/overmap.cc +++ b/crawl-ref/source/overmap.cc @@ -6,6 +6,8 @@ * Summary: Records location of stairs etc * Written by: Linley Henzell * + * Modified for Crawl Reference by $Author$ on $Date$ + * * Change History (most recent first): * * <3> 30/7/00 MV Made Over-map full-screen @@ -26,6 +28,7 @@ // for #definitions of MAX_BRANCHES & MAX_LEVELS #include "files.h" // for #definitions of MAX_BRANCHES & MAX_LEVELS +#include "misc.h" #include "religion.h" #include "stuff.h" #include "view.h" @@ -64,6 +67,22 @@ void print_one_highlighted_line( const char *pre, const char *text, static void print_level_name( int branch, int depth, bool &printed_branch, bool &printed_level ); +void seen_notable_thing( int which_thing ) +{ + // Don't record in temporary terrain + if (you.level_type != LEVEL_DUNGEON) + return; + + const god_type god = grid_altar_god(which_thing); + + if (god != GOD_NO_GOD) + seen_altar( god ); + else if (grid_is_branch_stairs( which_thing )) + seen_staircase( which_thing ); + else + seen_other_thing( which_thing ); +} + void init_overmap( void ) { for (int i = 0; i < MAX_LEVELS; i++) @@ -196,7 +215,7 @@ void display_overmap( void ) { pr_lev = false; // strcpy(info, " - a staircase leading to "); - info[0] = '\0'; + info[0] = 0; if (stair_level[k] == j) { @@ -359,7 +378,7 @@ static void print_level_name( int branch, int depth, } // we need our own buffer in here (info is used): - char buff[ INFO_SIZE ] = "\0";; + char buff[INFO_SIZE]; if (branch == BRANCH_MAIN_DUNGEON) depth += 1; @@ -424,10 +443,24 @@ void seen_staircase( unsigned char which_staircase ) case DNGN_ENTER_SWAMP: which_branch = BRANCH_SWAMP; break; + case DNGN_ENTER_DIS: + which_branch = BRANCH_DIS; + break; + case DNGN_ENTER_GEHENNA: + which_branch = BRANCH_GEHENNA; + break; + case DNGN_ENTER_COCYTUS: + which_branch = BRANCH_COCYTUS; + break; + case DNGN_ENTER_TARTARUS: + which_branch = BRANCH_TARTARUS; + break; default: - exit(-1); // shouldn't happen + break; } + ASSERT(which_branch != BRANCH_MAIN_DUNGEON); + stair_level[which_branch] = you.your_level; } // end seen_staircase() @@ -486,7 +519,7 @@ void seen_other_thing( unsigned char which_thing ) * prints "More..." message, read key, clear screen and after that prints new * line */ -void print_one_simple_line( const char *line , int colour) +void print_one_simple_line( const char *line, int colour) { if (map_lines == (get_number_of_lines() - 2)) { @@ -499,9 +532,7 @@ void print_one_simple_line( const char *line , int colour) } textcolor( colour ); - cprintf( line ); - cprintf( EOL ); - + cprintf( "%s" EOL, line ); map_lines++; } @@ -518,19 +549,19 @@ void print_one_highlighted_line( const char *pre, const char *text, map_lines = 0; } - if (pre[0] != '\0') + if (pre[0] != 0) { textcolor( LIGHTGREY ); - cprintf( pre ); + cprintf( "%s", pre ); } textcolor( colour ); - cprintf( text ); + cprintf( "%s", text ); - if (post[0] != '\0') + if (post[0] != 0) { textcolor( LIGHTGREY ); - cprintf( post ); + cprintf( "%s", post ); } cprintf( EOL ); |