implement #H4305 - Quivering wielded weapon

This ended up being more elaborate than I anticipated.  'Q' will
now accept the wielded weapon as a choice of item to quiver.  If
that item is a stack of more than one, it will offer to split N-1
into the quiver and leave 1 wielded.  If the offer is declined, or
if there is already just 1, it will require confirmation to move the
item from the weapon slot to the quiver slot.  The alternate weapon
is handled similarly, with different phrasing when in twoweapon
combat mode.

Just to be crystal clear:  a single object cannot be in more than
one weapon, alt-weapon, or quiver slot at the same time.  'Q's old
behavior of rejecting the wielded weapon was to avoid accidentally
becoming empty-handed, not anything to do with multiple worn/wield
slots.

'Q' will also accept a count when picking an inventory item, then
put 'count'-many into the quiver, leaving N-count in original stack.
Except when the chosen item is already in the quiver; it that case,
it undoes the stack split and leaves things as they were.  (That
restriction may not have been necessary but I'm not planning to
revisit it....)
This commit is contained in:
PatR
2016-04-29 15:10:56 -07:00
parent ff6e62b361
commit 2fe9170ee4
4 changed files with 165 additions and 50 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 extern.h $NHDT-Date: 1461437800 2016/04/23 18:56:40 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.557 $ */
/* NetHack 3.6 extern.h $NHDT-Date: 1461967848 2016/04/29 22:10:48 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.558 $ */
/* Copyright (c) Steve Creps, 1988. */
/* NetHack may be freely redistributed. See license for details. */
@@ -922,6 +922,7 @@ E boolean FDECL(obj_here, (struct obj *, int, int));
E boolean NDECL(wearing_armor);
E boolean FDECL(is_worn, (struct obj *));
E struct obj *FDECL(g_at, (int, int));
E boolean FDECL(splittable, (struct obj *));
E struct obj *FDECL(getobj, (const char *, const char *));
E int FDECL(ggetobj, (const char *, int (*)(OBJ_P), int,
BOOLEAN_P, unsigned *));