Re: Hey, stop picking that lock!
- From: Simon Tatham <anakin@xxxxxxxxx>
- Date: 30 May 2006 15:32:19 +0100 (BST)
rpresser <rpresser@xxxxxxxxx> wrote:
A quick source dive and wizmode test seems to Confirm Roy's view that
it is only lock picks that anger guards. Evidence to the contrary, in
the form of a detailed explanation of the source or else a ttyrec
showing a guard warning you for using a key, is eagerly awaited.
OK. In vanilla Nethack 3.4.3:
- watch_on_duty() in monmove.c says that the watch will notice if
the function picking_lock() returns true.
- picking_lock() in lock.c tests whether `occupation' is equal to
`picklock'.
- `occupation' is set to `picklock' by the function pick_lock(),
also in lock.c.
- pick_lock() is called by doapply() in apply.c, and can be
triggered by any of the three object types LOCK_PICK, CREDIT_CARD
or SKELETON_KEY.
That seems to me to conclusively demonstrate that use of a skeleton
key _does_ set the flag which triggers potential hassle from the
Watch. So why does it normally not come up? Well,
- the primary if statement in watch_on_duty() also contains the
term !rn2(3), i.e. a watchman will only notice you trying to pick
a lock with probability 1/3 on any given turn.
- picklock(), the function to which the variable `occupation' is
pointed above and which is therefore called on every turn when
you're attempting to pick the lock, has the semantics that on
every turn you either succeed or fail with a probability
dependent on your stats and the type of item. Keys give you a
(70+Dex)% chance of success, so you will almost certainly succeed
in unlocking a door on the very first try.
- pick_lock(), the function which causes you to _start_ picking a
lock, unsets flags.move(), meaning that starting to pick does not
consume a turn. Hence monsters do not get to move in between you
starting to pick the lock and your first attempt. (I think.)
Therefore, with a probability of around 80-90% (depending on Dex),
attempting to unlock a door with a key will succeed on the first
turn of trying, _without_ the watch getting a move while you're
attempting it. On rare occasions the unlock attempt will fail on the
first turn, in which case the watch get a chance to shout at you,
but even then they only have a 1/3 chance of spotting you per turn,
and it's overwhelmingly likely that they won't get another try,
because with another 80-90% probability your second unlock attempt
will succeed.
--
Simon Tatham What do we want? ROT13!
<anakin@xxxxxxxxx> When do we want it? ABJ!
.
- Follow-Ups:
- Re: Hey, stop picking that lock!
- From: Jakob Creutzig
- Re: Hey, stop picking that lock!
- From: rpresser
- Re: Hey, stop picking that lock!
- References:
- Hey, stop picking that lock!
- From: Janis Papanagnou
- Re: Hey, stop picking that lock!
- From: Janis Papanagnou
- Re: Hey, stop picking that lock!
- From: Roy L . Fuchs
- Re: Hey, stop picking that lock!
- From: rpresser
- Hey, stop picking that lock!
- Prev by Date: Re: PATCH: Gaseous attack protection
- Next by Date: Re: YANI: Safety Mirrors
- Previous by thread: Re: Hey, stop picking that lock!
- Next by thread: Re: Hey, stop picking that lock!
- Index(es):
Relevant Pages
|