Monsters can gain resistances by eating corpses

This is based on both the EvilHack implementation by
k21971 <keith.simpson1971@gmail.com>, and xNetHack
implementation by copperwater <aosdict@gmail.com>.
This commit is contained in:
Pasi Kallinen
2021-05-23 19:02:38 +03:00
parent 20cbadcf85
commit 8d2407f1f2
8 changed files with 149 additions and 50 deletions

View File

@@ -204,7 +204,7 @@ dog_eat(struct monst *mtmp,
{
register struct edog *edog = EDOG(mtmp);
boolean poly, grow, heal, eyes, slimer, deadmimic;
int nutrit, res;
int nutrit, res, corpsenm;
long oprice;
char objnambuf[BUFSZ];
@@ -221,6 +221,7 @@ dog_eat(struct monst *mtmp,
grow = mlevelgain(obj);
heal = mhealup(obj);
eyes = (obj->otyp == CARROT);
corpsenm = (obj->otyp == CORPSE ? obj->corpsenm : NON_PM);
if (devour) {
if (mtmp->meating > 1)
@@ -347,6 +348,8 @@ dog_eat(struct monst *mtmp,
mcureblindness(mtmp, canseemon(mtmp));
if (deadmimic)
quickmimic(mtmp);
if (corpsenm != NON_PM)
mon_givit(mtmp, &mons[corpsenm]);
return 1;
}