From 5feccd8e038752a00f9408159da613ba7fd02be1 Mon Sep 17 00:00:00 2001 From: dolorous Date: Thu, 16 Jul 2009 12:49:37 +0000 Subject: Fix inconsistencies with resistance displays in the "%" screen, including a fix for [2822291]. (For the record, there still seem to be some inconsistencies with how many levels some resistances have; do acid resistance and clarity have 3 levels or 1?) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10229 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/delay.cc | 1 + crawl-ref/source/output.cc | 7 +++---- crawl-ref/source/player.cc | 18 +++++++++--------- crawl-ref/source/player.h | 1 - 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/crawl-ref/source/delay.cc b/crawl-ref/source/delay.cc index a0f5b03c5a..d8cef1c7fc 100644 --- a/crawl-ref/source/delay.cc +++ b/crawl-ref/source/delay.cc @@ -1357,6 +1357,7 @@ static void _finish_delay(const delay_queue_item &delay) handle_interrupted_swap(true); break; } + case DELAY_DROP_ITEM: // Note: checking if item is droppable is assumed to // be done before setting up this delay... this includes diff --git a/crawl-ref/source/output.cc b/crawl-ref/source/output.cc index 1eb6726ae1..366386004d 100644 --- a/crawl-ref/source/output.cc +++ b/crawl-ref/source/output.cc @@ -2086,7 +2086,6 @@ static std::vector _get_overview_resistances( const int rmuta = (wearing_amulet(AMU_RESIST_MUTATION, calc_unid) || player_mutation_level(MUT_MUTATION_RESISTANCE) == 3 || you.religion == GOD_ZIN && you.piety >= 150); - const int rslow = wearing_amulet(AMU_RESIST_SLOW, calc_unid); snprintf(buf, sizeof buf, @@ -2133,9 +2132,9 @@ static std::vector _get_overview_resistances( const int rward = (wearing_amulet(AMU_WARDING, calc_unid) || you.religion == GOD_VEHUMET && !player_under_penance() && you.piety >= piety_breakpoint(2)); - const int rcons = wearing_amulet(AMU_CONSERVATION, calc_unid); - const int rcorr = wearing_amulet(AMU_RESIST_CORROSION, calc_unid); - const int rclar = wearing_amulet(AMU_CLARITY, calc_unid); + const int rcons = player_item_conserve(calc_unid); + const int rcorr = player_res_acid(calc_unid); + const int rclar = player_mental_clarity(calc_unid); snprintf(buf, sizeof buf, "%sSee Invis. : %s\n" "%sWarding : %s\n" diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index a3af5c9ebb..853da7983e 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -1545,8 +1545,14 @@ int player_res_acid(bool calc_unid, bool items) res += player_mutation_level(MUT_YELLOW_SCALES) * 2 / 3; } - if (items && wearing_amulet(AMU_RESIST_CORROSION, calc_unid)) - res++; + if (items) + { + if (wearing_amulet(AMU_RESIST_CORROSION, calc_unid)) + res++; + + if (player_equip_ego_type(EQ_CLOAK, SPARM_PRESERVATION)) + res++; + } return (res); } @@ -4381,12 +4387,6 @@ std::string species_name(species_type speci, int level, bool genus, bool adj) return res; } -bool player_res_corrosion(bool calc_unid) -{ - return (player_equip(EQ_AMULET, AMU_RESIST_CORROSION, calc_unid) - || player_equip_ego_type(EQ_CLOAK, SPARM_PRESERVATION)); -} - bool player_item_conserve(bool calc_unid) { return (player_equip(EQ_AMULET, AMU_CONSERVATION, calc_unid) @@ -6703,7 +6703,7 @@ int player::warding() const && piety >= piety_breakpoint(2)) { // Clamp piety at 160 and scale that down to a max of 30. - const int wardpiety = piety > 160? 160 : piety; + const int wardpiety = piety > 160 ? 160 : piety; return (wardpiety * 3 / 16); } diff --git a/crawl-ref/source/player.h b/crawl-ref/source/player.h index e2ab61cd5b..308d20572f 100644 --- a/crawl-ref/source/player.h +++ b/crawl-ref/source/player.h @@ -203,7 +203,6 @@ int player_acid_resist_factor(); int player_res_torment(bool calc_unid = true); -bool player_res_corrosion(bool calc_unid = true); bool player_item_conserve(bool calc_unid = true); int player_mental_clarity(bool calc_unid = true, bool items = true); -- cgit v1.2.3-54-g00ecf