summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-05-16 00:30:01 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-05-16 00:30:01 +0000
commit5bf0b52eb3d937b93c1c7ebcb80678a251a0502c (patch)
tree63143cba732b84ae93843a92143f9c6d9749dde5
parent3ac377c1d12efdc4bb8ab217aa2d4089f12542ec (diff)
downloadcrawl-ref-5bf0b52eb3d937b93c1c7ebcb80678a251a0502c.tar.gz
crawl-ref-5bf0b52eb3d937b93c1c7ebcb80678a251a0502c.zip
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
-rw-r--r--crawl-ref/source/abl-show.cc9
-rw-r--r--crawl-ref/source/beam.cc2
-rw-r--r--crawl-ref/source/spells1.cc13
-rw-r--r--crawl-ref/source/spells1.h4
4 files changed, 20 insertions, 8 deletions
diff --git a/crawl-ref/source/abl-show.cc b/crawl-ref/source/abl-show.cc
index d77898512f..a608e28acc 100644
--- a/crawl-ref/source/abl-show.cc
+++ b/crawl-ref/source/abl-show.cc
@@ -1704,8 +1704,9 @@ static bool _do_ability(const ability_def& abil)
case ABIL_ELYVILON_LESSER_HEALING_OTHERS:
{
const bool self = (abil.ability == ABIL_ELYVILON_LESSER_HEALING_SELF);
+
if (cast_healing(3 + (you.skills[SK_INVOCATIONS] / 6), true,
- self ? you.pos() : coord_def(0,0),
+ self ? you.pos() : coord_def(0, 0), !self,
self ? TARG_NUM_MODES : TARG_HOSTILE) < 0)
{
return (false);
@@ -1723,8 +1724,9 @@ static bool _do_ability(const ability_def& abil)
case ABIL_ELYVILON_GREATER_HEALING_OTHERS:
{
const bool self = (abil.ability == ABIL_ELYVILON_GREATER_HEALING_SELF);
+
if (cast_healing(10 + (you.skills[SK_INVOCATIONS] / 3), true,
- self ? you.pos() : coord_def(0,0),
+ self ? you.pos() : coord_def(0, 0), !self,
self ? TARG_NUM_MODES : TARG_HOSTILE) < 0)
{
return (false);
@@ -1753,6 +1755,7 @@ static bool _do_ability(const ability_def& abil)
mpr("You aren't in the Abyss!");
return (false); // Don't incur costs.
}
+
banished(DNGN_EXIT_ABYSS);
exercise(SK_INVOCATIONS, 8 + random2(10));
break;
@@ -1772,11 +1775,13 @@ static bool _do_ability(const ability_def& abil)
mpr("You cannot banish yourself!");
return (false);
}
+
if (!zapping(ZAP_BANISHMENT, 16 + you.skills[SK_INVOCATIONS] * 8, beam,
true))
{
return (false);
}
+
exercise(SK_INVOCATIONS, 3 + random2(5));
break;
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc
index c2e2a810e9..8c4f65f536 100644
--- a/crawl-ref/source/beam.cc
+++ b/crawl-ref/source/beam.cc
@@ -3568,7 +3568,7 @@ void bolt::affect_player_enchantment()
mpr("This is polymorph other only!");
}
else
- canned_msg( MSG_NOTHING_HAPPENS );
+ canned_msg(MSG_NOTHING_HAPPENS);
break;
case BEAM_SLOW:
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()
diff --git a/crawl-ref/source/spells1.h b/crawl-ref/source/spells1.h
index e63c136fa3..97f3c240ff 100644
--- a/crawl-ref/source/spells1.h
+++ b/crawl-ref/source/spells1.h
@@ -18,8 +18,8 @@ struct bolt;
bool cast_sure_blade(int power);
int cast_healing(int pow, bool divine_ability = false,
- const coord_def& where = coord_def(0,0),
- targ_mode_type mode = TARG_NUM_MODES);
+ const coord_def& where = coord_def(0, 0),
+ bool not_self = false, targ_mode_type mode = TARG_NUM_MODES);
void remove_divine_vigour();
bool cast_divine_vigour();