add MM_ASLEEP makemon() flag and honor it for fill_zoo

This commit is contained in:
nhmall
2018-12-06 22:30:15 -05:00
parent e9624f2583
commit 150d01a965
4 changed files with 22 additions and 17 deletions
+1
View File
@@ -251,6 +251,7 @@ hero hit by something that causes inventory items to be destroyed with loss of
blasted by lightning and dropping hero onto fire trap); [3.6.1 fixed a blasted by lightning and dropping hero onto fire trap); [3.6.1 fixed a
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
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
+7 -6
View File
@@ -253,13 +253,14 @@ typedef struct sortloot_item Loot;
#define MM_IGNOREWATER 0x00008 /* ignore water when positioning */ #define MM_IGNOREWATER 0x00008 /* ignore water when positioning */
#define MM_ADJACENTOK \ #define MM_ADJACENTOK \
0x00010 /* it is acceptable to use adjacent coordinates */ 0x00010 /* it is acceptable to use adjacent coordinates */
#define MM_ANGRY 0x00020 /* monster is created angry */ #define MM_ANGRY 0x00020 /* monster is created angry */
#define MM_NONAME 0x00040 /* monster is not christened */ #define MM_NONAME 0x00040 /* monster is not christened */
#define MM_EGD 0x00100 /* add egd structure */ #define MM_EGD 0x00100 /* add egd structure */
#define MM_EPRI 0x00200 /* add epri structure */ #define MM_EPRI 0x00200 /* add epri structure */
#define MM_ESHK 0x00400 /* add eshk structure */ #define MM_ESHK 0x00400 /* add eshk structure */
#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 */
/* flags for make_corpse() and mkcorpstat() */ /* flags for make_corpse() and mkcorpstat() */
#define CORPSTAT_NONE 0x00 #define CORPSTAT_NONE 0x00
+13 -10
View File
@@ -18,15 +18,15 @@ STATIC_DCL boolean FDECL(uncommon, (int));
STATIC_DCL int FDECL(align_shift, (struct permonst *)); STATIC_DCL int FDECL(align_shift, (struct permonst *));
STATIC_DCL boolean FDECL(mk_gen_ok, (int, int, int)); STATIC_DCL boolean FDECL(mk_gen_ok, (int, int, int));
STATIC_DCL boolean FDECL(wrong_elem_type, (struct permonst *)); STATIC_DCL boolean FDECL(wrong_elem_type, (struct permonst *));
STATIC_DCL void FDECL(m_initgrp, (struct monst *, int, int, int)); STATIC_DCL void FDECL(m_initgrp, (struct monst *, int, int, int, int));
STATIC_DCL void FDECL(m_initthrow, (struct monst *, int, int)); STATIC_DCL void FDECL(m_initthrow, (struct monst *, int, int));
STATIC_DCL void FDECL(m_initweap, (struct monst *)); STATIC_DCL void FDECL(m_initweap, (struct monst *));
STATIC_DCL void FDECL(m_initinv, (struct monst *)); STATIC_DCL void FDECL(m_initinv, (struct monst *));
STATIC_DCL boolean FDECL(makemon_rnd_goodpos, (struct monst *, STATIC_DCL boolean FDECL(makemon_rnd_goodpos, (struct monst *,
unsigned, coord *)); unsigned, coord *));
#define m_initsgrp(mtmp, x, y) m_initgrp(mtmp, x, y, 3) #define m_initsgrp(mtmp, x, y, mmf) m_initgrp(mtmp, x, y, 3, mmf)
#define m_initlgrp(mtmp, x, y) m_initgrp(mtmp, x, y, 10) #define m_initlgrp(mtmp, x, y, mmf) m_initgrp(mtmp, x, y, 10, mmf)
#define toostrong(monindx, lev) (mons[monindx].difficulty > lev) #define toostrong(monindx, lev) (mons[monindx].difficulty > lev)
#define tooweak(monindx, lev) (mons[monindx].difficulty < lev) #define tooweak(monindx, lev) (mons[monindx].difficulty < lev)
@@ -76,9 +76,9 @@ struct permonst *ptr;
/* make a group just like mtmp */ /* make a group just like mtmp */
STATIC_OVL void STATIC_OVL void
m_initgrp(mtmp, x, y, n) m_initgrp(mtmp, x, y, n, mmflags)
register struct monst *mtmp; struct monst *mtmp;
register int x, y, n; int x, y, n, mmflags;
{ {
coord mm; coord mm;
register int cnt = rnd(n); register int cnt = rnd(n);
@@ -131,6 +131,8 @@ register int x, y, n;
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, NO_MM_FLAGS);
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);
@@ -1193,7 +1195,8 @@ int mmflags;
newemin(mtmp); newemin(mtmp);
if (mmflags & MM_EDOG) if (mmflags & MM_EDOG)
newedog(mtmp); newedog(mtmp);
if (mmflags & MM_ASLEEP)
mtmp->msleeping = 1;
mtmp->nmon = fmon; mtmp->nmon = fmon;
fmon = mtmp; fmon = mtmp;
mtmp->m_id = context.ident++; mtmp->m_id = context.ident++;
@@ -1366,12 +1369,12 @@ int mmflags;
set_malign(mtmp); /* having finished peaceful changes */ set_malign(mtmp); /* having finished peaceful changes */
if (anymon) { if (anymon) {
if ((ptr->geno & G_SGROUP) && rn2(2)) { if ((ptr->geno & G_SGROUP) && rn2(2)) {
m_initsgrp(mtmp, mtmp->mx, mtmp->my); m_initsgrp(mtmp, mtmp->mx, mtmp->my, mmflags);
} else if (ptr->geno & G_LGROUP) { } else if (ptr->geno & G_LGROUP) {
if (rn2(3)) if (rn2(3))
m_initlgrp(mtmp, mtmp->mx, mtmp->my); m_initlgrp(mtmp, mtmp->mx, mtmp->my, mmflags);
else else
m_initsgrp(mtmp, mtmp->mx, mtmp->my); m_initsgrp(mtmp, mtmp->mx, mtmp->my, mmflags);
} }
} }
+1 -1
View File
@@ -341,7 +341,7 @@ struct mkroom *sroom;
: (type == ANTHOLE) : (type == ANTHOLE)
? antholemon() ? antholemon()
: (struct permonst *) 0, : (struct permonst *) 0,
sx, sy, NO_MM_FLAGS); sx, sy, MM_ASLEEP);
if (mon) { if (mon) {
mon->msleeping = 1; mon->msleeping = 1;
if (type == COURT && mon->mpeaceful) { if (type == COURT && mon->mpeaceful) {