From 9b1cdaf406c3cefd731676c4c67043b6f1158e09 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Thu, 16 Jul 2009 22:23:42 +0000 Subject: Fix 2819298: sling bullets not counting towards _ammo_count for slings Fix 2822293: colour "slot restricted" darkgrey on % screen Fix 2822279: polymorph other taking MR into account Fix 2821651: berserking monsters respecting 't' orders git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10247 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/beam.cc | 10 +++------- crawl-ref/source/effects.cc | 8 ++++++++ crawl-ref/source/output.cc | 20 ++++++++++---------- crawl-ref/source/religion.cc | 8 +++++++- 4 files changed, 28 insertions(+), 18 deletions(-) diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index dd420adaad..6e7eb9c717 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -3531,7 +3531,7 @@ bool bolt::misses_player() void bolt::affect_player_enchantment() { - if ((has_saving_throw() || flavour == BEAM_POLYMORPH) + if (has_saving_throw() && flavour != BEAM_POLYMORPH && you_resist_magic(ench_power)) { // You resisted it. @@ -4640,8 +4640,6 @@ bool bolt::has_saving_throw() const if (aimed_at_feet) return (false); - bool rc = true; - switch (flavour) { case BEAM_HASTE: @@ -4650,12 +4648,10 @@ bool bolt::has_saving_throw() const case BEAM_DISPEL_UNDEAD: case BEAM_ENSLAVE_SOUL: // has a different saving throw case BEAM_ENSLAVE_DEMON: // ditto - rc = false; - break; + return (false); default: - break; + return (true); } - return rc; } bool _ench_flavour_affects_monster(beam_type flavour, const monsters* mon) diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc index ca3881c962..ac4055d830 100644 --- a/crawl-ref/source/effects.cc +++ b/crawl-ref/source/effects.cc @@ -1994,6 +1994,10 @@ static void _set_friendly_foes(bool allow_patrol = false) if (!mon->alive() || !mons_near(mon) || !mons_friendly_real(mon)) continue; + // Berserking monsters cannot be ordered around. + if (mon->has_ench(ENCH_BERSERK)) + continue; + mon->foe = (allow_patrol && mon->is_patrolling() ? MHITNOT : you.pet_target); } @@ -2007,6 +2011,10 @@ static void _set_allies_patrol_point(bool clear = false) if (!mon->alive() || !mons_near(mon) || !mons_friendly_real(mon)) continue; + // Berserking monsters cannot be ordered around. + if (mon->has_ench(ENCH_BERSERK)) + continue; + mon->patrol_point = (clear ? coord_def(0, 0) : mon->pos()); if (!clear) diff --git a/crawl-ref/source/output.cc b/crawl-ref/source/output.cc index 366386004d..81cc4a51ac 100644 --- a/crawl-ref/source/output.cc +++ b/crawl-ref/source/output.cc @@ -1310,8 +1310,8 @@ static std::string _verbose_info(const monsters* m) return(" (fleeing)"); if (mons_is_sleeping(m)) { - if (mons_holiness(m) == MH_UNDEAD - || mons_holiness(m) == MH_NONLIVING + if (mons_holiness(m) == MH_UNDEAD + || mons_holiness(m) == MH_NONLIVING || mons_holiness(m) == MH_PLANT) { return(" (dormant)"); @@ -1768,14 +1768,14 @@ static void _print_overview_screen_equip(column_composer& cols, if (you.equip[ e_order[i] ] != -1) { - const int item_idx = you.equip[e_order[i]]; - const item_def& item = you.inv[item_idx]; - const bool not_melded = player_wearing_slot(e_order[i]); + // The player has something equipped. + const int item_idx = you.equip[e_order[i]]; + const item_def& item = you.inv[item_idx]; + const bool melded = !player_wearing_slot(e_order[i]); // Colour melded equipment dark grey. - const char* colname = - not_melded ? colour_to_str(item.colour).c_str() - : "darkgrey"; + const char* colname = melded ? "darkgrey" + : colour_to_str(item.colour).c_str(); const char equip_char = index_to_letter(item_idx); @@ -1784,7 +1784,7 @@ static void _print_overview_screen_equip(column_composer& cols, slot, equip_char, colname, - not_melded ? "" : "melded ", + melded ? "melded " : "", item.name(DESC_PLAIN, true).substr(0,42).c_str(), colname); equip_chars.push_back(equip_char); @@ -1819,7 +1819,7 @@ static void _print_overview_screen_equip(column_composer& cols, else if (!you_can_wear(e_order[i])) { snprintf(buf, sizeof buf, - "(%s restricted)", slot_name_lwr); + "(%s restricted)", slot_name_lwr); } else { diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index a11b5648b5..893853c075 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -1049,8 +1049,14 @@ static int _ammo_count(const item_def *launcher) continue; const item_def &item = you.inv[i]; - if (item.base_type == OBJ_MISSILES && item.sub_type == mt) + if (item.base_type != OBJ_MISSILES) + continue; + + if (item.sub_type == mt + || mt == MI_STONE && item.sub_type == MI_SLING_BULLET) + { count += item.quantity; + } } return (count); -- cgit v1.2.3-54-g00ecf