diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-04-22 22:11:34 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-04-22 22:11:34 +0000 |
commit | 6a295d5f7f78f116f71a89332f48ada4ca3ba045 (patch) | |
tree | 3927c658c3377484db2521530bc383b5cd7e5f02 /crawl-ref/source/misc.cc | |
parent | efda51aa0f651ed8983106c3bcbdc9c28d73c917 (diff) | |
download | crawl-ref-6a295d5f7f78f116f71a89332f48ada4ca3ba045.tar.gz crawl-ref-6a295d5f7f78f116f71a89332f48ada4ca3ba045.zip |
For now use normal tiles for the blessed blades (WPN_FALCHION rather
than WPN_BLESSED_FALCHION etc.)
FR 1928401: for undead attempting to Evoke an amulet of rage, print
"cannot raise a blood rage" message right away instead of printing
the "too hungry" message when applicable.
FR 1899121: prompt when using stairs that have an exclusion area centered
on them.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4492 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/misc.cc')
-rw-r--r-- | crawl-ref/source/misc.cc | 78 |
1 files changed, 38 insertions, 40 deletions
diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc index 0af3074f5e..22f7cd463d 100644 --- a/crawl-ref/source/misc.cc +++ b/crawl-ref/source/misc.cc @@ -1528,6 +1528,40 @@ static int runes_in_pack() return num_runes; } +static 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); + + crawl_state.level_annotation_shown = false; + bool might_be_dangerous = false; + + if (level_annotation_has("!", next_level_id) + && next_level_id != level_id::current() + && next_level_id.level_type == LEVEL_DUNGEON) + { + mpr("Warning: level annotation for next level is:", MSGCH_PROMPT); + mpr(get_level_annotation(next_level_id).c_str(), MSGCH_PLAIN, YELLOW); + might_be_dangerous = true; + crawl_state.level_annotation_shown = true; + } + else if (is_exclude_root(pos)) + { + mpr("This staircase is marked as excluded!", MSGCH_WARN); + might_be_dangerous = true; + } + + if (might_be_dangerous + && !yesno("Enter next level anyway?", true, 'n', true, false)) + { + canned_msg(MSG_OK); + interrupt_activity( AI_FORCE_INTERRUPT ); + crawl_state.level_annotation_shown = false; + return false; + } + return true; +} + void up_stairs(dungeon_feature_type force_stair, entry_cause_type entry_cause) { @@ -1556,26 +1590,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? - coord_def pos(you.x_pos, you.y_pos); - level_id next_level_id = level_id::get_next_level_id(pos); - - crawl_state.level_annotation_shown = false; - - if (level_annotation_has("!", next_level_id) - && next_level_id != level_id::current() - && next_level_id.level_type == LEVEL_DUNGEON && !force_stair) - { - mpr("Warning: level annotation for next level is:", MSGCH_PROMPT); - mpr(get_level_annotation(next_level_id).c_str(), MSGCH_PLAIN, YELLOW); - - if (!yesno("Enter next level anyway?", true, 0, true, false)) - { - interrupt_activity( AI_FORCE_INTERRUPT ); - return; - } - - crawl_state.level_annotation_shown = true; - } + 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 @@ -1941,26 +1957,8 @@ void down_stairs( int old_level, dungeon_feature_type force_stair, } // Does the next level have a warning annotation? - coord_def pos = you.pos(); - level_id next_level_id = level_id::get_next_level_id(pos); - - crawl_state.level_annotation_shown = false; - - if (level_annotation_has("!", next_level_id) - && next_level_id != level_id::current() - && next_level_id.level_type == LEVEL_DUNGEON && !force_stair) - { - mpr("Warning: level annotation for next level is:", MSGCH_PROMPT); - mpr(get_level_annotation(next_level_id).c_str(), MSGCH_PLAIN, YELLOW); - - if (!yesno("Enter next level anyway?", true, 0, true, false)) - { - interrupt_activity( AI_FORCE_INTERRUPT ); - return; - } - - crawl_state.level_annotation_shown = true; - } + if (!force_stair && !_check_annotation_exclusion_warning()) + return; // Interlevel travel data: bool collect_travel_data = can_travel_interlevel(); |