switch to using a flag parameter on newcham()

This commit is contained in:
nhmall
2022-05-28 19:35:48 -04:00
parent ef9d874c22
commit 9e6ac144b4
13 changed files with 70 additions and 49 deletions
+1 -1
View File
@@ -1568,7 +1568,7 @@ extern boolean valid_vampshiftform(int, int);
extern boolean validvamp(struct monst *, int *, int); extern boolean validvamp(struct monst *, int *, int);
extern int select_newcham_form(struct monst *); extern int select_newcham_form(struct monst *);
extern void mgender_from_permonst(struct monst *, struct permonst *); extern void mgender_from_permonst(struct monst *, struct permonst *);
extern int newcham(struct monst *, struct permonst *, boolean, boolean); extern int newcham(struct monst *, struct permonst *, unsigned);
extern int can_be_hatched(int); extern int can_be_hatched(int);
extern int egg_type_from_parent(int, boolean); extern int egg_type_from_parent(int, boolean);
extern boolean dead_species(int, boolean); extern boolean dead_species(int, boolean);
+5
View File
@@ -585,6 +585,11 @@ enum bodypart_types {
#define ECMD_CANCEL 0x02 /* cmd canceled by user */ #define ECMD_CANCEL 0x02 /* cmd canceled by user */
#define ECMD_FAIL 0x04 /* cmd failed to finish, maybe with a yafm */ #define ECMD_FAIL 0x04 /* cmd failed to finish, maybe with a yafm */
/* flags for newcham() */
#define NO_NC_FLAGS 0U
#define NC_SHOW_MSG 0x01U
#define NC_VIA_WAND_OR_SPELL 0x02U
/* values returned from getobj() callback functions */ /* values returned from getobj() callback functions */
enum getobj_callback_returns { enum getobj_callback_returns {
/* generally invalid - can't be used for this purpose. will give a "silly /* generally invalid - can't be used for this purpose. will give a "silly
+1 -1
View File
@@ -766,7 +766,7 @@ engulfer_digests_food(struct obj *obj)
if (could_poly || could_slime) { if (could_poly || could_slime) {
(void) newcham(u.ustuck, could_slime ? &mons[PM_GREEN_SLIME] : 0, (void) newcham(u.ustuck, could_slime ? &mons[PM_GREEN_SLIME] : 0,
FALSE, could_slime); could_slime ? NC_SHOW_MSG : NO_NC_FLAGS);
} else if (could_petrify) { } else if (could_petrify) {
minstapetrify(u.ustuck, TRUE); minstapetrify(u.ustuck, TRUE);
} else if (could_grow) { } else if (could_grow) {
+2 -1
View File
@@ -356,7 +356,8 @@ dog_eat(struct monst *mtmp,
if (poly || slimer) { if (poly || slimer) {
struct permonst *ptr = slimer ? &mons[PM_GREEN_SLIME] : 0; struct permonst *ptr = slimer ? &mons[PM_GREEN_SLIME] : 0;
(void) newcham(mtmp, ptr, FALSE, cansee(mtmp->mx, mtmp->my)); (void) newcham(mtmp, ptr,
cansee(mtmp->mx, mtmp->my) ? NC_SHOW_MSG : 0);
} }
/* limit "instant" growth to prevent potential abuse */ /* limit "instant" growth to prevent potential abuse */
+1 -1
View File
@@ -1326,7 +1326,7 @@ makemon(
to the level's difficulty but ignoring the changer's usual to the level's difficulty but ignoring the changer's usual
type selection, so was inappropriate for vampshifters. type selection, so was inappropriate for vampshifters.
Let newcham() pick the shape. */ Let newcham() pick the shape. */
&& newcham(mtmp, (struct permonst *) 0, FALSE, FALSE)) && newcham(mtmp, (struct permonst *) 0, NO_NC_FLAGS))
allow_minvent = FALSE; allow_minvent = FALSE;
} else if (mndx == PM_WIZARD_OF_YENDOR) { } else if (mndx == PM_WIZARD_OF_YENDOR) {
mtmp->iswiz = TRUE; mtmp->iswiz = TRUE;
+4 -4
View File
@@ -772,7 +772,7 @@ gulpmm(register struct monst *magr, register struct monst *mdef,
} }
if (is_vampshifter(mdef) if (is_vampshifter(mdef)
&& newcham(mdef, &mons[mdef->cham], FALSE, FALSE)) { && newcham(mdef, &mons[mdef->cham], NO_NC_FLAGS)) {
if (g.vis) { if (g.vis) {
/* 'it' -- previous form is no longer available and /* 'it' -- previous form is no longer available and
using that would be excessively verbose */ using that would be excessively verbose */
@@ -959,9 +959,9 @@ mdamagem(struct monst *magr, struct monst *mdef,
/* various checks similar to dog_eat and meatobj. /* various checks similar to dog_eat and meatobj.
* after monkilled() to provide better message ordering */ * after monkilled() to provide better message ordering */
if (mdef->cham >= LOW_PM) { if (mdef->cham >= LOW_PM) {
(void) newcham(magr, (struct permonst *) 0, FALSE, TRUE); (void) newcham(magr, (struct permonst *) 0, NC_SHOW_MSG);
} else if (pd == &mons[PM_GREEN_SLIME] && !slimeproof(pa)) { } else if (pd == &mons[PM_GREEN_SLIME] && !slimeproof(pa)) {
(void) newcham(magr, &mons[PM_GREEN_SLIME], FALSE, TRUE); (void) newcham(magr, &mons[PM_GREEN_SLIME], NC_SHOW_MSG);
} else if (pd == &mons[PM_WRAITH]) { } else if (pd == &mons[PM_WRAITH]) {
(void) grow_up(magr, (struct monst *) 0); (void) grow_up(magr, (struct monst *) 0);
/* don't grow up twice */ /* don't grow up twice */
@@ -1029,7 +1029,7 @@ mon_poly(struct monst *magr, struct monst *mdef, int dmg)
else else
monkilled(mdef, "", AD_RBRE); monkilled(mdef, "", AD_RBRE);
} }
} else if (newcham(mdef, (struct permonst *) 0, FALSE, FALSE)) { } else if (newcham(mdef, (struct permonst *) 0, NO_NC_FLAGS)) {
if (g.vis) { /* either seen or adjacent */ if (g.vis) { /* either seen or adjacent */
boolean was_seen = !!strcmpi("It", Before), boolean was_seen = !!strcmpi("It", Before),
verbosely = flags.verbose || !was_seen; verbosely = flags.verbose || !was_seen;
+18 -15
View File
@@ -1172,7 +1172,8 @@ meatmetal(struct monst *mtmp)
delobj(otmp); delobj(otmp);
ptr = mtmp->data; ptr = mtmp->data;
if (poly) { if (poly) {
if (newcham(mtmp, (struct permonst *) 0, FALSE, vis)) if (newcham(mtmp, (struct permonst *) 0,
vis ? NC_SHOW_MSG : NO_NC_FLAGS))
ptr = mtmp->data; ptr = mtmp->data;
} else if (grow) { } else if (grow) {
ptr = grow_up(mtmp, (struct monst *) 0); ptr = grow_up(mtmp, (struct monst *) 0);
@@ -1334,7 +1335,8 @@ meatobj(struct monst* mtmp) /* for gelatinous cubes */
delobj(otmp); /* munch */ delobj(otmp); /* munch */
ptr = mtmp->data; ptr = mtmp->data;
if (poly) { if (poly) {
if (newcham(mtmp, (struct permonst *) 0, FALSE, vis)) if (newcham(mtmp, (struct permonst *) 0,
vis ? NC_SHOW_MSG : NO_NC_FLAGS))
ptr = mtmp->data; ptr = mtmp->data;
} else if (grow) { } else if (grow) {
ptr = grow_up(mtmp, (struct monst *) 0); ptr = grow_up(mtmp, (struct monst *) 0);
@@ -1428,7 +1430,8 @@ meatcorpse(struct monst* mtmp) /* for purple worms and other voracious monsters
ptr = original_ptr; ptr = original_ptr;
delobj(otmp); delobj(otmp);
if (poly) { if (poly) {
if (newcham(mtmp, (struct permonst *) 0, FALSE, vis)) if (newcham(mtmp, (struct permonst *) 0,
vis ? NC_SHOW_MSG : NO_NC_FLAGS))
ptr = mtmp->data; ptr = mtmp->data;
} else if (grow) { } else if (grow) {
ptr = grow_up(mtmp, (struct monst *) 0); ptr = grow_up(mtmp, (struct monst *) 0);
@@ -2543,7 +2546,7 @@ mondead(register struct monst* mtmp)
if (enexto(&new_xy, mtmp->mx, mtmp->my, &mons[mndx])) if (enexto(&new_xy, mtmp->mx, mtmp->my, &mons[mndx]))
rloc_to(mtmp, new_xy.x, new_xy.y); rloc_to(mtmp, new_xy.x, new_xy.y);
} }
(void) newcham(mtmp, &mons[mndx], FALSE, FALSE); (void) newcham(mtmp, &mons[mndx], NO_NC_FLAGS);
if (mtmp->data == &mons[mndx]) if (mtmp->data == &mons[mndx])
mtmp->cham = NON_PM; mtmp->cham = NON_PM;
else else
@@ -3201,7 +3204,7 @@ mon_to_stone(struct monst* mtmp)
/* it's a golem, and not a stone golem */ /* it's a golem, and not a stone golem */
if (canseemon(mtmp)) if (canseemon(mtmp))
pline("%s solidifies...", Monnam(mtmp)); pline("%s solidifies...", Monnam(mtmp));
if (newcham(mtmp, &mons[PM_STONE_GOLEM], FALSE, FALSE)) { if (newcham(mtmp, &mons[PM_STONE_GOLEM], NO_NC_FLAGS)) {
if (canseemon(mtmp)) if (canseemon(mtmp))
pline("Now it's %s.", an(pmname(mtmp->data, Mgender(mtmp)))); pline("Now it's %s.", an(pmname(mtmp->data, Mgender(mtmp))));
} else { } else {
@@ -3253,7 +3256,7 @@ vamp_stone(struct monst* mtmp)
pline("%s!", buf); pline("%s!", buf);
display_nhwindow(WIN_MESSAGE, FALSE); display_nhwindow(WIN_MESSAGE, FALSE);
} }
(void) newcham(mtmp, &mons[mndx], FALSE, FALSE); (void) newcham(mtmp, &mons[mndx], NO_NC_FLAGS);
if (mtmp->data == &mons[mndx]) if (mtmp->data == &mons[mndx])
mtmp->cham = NON_PM; mtmp->cham = NON_PM;
else else
@@ -3273,7 +3276,7 @@ vamp_stone(struct monst* mtmp)
mtmp->mfrozen = 0; mtmp->mfrozen = 0;
set_mon_min_mhpmax(mtmp, 10); /* mtmp->mhpmax=max(mtmp->m_lev+1,10) */ set_mon_min_mhpmax(mtmp, 10); /* mtmp->mhpmax=max(mtmp->m_lev+1,10) */
mtmp->mhp = mtmp->mhpmax; mtmp->mhp = mtmp->mhpmax;
(void) newcham(mtmp, &mons[mtmp->cham], FALSE, TRUE); (void) newcham(mtmp, &mons[mtmp->cham], NC_SHOW_MSG);
newsym(mtmp->mx, mtmp->my); newsym(mtmp->mx, mtmp->my);
return FALSE; /* didn't petrify */ return FALSE; /* didn't petrify */
} }
@@ -3808,7 +3811,7 @@ normal_shape(struct monst *mon)
if (mcham >= LOW_PM) { if (mcham >= LOW_PM) {
unsigned mcan = mon->mcan; unsigned mcan = mon->mcan;
(void) newcham(mon, &mons[mcham], FALSE, FALSE); (void) newcham(mon, &mons[mcham], NO_NC_FLAGS);
mon->cham = NON_PM; mon->cham = NON_PM;
/* newcham() may uncancel a polymorphing monster; override that */ /* newcham() may uncancel a polymorphing monster; override that */
if (mcan) if (mcan)
@@ -4124,7 +4127,7 @@ decide_to_shapeshift(struct monst* mon, int shiftflags)
} }
} }
if (dochng) { if (dochng) {
if (newcham(mon, ptr, FALSE, msg) && is_vampshifter(mon)) { if (newcham(mon, ptr, msg ? NC_SHOW_MSG : 0) && is_vampshifter(mon)) {
/* for vampshift, override the 10% chance for sex change */ /* for vampshift, override the 10% chance for sex change */
ptr = mon->data; ptr = mon->data;
if (!is_male(ptr) && !is_female(ptr) && !is_neuter(ptr)) if (!is_male(ptr) && !is_female(ptr) && !is_neuter(ptr))
@@ -4440,12 +4443,12 @@ mgender_from_permonst(struct monst* mtmp, struct permonst* mdat)
int int
newcham( newcham(
struct monst *mtmp, struct monst *mtmp,
struct permonst *mdat, struct permonst *mdat, unsigned ncflags)
boolean polyspot, /* change is the result of wand or spell of polymorph */
boolean msg) /* "The oldmon turns into a newmon!" */
{ {
int hpn, hpd; boolean polyspot = ((ncflags & NC_VIA_WAND_OR_SPELL) !=0),
int mndx, tryct; /* "The oldmon turns into a newmon!" */
msg = ((ncflags & NC_SHOW_MSG) != 0);
int hpn, hpd, mndx, tryct;
struct permonst *olddata = mtmp->data; struct permonst *olddata = mtmp->data;
char *p, oldname[BUFSZ], l_oldname[BUFSZ], newname[BUFSZ]; char *p, oldname[BUFSZ], l_oldname[BUFSZ], newname[BUFSZ];
@@ -4792,7 +4795,7 @@ kill_genocided_monsters(void)
&& (g.mvitals[mtmp->cham].mvflags & G_GENOD)); && (g.mvitals[mtmp->cham].mvflags & G_GENOD));
if ((g.mvitals[mndx].mvflags & G_GENOD) || kill_cham) { if ((g.mvitals[mndx].mvflags & G_GENOD) || kill_cham) {
if (mtmp->cham >= LOW_PM && !kill_cham) if (mtmp->cham >= LOW_PM && !kill_cham)
(void) newcham(mtmp, (struct permonst *) 0, FALSE, TRUE); (void) newcham(mtmp, (struct permonst *) 0, NC_SHOW_MSG);
else else
mondead(mtmp); mondead(mtmp);
} }
+1 -1
View File
@@ -1967,7 +1967,7 @@ vamp_shift(
reslt = 1; reslt = 1;
domsg = FALSE; domsg = FALSE;
} else if (is_vampshifter(mon)) { } else if (is_vampshifter(mon)) {
reslt = newcham(mon, ptr, FALSE, FALSE); reslt = newcham(mon, ptr, NO_NC_FLAGS);
} }
if (reslt && domsg) { if (reslt && domsg) {
+3 -3
View File
@@ -2143,7 +2143,7 @@ use_misc(struct monst* mtmp)
return 2; return 2;
case MUSE_WAN_POLYMORPH: case MUSE_WAN_POLYMORPH:
mzapwand(mtmp, otmp, TRUE); mzapwand(mtmp, otmp, TRUE);
(void) newcham(mtmp, muse_newcham_mon(mtmp), TRUE, FALSE); (void) newcham(mtmp, muse_newcham_mon(mtmp), NC_VIA_WAND_OR_SPELL);
if (oseen) if (oseen)
makeknown(WAN_POLYMORPH); makeknown(WAN_POLYMORPH);
return 2; return 2;
@@ -2152,7 +2152,7 @@ use_misc(struct monst* mtmp)
m_useup(mtmp, otmp); m_useup(mtmp, otmp);
if (vismon) if (vismon)
pline("%s suddenly mutates!", Monnam(mtmp)); pline("%s suddenly mutates!", Monnam(mtmp));
(void) newcham(mtmp, muse_newcham_mon(mtmp), FALSE, FALSE); (void) newcham(mtmp, muse_newcham_mon(mtmp), NO_NC_FLAGS);
if (oseen) if (oseen)
makeknown(POT_POLYMORPH); makeknown(POT_POLYMORPH);
return 2; return 2;
@@ -2179,7 +2179,7 @@ use_misc(struct monst* mtmp)
worm_move(mtmp); worm_move(mtmp);
newsym(g.trapx, g.trapy); newsym(g.trapx, g.trapy);
(void) newcham(mtmp, (struct permonst *) 0, FALSE, FALSE); (void) newcham(mtmp, (struct permonst *) 0, NO_NC_FLAGS);
return 2; return 2;
case MUSE_BAG: case MUSE_BAG:
return mloot_container(mtmp, otmp, vismon); return mloot_container(mtmp, otmp, vismon);
+1 -1
View File
@@ -3117,7 +3117,7 @@ create_particular_creation(struct _create_particular_data* d)
for, make it start out looking like what was asked for */ for, make it start out looking like what was asked for */
if (mtmp->cham != NON_PM && firstchoice != NON_PM if (mtmp->cham != NON_PM && firstchoice != NON_PM
&& mtmp->cham != firstchoice) && mtmp->cham != firstchoice)
(void) newcham(mtmp, &mons[firstchoice], FALSE, FALSE); (void) newcham(mtmp, &mons[firstchoice], NO_NC_FLAGS);
} }
return madeany; return madeany;
} }
+4 -3
View File
@@ -656,7 +656,7 @@ animate_statue(
/* if hero has protection from shape changers, cham field will /* if hero has protection from shape changers, cham field will
be NON_PM; otherwise, set form to match the statue */ be NON_PM; otherwise, set form to match the statue */
if (mon && mon->cham >= LOW_PM) if (mon && mon->cham >= LOW_PM)
(void) newcham(mon, mptr, FALSE, FALSE); (void) newcham(mon, mptr, NO_NC_FLAGS);
} else { } else {
if (cause == ANIMATE_SPELL) if (cause == ANIMATE_SPELL)
mmflags |= MM_ADJACENTOK; mmflags |= MM_ADJACENTOK;
@@ -2166,7 +2166,8 @@ trapeffect_poly_trap(
if (resists_magm(mtmp)) { if (resists_magm(mtmp)) {
shieldeff(mtmp->mx, mtmp->my); shieldeff(mtmp->mx, mtmp->my);
} else if (!resist(mtmp, WAND_CLASS, 0, NOTELL)) { } else if (!resist(mtmp, WAND_CLASS, 0, NOTELL)) {
(void) newcham(mtmp, (struct permonst *) 0, FALSE, in_sight); (void) newcham(mtmp, (struct permonst *) 0,
in_sight ? NC_SHOW_MSG : NO_NC_FLAGS);
if (in_sight) if (in_sight)
seetrap(trap); seetrap(trap);
} }
@@ -2617,7 +2618,7 @@ steedintrap(struct trap* trap, struct obj* otmp)
if (!resists_magm(steed) && !resist(steed, WAND_CLASS, 0, NOTELL)) { if (!resists_magm(steed) && !resist(steed, WAND_CLASS, 0, NOTELL)) {
struct permonst *mdat = steed->data; struct permonst *mdat = steed->data;
(void) newcham(steed, (struct permonst *) 0, FALSE, FALSE); (void) newcham(steed, (struct permonst *) 0, NO_NC_FLAGS);
if (!can_saddle(steed) || !can_ride(steed)) { if (!can_saddle(steed) || !can_ride(steed)) {
dismount_steed(DISMOUNT_POLY); dismount_steed(DISMOUNT_POLY);
} else { } else {
+7 -4
View File
@@ -3001,7 +3001,7 @@ mhitm_ad_slim(struct monst *magr, struct attack *mattk, struct monst *mdef,
/* this assumes newcham() won't fail; since hero has /* this assumes newcham() won't fail; since hero has
a slime attack, green slimes haven't been geno'd */ a slime attack, green slimes haven't been geno'd */
You("turn %s into slime.", mon_nam(mdef)); You("turn %s into slime.", mon_nam(mdef));
if (newcham(mdef, &mons[PM_GREEN_SLIME], FALSE, FALSE)) if (newcham(mdef, &mons[PM_GREEN_SLIME], NO_NC_FLAGS))
pd = mdef->data; pd = mdef->data;
} }
/* munslime attempt could have been fatal */ /* munslime attempt could have been fatal */
@@ -3037,8 +3037,11 @@ mhitm_ad_slim(struct monst *magr, struct attack *mattk, struct monst *mdef,
return; /* physical damage only */ return; /* physical damage only */
if (!rn2(4) && !slimeproof(pd)) { if (!rn2(4) && !slimeproof(pd)) {
if (!munslime(mdef, FALSE) && !DEADMONSTER(mdef)) { if (!munslime(mdef, FALSE) && !DEADMONSTER(mdef)) {
if (newcham(mdef, &mons[PM_GREEN_SLIME], FALSE, unsigned ncflags = NO_NC_FLAGS;
(boolean) (g.vis && canseemon(mdef))))
if (g.vis && canseemon(mdef))
ncflags |= NC_SHOW_MSG;
if (newcham(mdef, &mons[PM_GREEN_SLIME], ncflags))
pd = mdef->data; pd = mdef->data;
mdef->mstrategy &= ~STRAT_WAITFORU; mdef->mstrategy &= ~STRAT_WAITFORU;
mhm->hitflags = MM_HIT; mhm->hitflags = MM_HIT;
@@ -4321,7 +4324,7 @@ gulpum(struct monst *mdef, struct attack *mattk)
/* force vampire in bat, cloud, or wolf form to revert back to /* force vampire in bat, cloud, or wolf form to revert back to
vampire form now instead of dealing with that when it dies */ vampire form now instead of dealing with that when it dies */
if (is_vampshifter(mdef) if (is_vampshifter(mdef)
&& newcham(mdef, &mons[mdef->cham], FALSE, FALSE)) { && newcham(mdef, &mons[mdef->cham], NO_NC_FLAGS)) {
You("engulf it, then expel it."); You("engulf it, then expel it.");
if (canspotmon(mdef)) if (canspotmon(mdef))
pline("It turns into %s.", a_monnam(mdef)); pline("It turns into %s.", a_monnam(mdef));
+22 -14
View File
@@ -251,17 +251,24 @@ bhitm(struct monst *mtmp, struct obj *otmp)
/* g.context.bypasses = TRUE; ## for make_corpse() */ /* g.context.bypasses = TRUE; ## for make_corpse() */
/* no corpse after system shock */ /* no corpse after system shock */
xkilled(mtmp, XKILL_GIVEMSG | XKILL_NOCORPSE); xkilled(mtmp, XKILL_GIVEMSG | XKILL_NOCORPSE);
} else if (newcham(mtmp, (struct permonst *) 0, } else {
polyspot, give_msg) != 0 unsigned ncflags = NO_NC_FLAGS;
/* if shapechange failed because there aren't
enough eligible candidates (most likely for if (polyspot)
vampshifter), try reverting to original form */ ncflags |= NC_VIA_WAND_OR_SPELL;
|| (mtmp->cham >= LOW_PM if (give_msg)
&& newcham(mtmp, &mons[mtmp->cham], ncflags |= NC_SHOW_MSG;
polyspot, give_msg) != 0)) { if (newcham(mtmp, (struct permonst *) 0, ncflags) != 0
if (give_msg && (canspotmon(mtmp) /* if shapechange failed because there aren't
|| engulfing_u(mtmp))) enough eligible candidates (most likely for
learn_it = TRUE; vampshifter), try reverting to original form */
|| (mtmp->cham >= LOW_PM
&& newcham(mtmp, &mons[mtmp->cham],
ncflags) != 0)) {
if (give_msg && (canspotmon(mtmp)
|| engulfing_u(mtmp)))
learn_it = TRUE;
}
} }
/* do this even if polymorphed failed (otherwise using /* do this even if polymorphed failed (otherwise using
@@ -407,7 +414,7 @@ bhitm(struct monst *mtmp, struct obj *otmp)
char *name = Monnam(mtmp); char *name = Monnam(mtmp);
/* turn into flesh golem */ /* turn into flesh golem */
if (newcham(mtmp, &mons[PM_FLESH_GOLEM], FALSE, FALSE)) { if (newcham(mtmp, &mons[PM_FLESH_GOLEM], NO_NC_FLAGS)) {
if (canseemon(mtmp)) if (canseemon(mtmp))
pline("%s turns to flesh!", name); pline("%s turns to flesh!", name);
} else { } else {
@@ -877,7 +884,7 @@ revive(struct obj *corpse, boolean by_hero)
free_omonst(corpse); free_omonst(corpse);
if (mtmp->cham == PM_DOPPELGANGER) { if (mtmp->cham == PM_DOPPELGANGER) {
/* change shape to match the corpse */ /* change shape to match the corpse */
(void) newcham(mtmp, mptr, FALSE, FALSE); (void) newcham(mtmp, mptr, NO_NC_FLAGS);
} else if (mtmp->data->mlet == S_ZOMBIE) { } else if (mtmp->data->mlet == S_ZOMBIE) {
mtmp->mhp = mtmp->mhpmax = 100; mtmp->mhp = mtmp->mhpmax = 100;
mon_adjust_speed(mtmp, 2, (struct obj *) 0); /* MFAST */ mon_adjust_speed(mtmp, 2, (struct obj *) 0); /* MFAST */
@@ -1901,7 +1908,8 @@ stone_to_flesh_obj(struct obj *obj)
ptr = mon->data; ptr = mon->data;
/* this golem handling is redundant... */ /* this golem handling is redundant... */
if (is_golem(ptr) && ptr != &mons[PM_FLESH_GOLEM]) if (is_golem(ptr) && ptr != &mons[PM_FLESH_GOLEM])
(void) newcham(mon, &mons[PM_FLESH_GOLEM], TRUE, FALSE); (void) newcham(mon, &mons[PM_FLESH_GOLEM],
NC_VIA_WAND_OR_SPELL);
} else if ((ptr->geno & (G_NOCORPSE | G_UNIQ)) != 0) { } else if ((ptr->geno & (G_NOCORPSE | G_UNIQ)) != 0) {
/* didn't revive but can't leave corpse either */ /* didn't revive but can't leave corpse either */
res = 0; res = 0;