From 3672d894756ece74eec3daa854a8e79cbe2f8f7d Mon Sep 17 00:00:00 2001 From: dolorous Date: Mon, 7 Apr 2008 23:04:11 +0000 Subject: For consistency, if a holy being is permanently neutralized via Zin's Recite or Elyvilon's healing, run the conversion-on-sight routine so that they don't attack you. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4120 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/delay.cc | 28 ++++++++++++++++------------ crawl-ref/source/spells1.cc | 24 +++++++++++++++--------- 2 files changed, 31 insertions(+), 21 deletions(-) (limited to 'crawl-ref') diff --git a/crawl-ref/source/delay.cc b/crawl-ref/source/delay.cc index c704083560..bc662d4332 100644 --- a/crawl-ref/source/delay.cc +++ b/crawl-ref/source/delay.cc @@ -183,16 +183,20 @@ static int recite_to_monsters(int x, int y, int pow, int unused) simple_monster_message(mons, " freezes in fright!"); break; default: - // permanently neutral, but same message as enchantment - mons->attitude = ATT_NEUTRAL; - mons->flags |= MF_WAS_NEUTRAL; - - // give half of the monster's xp - unsigned int exp_gain = 0, avail_gain = 0; - gain_exp( exper_value(mons) / 2 + 1, &exp_gain, &avail_gain ); - mons->flags |= MF_GOT_HALF_XP; - simple_monster_message(mons, " seems impressed!"); + if (holiness == MH_HOLY) + good_god_holy_attitude_change(mons); + else + { + // permanently neutral, but same message as enchantment + mons->attitude = ATT_NEUTRAL; + mons->flags |= MF_WAS_NEUTRAL; + + // give half of the monster's xp + unsigned int exp_gain = 0, avail_gain = 0; + gain_exp( exper_value(mons) / 2 + 1, &exp_gain, &avail_gain ); + mons->flags |= MF_GOT_HALF_XP; + } break; } @@ -206,11 +210,11 @@ static const char* _get_recite_speech(const std::string key, int weight) if (!str.empty()) return (str.c_str()); - + // in case nothing is found if (key == "start") return ("begin reciting the Axioms of Law."); - + return ("reciting"); } @@ -231,7 +235,7 @@ static bool is_parent_delay(delay_type delay) static int push_delay(const delay_queue_item &delay) { - for (delay_queue_type::iterator i = you.delay_queue.begin(); + for (delay_queue_type::iterator i = you.delay_queue.begin(); i != you.delay_queue.end(); ++i) { diff --git a/crawl-ref/source/spells1.cc b/crawl-ref/source/spells1.cc index f01a93f4d1..9ba23622d2 100644 --- a/crawl-ref/source/spells1.cc +++ b/crawl-ref/source/spells1.cc @@ -701,17 +701,23 @@ static int _healing_spell( int healed, int target_x = -1, int target_y = -1) if (you.religion == GOD_ELYVILON && _mons_hostile(monster)) { simple_god_message(" supports your offer of peace."); - simple_monster_message( monster, " turns neutral." ); - monster->attitude = ATT_NEUTRAL; - monster->flags |= MF_WAS_NEUTRAL; - // give half of the monster's xp - unsigned int exp_gain = 0, avail_gain = 0; - gain_exp( exper_value(monster) / 2 + 1, &exp_gain, &avail_gain ); - monster->flags |= MF_GOT_HALF_XP; + if (mons_is_holy(monster)) + good_god_holy_attitude_change(monster); + else + { + simple_monster_message( monster, " turns neutral." ); + monster->attitude = ATT_NEUTRAL; + monster->flags |= MF_WAS_NEUTRAL; - // finally give a small piety return - gain_piety(1 + random2(healed/15)); + // give half of the monster's xp + unsigned int exp_gain = 0, avail_gain = 0; + gain_exp( exper_value(monster) / 2 + 1, &exp_gain, &avail_gain ); + monster->flags |= MF_GOT_HALF_XP; + + // finally give a small piety return + gain_piety(1 + random2(healed/15)); + } } else if (nothing_happens) canned_msg(MSG_NOTHING_HAPPENS); -- cgit v1.2.3-54-g00ecf