From 76def74997dc35755479b2b623458dff8912342d Mon Sep 17 00:00:00 2001 From: dolorous Date: Sun, 29 Jun 2008 04:47:02 +0000 Subject: 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 --- crawl-ref/source/spells1.cc | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'crawl-ref/source/spells1.cc') 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 ) -- cgit v1.2.3-54-g00ecf