when doppelgangers taking on new shape don't specifically pick nasty monster
or role monster, bias the random form towards humanoid
salamanders can use green slime corpses to cure themselves of petrification
+feedback about summoned monsters may use singular when it should use plural
Platform- and/or Interface-Specific Fixes
E void FDECL(newemin, (struct monst *));
E void FDECL(free_emin, (struct monst *));
+E int NDECL(monster_census);
E int FDECL(msummon, (struct monst *));
E void FDECL(summon_minion, (ALIGNTYP_P,BOOLEAN_P));
E int FDECL(demon_talk, (struct monst *));
-/* SCCS Id: @(#)minion.c 3.5 2006/12/04 */
+/* SCCS Id: @(#)minion.c 3.5 2007/04/15 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
mtmp->isminion = 0;
}
+/* count the number of monsters on the level */
+int
+monster_census()
+{
+ struct monst *mtmp;
+ int count = 0;
+
+ for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
+ if (DEADMONSTER(mtmp)) continue;
+ ++count;
+ }
+ return count;
+}
+
int
msummon(mon) /* mon summons a monster */
struct monst *mon;
{
struct permonst *ptr;
- int dtype = NON_PM, cnt = 0, result = 0;
+ int dtype = NON_PM, cnt = 0, result = 0, census;
aligntyp atyp;
struct monst *mtmp;
if (dtype == NON_PM) return 0;
}
+ /* some candidates can generate a group of monsters, so simple
+ count of non-null makemon() result is not sufficient */
+ census = monster_census();
+
while (cnt > 0) {
mtmp = makemon(&mons[dtype], u.ux, u.uy, MM_EMIN);
if (mtmp) {
}
cnt--;
}
+
+ /* how many monsters exist now compared to before? */
+ if (result) result = monster_census() - census;
+
return result;
}
-/* SCCS Id: @(#)wizard.c 3.5 2007/02/07 */
+/* SCCS Id: @(#)wizard.c 3.5 2007/04/15 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
register int i, j, tmp;
int castalign = (mcast ? sgn(mcast->data->maligntyp) : -1);
coord bypos;
- int count;
+ int count, census;
+
+ /* some candidates may be created in groups, so simple count
+ of non-null makemon() return is inadequate */
+ census = monster_census();
if(!rn2(10) && Inhell) {
count = msummon((struct monst *) 0); /* summons like WoY */
}
}
}
+
+ if (count) count = monster_census() - census;
return count;
}