From 783d701df6b0352a730c211be593d91c27b07b4a Mon Sep 17 00:00:00 2001 From: dolorous Date: Wed, 2 Jul 2008 14:27:05 +0000 Subject: Make the neutrality enchantment decay properly. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6336 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/delay.cc | 14 +++++++++++--- crawl-ref/source/mon-util.cc | 9 +++++++++ 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/crawl-ref/source/delay.cc b/crawl-ref/source/delay.cc index 35f94b9ebd..8e2ffa7230 100644 --- a/crawl-ref/source/delay.cc +++ b/crawl-ref/source/delay.cc @@ -155,7 +155,7 @@ static int _recite_to_monsters(int x, int y, int pow, int unused) || !mons->add_ench(mon_enchant(ENCH_CONFUSION, 0, KC_YOU, (16 + random2avg(13, 2)) * 10))) { - return (0); + return (0); } simple_monster_message(mons, " looks confused."); break; @@ -170,8 +170,11 @@ static int _recite_to_monsters(int x, int y, int pow, int unused) case 10: case 11: case 12: - if (!mons->add_ench(ENCH_NEUTRAL)) + if (!mons->add_ench(mon_enchant(ENCH_NEUTRAL, 0, KC_YOU, + (16 + random2avg(13, 2)) * 10))) + { return (0); + } simple_monster_message(mons, " seems impressed!"); break; case 13: @@ -185,7 +188,9 @@ static int _recite_to_monsters(int x, int y, int pow, int unused) case 17: if (!mons->add_ench(mon_enchant(ENCH_PARALYSIS, 0, KC_YOU, (16 + random2avg(13, 2)) * 10))) + { return (0); + } simple_monster_message(mons, " freezes in fright!"); break; default: @@ -195,8 +200,11 @@ static int _recite_to_monsters(int x, int y, int pow, int unused) { if (holiness == MH_UNDEAD || holiness == MH_DEMONIC) { - if (!mons->add_ench(ENCH_NEUTRAL)) + if (!mons->add_ench(mon_enchant(ENCH_NEUTRAL, 0, KC_YOU, + (16 + random2avg(13, 2)) * 10))) + { return (0); + } simple_monster_message(mons, " seems impressed!"); } else diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc index a19ca4cd6c..0840042d1a 100644 --- a/crawl-ref/source/mon-util.cc +++ b/crawl-ref/source/mon-util.cc @@ -5202,6 +5202,13 @@ void monsters::remove_enchantment_effect(const mon_enchant &me, bool quiet) behaviour_event(this, ME_EVAL); break; + case ENCH_NEUTRAL: + if (!quiet) + simple_monster_message(this, " is no longer neutral."); + + behaviour_event(this, ME_EVAL); + break; + case ENCH_PETRIFIED: if (!quiet) simple_monster_message(this, " is no longer petrified."); @@ -5216,6 +5223,7 @@ void monsters::remove_enchantment_effect(const mon_enchant &me, bool quiet) if (!quiet) simple_monster_message(this, " stops moving altogether!"); + behaviour_event(this, ME_EVAL); break; @@ -5597,6 +5605,7 @@ void monsters::apply_enchantment(const mon_enchant &me) case ENCH_HASTE: case ENCH_FEAR: case ENCH_PARALYSIS: + case ENCH_NEUTRAL: case ENCH_PETRIFYING: case ENCH_PETRIFIED: case ENCH_SICK: -- cgit v1.2.3-54-g00ecf