From 0eb7e87096f07509f3fed6a82fab696d505a2c18 Mon Sep 17 00:00:00 2001 From: dshaligram Date: Fri, 13 Jul 2007 11:26:38 +0000 Subject: [1746014] Added an implicit quiver when firing missiles: - ^P/^N change the selected missile, but only within a fire_order slot. i.e., if you're wielding a launcher and have "launcher" first in your fire order, ^N and ^P will cycle only through suitable launcher ammo. - If you use ^P or ^N to change the default missiles offered, that choice gets saved as your quiver (unless you cancel targeting). - Fire always offers the quivered item first, if appropriate (so if you have darts quivered and try to shoot from a bow, the darts will not be offered). Breaks save compatibility (quiver is saved). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1854 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/direct.h | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'crawl-ref/source/direct.h') diff --git a/crawl-ref/source/direct.h b/crawl-ref/source/direct.h index f8be4357a7..9541e23825 100644 --- a/crawl-ref/source/direct.h +++ b/crawl-ref/source/direct.h @@ -23,9 +23,26 @@ * spells2 - spells3 - spells4 * *********************************************************************** */ +// An object that modifies the behaviour of the direction prompt. +class targeting_behaviour +{ +public: + targeting_behaviour(bool just_looking = false); + virtual ~targeting_behaviour(); + + // Returns a keystroke for the prompt. + virtual int get_key(); + virtual command_type get_command(int key = -1); + virtual bool should_redraw(); + +public: + bool just_looking; + bool compass; +}; + void direction( dist &moves, targeting_type restricts = DIR_NONE, targ_mode_type mode = TARG_ANY, bool just_looking = false, - const char *prompt = NULL ); + const char *prompt = NULL, targeting_behaviour *mod = NULL ); bool in_los_bounds(int x, int y); bool in_viewport_bounds(int x, int y); -- cgit v1.2.3-54-g00ecf