summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/docs/crawl_manual.txt7
-rw-r--r--crawl-ref/source/command.cc4
-rw-r--r--crawl-ref/source/invent.cc10
-rw-r--r--crawl-ref/source/quiver.cc34
-rw-r--r--crawl-ref/source/quiver.h1
5 files changed, 41 insertions, 15 deletions
diff --git a/crawl-ref/docs/crawl_manual.txt b/crawl-ref/docs/crawl_manual.txt
index c444ae9082..b9a2ca99db 100644
--- a/crawl-ref/docs/crawl_manual.txt
+++ b/crawl-ref/docs/crawl_manual.txt
@@ -703,8 +703,8 @@ spears, daggers, or hand axes. If you manually select a piece of ammo
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. Note that this only applies if you
+Use the '(' or 'Q' command if you want to change your quiver without
+firing.
The interface for shooting or throwing things is also used for zapping
wands and casting certain spells, and is described in detail in
@@ -2311,6 +2311,7 @@ Item interaction (inventory):
monster will be automatically target. Pressing
f again shoots.
( Cycle quiver to next suitable missile.
+ Q Quiver item from a menu.
q Quaff a potion.
e Eat food (tries floor first, inventory next).
In the eating prompt, e is synonymous to y.
@@ -2361,6 +2362,8 @@ Other game-playing commands:
Ctrl-T Toggle your allies' pickup behaviour between three
settings: don't pick up anything, only pick up
items dropped by allies, pick up anything.
+ This toggle only works for some kind of characters
+ who can gain permanent, intelligent allies.
` Re-do previous command
0 Repeat next command a given number of times
diff --git a/crawl-ref/source/command.cc b/crawl-ref/source/command.cc
index 473723e88c..24a11729ec 100644
--- a/crawl-ref/source/command.cc
+++ b/crawl-ref/source/command.cc
@@ -1740,7 +1740,7 @@ static void _add_formatted_keyhelp(column_composer &cols)
"\n"
"<h>Item types (and common commands)\n"
"<cyan>)</cyan> : hand weapons (<w>w</w>ield)\n"
- "<brown>(</brown> : missiles (<w>f</w>ire, <w>(</w> to cycle ammo)\n"
+ "<brown>(</brown> : missiles (<w>Q</w>uiver, <w>f</w>ire, <w>(</w> to cycle ammo)\n"
"<cyan>[</cyan> : armour (<w>W</w>ear and <w>T</w>ake off)\n"
"<brown>%</brown> : corpses and food (<w>c</w>hop up and <w>e</w>at)\n"
"<w>?</w> : scrolls (<w>r</w>ead)\n"
@@ -1868,7 +1868,7 @@ static void _add_formatted_tutorial_help(column_composer &cols)
text <<
"<h>Item types (and common commands)\n"
"<cyan>)</cyan> : hand weapons (<w>w</w>ield)\n"
- "<brown>(</brown> : missiles (<w>f</w>ire, <w>(</w> to cycle ammo)\n"
+ "<brown>(</brown> : missiles (<w>Q</w>uiver, <w>f</w>ire, <w>(</w> to cycle ammo)\n"
"<cyan>[</cyan> : armour (<w>W</w>ear and <w>T</w>ake off)\n"
"<brown>%</brown> : corpses and food (<w>c</w>hop up and <w>e</w>at)\n"
"<w>?</w> : scrolls (<w>r</w>ead)\n"
diff --git a/crawl-ref/source/invent.cc b/crawl-ref/source/invent.cc
index e2955ca7db..fb0d215369 100644
--- a/crawl-ref/source/invent.cc
+++ b/crawl-ref/source/invent.cc
@@ -178,9 +178,9 @@ std::string InvEntry::get_text() const
std::ostringstream tstr;
tstr << ' ' << static_cast<char>(hotkeys[0]) << ' ';
- if ( !selected_qty )
+ if (!selected_qty)
tstr << '-';
- else if ( selected_qty < quantity )
+ else if (selected_qty < quantity)
tstr << '#';
else
tstr << '+';
@@ -192,7 +192,7 @@ std::string InvEntry::get_text() const
tstr << " (" << value << " gold)";
}
- if ( Options.show_inventory_weights )
+ if (Options.show_inventory_weights)
{
const int mass = item_mass(*item) * item->quantity;
tstr << std::setw(get_number_of_cols() - tstr.str().length() - 1)
@@ -694,8 +694,10 @@ unsigned char InvMenu::getkey() const
{
unsigned char mkey = lastch;
if (!isalnum(mkey) && mkey != '$' && mkey != '-' && mkey != '?'
- && mkey != '*' && mkey != ESCAPE)
+ && mkey != '*' && mkey != ESCAPE)
+ {
mkey = ' ';
+ }
return (mkey);
}
diff --git a/crawl-ref/source/quiver.cc b/crawl-ref/source/quiver.cc
index e22f5097c3..a125f15d6f 100644
--- a/crawl-ref/source/quiver.cc
+++ b/crawl-ref/source/quiver.cc
@@ -127,15 +127,23 @@ void player_quiver::set_quiver(const item_def &item, ammo_t ammo_type)
{
m_last_used_of_type[ammo_type] = item;
m_last_used_of_type[ammo_type].quantity = 1;
- m_last_used_type = ammo_type;
+ m_last_used_type = ammo_type;
+ you.redraw_quiver = true;
+}
+
+void player_quiver::empty_quiver(ammo_t ammo_type)
+{
+ m_last_used_of_type[ammo_type] = item_def();
+ m_last_used_of_type[ammo_type].quantity = 0;
+ m_last_used_type = ammo_type;
you.redraw_quiver = true;
}
void choose_item_for_quiver()
{
- int slot = prompt_invent_item( "Quiver which item? (* to show all)",
+ int slot = prompt_invent_item( "Quiver which item? (- for none, * to show all)",
MT_INVLIST,
- OSEL_THROWABLE, true, true, true, 0, NULL,
+ OSEL_THROWABLE, true, true, true, '-', NULL,
OPER_FIRE );
if (slot == PROMPT_ABORT)
@@ -146,13 +154,25 @@ void choose_item_for_quiver()
else if (slot == PROMPT_NOTHING)
return;
- const item_def item = you.inv[slot];
-
- if (!is_valid_item(item))
+ if (slot == PROMPT_GOT_SPECIAL) // '-' or empty quiver
+ {
+ ammo_t t = _get_weapon_ammo_type(you.weapon());
+ you.m_quiver->empty_quiver(t);
+
+ mprf("Emptying quiver for %s.",
+ t == AMMO_THROW ? "throwing" :
+ t == AMMO_BLOWGUN ? "blowguns" :
+ t == AMMO_SLING ? "slings" :
+ t == AMMO_BOW ? "bows" :
+ t == AMMO_CROSSBOW ? "crossbows"
+ : "hand crossbows");
return;
+ }
- ammo_t t = AMMO_THROW;
+ const item_def item = you.inv[slot];
+ ASSERT(is_valid_item(item));
+ ammo_t t = AMMO_THROW;
const item_def *weapon = you.weapon();
if (weapon && item.launched_by(*weapon))
t = _get_weapon_ammo_type(weapon);
diff --git a/crawl-ref/source/quiver.h b/crawl-ref/source/quiver.h
index 5014cc1a8f..16f9ef5470 100644
--- a/crawl-ref/source/quiver.h
+++ b/crawl-ref/source/quiver.h
@@ -39,6 +39,7 @@ class player_quiver
// Callbacks from engine
void set_quiver(const item_def &item, ammo_t ammo_type);
+ void empty_quiver(ammo_t ammo_type);
void on_item_fired(const item_def &item, bool explicitly_chosen = false);
void on_item_fired_fi(const item_def &item);
void on_inv_quantity_changed(int slot, int amt);