Merge branch 'autounlock' of https://github.com/copperwater/NetHack into copperwater-autounlock-3.7

github pull request #228 commentary follows:

This adds a boolean option, autounlock, defaulting to true. When this is
set to TRUE, messages stating that some door or container is locked are
automatically followed by a prompt asking if you would like to unlock
it, if you are carrying an unlocking tool (key, lock pick, or credit
card).

Architecturally, this extends the pick_lock function to take three
additional arguments (door coordinates or a box on the ground you are
autounlocking).

Because this adds a new field to struct flag, this is not a
save-compatible change. I have not adjusted EDITLEVEL or
VERSION_COMPATIBILITY, though.

The code that selects an unlocking tool will always look first for a
skeleton key, then a lock pick, then a credit card. Since curses, rust,
and other attributes don't really have an effect on the viability of the
unlocking device, it didn't seem to warrant making a more complex
function for that.

closes #228
This commit is contained in:
nhmall
2019-10-02 13:47:33 -04:00
7 changed files with 58 additions and 17 deletions

View File

@@ -1101,7 +1101,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 int FDECL(pick_lock, (struct obj *));
E int FDECL(pick_lock, (struct obj *, xchar, xchar, struct obj *));
E int NDECL(doforce);
E boolean FDECL(boxlock, (struct obj *, struct obj *));
E boolean FDECL(doorlock, (struct obj *, int, int));

View File

@@ -20,6 +20,7 @@ struct flag {
boolean autodig; /* MRKR: Automatically dig */
boolean autoquiver; /* Automatically fill quiver */
boolean autoopen; /* open doors by walking into them */
boolean autounlock; /* automatically apply unlocking tools */
boolean beginner;
boolean biff; /* enable checking for mail */
boolean bones; /* allow saving/loading bones */