monster aggravation spell

When testing drawbridge stuff recently I ended up with an unseen
monster who evidently cast the aggravation spell repeatedly, yielding a
steady stream of "you feel that monsters are aware of your presence"
messages.  This patch makes monsters tend to avoid repeating that spell
once everyone on the level has already been woken up.  It also extends
the spell effect so that it will wake monsters like quest nemesis and the
Wizard who ordinarily wait until you get close before they become active.
This commit is contained in:
nethack.rankin
2005-03-20 05:05:06 +00:00
parent 8225790b08
commit f6c08d9f80
3 changed files with 27 additions and 9 deletions

View File

@@ -99,6 +99,8 @@ land mine explosion will destroy a drawbridge at same location
avoid some more buffer overflows in query buffers containing object names
avoid giving extra information about things that break out of sight
avoid giving away wand type for near misses while blind
avoid excessive repetition of "monsters are aware of your presence"
monster's aggravation spell now affects meditating monsters
Platform- and/or Interface-Specific Fixes

View File

@@ -1,4 +1,4 @@
/* SCCS Id: @(#)mcastu.c 3.5 2003/01/08 */
/* SCCS Id: @(#)mcastu.c 3.5 2005/03/19 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -731,6 +731,21 @@ int spellnum;
if ((!mtmp->iswiz || context.no_of_wizards > 1)
&& spellnum == MGC_CLONE_WIZ)
return TRUE;
/* aggravation (global wakeup) when everyone is already active */
if (spellnum == MGC_AGGRAVATION) {
struct monst *nxtmon;
for (nxtmon = fmon; nxtmon; nxtmon = nxtmon->nmon) {
if (DEADMONSTER(nxtmon)) continue;
if ((nxtmon->mstrategy & STRAT_WAITFORU) != 0 ||
nxtmon->msleeping || !nxtmon->mcanmove) break;
}
/* if nothing needs to be awakened then this spell is useless
but caster might not realize that [chance to pick it then
must be very small otherwise caller's many retry attempts
will eventually end up picking it too often] */
if (!nxtmon) return rn2(100) ? TRUE : FALSE;
}
} else if (adtyp == AD_CLRC) {
/* summon insects/sticks to snakes won't be cast by peaceful monsters */
if (mtmp->mpeaceful && spellnum == CLC_INSECTS)

View File

@@ -1,4 +1,4 @@
/* SCCS Id: @(#)wizard.c 3.5 2004/12/20 */
/* SCCS Id: @(#)wizard.c 3.5 2005/03/19 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -371,14 +371,15 @@ aggravate()
{
register struct monst *mtmp;
for(mtmp = fmon; mtmp; mtmp = mtmp->nmon)
if (!DEADMONSTER(mtmp)) {
mtmp->msleeping = 0;
if(!mtmp->mcanmove && !rn2(5)) {
mtmp->mfrozen = 0;
mtmp->mcanmove = 1;
}
for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
if (DEADMONSTER(mtmp)) continue;
mtmp->mstrategy &= ~STRAT_WAITFORU;
mtmp->msleeping = 0;
if (!mtmp->mcanmove && !rn2(5)) {
mtmp->mfrozen = 0;
mtmp->mcanmove = 1;
}
}
}
void