From 6a295d5f7f78f116f71a89332f48ada4ca3ba045 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Tue, 22 Apr 2008 22:11:34 +0000 Subject: 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 --- crawl-ref/source/abl-show.cc | 14 ++++---- crawl-ref/source/food.cc | 2 +- crawl-ref/source/misc.cc | 78 +++++++++++++++++++++----------------------- crawl-ref/source/tile1.cc | 21 ++++++++++++ 4 files changed, 67 insertions(+), 48 deletions(-) (limited to 'crawl-ref/source') diff --git a/crawl-ref/source/abl-show.cc b/crawl-ref/source/abl-show.cc index 8b25beec0d..59da0aa72b 100644 --- a/crawl-ref/source/abl-show.cc +++ b/crawl-ref/source/abl-show.cc @@ -908,6 +908,13 @@ static bool _activate_talent(const talent& tal) return (false); } + if ((tal.which == ABIL_EVOKE_BERSERK || tal.which == ABIL_TROG_BERSERK) + && !you.can_go_berserk(true)) + { + crawl_state.zero_turns_taken(); + return (false); + } + // some abilities don't need a hunger check bool hungerCheck = true; switch (tal.which) @@ -954,13 +961,6 @@ static bool _activate_talent(const talent& tal) return (false); } - if ((tal.which == ABIL_EVOKE_BERSERK || tal.which == ABIL_TROG_BERSERK) - && !you.can_go_berserk(true)) - { - crawl_state.zero_turns_taken(); - return (false); - } - // don't insta-starve the player // (happens at 100, losing consciousness possible from 500 downward) if (hungerCheck) diff --git a/crawl-ref/source/food.cc b/crawl-ref/source/food.cc index 5138d12246..41cd2215f2 100644 --- a/crawl-ref/source/food.cc +++ b/crawl-ref/source/food.cc @@ -841,7 +841,7 @@ void eat_floor_item(int item_link) const bool cannibal = is_player_same_species( food.plus ); const bool rotten = food_is_rotten(food); - if (!_player_can_eat_rotten_meat(true)) + if (rotten && !_player_can_eat_rotten_meat(true)) return; eat_chunk(determine_chunk_effect(chunk_type, rotten), cannibal, intel); 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(); diff --git a/crawl-ref/source/tile1.cc b/crawl-ref/source/tile1.cc index f4050e4dc2..8ddd15e5d7 100644 --- a/crawl-ref/source/tile1.cc +++ b/crawl-ref/source/tile1.cc @@ -1110,6 +1110,27 @@ static int _tileidx_weapon(const item_def &item) case WPN_BARDICHE: return TILE_WPN_LOCHABER_AXE; + + case WPN_BLESSED_FALCHION: + return TILE_WPN_FALCHION; + + case WPN_BLESSED_LONG_SWORD: + return TILE_WPN_LONG_SWORD + etable[1][etype]; + + case WPN_BLESSED_SCIMITAR: + return TILE_WPN_SCIMITAR + etable[1][etype]; + + case WPN_BLESSED_KATANA: + return TILE_WPN_KATANA + etable[1][etype]; + + case WPN_BLESSED_GREAT_SWORD: + return TILE_WPN_GREAT_SWORD + etable[1][etype]; + + case WPN_BLESSED_DOUBLE_SWORD: + return TILE_WPN_DOUBLE_SWORD; + + case WPN_BLESSED_TRIPLE_SWORD: + return TILE_WPN_TRIPLE_SWORD; } return TILE_ERROR; -- cgit v1.2.3-54-g00ecf