Using a cursed tin whistle in a vault summons the guard
...since guards respond to shrill whistles. Based on a patch by Leon Arnott.
This commit is contained in:
@@ -405,6 +405,7 @@ fix the 'A' command to have the 'D' command's fix for C331-1 (quirk for
|
||||
response, to operate on applicable all items, there would still be a
|
||||
followup menu asking to choose specific items)
|
||||
eating 1 tin from stack of N (for N >= 2) on shop's floor forced hero to buy 2
|
||||
using a cursed whistle in a vault will summon the guard immediately
|
||||
|
||||
|
||||
Fixes to Post-3.6.0 Problems that Were Exposed Via git Repository
|
||||
|
||||
@@ -2510,6 +2510,7 @@ E int FDECL(hide_privileges, (BOOLEAN_P));
|
||||
E void FDECL(newegd, (struct monst *));
|
||||
E void FDECL(free_egd, (struct monst *));
|
||||
E boolean FDECL(grddead, (struct monst *));
|
||||
E void NDECL(vault_summon_gd);
|
||||
E char FDECL(vault_occupied, (char *));
|
||||
E void NDECL(invault);
|
||||
E int FDECL(gd_move, (struct monst *));
|
||||
|
||||
@@ -34,6 +34,9 @@ enum encumbrance_types {
|
||||
/* weight increment of heavy iron ball */
|
||||
#define IRON_BALL_W_INCR 160
|
||||
|
||||
/* number of turns it takes for vault guard to show up */
|
||||
#define VAULT_GUARD_TIME 30
|
||||
|
||||
/* hunger states - see hu_stat in eat.c */
|
||||
enum hunger_state_types {
|
||||
SATIATED = 0,
|
||||
|
||||
@@ -445,6 +445,8 @@ struct obj *obj;
|
||||
} else {
|
||||
You(whistle_str, obj->cursed ? "shrill" : "high");
|
||||
wake_nearby();
|
||||
if (obj->cursed)
|
||||
vault_summon_gd();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
10
src/vault.c
10
src/vault.c
@@ -191,6 +191,13 @@ findgd()
|
||||
return (struct monst *) 0;
|
||||
}
|
||||
|
||||
void
|
||||
vault_summon_gd()
|
||||
{
|
||||
if (vault_occupied(u.urooms) && !findgd())
|
||||
u.uinvault = (VAULT_GUARD_TIME - 1);
|
||||
}
|
||||
|
||||
char
|
||||
vault_occupied(array)
|
||||
char *array;
|
||||
@@ -221,7 +228,8 @@ invault()
|
||||
vaultroom -= ROOMOFFSET;
|
||||
|
||||
guard = findgd();
|
||||
if (++u.uinvault % 30 == 0 && !guard) { /* if time ok and no guard now. */
|
||||
if (++u.uinvault % VAULT_GUARD_TIME == 0 && !guard) {
|
||||
/* if time ok and no guard now. */
|
||||
char buf[BUFSZ];
|
||||
register int x, y, dd, gx, gy;
|
||||
int lx = 0, ly = 0;
|
||||
|
||||
Reference in New Issue
Block a user