eating gold in front of the vault guard (trunk only)
<email deleted> wrote: > Eating gold in a vault (or polymorphing a pile of gold into 1 gold piece) > doesn't anger the guard. This addresses the eating part of that report, but the hero has to get caught doing it.
This commit is contained in:
@@ -130,6 +130,7 @@ doors break instead of absorbing the blast of a broken wand of striking
|
|||||||
avoid "Something's in the way" message with unidentified wand of locking
|
avoid "Something's in the way" message with unidentified wand of locking
|
||||||
better handling for Fort Ludios and endgame in wizard mode's `^V ?' menu
|
better handling for Fort Ludios and endgame in wizard mode's `^V ?' menu
|
||||||
no free lunch for gelatinous cubes eating scrolls of mail
|
no free lunch for gelatinous cubes eating scrolls of mail
|
||||||
|
eating gold in front of the vault guard will make the guard angry
|
||||||
|
|
||||||
|
|
||||||
Platform- and/or Interface-Specific Fixes
|
Platform- and/or Interface-Specific Fixes
|
||||||
|
|||||||
@@ -2236,6 +2236,7 @@ E int FDECL(gd_move, (struct monst *));
|
|||||||
E void NDECL(paygd);
|
E void NDECL(paygd);
|
||||||
E long NDECL(hidden_gold);
|
E long NDECL(hidden_gold);
|
||||||
E boolean NDECL(gd_sound);
|
E boolean NDECL(gd_sound);
|
||||||
|
E void FDECL(vault_gd_watching, (unsigned int));
|
||||||
|
|
||||||
/* ### version.c ### */
|
/* ### version.c ### */
|
||||||
|
|
||||||
|
|||||||
@@ -62,6 +62,8 @@
|
|||||||
** formerly vault.h -- vault guard extension
|
** formerly vault.h -- vault guard extension
|
||||||
*/
|
*/
|
||||||
#define FCSIZ (ROWNO+COLNO)
|
#define FCSIZ (ROWNO+COLNO)
|
||||||
|
#define GD_EATGOLD 0x01
|
||||||
|
#define GD_DESTROYGOLD 0x02
|
||||||
|
|
||||||
struct fakecorridor {
|
struct fakecorridor {
|
||||||
xchar fx, fy, ftyp;
|
xchar fx, fy, ftyp;
|
||||||
@@ -75,7 +77,8 @@ struct egd {
|
|||||||
d_level gdlevel; /* level (& dungeon) guard was created in */
|
d_level gdlevel; /* level (& dungeon) guard was created in */
|
||||||
xchar warncnt; /* number of warnings to follow */
|
xchar warncnt; /* number of warnings to follow */
|
||||||
Bitfield(gddone,1); /* true iff guard has released player */
|
Bitfield(gddone,1); /* true iff guard has released player */
|
||||||
Bitfield(unused,7);
|
Bitfield(witness,2); /* the guard saw you do something */
|
||||||
|
Bitfield(unused,5);
|
||||||
struct fakecorridor fakecorr[FCSIZ];
|
struct fakecorridor fakecorr[FCSIZ];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1900,6 +1900,7 @@ eatspecial() /* called after eating non-food */
|
|||||||
#endif
|
#endif
|
||||||
else
|
else
|
||||||
useupf(otmp, otmp->quan);
|
useupf(otmp, otmp->quan);
|
||||||
|
vault_gd_watching(GD_EATGOLD);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#ifdef MAIL
|
#ifdef MAIL
|
||||||
|
|||||||
19
src/vault.c
19
src/vault.c
@@ -510,6 +510,14 @@ register struct monst *grd;
|
|||||||
if(abs(egrd->ogx - grd->mx) > 1 ||
|
if(abs(egrd->ogx - grd->mx) > 1 ||
|
||||||
abs(egrd->ogy - grd->my) > 1)
|
abs(egrd->ogy - grd->my) > 1)
|
||||||
return(-1); /* teleported guard - treat as monster */
|
return(-1); /* teleported guard - treat as monster */
|
||||||
|
|
||||||
|
if(egrd->witness) {
|
||||||
|
verbalize("How dare you %s that gold, scoundrel!",
|
||||||
|
(egrd->witness & GD_EATGOLD) ? "consume" : "destroy");
|
||||||
|
egrd->witness = 0;
|
||||||
|
grd->mpeaceful = 0;
|
||||||
|
return(-1);
|
||||||
|
}
|
||||||
if(egrd->fcend == 1) {
|
if(egrd->fcend == 1) {
|
||||||
if(u_in_vault &&
|
if(u_in_vault &&
|
||||||
(u_carry_gold || um_dist(grd->mx, grd->my, 1))) {
|
(u_carry_gold || um_dist(grd->mx, grd->my, 1))) {
|
||||||
@@ -864,4 +872,15 @@ gd_sound() /* prevent "You hear footsteps.." when inappropriate */
|
|||||||
else return((boolean)(grd == (struct monst *)0));
|
else return((boolean)(grd == (struct monst *)0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
vault_gd_watching(activity)
|
||||||
|
unsigned int activity;
|
||||||
|
{
|
||||||
|
struct monst *guard = findgd();
|
||||||
|
if (guard && guard->mcansee && m_canseeu(guard)) {
|
||||||
|
if (activity == GD_EATGOLD ||
|
||||||
|
activity == GD_DESTROYGOLD)
|
||||||
|
EGD(guard)->witness = activity;
|
||||||
|
}
|
||||||
|
}
|
||||||
/*vault.c*/
|
/*vault.c*/
|
||||||
|
|||||||
Reference in New Issue
Block a user