diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-29 04:47:02 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-29 04:47:02 +0000 |
commit | 76def74997dc35755479b2b623458dff8912342d (patch) | |
tree | a65a063124292f977cc17c11a625be2661f4e7a9 /crawl-ref/source/spells1.cc | |
parent | e7a6987931173ad13d9be69bbd7c089fb982972d (diff) | |
download | crawl-ref-76def74997dc35755479b2b623458dff8912342d.tar.gz crawl-ref-76def74997dc35755479b2b623458dff8912342d.zip |
Use spell_direction() in _healing_spell(), to allow cycling through
targets via "-".
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6203 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/spells1.cc')
-rw-r--r-- | crawl-ref/source/spells1.cc | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/crawl-ref/source/spells1.cc b/crawl-ref/source/spells1.cc index 37b08aaddc..64b64871a8 100644 --- a/crawl-ref/source/spells1.cc +++ b/crawl-ref/source/spells1.cc @@ -683,33 +683,32 @@ static int _healing_spell( int healed, int target_x = -1, int target_y = -1) { ASSERT(healed >= 1); - dist bmove; + bolt beam; + dist spd; + if (target_x == -1 || target_y == -1) - { - mpr("Heal whom?", MSGCH_PROMPT); - direction( bmove, DIR_TARGET, TARG_FRIEND ); - } + spd.isValid = spell_direction(spd, beam); else { - bmove.tx = target_x; - bmove.ty = target_y; - bmove.isValid = true; + spd.tx = target_x; + spd.ty = target_y; + spd.isValid = in_bounds(spd.tx, spd.ty); } - if (!bmove.isValid || !in_bounds(bmove.tx, bmove.ty)) + if (!spd.isValid) { canned_msg( MSG_OK ); return 0; } - if (bmove.tx == you.x_pos && bmove.ty == you.y_pos) + if (spd.tx == you.x_pos && spd.ty == you.y_pos) { mpr("You are healed."); inc_hp(healed, false); return 1; } - const int mgr = mgrd[bmove.tx][bmove.ty]; + const int mgr = mgrd[spd.tx][spd.ty]; if (mgr == NON_MONSTER) { @@ -768,7 +767,7 @@ static int _healing_spell( int healed, int target_x = -1, int target_y = -1) canned_msg(MSG_NOTHING_HAPPENS); return 1; -} // end _healing_spell() +} #if 0 char cast_lesser_healing( int pow ) |