summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/misc.cc
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2009-02-08 16:14:57 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2009-02-08 16:14:57 +0000
commitb5d57494a0e21209f23208562f960dd8f1cebebe (patch)
treed73cea7a2e8c977b82e2af9a784958d3de1faf24 /crawl-ref/source/misc.cc
parent80c7baf5a9d6beab424479c2295d4a52b1ed757b (diff)
downloadcrawl-ref-b5d57494a0e21209f23208562f960dd8f1cebebe.tar.gz
crawl-ref-b5d57494a0e21209f23208562f960dd8f1cebebe.zip
Be (much) nicer about damage when climbing up/down stairs while confused.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8980 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/misc.cc')
-rw-r--r--crawl-ref/source/misc.cc33
1 files changed, 14 insertions, 19 deletions
diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc
index fc185766a6..4587200875 100644
--- a/crawl-ref/source/misc.cc
+++ b/crawl-ref/source/misc.cc
@@ -1687,21 +1687,20 @@ void up_stairs(dungeon_feature_type force_stair,
if (!player_is_airborne()
&& you.confused()
&& old_level_type == LEVEL_DUNGEON
- && stair_find >= DNGN_STONE_STAIRS_UP_I
- && stair_find <= DNGN_STONE_STAIRS_UP_III
- && random2(100) > you.dex)
+ && !grid_is_escape_hatch(stair_find)
+ && coinflip())
{
- mpr("In your confused state, you trip and fall back down the stairs.");
-
- ouch(roll_dice(3 + you.burden_state, 5), NON_MONSTER,
- KILLED_BY_FALLING_DOWN_STAIRS);
+ const char* fall_where = "down the stairs";
+ if (!grid_is_staircase(stair_find))
+ fall_where = "through the gate";
+ mprf("In your confused state, you trip and fall back %s.", fall_where);
+ ouch(1, NON_MONSTER, KILLED_BY_FALLING_DOWN_STAIRS);
you.turn_is_over = true;
return;
}
- if (you.burden_state == BS_OVERLOADED
- && !grid_is_escape_hatch(stair_find))
+ if (you.burden_state == BS_OVERLOADED && !grid_is_escape_hatch(stair_find))
{
mpr("You are carrying too much to climb upwards.");
you.turn_is_over = true;
@@ -2173,20 +2172,16 @@ void down_stairs( int old_level, dungeon_feature_type force_stair,
&& you.confused()
&& !grid_is_escape_hatch(stair_find)
&& force_stair != DNGN_ENTER_ABYSS
- && random2(100) > you.dex)
+ && coinflip())
{
- std::string fall_where = "down the stairs";
-
+ const char* fall_where = "down the stairs";
if (!grid_is_staircase(stair_find))
fall_where = "through the gate";
- mprf("In your confused state, you trip and fall %s.",
- fall_where.c_str());
-
- // Nastier than when climbing stairs, but you'll aways get to
- // your destination. -- bwr
- ouch(roll_dice(6 + you.burden_state, 10), NON_MONSTER,
- KILLED_BY_FALLING_DOWN_STAIRS);
+ mprf("In your confused state, you trip and fall %s.", fall_where);
+ // Note that this only does damage; it doesn't cancel the level
+ // transition.
+ ouch(1, NON_MONSTER, KILLED_BY_FALLING_DOWN_STAIRS);
}
dungeon_feature_type stair_taken = stair_find;