From 5ab24723edffd09f81cbfb6634fa1b175ed9d054 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Mon, 23 Jun 2008 20:02:57 +0000 Subject: Move the prompt on entering a level that is marked as dangerous via annotation or exclusion *before* the delay is started, so it doesn't cost a turn. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6087 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/acr.cc | 12 ++++++++++-- crawl-ref/source/misc.cc | 18 +++++++++--------- crawl-ref/source/misc.h | 1 + 3 files changed, 20 insertions(+), 11 deletions(-) (limited to 'crawl-ref') diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc index 3b59ced864..4f3b1521c8 100644 --- a/crawl-ref/source/acr.cc +++ b/crawl-ref/source/acr.cc @@ -1667,7 +1667,7 @@ static void _go_upstairs() if (ygrd == DNGN_ENTER_SHOP) { - if ( you.duration[DUR_BERSERKER] ) + if (you.duration[DUR_BERSERKER]) canned_msg(MSG_TOO_BERSERK); else shop(); @@ -1678,10 +1678,14 @@ static void _go_upstairs() if (ygrd == DNGN_STONE_ARCH) mpr("There is nothing on the other side of the stone arch."); else - mpr( "You can't go up here!" ); + mpr("You can't go up here!"); return; } + // Does the next level have a warning annotation? + if (!check_annotation_exclusion_warning()) + return; + tag_followers(); // only those beside us right now can follow start_delay( DELAY_ASCENDING_STAIRS, 1 + (you.burden_state > BS_UNENCUMBERED) ); @@ -1718,6 +1722,10 @@ static void _go_downstairs() return; } + // Does the next level have a warning annotation? + if (!check_annotation_exclusion_warning()) + return; + if (shaft) { start_delay( DELAY_DESCENDING_STAIRS, 0, you.your_level ); diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc index c975143f50..542a912c17 100644 --- a/crawl-ref/source/misc.cc +++ b/crawl-ref/source/misc.cc @@ -1438,7 +1438,7 @@ static int runes_in_pack() return num_runes; } -static bool _check_annotation_exclusion_warning() +bool check_annotation_exclusion_warning() { coord_def pos(you.x_pos, you.y_pos); level_id next_level_id = level_id::get_next_level_id(pos); @@ -1467,9 +1467,9 @@ static bool _check_annotation_exclusion_warning() canned_msg(MSG_OK); interrupt_activity( AI_FORCE_INTERRUPT ); crawl_state.level_annotation_shown = false; - return false; + return (false); } - return true; + return (true); } void up_stairs(dungeon_feature_type force_stair, @@ -1500,8 +1500,8 @@ void up_stairs(dungeon_feature_type force_stair, LevelInfo &old_level_info = travel_cache.get_level_info(old_level_id); // Does the next level have a warning annotation? - if (!force_stair && !_check_annotation_exclusion_warning()) - return; +// if (!force_stair && !check_annotation_exclusion_warning()) +// return; // Since the overloaded message set turn_is_over, I'm assuming that // the overloaded character makes an attempt... so we're doing this @@ -1814,6 +1814,10 @@ void down_stairs( int old_level, dungeon_feature_type force_stair, mpr("You fall through a shaft!"); } + // Does the next level have a warning annotation? +// if (!force_stair && !check_annotation_exclusion_warning()) +// return; + // All checks are done, the player is on the move now. // Fire level-leaving trigger. @@ -1858,10 +1862,6 @@ void down_stairs( int old_level, dungeon_feature_type force_stair, } } - // Does the next level have a warning annotation? - if (!force_stair && !_check_annotation_exclusion_warning()) - return; - // Interlevel travel data. bool collect_travel_data = can_travel_interlevel(); diff --git a/crawl-ref/source/misc.h b/crawl-ref/source/misc.h index 4e1f41d3fe..2177da622c 100644 --- a/crawl-ref/source/misc.h +++ b/crawl-ref/source/misc.h @@ -82,6 +82,7 @@ void generate_random_blood_spatter_on_level(); /* *********************************************************************** * called from: acr * *********************************************************************** */ +bool check_annotation_exclusion_warning(); void up_stairs(dungeon_feature_type force_stair = DNGN_UNSEEN, entry_cause_type entry_cause = EC_UNKNOWN); -- cgit v1.2.3-54-g00ecf