twoweapon tweaks
Don't allow dual-wielding if either wielded or alternate weapon (or both) is a launcher: bow, crossbow, or sling. (I thought that this had been addressed ages ago.) Refine the "can't twoweapon" feedback. The message for having either or both hands empty is the same, but sentence construction is different. The not-a-weapon feedback is slightly different, now mentioning whether it's the wielded or alternate weapon which isn't allowed. The case where neither are acceptable still just reports uwep; mentioning both it and uswapwep would be too verbose. Make more things be described as "(wielded)" instead of "(weapon in hand)". It was just stacks with quantity more than 1. That's now joined by ammo and missiles (any stack size, but in reality just 1 since greater was already being caught here) and any quantity of non-weapon, non-weptool. It's overridden if dual-wielding so that right/left stay matched. When dual-wielding, list primary as "(wielded in right hand)" and secondary as "(wielded in left hand)" instead of "(weapon in hand)" and "(wielded in other hand)". The vaguer wording was better for bows since they're held in the off hand but now that they can't be dual-wielded that doesn't matter. (Single-wielding a bow is still "(weapon in hand)".) When not dual-wielding, the item in the alternate weapon slot is still described as "(alternate weapon; not wielded)" even if it's not actually a weapon. I couldn't think of better phrasing.
This commit is contained in:
41
src/wield.c
41
src/wield.c
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 wield.c $NHDT-Date: 1577186790 2019/12/24 11:26:30 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.69 $ */
|
||||
/* NetHack 3.6 wield.c $NHDT-Date: 1578190903 2020/01/05 02:21:43 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.72 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Robert Patrick Rankin, 2009. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -659,32 +659,41 @@ can_twoweapon()
|
||||
{
|
||||
struct obj *otmp;
|
||||
|
||||
#define NOT_WEAPON(obj) (!is_weptool(obj) && obj->oclass != WEAPON_CLASS)
|
||||
/* to dual-wield, must be a weapon-tool or a weapon other than a bow */
|
||||
#define TWOWEAPOK(obj) \
|
||||
(((obj)->oclass == WEAPON_CLASS) ? !is_launcher(obj) : is_weptool(obj))
|
||||
|
||||
if (!could_twoweap(g.youmonst.data)) {
|
||||
if (Upolyd)
|
||||
You_cant("use two weapons in your current form.");
|
||||
else
|
||||
pline("%s aren't able to use two weapons at once.",
|
||||
makeplural((flags.female && g.urole.name.f) ? g.urole.name.f
|
||||
: g.urole.name.m));
|
||||
} else if (!uwep || !uswapwep)
|
||||
Your("%s%s%s empty.", uwep ? "left " : uswapwep ? "right " : "",
|
||||
body_part(HAND), (!uwep && !uswapwep) ? "s are" : " is");
|
||||
else if (NOT_WEAPON(uwep) || NOT_WEAPON(uswapwep)) {
|
||||
otmp = NOT_WEAPON(uwep) ? uwep : uswapwep;
|
||||
pline("%s %s.", Yname2(otmp),
|
||||
is_plural(otmp) ? "aren't suitable weapons"
|
||||
: "isn't a suitable weapon");
|
||||
makeplural((flags.female && g.urole.name.f)
|
||||
? g.urole.name.f : g.urole.name.m));
|
||||
} else if (!uwep || !uswapwep) {
|
||||
const char *hand_s = body_part(HAND);
|
||||
|
||||
if (!uwep && !uswapwep)
|
||||
hand_s = makeplural(hand_s);
|
||||
/* "your hands are empty" or "your {left|right} hand is empty" */
|
||||
Your("%s%s %s empty.", uwep ? "left " : uswapwep ? "right " : "",
|
||||
hand_s, vtense(hand_s, "are"));
|
||||
} else if (!TWOWEAPOK(uwep) || !TWOWEAPOK(uswapwep)) {
|
||||
otmp = !TWOWEAPOK(uwep) ? uwep : uswapwep;
|
||||
pline("%s %s suitable %s weapon%s.", Yname2(otmp),
|
||||
is_plural(otmp) ? "aren't" : "isn't a",
|
||||
(otmp == uwep) ? "primary" : "secondary",
|
||||
plur(otmp->quan));
|
||||
} else if (bimanual(uwep) || bimanual(uswapwep)) {
|
||||
otmp = bimanual(uwep) ? uwep : uswapwep;
|
||||
pline("%s isn't one-handed.", Yname2(otmp));
|
||||
} else if (uarms)
|
||||
} else if (uarms) {
|
||||
You_cant("use two weapons while wearing a shield.");
|
||||
else if (uswapwep->oartifact)
|
||||
} else if (uswapwep->oartifact) {
|
||||
pline("%s being held second to another weapon!",
|
||||
Yobjnam2(uswapwep, "resist"));
|
||||
else if (uswapwep->otyp == CORPSE && cant_wield_corpse(uswapwep)) {
|
||||
/* [Note: NOT_WEAPON() check prevents ever getting here...] */
|
||||
} else if (uswapwep->otyp == CORPSE && cant_wield_corpse(uswapwep)) {
|
||||
/* [Note: !TWOWEAPOK() check prevents ever getting here...] */
|
||||
; /* must be life-saved to reach here; return FALSE */
|
||||
} else if (Glib || uswapwep->cursed) {
|
||||
if (!Glib)
|
||||
|
||||
Reference in New Issue
Block a user