fix #H3820 - vault guard's "I repeat" message

Reported seven and a half years ago:  if you are in a vault but not
carrying any gold and the guard arrives, you're told "Follow me."
Then if you pick up gold while the guard is still in the wall breach
rather than out in the corridor, you would be told "I repeat, drop
that gold and follow me!"  "Repeat" refers to the follow part but
sounds as if it refers to the drop-gold part which isn't actually
being repeated.  Keep track of whether the guard has issued a drop
gold demand and use that to vary the wording of subsequent "I repeat"
message.

Modifies monst->mextra->egd so save and bones files are invalidated.
This commit is contained in:
PatR
2022-09-09 11:45:30 -07:00
parent a733004912
commit 1df88e4c65
3 changed files with 18 additions and 8 deletions

View File

@@ -80,7 +80,8 @@ struct egd {
coordxy gdx, gdy; /* goal of guard's walk */
coordxy ogx, ogy; /* guard's last position */
d_level gdlevel; /* level (& dungeon) guard was created in */
xint16 warncnt; /* number of warnings to follow */
xint8 warncnt; /* number of warnings to follow */
xint8 dropgoldcnt; /* number of demands to drop gold */
Bitfield(gddone, 1); /* true iff guard has released player */
Bitfield(witness, 2); /* the guard saw you do something */
Bitfield(unused, 5);

View File

@@ -17,7 +17,7 @@
* Incrementing EDITLEVEL can be used to force invalidation of old bones
* and save files.
*/
#define EDITLEVEL 63
#define EDITLEVEL 64
/*
* Development status possibilities.

View File

@@ -553,6 +553,7 @@ invault(void)
"Most likely all your gold was stolen from this vault.");
verbalize("Please drop that gold and follow me.");
}
EGD(guard)->dropgoldcnt++;
}
EGD(guard)->gdx = gx;
EGD(guard)->gdy = gy;
@@ -908,12 +909,20 @@ gd_move(struct monst *grd)
u_carry_gold = (umoney > 0L || hidden_gold(TRUE) > 0L);
if (egrd->fcend == 1) {
if (u_in_vault && (u_carry_gold || um_dist(grd->mx, grd->my, 1))) {
if (egrd->warncnt == 3 && !Deaf)
verbalize("I repeat, %sfollow me!",
u_carry_gold
? (!umoney ? "drop that hidden gold and "
: "drop that gold and ")
: "");
if (egrd->warncnt == 3 && !Deaf) {
char buf[BUFSZ];
Sprintf(buf, "%sfollow me!",
u_carry_gold ? (!umoney ? "drop that hidden gold and "
: "drop that gold and ")
: "");
if (egrd->dropgoldcnt || !u_carry_gold)
verbalize("I repeat, %s", buf);
else
verbalize("%s", upstart(buf));
if (u_carry_gold)
egrd->dropgoldcnt++;
}
if (egrd->warncnt == 7) {
m = grd->mx;
n = grd->my;