add MM_NOGRP makemon() flag

add MM_NOGRP makemon() flag as a means of suppressing groups of monsters in
a couple places that warrant it when a specific monster type isn't
specified on the call to makemon()
This commit is contained in:
nhmall
2018-12-07 09:29:01 -05:00
parent 150d01a965
commit a1c1acdd24
4 changed files with 7 additions and 5 deletions
+3
View File
@@ -252,6 +252,9 @@ hero hit by something that causes inventory items to be destroyed with loss of
similar problem with more obvious symptom, an "object lost" panic when similar problem with more obvious symptom, an "object lost" panic when
the unholy water was wielded; the fix for that wasn't general enough] the unholy water was wielded; the fix for that wasn't general enough]
add MM_ASLEEP makemon() flag and honor it when creating group for fill_zoo add MM_ASLEEP makemon() flag and honor it when creating group for fill_zoo
add MM_NOGRP makemon() flag as a means of suppressing groups of monsters in
a couple places that warrant it when a specific monster type isn't
specified on the call to makemon()
Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository
+1
View File
@@ -261,6 +261,7 @@ typedef struct sortloot_item Loot;
#define MM_EMIN 0x00800 /* add emin structure */ #define MM_EMIN 0x00800 /* add emin structure */
#define MM_EDOG 0x01000 /* add edog structure */ #define MM_EDOG 0x01000 /* add edog structure */
#define MM_ASLEEP 0x02000 /* monsters should be generated asleep */ #define MM_ASLEEP 0x02000 /* monsters should be generated asleep */
#define MM_NOGRP 0x04000 /* suppress creation of monster groups */
/* flags for make_corpse() and mkcorpstat() */ /* flags for make_corpse() and mkcorpstat() */
#define CORPSTAT_NONE 0x00 #define CORPSTAT_NONE 0x00
+2 -4
View File
@@ -129,10 +129,8 @@ int x, y, n, mmflags;
* smaller group. * smaller group.
*/ */
if (enexto(&mm, mm.x, mm.y, mtmp->data)) { if (enexto(&mm, mm.x, mm.y, mtmp->data)) {
mon = makemon(mtmp->data, mm.x, mm.y, NO_MM_FLAGS); mon = makemon(mtmp->data, mm.x, mm.y, (mmflags | MM_NOGRP));
if (mon) { if (mon) {
if (mmflags & MM_ASLEEP)
mon->msleeping = 1;
mon->mpeaceful = FALSE; mon->mpeaceful = FALSE;
mon->mavenge = 0; mon->mavenge = 0;
set_malign(mon); set_malign(mon);
@@ -1367,7 +1365,7 @@ int mmflags;
: eminp->renegade; : eminp->renegade;
} }
set_malign(mtmp); /* having finished peaceful changes */ set_malign(mtmp); /* having finished peaceful changes */
if (anymon) { if (anymon && !(mmflags & MM_NOGRP)) {
if ((ptr->geno & G_SGROUP) && rn2(2)) { if ((ptr->geno & G_SGROUP) && rn2(2)) {
m_initsgrp(mtmp, mtmp->mx, mtmp->my, mmflags); m_initsgrp(mtmp, mtmp->mx, mtmp->my, mmflags);
} else if (ptr->geno & G_LGROUP) { } else if (ptr->geno & G_LGROUP) {
+1 -1
View File
@@ -803,7 +803,7 @@ skip0:
if (u.uhave.amulet || !rn2(3)) { if (u.uhave.amulet || !rn2(3)) {
x = somex(croom); x = somex(croom);
y = somey(croom); y = somey(croom);
tmonst = makemon((struct permonst *) 0, x, y, NO_MM_FLAGS); tmonst = makemon((struct permonst *) 0, x, y, (MM_NOGRP | MM_ASLEEP));
if (tmonst && tmonst->data == &mons[PM_GIANT_SPIDER] if (tmonst && tmonst->data == &mons[PM_GIANT_SPIDER]
&& !occupied(x, y)) && !occupied(x, y))
(void) maketrap(x, y, WEB); (void) maketrap(x, y, WEB);