@@ -230,19 +230,13 @@ struct monst *mtmp;
230230/* Return TRUE if this monster is capable of converting other monsters into
231231 * zombies. */
232232boolean
233- zombie_maker (pm )
234- struct permonst * pm ;
233+ zombie_maker (mon )
234+ struct monst * mon ;
235235{
236- switch (pm -> mlet ) {
237- case S_ZOMBIE :
238- /* Z-class monsters that aren't actually zombies go here */
239- return is_zombie (pm );
240- }
241-
242- if (!Upolyd && Race_if (PM_DRAUGR ))
243- return TRUE;
244-
245- return FALSE;
236+ /* NB: right now, this is literally just a wrapper around racial_zombie,
237+ * but maybe in the future there will be more complicated rules or
238+ * exceptions about when zombies will be created -- esp. by the hero */
239+ return racial_zombie (mon );
246240}
247241
248242/* From xNetHack: return the monster index of the zombie monster which this monster could be
@@ -761,12 +755,12 @@ unsigned corpseflags;
761755 return (struct obj * ) 0 ;
762756 } else {
763757 corpstatflags |= CORPSTAT_INIT ;
764- if racial_zombie (mtmp )
758+ if ( racial_zombie (mtmp ) )
765759 corpstatflags |= CORPSTAT_ZOMBIE ;
766760 /* preserve the unique traits of some creatures */
767761 obj = mkcorpstat (CORPSE , KEEPTRAITS (mtmp ) ? mtmp : 0 ,
768762 mdat , x , y , corpstatflags );
769- if racial_zombie (mtmp )
763+ if ( racial_zombie (mtmp ) )
770764 obj -> age -= 100 ;
771765 if (burythem ) {
772766 boolean dealloc ;
@@ -4001,9 +3995,9 @@ int how;
40013995 disintegested = (how == AD_DGST || how == - AD_RBRE
40023996 || how == AD_WTHR || how == AD_DISN );
40033997 if (disintegested )
4004- xkilled (mdef , XKILL_NOCORPSE );
3998+ xkilled (mdef , XKILL_NOMSG | XKILL_NOCORPSE | XKILL_INDIRECT );
40053999 else
4006- xkilled (mdef , XKILL_NOMSG );
4000+ xkilled (mdef , XKILL_NOMSG | XKILL_INDIRECT );
40074001
40084002 if (be_sad && DEADMONSTER (mdef ))
40094003 You ("have a sad feeling for a moment, then it passes." );
@@ -4051,7 +4045,9 @@ struct monst *mtmp;
40514045void
40524046xkilled (mtmp , xkill_flags )
40534047struct monst * mtmp ;
4054- int xkill_flags ; /* 1: suppress message, 2: suppress corpse, 4: pacifist */
4048+ int xkill_flags ; /* XKILL_GIVEMSG, XKILL_NOMSG, XKILL_NOCORPSE,
4049+ * XKILL_NOCONDUCT (maintain pacificst),
4050+ * or XKILL_INDIRECT (mtmp killed by summoned sphere) */
40554051{
40564052 int tmp , mndx , x = mtmp -> mx , y = mtmp -> my ;
40574053 struct monst museum = zeromonst ;
@@ -4062,7 +4058,8 @@ int xkill_flags; /* 1: suppress message, 2: suppress corpse, 4: pacifist */
40624058 burycorpse = FALSE,
40634059 nomsg = (xkill_flags & XKILL_NOMSG ) != 0 ,
40644060 nocorpse = (xkill_flags & XKILL_NOCORPSE ) != 0 ,
4065- noconduct = (xkill_flags & XKILL_NOCONDUCT ) != 0 ;
4061+ noconduct = (xkill_flags & XKILL_NOCONDUCT ) != 0 ,
4062+ indirect = (xkill_flags & XKILL_INDIRECT ) != 0 ;
40664063
40674064 mtmp -> mhp = 0 ; /* caller will usually have already done this */
40684065 if (!noconduct ) /* KMH, conduct */
@@ -4179,9 +4176,16 @@ int xkill_flags; /* 1: suppress message, 2: suppress corpse, 4: pacifist */
41794176 }
41804177 /* corpse--none if hero was inside the monster */
41814178 if (!wasinside && corpse_chance (mtmp , (struct monst * ) 0 , FALSE)) {
4182- zombify = (!thrownobj && !stoned && !uwep
4183- && zombie_maker (youmonst .data )
4184- && zombie_form (r_data (mtmp )) != NON_PM );
4179+ /* for kills by monsters credited to the hero (e.g. summoned
4180+ * exploding spheres), zombify will have been set already in
4181+ * mhitm.c where the information about the particular attacking
4182+ * monster, etc, was available; for actual kills by the hero we
4183+ * can figure it out here */
4184+ if (!indirect ) {
4185+ zombify = (!thrownobj && !stoned && !uwep
4186+ && zombie_maker (& youmonst )
4187+ && zombie_form (r_data (mtmp )) != NON_PM );
4188+ }
41854189 cadaver = make_corpse (mtmp , burycorpse ? CORPSTAT_BURIED
41864190 : CORPSTAT_NONE );
41874191 zombify = FALSE; /* reset */
0 commit comments