B02001 - trees and monster

<Someone> noticed that the change to require axes for trees (and allow them for
doors) did not extend to monsters.  Now it does.
- added 2 new weapon check flags to handle the new cases
- added some detailed digging flags to mfndpos, based on ALLOW_DIG, and
  moved some common logic regarding that flag into mfndpos
- made the ARMS check consistent for 2-handed weapons
I also noticed that simply carrying a pick was enough to allow a monster to
dig a door; wielding wasn't required.  This is fixed as well.
This commit is contained in:
cohrs
2002-08-11 17:32:47 +00:00
parent 02c9ce9214
commit b4b5a0fe52
6 changed files with 81 additions and 33 deletions

View File

@@ -599,7 +599,23 @@ register struct monst *mon;
case NEED_PICK_AXE:
obj = m_carrying(mon, PICK_AXE);
/* KMH -- allow other picks */
if (!obj) obj = m_carrying(mon, DWARVISH_MATTOCK);
if (!obj && !which_armor(mon, W_ARMS))
obj = m_carrying(mon, DWARVISH_MATTOCK);
break;
case NEED_AXE:
/* currently, only 2 types of axe */
obj = m_carrying(mon, BATTLE_AXE);
if (!obj || which_armor(mon, W_ARMS))
obj = m_carrying(mon, AXE);
break;
case NEED_PICK_OR_AXE:
/* prefer pick for fewer switches on most levels */
obj = m_carrying(mon, DWARVISH_MATTOCK);
if (!obj) obj = m_carrying(mon, BATTLE_AXE);
if (!obj || which_armor(mon, W_ARMS)) {
obj = m_carrying(mon, PICK_AXE);
if (!obj) obj = m_carrying(mon, AXE);
}
break;
default: impossible("weapon_check %d for %s?",
mon->weapon_check, mon_nam(mon));