From b5d57494a0e21209f23208562f960dd8f1cebebe Mon Sep 17 00:00:00 2001 From: haranp Date: Sun, 8 Feb 2009 16:14:57 +0000 Subject: 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 --- crawl-ref/source/misc.cc | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) (limited to 'crawl-ref/source/misc.cc') 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; -- cgit v1.2.3-54-g00ecf