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:
PatR
2020-04-06 06:12:25 -07:00
parent d087746fd7
commit d07595db2c
3 changed files with 21 additions and 6 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 mondata.h $NHDT-Date: 1576626512 2019/12/17 23:48:32 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.39 $ */
/* NetHack 3.6 mondata.h $NHDT-Date: 1586178708 2020/04/06 13:11:48 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.43 $ */
/* Copyright (c) 1989 Mike Threepoint */
/* NetHack may be freely redistributed. See license for details. */
@@ -140,7 +140,15 @@
#define strongmonst(ptr) (((ptr)->mflags2 & M2_STRONG) != 0L)
#define can_breathe(ptr) attacktype(ptr, AT_BREA)
#define cantwield(ptr) (nohands(ptr) || verysmall(ptr))
#define could_twoweap(ptr) ((ptr)->mattk[1].aatyp == AT_WEAP)
/* Does this type of monster have multiple weapon attacks? If so,
hero poly'd into this form can use two-weapon combat. It used
to just check mattk[1] and assume mattk[0], which was suitable
for mons[] at the time but somewhat fragile. This is more robust
without going to the extreme of checking all six slots. */
#define could_twoweap(ptr) \
(( ((ptr)->mattk[0].aatyp == AT_WEAP) \
+ ((ptr)->mattk[1].aatyp == AT_WEAP) \
+ ((ptr)->mattk[2].aatyp == AT_WEAP) ) > 1)
#define cantweararm(ptr) (breakarm(ptr) || sliparm(ptr))
#define throws_rocks(ptr) (((ptr)->mflags2 & M2_ROCKTHROW) != 0L)
#define type_is_pname(ptr) (((ptr)->mflags2 & M2_PNAME) != 0L)