]> granicus.if.org Git - nethack/commitdiff
wishing for quest guardian corpse
authornethack.allison <nethack.allison>
Tue, 19 Aug 2003 04:06:34 +0000 (04:06 +0000)
committernethack.allison <nethack.allison>
Tue, 19 Aug 2003 04:06:34 +0000 (04:06 +0000)
wishing for quest guardian corpse now gives
a generic corpse of the species

doc/fixes34.2
include/extern.h
src/mon.c
src/objnam.c

index 98ec44bb9fb2e8c24e997c9ba319f72ab1dc5bcf..0e2a194457d8d94cd73b3af56383a2a0fc64b7cf 100644 (file)
@@ -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
index 056d92c1f752bf8908ac39dbc50943fe2ad3b3e0..1f905b89d2c21387f9470a63255fd3b630f7884b 100644 (file)
@@ -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);
index 669466c74cfdfcb53295ce40b25bfdcb88e87d97..ac46115d9b1d5248cd5154009798ad5792bc1788 100644 (file)
--- 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)
index 472223f91c39425840ede022ac6227b07f0098db..1b5d22d37c2163d0cb8f23acd52a95bc324c6b9e 100644 (file)
@@ -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;