fix #H1378 - vault guard interaction while swallowed
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.
This commit is contained in:
@@ -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 corridor disappears" when vault guard gets killed
|
||||||
avoid inappropriate "the guard calms down" if vault guard's magic corridor
|
avoid inappropriate "the guard calms down" if vault guard's magic corridor
|
||||||
reaches a spot where gold is embedded in the rock
|
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
|
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
|
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
|
identified touchstone can rub on gold like the data.base entry says
|
||||||
|
|||||||
+18
-9
@@ -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. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
|
|
||||||
@@ -163,6 +163,7 @@ invault()
|
|||||||
int dummy; /* hack to avoid schain botch */
|
int dummy; /* hack to avoid schain botch */
|
||||||
#endif
|
#endif
|
||||||
struct monst *guard;
|
struct monst *guard;
|
||||||
|
boolean gsensed;
|
||||||
int trycount, vaultroom = (int)vault_occupied(u.urooms);
|
int trycount, vaultroom = (int)vault_occupied(u.urooms);
|
||||||
|
|
||||||
if(!vaultroom) {
|
if(!vaultroom) {
|
||||||
@@ -265,16 +266,25 @@ fnd:
|
|||||||
EGD(guard)->warncnt = 0;
|
EGD(guard)->warncnt = 0;
|
||||||
|
|
||||||
reset_faint(); /* if fainted - wake up */
|
reset_faint(); /* if fainted - wake up */
|
||||||
if (canspotmon(guard))
|
gsensed = !canspotmon(guard);
|
||||||
|
if (!gsensed)
|
||||||
pline("Suddenly one of the Vault's %s enters!",
|
pline("Suddenly one of the Vault's %s enters!",
|
||||||
makeplural(g_monnam(guard)));
|
makeplural(g_monnam(guard)));
|
||||||
else
|
else
|
||||||
pline("Someone else has entered the Vault.");
|
pline("Someone else has entered the Vault.");
|
||||||
newsym(guard->mx,guard->my);
|
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 || u.uundetected) {
|
||||||
if (youmonst.m_ap_type == M_AP_OBJECT &&
|
if (youmonst.m_ap_type == M_AP_OBJECT &&
|
||||||
youmonst.mappearance != GOLD_PIECE)
|
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. */
|
/* You're mimicking some object or you're hidden. */
|
||||||
pline("Puzzled, %s turns around and leaves.", mhe(guard));
|
pline("Puzzled, %s turns around and leaves.", mhe(guard));
|
||||||
mongone(guard);
|
mongone(guard);
|
||||||
@@ -651,14 +661,13 @@ letknow:
|
|||||||
place_monster(grd, x, y);
|
place_monster(grd, x, y);
|
||||||
newsym(x, y);
|
newsym(x, y);
|
||||||
}
|
}
|
||||||
if(!grd->mpeaceful) return(-1);
|
if (!grd->mpeaceful) return -1;
|
||||||
else {
|
egrd->warncnt = 5;
|
||||||
egrd->warncnt = 5;
|
return 0;
|
||||||
return(0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if(um_dist(grd->mx, grd->my, 1) || egrd->gddone) {
|
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!");
|
verbalize("Move along!");
|
||||||
restfakecorr(grd);
|
restfakecorr(grd);
|
||||||
return(0); /* didn't move */
|
return(0); /* didn't move */
|
||||||
|
|||||||
Reference in New Issue
Block a user