diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 3668be89f..75d5a4875 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -177,6 +177,7 @@ keep track of which monsters were cloned from other monsters number_pad:3 run-time option to use inverted phone keypad layout for movement number_pad:-1 to swap function of y and z keys; z to move NW, y to zap wands display spell retention information in the spell menu +tame ghouls can eat old eggs Platform- and/or Interface-Specific New Features diff --git a/src/dog.c b/src/dog.c index 03e4324cb..d463ed0c6 100644 --- a/src/dog.c +++ b/src/dog.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)dog.c 3.5 2006/01/03 */ +/* SCCS Id: @(#)dog.c 3.5 2006/02/13 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -687,7 +687,7 @@ dogfood(mon,obj) struct monst *mon; register struct obj *obj; { - struct permonst *mptr = mon->data, *fptr = &mons[obj->corpsenm]; + struct permonst *mptr = mon->data, *fptr = 0; boolean carni = carnivorous(mptr), herbi = herbivorous(mptr), starving; @@ -696,24 +696,34 @@ register struct obj *obj; switch(obj->oclass) { case FOOD_CLASS: - if (obj->otyp == CORPSE && - ((touch_petrifies(fptr) && !resists_ston(mon)) - || is_rider(fptr))) - return TABU; + if (obj->otyp == CORPSE || obj->otyp == TIN || obj->otyp == EGG) + fptr = &mons[obj->corpsenm]; - /* Ghouls only eat old corpses... yum! */ - if (mptr == &mons[PM_GHOUL]) - return (obj->otyp == CORPSE && - peek_at_iced_corpse_age(obj) + 50L <= monstermoves) ? - DOGFOOD : TABU; - - if (!carni && !herbi) - return (obj->cursed ? UNDEF : APPORT); + if (obj->otyp == CORPSE && is_rider(fptr)) return TABU; + if ((obj->otyp == CORPSE || obj->otyp == EGG) && + touch_petrifies(fptr) && !resists_ston(mon)) return POISON; + if (!carni && !herbi) return obj->cursed ? UNDEF : APPORT; /* a starving pet will eat almost anything */ starving = (mon->mtame && !mon->isminion && EDOG(mon)->mhpmax_penalty); + /* ghouls prefer old corpses and unhatchable eggs, yum! + they'll eat fresh non-veggy corpses and hatchable eggs + when starving; they never eat stone-to-flesh'd meat */ + if (mptr == &mons[PM_GHOUL]) { + if (obj->otyp == CORPSE) + return + (peek_at_iced_corpse_age(obj) + 50L <= monstermoves && + fptr != &mons[PM_LIZARD] && + fptr != &mons[PM_LICHEN]) ? DOGFOOD : + (starving && !vegan(fptr)) ? ACCFOOD : POISON; + if (obj->otyp == EGG) + return stale_egg(obj) ? CADAVER : + starving ? ACCFOOD : POISON; + return TABU; + } + switch (obj->otyp) { case TRIPE_RATION: case MEATBALL: @@ -722,8 +732,6 @@ register struct obj *obj; case HUGE_CHUNK_OF_MEAT: return (carni ? DOGFOOD : MANFOOD); case EGG: - if (touch_petrifies(fptr) && !resists_ston(mon)) - return POISON; return (carni ? CADAVER : MANFOOD); case CORPSE: if ((peek_at_iced_corpse_age(obj) + 50L <= monstermoves diff --git a/src/monst.c b/src/monst.c index 20da9edc5..71d7db135 100644 --- a/src/monst.c +++ b/src/monst.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)monst.c 3.5 2006/01/04 */ +/* SCCS Id: @(#)monst.c 3.5 2006/02/13 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -2169,7 +2169,7 @@ struct permonst _mons2[] = { NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK), SIZ(400, 50, MS_SILENT, MZ_SMALL), MR_COLD|MR_SLEEP|MR_POISON, 0, - M1_BREATHLESS|M1_MINDLESS|M1_HUMANOID|M1_POIS, + M1_BREATHLESS|M1_MINDLESS|M1_HUMANOID|M1_POIS|M1_OMNIVORE, M2_UNDEAD|M2_WANDER|M2_HOSTILE, M3_INFRAVISION, CLR_BLACK), MON("giant zombie", S_ZOMBIE, LVL(8, 8, 6, 0, -4), (G_GENO|G_NOCORPSE|1),