dual-wielding tweaks
Reject arrows and darts as candidates for wielding two weapons at once. Make the check for being able to two-weapon when polymorphed be more robust. Instead of just testing whether the monster form's second atttack is a weapon attack and then assuming that the first one is too, test the first three to validate that at least two of those are AT_WEAP. The existing code works but seemed fragile.
This commit is contained in:
12
src/wield.c
12
src/wield.c
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 wield.c $NHDT-Date: 1578190903 2020/01/05 02:21:43 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.72 $ */
|
||||
/* NetHack 3.6 wield.c $NHDT-Date: 1586178709 2020/04/06 13:11:49 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.75 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Robert Patrick Rankin, 2009. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -662,9 +662,15 @@ can_twoweapon()
|
||||
{
|
||||
struct obj *otmp;
|
||||
|
||||
/* to dual-wield, must be a weapon-tool or a weapon other than a bow */
|
||||
/* to dual-wield, obj must be a weapon or a weapon-tool, and not
|
||||
a bow or arrow or missile (dart, shuriken, boomerang), matching
|
||||
the sorts of weapons which yield "you begin bashing" when used
|
||||
for melee; we don't bother including polearms here because
|
||||
they'll be rejected as two-weapon because they're two-handed */
|
||||
#define TWOWEAPOK(obj) \
|
||||
(((obj)->oclass == WEAPON_CLASS) ? !is_launcher(obj) : is_weptool(obj))
|
||||
(((obj)->oclass == WEAPON_CLASS) \
|
||||
? !(is_launcher(obj) ||is_ammo(obj) || is_missile(obj)) \
|
||||
: is_weptool(obj))
|
||||
|
||||
if (!could_twoweap(g.youmonst.data)) {
|
||||
if (Upolyd)
|
||||
|
||||
Reference in New Issue
Block a user