fix #K125 - autounlock vs touching artifacts

Apply makes a touch_artifact check on the tool being applied, but
autounlock would pick an unlocking tool to use without doing that.
Noticed while fixing that:  autounlock took no time.

Since picking an artifact unlocking tool might now blast the hero,
change the tool selection.  First choice: any key except another
role's quest artifact; second: any lock-pick except another role's
quest artifact; third: any credit card except another role's quest
artifact; fourth, fifth, sixth: other roles' quest artifact key,
lock-pick, or credit card.  The fifth category (artifact lock-picks)
is empty.  Rogues will pick non-cursed Master Key over any other
key (special case for first choice).  Tourists will pick a key or
a lock-pick over their PYEC (first and second choices over third).
This commit is contained in:
PatR
2020-01-05 23:54:11 -08:00
parent 3a8990b8a0
commit bfa0f072f7
4 changed files with 88 additions and 19 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 extern.h $NHDT-Date: 1575830178 2019/12/08 18:36:18 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.767 $ */
/* NetHack 3.6 extern.h $NHDT-Date: 1578297243 2020/01/06 07:54:03 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.781 $ */
/* Copyright (c) Steve Creps, 1988. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1117,6 +1117,7 @@ E boolean FDECL(picking_at, (int, int));
E void FDECL(breakchestlock, (struct obj *, BOOLEAN_P));
E void NDECL(reset_pick);
E void FDECL(maybe_reset_pick, (struct obj *));
E struct obj *FDECL(autokey, (BOOLEAN_P));
E int FDECL(pick_lock, (struct obj *, XCHAR_P, XCHAR_P, struct obj *));
E int NDECL(doforce);
E boolean FDECL(boxlock, (struct obj *, struct obj *));