summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/docs/crawl_manual.txt33
-rw-r--r--crawl-ref/docs/crawl_options.txt22
-rw-r--r--crawl-ref/init.txt1
-rw-r--r--crawl-ref/source/acr.cc5
-rw-r--r--crawl-ref/source/command.cc17
-rw-r--r--crawl-ref/source/externs.h1
-rw-r--r--crawl-ref/source/initfile.cc7
-rw-r--r--crawl-ref/source/item_use.cc12
8 files changed, 58 insertions, 40 deletions
diff --git a/crawl-ref/docs/crawl_manual.txt b/crawl-ref/docs/crawl_manual.txt
index 76b94f68f3..c3c67df3d9 100644
--- a/crawl-ref/docs/crawl_manual.txt
+++ b/crawl-ref/docs/crawl_manual.txt
@@ -547,7 +547,7 @@ you might find in the course of your adventures, how these are
displayed, and what commands there are to use them:
) weapons (use 'w'ield)
-( ammunition (use 'f'ire)
+( missiles (use 'f'ire)
[ armour (use 'W'ear and 'T'ake off)
% food (use 'e'at; also 'c'hop up corpses)
? scrolls (use 'r'ead)
@@ -657,21 +657,28 @@ You can press ')' to show your primary (wielded) and secondary
(slot b) weapons, as well as the preferred missiles (to be shot when
using 'f' to fire).
-( Ammunition
-------------
+( Missiles
+----------
+
+(The following section assumes the option setting
+fire_quiver_best = false, which is the default.)
+
If you would rather pick off monsters from a safe distance, you will
-need ammunition for your sling, bow, or other appropriate launcher.
-Several kinds of ammunition, such as javelins, are effective when simply
+need missiles for your sling, bow, or other appropriate launcher.
+Several kinds of missiles, such as javelins, are effective when simply
thrown; other kinds require you to wield an appropriate device to
-inflict worthwhile damage. Ammunition has only one "plus" value, which
+inflict worthwhile damage. Missiles have only one "plus" value, which
affects both accuracy and damage.
-The 'f' command fires or throws a piece of ammunition, typically
-chosen from lots suitable for your weapon and defaulting to the last
-lot you fired with that weapon (your "quiver"). Note that the item you
-will shoot with 'f' is displayed on the main screen beneath your
-wielded weapon. See Appendix 6 (Inscriptions) for inscriptions which
-let you fine-tune the list of items to choose from.
+The 'f' command fires or throws a missile, typically chosen from lots
+suitable for your weapon. The default lot (your "quiver") is displayed
+on the main screen beneath your wielded weapon. It is either the
+previous item you fired, or the "best" available lot, depending on an
+option setting.
+
+See Appendix 6 (Inscriptions) for inscriptions which let you fine-tune
+the list of items to choose from. See also the "Missiles" section of
+crawl_options.txt.
The firing interface also allows you to manually select an item to
throw with 'i'; but it may not be very effective if you lack the
@@ -681,7 +688,7 @@ this way, it is assumed to be a one-time use, and your quiver will not
be changed.
Use the '(' command if you want to change your quiver without
-firing.
+firing. Note that this only applies if you
The interface for shooting or throwing things is also used for zapping
wands and casting certain spells, and is described in detail in
diff --git a/crawl-ref/docs/crawl_options.txt b/crawl-ref/docs/crawl_options.txt
index f09e5d0093..bf2b172f9d 100644
--- a/crawl-ref/docs/crawl_options.txt
+++ b/crawl-ref/docs/crawl_options.txt
@@ -64,7 +64,7 @@ The contents of this text are:
menu_colour, menu_colour_prefix_id,
menu_colour_prefix_class
4-k Missiles.
- fire_items_start, fire_order
+ fire_items_start, fire_order, fire_quiver_behavior
4-l Message Channels.
plain, prompt, god, pray, duration, danger, food, warning,
recovery, talk, talk_visual, intrinsic_gain, mutation,
@@ -568,20 +568,18 @@ item_colour = true
The viewport is the portion of the map that is displayed during normal
play. The viewport is 33x17 by default, but if you use larger terminal
-sizes, you can set these options to make the game show a larger
+sizes, you can set these options to allow the game to show a larger
viewport. (These options are not fully available on DOS.)
None of these options affects gameplay. In particular, your character's
line-of-sight is unaffected by these options.
view_max_width = 33
- Sets the maximum width of the viewport (defaults to 33).
- Making this larger will allow Crawl to show a wider viewport
- on larger terminals.
+ Sets the maximum width of the viewport. Making this larger
+ will allow Crawl to show a wider viewport on larger terminals.
view_max_height = 17
- Similar to view_max_width, but sets the viewport's maximum
- height.
+ Similar to view_max_width, but sets the maximum height.
* Note that using large viewports can slow the game down.
@@ -1167,14 +1165,20 @@ fire_order += inscribed
the "Inscriptions" section of the crawl manual for more information
about inscriptions.
- the "Inscriptions"
-
'launcher' refers to firing the appropriate missile for the
wielded weapon (ie crossbow, bow, sling, blowgun). You'll almost
certainly want it first, as it'll be ignored when you're not
wielding a ranged weapon. 'return' refers to (identified)
weapons of returning.
+fire_quiver_best = false
+ Controls the behavior of the quiver. If false, the quiver
+ contains the previous ammo fired.
+
+ If true, Crawl will always put the best-ranked item in the
+ quiver, as specified by fire_order, current launcher, and
+ inventory ordering.
+
(See also pickup_thrown in 4-a.)
4-l Message Channels.
diff --git a/crawl-ref/init.txt b/crawl-ref/init.txt
index 53101ad103..46a6843120 100644
--- a/crawl-ref/init.txt
+++ b/crawl-ref/init.txt
@@ -253,6 +253,7 @@ message_colour = yellow:fails to return
# fire_order = launcher, return
# fire_order += javelin / dart / stone / rock / spear / net / handaxe / dagger
# fire_order += inscribed
+# fire_quiver_best = false
##### 4-l Channels ##############################
#
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc
index a08c5aeb77..8fa1480ddd 100644
--- a/crawl-ref/source/acr.cc
+++ b/crawl-ref/source/acr.cc
@@ -2377,6 +2377,11 @@ void process_command( command_type cmd )
case CMD_CYCLE_QUIVER_FORWARD:
{
+ if (Options.fire_quiver_best)
+ {
+ mpr("Use fire_quiver_best=false if you want manual quiver control.");
+ break;
+ }
const int cur = you.quiver[get_quiver_type()];
if (cur != ENDOFPACK)
{
diff --git a/crawl-ref/source/command.cc b/crawl-ref/source/command.cc
index 00432ead51..485df76827 100644
--- a/crawl-ref/source/command.cc
+++ b/crawl-ref/source/command.cc
@@ -52,7 +52,7 @@
#include "version.h"
#include "view.h"
-static void adjust_item(void);
+static void _adjust_item(void);
static void adjust_spells(void);
static void adjust_ability(void);
static void list_wizard_commands();
@@ -107,7 +107,7 @@ void adjust(void)
const int keyin = tolower( get_ch() );
if (keyin == 'i')
- adjust_item();
+ _adjust_item();
else if (keyin == 's')
adjust_spells();
else if (keyin == 'a')
@@ -152,18 +152,11 @@ void swap_inv_slots(int from_slot, int to_slot, bool verbose)
if (to_slot == you.equip[EQ_WEAPON] || from_slot == you.equip[EQ_WEAPON])
{
you.wield_change = true;
- you.quiver_change = true;
}
- if (!you.quiver_change)
- {
- int quiver = you.quiver[get_quiver_type()];
- if (to_slot == quiver || from_slot == quiver)
- you.quiver_change = true;
- }
-
+ you.quiver_change = true;
}
-static void adjust_item(void)
+static void _adjust_item(void)
{
int from_slot, to_slot;
@@ -195,7 +188,7 @@ static void adjust_item(void)
}
swap_inv_slots(from_slot, to_slot, true);
-} // end adjust_item()
+} // end _adjust_item()
static void adjust_spells(void)
{
diff --git a/crawl-ref/source/externs.h b/crawl-ref/source/externs.h
index d8bb41f6d6..c6eed59f14 100644
--- a/crawl-ref/source/externs.h
+++ b/crawl-ref/source/externs.h
@@ -1615,6 +1615,7 @@ public:
int fire_items_start;// index of first item for fire command
std::vector<unsigned> fire_order; // missile search order for 'f' command
+ bool fire_quiver_best;
bool auto_list; // automatically jump to appropriate item lists
diff --git a/crawl-ref/source/initfile.cc b/crawl-ref/source/initfile.cc
index 296d30fdba..fa50bf5ab3 100644
--- a/crawl-ref/source/initfile.cc
+++ b/crawl-ref/source/initfile.cc
@@ -767,6 +767,7 @@ void game_options::reset_options()
flush_input[ FLUSH_LUA ] = true;
fire_items_start = 0; // start at slot 'a'
+ fire_quiver_best = false;
// Clear fire_order and set up the defaults.
set_fire_order("launcher, return, "
@@ -1997,10 +1998,14 @@ void game_options::read_option_line(const std::string &str, bool runscript)
fire_items_start = letter_to_index( field[0] );
else
{
- fprintf( stderr, "Bad fire item start index -- %s\n",
+ fprintf( stderr, "Bad fire item start index: %s\n",
field.c_str() );
}
}
+ else if (key == "fire_quiver_best")
+ {
+ fire_quiver_best = _read_bool(field, fire_quiver_best);
+ }
else if (key == "assign_item_slot")
{
if (field == "forward")
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index e2dbb09aa8..162adce4b1 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -1359,11 +1359,13 @@ int get_current_fire_item()
if (fire_order.size() == 0)
return ENDOFPACK;
- const int q = you.quiver[get_quiver_type()];
- for (unsigned i = 0; i < fire_order.size(); i++)
- if (q == fire_order[i])
- return q;
-
+ if (! Options.fire_quiver_best)
+ {
+ const int q = you.quiver[get_quiver_type()];
+ for (unsigned i = 0; i < fire_order.size(); i++)
+ if (q == fire_order[i])
+ return q;
+ }
return fire_order[0];
}