Skip to content

Commit

Permalink
fix #H1378 - vault guard interaction while swallowed
Browse files Browse the repository at this point in the history
     From a bug report, if you're swallowed
while in a vault and the guard arrives, he'll ask your name even though
you're hidden within the engulfer.  This makes him give a message and
then leave, as is already done if you're mimicking an object or unable to
speak.

     This also suppresses his repeated "Move along!" message if you're
swallowed or held since it's silly to keep telling you to move when you
obviously can't.
  • Loading branch information
nethack.rankin committed Sep 1, 2007
1 parent eca287a commit 01f954a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
1 change: 1 addition & 0 deletions doc/fixes34.4
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ pets capable of digging could pass through walls and stone on the Rogue level
avoid inappropriate "the corridor disappears" when vault guard gets killed
avoid inappropriate "the guard calms down" if vault guard's magic corridor
reaches a spot where gold is embedded in the rock
avoid having vault guard ask hero's name when hero is swallowed
adjust message for gas effect from chest trap if hero resists hallucination
cancelling non-shop objects in a shop's entrance would upset the shopkeeper
identified touchstone can rub on gold like the data.base entry says
Expand Down
27 changes: 18 additions & 9 deletions src/vault.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* SCCS Id: @(#)vault.c 3.5 2006/06/11 */
/* SCCS Id: @(#)vault.c 3.5 2007/08/30 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */

Expand Down Expand Up @@ -163,6 +163,7 @@ invault()
int dummy; /* hack to avoid schain botch */
#endif
struct monst *guard;
boolean gsensed;
int trycount, vaultroom = (int)vault_occupied(u.urooms);

if(!vaultroom) {
Expand Down Expand Up @@ -265,16 +266,25 @@ incr_radius: ;
EGD(guard)->warncnt = 0;

reset_faint(); /* if fainted - wake up */
if (canspotmon(guard))
gsensed = !canspotmon(guard);
if (!gsensed)
pline("Suddenly one of the Vault's %s enters!",
makeplural(g_monnam(guard)));
else
pline("Someone else has entered the Vault.");
newsym(guard->mx,guard->my);
if (u.uswallow) {
/* can't interrogate hero, don't interrogate engulfer */
verbalize("What's going on here?");
if (gsensed) pline_The("other presence vanishes.");
mongone(guard);
return;
}
if (youmonst.m_ap_type == M_AP_OBJECT || u.uundetected) {
if (youmonst.m_ap_type == M_AP_OBJECT &&
youmonst.mappearance != GOLD_PIECE)
verbalize("Hey! Who left that %s in here?", mimic_obj_name(&youmonst));
verbalize("Hey! Who left that %s in here?",
mimic_obj_name(&youmonst));
/* You're mimicking some object or you're hidden. */
pline("Puzzled, %s turns around and leaves.", mhe(guard));
mongone(guard);
Expand Down Expand Up @@ -651,14 +661,13 @@ register struct monst *grd;
place_monster(grd, x, y);
newsym(x, y);
}
if(!grd->mpeaceful) return(-1);
else {
egrd->warncnt = 5;
return(0);
}
if (!grd->mpeaceful) return -1;
egrd->warncnt = 5;
return 0;
}
if(um_dist(grd->mx, grd->my, 1) || egrd->gddone) {
if(!egrd->gddone && !rn2(10) && !Deaf)
if (!egrd->gddone && !rn2(10) && !Deaf && !u.uswallow &&
!(u.ustuck && !sticks(youmonst.data)))
verbalize("Move along!");
restfakecorr(grd);
return(0); /* didn't move */
Expand Down

0 comments on commit 01f954a

Please sign in to comment.