From a117fb1baf5f81a56014a174f0400622cdf2ab5d Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Tue, 24 Jun 2008 14:06:28 +0000 Subject: Modify quiver to only quiver ammunition explicitly chosen by the player (via (,) or i, or by the new quivering command). Ammo that just happens to come next in the fire order is not quivered anymore even if you continue firing. Add a new quiver command on Q, and while I was at it, restrict the items offered when firing (fi) or quivering to actual throwables. (This was a long outstanding FR.) I think that's it... git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6112 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/directn.cc | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'crawl-ref/source/directn.cc') diff --git a/crawl-ref/source/directn.cc b/crawl-ref/source/directn.cc index e84c8d8319..2f86f47638 100644 --- a/crawl-ref/source/directn.cc +++ b/crawl-ref/source/directn.cc @@ -134,18 +134,18 @@ void direction_choose_compass( dist& moves, targeting_behaviour *beh) } const int i = _targeting_cmd_to_compass(key_command); - if ( i != -1 ) + if (i != -1) { moves.dx = Compass[i].x; moves.dy = Compass[i].y; } - else if ( key_command == CMD_TARGET_CANCEL ) + else if (key_command == CMD_TARGET_CANCEL) { moves.isCancel = true; moves.isValid = false; } } - while ( !moves.isCancel && moves.dx == 0 && moves.dy == 0 ); + while (!moves.isCancel && moves.dx == 0 && moves.dy == 0); } static int _targeting_cmd_to_compass( command_type command ) @@ -832,6 +832,7 @@ void direction(dist& moves, targeting_type restricts, case CMD_TARGET_CANCEL: loop_done = true; moves.isCancel = true; + beh->mark_ammo_nonchosen(); break; #ifdef WIZARD @@ -839,6 +840,7 @@ void direction(dist& moves, targeting_type restricts, // Maybe we can skip this check...but it can't hurt if (!you.wizard || !in_bounds(moves.tx, moves.ty)) break; + mid = mgrd[moves.tx][moves.ty]; if (mid == NON_MONSTER) // can put in terrain description here break; @@ -2575,3 +2577,8 @@ bool targeting_behaviour::should_redraw() { return (false); } + +void targeting_behaviour::mark_ammo_nonchosen() +{ + // Nothing to be done. +} -- cgit v1.2.3-54-g00ecf