From 5bf0b52eb3d937b93c1c7ebcb80678a251a0502c Mon Sep 17 00:00:00 2001 From: dolorous Date: Sat, 16 May 2009 00:30:01 +0000 Subject: Properly disallow Elyvilon's "Heal Other" abilities when they're aimed at the player, just as we do with Lugonu's "Banish" ability. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9778 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/spells1.cc | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'crawl-ref/source/spells1.cc') diff --git a/crawl-ref/source/spells1.cc b/crawl-ref/source/spells1.cc index f6ff7ca7c3..f7806536e6 100644 --- a/crawl-ref/source/spells1.cc +++ b/crawl-ref/source/spells1.cc @@ -690,7 +690,8 @@ static bool _can_pacify_monster(const monsters *mon, const int healed) // Returns: 1 -- success, 0 -- failure, -1 -- cancel static int _healing_spell(int healed, bool divine_ability, - const coord_def& where, targ_mode_type mode) + const coord_def& where, bool not_self, + targ_mode_type mode) { ASSERT(healed >= 1); @@ -717,6 +718,12 @@ static int _healing_spell(int healed, bool divine_ability, if (spd.target == you.pos()) { + if (not_self) + { + mpr("You can only heal others!"); + return (-1); + } + mpr("You are healed."); inc_hp(healed, false); return (1); @@ -797,11 +804,11 @@ static int _healing_spell(int healed, bool divine_ability, // Returns: 1 -- success, 0 -- failure, -1 -- cancel int cast_healing(int pow, bool divine_ability, const coord_def& where, - targ_mode_type mode) + bool not_self, targ_mode_type mode) { pow = std::min(50, pow); return (_healing_spell(pow + roll_dice(2, pow) - 2, divine_ability, where, - mode)); + not_self, mode)); } void remove_divine_vigour() -- cgit v1.2.3-54-g00ecf