fix issue #333 - obsolete "green slime corpse"

Issue was for dropping glob of green slime while swallowed by a
purple worm but also applied to pet eating habits.  Green slime
corpse doesn't exist any more; check for glob instead.

Fixes #333
This commit is contained in:
PatR
2020-04-23 17:31:21 -07:00
parent ff483694af
commit 6677003c8f
4 changed files with 15 additions and 13 deletions

View File

@@ -717,9 +717,10 @@ boolean with_impact;
if (obj->otyp == CORPSE) {
could_petrify = touch_petrifies(&mons[obj->corpsenm]);
could_poly = polyfodder(obj);
could_slime = (obj->corpsenm == PM_GREEN_SLIME);
could_grow = (obj->corpsenm == PM_WRAITH);
could_heal = (obj->corpsenm == PM_NURSE);
} else if (obj->otyp == GLOB_OF_GREEN_SLIME) {
could_slime = TRUE;
}
if (is_unpaid(obj))
(void) stolen_value(obj, u.ux, u.uy, TRUE, FALSE);
@@ -730,7 +731,7 @@ boolean with_impact;
could_poly ? (struct permonst *) 0
: &mons[PM_GREEN_SLIME],
FALSE, could_slime);
delobj(obj); /* corpse is digested */
delobj(obj); /* corpse or glob is digested */
} else if (could_petrify) {
minstapetrify(u.ustuck, TRUE);
/* Don't leave a cockatrice corpse in a statue */

View File

@@ -804,21 +804,17 @@ register struct obj *obj;
|| (acidic(fptr) && !resists_acid(mon))
|| (poisonous(fptr) && !resists_poison(mon)))
return POISON;
/* turning into slime is preferable to starvation */
else if (fptr == &mons[PM_GREEN_SLIME] && !slimeproof(mon->data))
return starving ? ACCFOOD : POISON;
/* polymorphing is preferable to starvation, and the pet might also
* want to take their chances on it if they've been mistreated */
/* polymorphing is preferable to starvation, and pet might also
want to take its chances on that if they've been mistreated */
else if (is_shapeshifter(fptr)) {
if (mon->mtame == 1) {
/* A herbivore still won't eat a nonvegan corpse, but in any
* other circumstance a pet with tameness 1 will happily eat
* a shapeshifter. */
/* A herbivore still won't eat a nonvegan corpse, but
in any other circumstance a pet with tameness 1 will
happily eat a shapeshifter. */
return (herbi && !vegan(fptr)) ? MANFOOD : CADAVER;
}
return starving ? ACCFOOD : MANFOOD;
}
else if (vegan(fptr))
} else if (vegan(fptr))
return herbi ? CADAVER : MANFOOD;
/* most humanoids will avoid cannibalism unless starving;
arbitrary: elves won't eat other elves even then */
@@ -828,6 +824,9 @@ register struct obj *obj;
return (starving && carni && !is_elf(mptr)) ? ACCFOOD : TABU;
else
return carni ? CADAVER : MANFOOD;
case GLOB_OF_GREEN_SLIME: /* other globs use the default case */
/* turning into slime is preferable to starvation */
return (starving || slimeproof(mon->data)) ? ACCFOOD : POISON;
case CLOVE_OF_GARLIC:
return (is_undead(mptr) || is_vampshifter(mon))
? TABU

View File

@@ -220,7 +220,7 @@ boolean devour;
deadmimic = (obj->otyp == CORPSE && (obj->corpsenm == PM_SMALL_MIMIC
|| obj->corpsenm == PM_LARGE_MIMIC
|| obj->corpsenm == PM_GIANT_MIMIC));
slimer = (obj->otyp == CORPSE && obj->corpsenm == PM_GREEN_SLIME);
slimer = (obj->otyp == GLOB_OF_GREEN_SLIME);
poly = polyfodder(obj);
grow = mlevelgain(obj);
heal = mhealup(obj);