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:
Pasi Kallinen
2017-08-04 22:41:26 +03:00
parent e2904012b7
commit b6d1ee3320
5 changed files with 16 additions and 1 deletions

View File

@@ -445,6 +445,8 @@ struct obj *obj;
} else {
You(whistle_str, obj->cursed ? "shrill" : "high");
wake_nearby();
if (obj->cursed)
vault_summon_gd();
}
}

View File

@@ -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;