diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-04-03 20:21:50 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-04-03 20:21:50 +0000 |
commit | 02a23f0ae54f800e42a987a6080b2d37b87aebc5 (patch) | |
tree | 31c4508b80a3eb20184dbea48316f4977bc5266b /crawl-ref/source/spells1.cc | |
parent | 2d1dc73ba81562198242670c328146d3f13695c6 (diff) | |
download | crawl-ref-02a23f0ae54f800e42a987a6080b2d37b87aebc5.tar.gz crawl-ref-02a23f0ae54f800e42a987a6080b2d37b87aebc5.zip |
Implement a hack to differentiate between Ely's self healing and healing
others. I've added a new targetting mode TARG_NOT_SELF that basically
just forces the autotargetting to skip the player in favour of the
previous target or, failing that, the nearest monster (no matter whether
friendly, hostile or neutral).
Both types of ability crop up at the same piety point, and the ability
letters are changed accordingly (which is likely to wreak havoc on those
relying on their finger memory, but makes more sense and is easier to
remember in the long run).
I haven't changed/added the ability descriptions. If someone could do
that, please?
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9575 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/spells1.cc')
-rw-r--r-- | crawl-ref/source/spells1.cc | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/crawl-ref/source/spells1.cc b/crawl-ref/source/spells1.cc index 0f7ece7715..ef998c9e48 100644 --- a/crawl-ref/source/spells1.cc +++ b/crawl-ref/source/spells1.cc @@ -689,7 +689,7 @@ 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) + const coord_def& where, targ_mode_type mode) { ASSERT(healed >= 1); @@ -699,14 +699,15 @@ static int _healing_spell(int healed, bool divine_ability, if (where.origin()) { spd.isValid = spell_direction(spd, beam, DIR_TARGET, + mode != TARG_NUM_MODES ? mode : you.religion == GOD_ELYVILON ? - TARG_ANY : TARG_FRIEND, + TARG_ANY : TARG_FRIEND, LOS_RADIUS, false, true, true, "Heal whom?"); } else { - spd.target = where; + spd.target = where; spd.isValid = in_bounds(spd.target); } @@ -786,10 +787,12 @@ 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) +int cast_healing(int pow, bool divine_ability, const coord_def& where, + targ_mode_type mode) { pow = std::min(50, pow); - return (_healing_spell(pow + roll_dice(2, pow) - 2, divine_ability, where)); + return (_healing_spell(pow + roll_dice(2, pow) - 2, divine_ability, where, + mode)); } void remove_divine_vigour() |