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
-/* 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. */
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)
-/* 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. */
{
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