Vault guards are more reluctant to turn up if they keep dying
This is primarily meant as a fix for a farming strategy, although it also makes sense in terms of the decisions the guards would likely make.
This commit is contained in:
13
src/vault.c
13
src/vault.c
@@ -320,12 +320,19 @@ invault(void)
|
|||||||
struct obj *otmp;
|
struct obj *otmp;
|
||||||
boolean spotted;
|
boolean spotted;
|
||||||
int trycount, vaultroom = (int) vault_occupied(u.urooms);
|
int trycount, vaultroom = (int) vault_occupied(u.urooms);
|
||||||
|
int vgdeathcount;
|
||||||
|
|
||||||
if (!vaultroom) {
|
if (!vaultroom) {
|
||||||
u.uinvault = 0;
|
u.uinvault = 0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
++u.uinvault;
|
/* after a couple of guards don't come back from their trips to
|
||||||
|
the vault, future guards become more reluctant to turn up (even
|
||||||
|
if summoned via whistle) */
|
||||||
|
vgdeathcount = svm.mvitals[PM_GUARD].died;
|
||||||
|
if (vgdeathcount < 2 ||
|
||||||
|
(vgdeathcount < 50 && !rn2(vgdeathcount * vgdeathcount)))
|
||||||
|
++u.uinvault;
|
||||||
if (u.uinvault < VAULT_GUARD_TIME
|
if (u.uinvault < VAULT_GUARD_TIME
|
||||||
|| (u.uinvault % (VAULT_GUARD_TIME / 2)) != 0)
|
|| (u.uinvault % (VAULT_GUARD_TIME / 2)) != 0)
|
||||||
return;
|
return;
|
||||||
@@ -409,6 +416,10 @@ invault(void)
|
|||||||
EGD(guard)->vroom = vaultroom;
|
EGD(guard)->vroom = vaultroom;
|
||||||
EGD(guard)->warncnt = 0;
|
EGD(guard)->warncnt = 0;
|
||||||
|
|
||||||
|
/* ensure the guard doesn't respawn again next turn if killed
|
||||||
|
immediately */
|
||||||
|
++u.uinvault;
|
||||||
|
|
||||||
reset_faint(); /* if fainted - wake up */
|
reset_faint(); /* if fainted - wake up */
|
||||||
/* if there are any boulders in the guard's way, destroy them;
|
/* if there are any boulders in the guard's way, destroy them;
|
||||||
perhaps the guard knows a touch equivalent of force bolt;
|
perhaps the guard knows a touch equivalent of force bolt;
|
||||||
|
|||||||
Reference in New Issue
Block a user