summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/acr.cc
diff options
context:
space:
mode:
authorpauldubois <pauldubois@c06c8d41-db1a-0410-9941-cceddc491573>2008-03-15 23:47:33 +0000
committerpauldubois <pauldubois@c06c8d41-db1a-0410-9941-cceddc491573>2008-03-15 23:47:33 +0000
commit636cb150289264fb06e4c3ad74da2ed385234567 (patch)
tree84148bfd54f605b81da592ae9dff9e1671dcf933 /crawl-ref/source/acr.cc
parent80bb6d7dfc1d7fc620af3f77935dcfca9cce788a (diff)
downloadcrawl-ref-636cb150289264fb06e4c3ad74da2ed385234567.tar.gz
crawl-ref-636cb150289264fb06e4c3ad74da2ed385234567.zip
Changed door-open failure message to match the door-close message.
Added special case messages for doors already open or closed. Maybe there should be flavor messages for # gateways? We use the same noun (gate/gateway) for # and +++. Remove leading underscore from find_connected_identical() now that it's public. Change large door descriptions slightly: - "open/closed large door" -> "large open/closed door" - "There's a creature in the large doorway!" -> "... in the doorway" - Other messages read a bit better without the adjective, but if it's removed then almost all the flavor is gone. So I left them alone. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3664 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/acr.cc')
-rw-r--r--crawl-ref/source/acr.cc55
1 files changed, 38 insertions, 17 deletions
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc
index b52b08b403..950925d330 100644
--- a/crawl-ref/source/acr.cc
+++ b/crawl-ref/source/acr.cc
@@ -3440,9 +3440,16 @@ static void open_door(int move_x, int move_y, bool check_confused)
dx = you.x_pos + door_move.dx;
dy = you.y_pos + door_move.dy;
- if (!in_bounds(dx, dy) || grd[dx][dy] != DNGN_CLOSED_DOOR)
+ const dungeon_feature_type feat =
+ in_bounds(dx, dy) ? grd[dx][dy] : DNGN_UNSEEN;
+ if (feat != DNGN_CLOSED_DOOR)
{
- mpr( "There's no door there." );
+ switch (feat) {
+ case DNGN_OPEN_DOOR:
+ mpr("It's already open!"); break;
+ default:
+ mpr("There isn't anything that you can open there!"); break;
+ }
// Don't lose a turn.
return;
}
@@ -3451,31 +3458,34 @@ static void open_door(int move_x, int move_y, bool check_confused)
if (grd[dx][dy] == DNGN_CLOSED_DOOR)
{
std::set<coord_def> all_door;
- _find_connected_identical(coord_def(dx,dy), grd[dx][dy], all_door);
- const char* noun = get_door_noun(all_door.size()).c_str();
+ find_connected_identical(coord_def(dx,dy), grd[dx][dy], all_door);
+ const char *adj, *noun;
+ get_door_description(all_door.size(), &adj, &noun);
int skill = you.dex + (you.skills[SK_TRAPS_DOORS] + you.skills[SK_STEALTH]) / 2;
if (you.duration[DUR_BERSERKER])
{
+ // XXX: better flavor for larger doors?
if (silenced(you.x_pos, you.y_pos))
- mprf("The %s flies open!", noun);
+ {
+ mprf("The %s%s flies open!", adj, noun);
+ }
else
{
- // XXX: better flavor for gateways?
- mprf("The %s flies open with a bang!", noun);
+ mprf("The %s%s flies open with a bang!", adj, noun);
noisy( 15, you.x_pos, you.y_pos );
}
}
else if (one_chance_in(skill) && !silenced(you.x_pos, you.y_pos))
{
- mprf( "As you open the %s, it creaks loudly!", noun );
+ mprf( "As you open the %s%s, it creaks loudly!", adj, noun );
noisy( 10, you.x_pos, you.y_pos );
}
else
{
const char* verb = player_is_airborne() ? "reach down and open" : "open";
- mprf( "You %s the %s.", verb, noun );
+ mprf( "You %s the %s%s.", verb, adj, noun );
}
for (std::set<coord_def>::iterator i = all_door.begin();
@@ -3524,11 +3534,14 @@ static void close_door(int door_x, int door_y)
dx = you.x_pos + door_move.dx;
dy = you.y_pos + door_move.dy;
- if (grd[dx][dy] == DNGN_OPEN_DOOR)
+ const dungeon_feature_type feat =
+ in_bounds(dx, dy) ? grd[dx][dy] : DNGN_UNSEEN;
+ if (feat == DNGN_OPEN_DOOR)
{
std::set<coord_def> all_door;
- _find_connected_identical(coord_def(dx,dy), grd[dx][dy], all_door);
- const char* noun = get_door_noun(all_door.size()).c_str();
+ find_connected_identical(coord_def(dx,dy), grd[dx][dy], all_door);
+ const char *adj, *noun;
+ get_door_description(all_door.size(), &adj, &noun);
const coord_def you_coord(you.x_pos, you.y_pos);
for (std::set<coord_def>::iterator i = all_door.begin();
@@ -3565,22 +3578,24 @@ static void close_door(int door_x, int door_y)
if (you.duration[DUR_BERSERKER])
{
if (silenced(you.x_pos, you.y_pos))
- mprf("You slam the %s shut!", noun);
+ {
+ mprf("You slam the %s%s shut!", adj, noun);
+ }
else
{
- mprf("You slam the %s shut with an echoing bang!", noun);
+ mprf("You slam the %s%s shut with an echoing bang!", adj, noun);
noisy( 25, you.x_pos, you.y_pos );
}
}
else if (one_chance_in(skill) && !silenced(you.x_pos, you.y_pos))
{
- mprf("As you close the %s, it creaks loudly!", noun);
+ mprf("As you close the %s%s, it creaks loudly!", adj, noun);
noisy( 10, you.x_pos, you.y_pos );
}
else
{
const char* verb = player_is_airborne() ? "reach down and close" : "close";
- mprf( "You %s the %s.", verb, noun );
+ mprf( "You %s the %s%s.", verb, adj, noun );
}
for (std::set<coord_def>::iterator i = all_door.begin();
@@ -3593,7 +3608,13 @@ static void close_door(int door_x, int door_y)
}
else
{
- mpr("There isn't anything that you can close there!");
+ switch (feat)
+ {
+ case DNGN_CLOSED_DOOR:
+ mpr("It's already closed!"); break;
+ default:
+ mpr("There isn't anything that you can close there!"); break;
+ }
}
} // end open_door()