From 8bcec066454c13c40ccd824343fde5404d159ec4 Mon Sep 17 00:00:00 2001 From: "nethack.rankin" Date: Fri, 19 Apr 2002 06:03:01 +0000 Subject: [PATCH] vault guard behavior From the newsgroup: vault guards would ask your name--and you'd be able to respond--even when you were unconscious (for any reason besides fainting from lack of food) or paralyzed. (The code already made the guard be forgiving when you failed to promptly follow him out due to that situation, but it would repeatedly say "move along!" even though you were unable to move.) --- doc/fixes34.1 | 1 + src/vault.c | 17 ++++++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/doc/fixes34.1 b/doc/fixes34.1 index ae3bf2e25..466eb9183 100644 --- a/doc/fixes34.1 +++ b/doc/fixes34.1 @@ -86,6 +86,7 @@ scroll of enchant weapon will become discovered when read in some cases don't crash when using lookat on a boulder an BOULDER sym is unique attaching a single candle to fill candelabrum's last slot gave message with poor grammar: "The candelabrum now has seven candle attached." +vault guards won't ask who you are if you're unconscious or paralyzed Platform- and/or Interface-Specific Fixes diff --git a/src/vault.c b/src/vault.c index 51fca6727..0f380aa56 100644 --- a/src/vault.c +++ b/src/vault.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)vault.c 3.4 2001/05/24 */ +/* SCCS Id: @(#)vault.c 3.4 2002/04/18 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -133,7 +133,7 @@ invault() int dummy; /* hack to avoid schain botch */ #endif struct monst *guard; - int vaultroom = (int)vault_occupied(u.urooms); + int trycount, vaultroom = (int)vault_occupied(u.urooms); if(!vaultroom) { u.uinvault = 0; @@ -250,15 +250,22 @@ fnd: mongone(guard); return; } - if (Strangled || is_silent(youmonst.data)) { + if (Strangled || is_silent(youmonst.data) || multi < 0) { + /* [we ought to record whether this this message has already + been given in order to vary it upon repeat visits, but + discarding the monster and its egd data renders that hard] */ verbalize("I'll be back when you're ready to speak to me!"); mongone(guard); return; } + stop_occupation(); /* if occupied, stop it *now* */ + if (multi > 0) { nomul(0); unmul((char *)0); } + trycount = 5; do { - getlin("\"Hello stranger, who are you?\" -",buf); - } while (!letter(buf[0])); + getlin("\"Hello stranger, who are you?\" -", buf); + (void) mungspaces(buf); + } while (!letter(buf[0]) && --trycount > 0); if (u.ualign.type == A_LAWFUL && /* ignore trailing text, in case player includes character's rank */