From 3372f5d6940a4f29fab328b42cc5be61b5befefc Mon Sep 17 00:00:00 2001 From: "nethack.allison" Date: Tue, 19 Aug 2003 04:06:34 +0000 Subject: [PATCH] wishing for quest guardian corpse wishing for quest guardian corpse now gives a generic corpse of the species --- doc/fixes34.2 | 1 + include/extern.h | 1 + src/mon.c | 40 ++++++++++++++++++++++++++++++++++++++++ src/objnam.c | 5 ++++- 4 files changed, 46 insertions(+), 1 deletion(-) diff --git a/doc/fixes34.2 b/doc/fixes34.2 index 98ec44bb9..0e2a19445 100644 --- a/doc/fixes34.2 +++ b/doc/fixes34.2 @@ -132,6 +132,7 @@ if you couldn't see the rat created in a sink for some reason other than digging a pit while stuck in the floor should always free the player quest guardians can no longer be created via stone-to-flesh on their statue stone-to-flesh no longer silently ignored by a statue of a unique monster +wishing for quest guardian corpse now gives a generic corpse of the species Platform- and/or Interface-Specific Fixes diff --git a/include/extern.h b/include/extern.h index 056d92c1f..1f905b89d 100644 --- a/include/extern.h +++ b/include/extern.h @@ -1098,6 +1098,7 @@ E struct mkroom *FDECL(search_special, (SCHAR_P)); /* ### mon.c ### */ E int FDECL(undead_to_corpse, (int)); +E int FDECL(genus, (int)); E int FDECL(pm_to_cham, (int)); E int FDECL(minliquid, (struct monst *)); E int NDECL(movemon); diff --git a/src/mon.c b/src/mon.c index 669466c74..ac46115d9 100644 --- a/src/mon.c +++ b/src/mon.c @@ -84,6 +84,46 @@ int mndx; return mndx; } +/* Convert the monster index of some monsters (such as quest guardians) + * to their generic species type. + */ +int +genus(mndx) +int mndx; +{ + switch (mndx) { +/* Quest guardians */ + case PM_STUDENT: + case PM_CHIEFTAIN: + case PM_NEANDERTHAL: + case PM_ATTENDANT: + case PM_PAGE: + case PM_ABBOT: + case PM_ACOLYTE: + case PM_HUNTER: + case PM_THUG: + case PM_ROSHI: +#ifdef TOURIST + case PM_GUIDE: +#endif + case PM_WARRIOR: + case PM_APPRENTICE: + mndx = PM_HUMAN; + break; + default: + if (mndx >= LOW_PM && mndx < NUMMONS) { + struct permonst *ptr = &mons[mndx]; + if (is_human(ptr)) mndx = PM_HUMAN; + else if (is_elf(ptr)) mndx = PM_ELF; + else if (is_dwarf(ptr)) mndx = PM_DWARF; + else if (is_gnome(ptr)) mndx = PM_GNOME; + else if (is_orc(ptr)) mndx = PM_ORC; + } + break; + } + return mndx; +} + /* convert monster index to chameleon index */ int pm_to_cham(mndx) diff --git a/src/objnam.c b/src/objnam.c index 472223f91..1b5d22d37 100644 --- a/src/objnam.c +++ b/src/objnam.c @@ -2559,7 +2559,10 @@ typfnd: /* beware of random troll or lizard corpse, or of ordinary one being forced to such */ if (otmp->timed) obj_stop_timers(otmp); - otmp->corpsenm = mntmp; + if (mons[mntmp].msound == MS_GUARDIAN) + otmp->corpsenm = genus(mntmp); + else + otmp->corpsenm = mntmp; start_corpse_timeout(otmp); } break; -- 2.40.0