autounlock:untrap

Implement 'untrap' as an 'autounlock' action.  Quite a bit more work
than anticipated.  The new documentation is rather clumsy; too many
if-this and if-not-that clauses have intruded.

I'll be astonished if all the return values are correct....

[A couple of places were checking for (rx != 0 && ry != 0) to decide
whether they were performating an autounlock action at <rx,ry> but
that erroneously excludes the top line of the map if the current
level extends that far.  Just check rx for zero/non-zero.]
This commit is contained in:
PatR
2022-05-06 14:44:57 -07:00
parent a31dd26d8a
commit 02207b967a
10 changed files with 268 additions and 126 deletions

View File

@@ -148,12 +148,18 @@ Compound options are written as option_name:option_value.
Compound options which can be set during the game are:
autounlock when attempting to open a door or loot a [Apply-Key]
container that is locked, specifies an action to take:
can be None, or one or more of Apply-Key + Kick + Force;
autounlock when attempting to open a locked door or loot [Apply-Key]
a locked container, specifies an action to take: can be
None, or one or more of Untrap + Apply-Key + Kick + Force;
if Untrap is included, it will be handled first; the
others apply if you answer "no" to "check for traps?";
for "yes", it won't necessary find anything even when a
trap happens to be present and will use up the rest of
the current move regardless of whether it finds anything;
Kick is only useful for doors and Force is only useful for
containers; either will only be attempted if Apply-Key is
omitted or you aren't carrying any unlocking tool
containers; either will only be attempted if Untrap is
omitted or skipped and Apply-Key is omitted or you aren't
carrying an unlocking tool or you decline to use one
boulder override the default boulder symbol [`]
disclose the types of information you want [ni na nv ng nc no]
offered at the end of the game