From 81a4c2ed4c987ecd864e5f974fc179cfbc3740f5 Mon Sep 17 00:00:00 2001 From: PatR Date: Fri, 8 Apr 2022 00:35:13 -0700 Subject: [PATCH] aligned cleric corpse I was looking into "The Lord Surtur's corpse" and got side-tracked by something else: move a priest hack for avoiding "aligned" in a corpse description from corpse_xname() to obj_pmname(). The old variation always picked "priest corpse" over "priestess corpse". The new one will use either one of those if the corpse is flagged as such, or use "cleric corpse" (avoiding "aligned cleric corpse") if it's flagged as random. --- src/do_name.c | 17 +++++++++++++++-- src/objnam.c | 5 ----- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/do_name.c b/src/do_name.c index 0880333bc..ed88d2dab 100644 --- a/src/do_name.c +++ b/src/do_name.c @@ -2209,9 +2209,22 @@ obj_pmname(struct obj *obj) int cgend = (obj->spe & CORPSTAT_GENDER), mgend = ((cgend == CORPSTAT_MALE) ? MALE : (cgend == CORPSTAT_FEMALE) ? FEMALE - : NEUTRAL); + : NEUTRAL), + mndx = obj->corpsenm; - return pmname(&mons[obj->corpsenm], mgend); + /* mons[].pmnames[] for monster cleric uses "priest" or "priestess" + or "aligned cleric"; we want to avoid "aligned cleric [corpse]" + unless it has been explicitly flagged as neuter rather than + defaulting to random (which fails male or female check above); + role monster cleric uses "priest" or "priestess" or "cleric" + without "aligned" prefix so we switch to that; [can't force + random gender to be chosen here because splitting a stack of + corpses could cause the split-off portion to change gender, so + settle for avoiding "aligned"] */ + if (mndx == PM_ALIGNED_CLERIC && cgend == CORPSTAT_RANDOM) + mndx = PM_CLERIC; + + return pmname(&mons[mndx], mgend); } return "two-legged glorkum-seeker"; } diff --git a/src/objnam.c b/src/objnam.c index 7bf853fc9..c26ecac6b 100644 --- a/src/objnam.c +++ b/src/objnam.c @@ -1560,11 +1560,6 @@ corpse_xname( mnam = OBJ_NAME(objects[otmp->otyp]); /* "glob of " */ } else if (omndx == NON_PM) { /* paranoia */ mnam = "thing"; - /* [Possible enhancement: check whether corpse has monster traits - attached in order to use priestname() for priests and minions.] */ - } else if (omndx == PM_ALIGNED_CLERIC) { - /* avoid "aligned priest"; it just exposes internal details */ - mnam = "priest"; } else { mnam = obj_pmname(otmp); if (the_unique_pm(&mons[omndx]) || type_is_pname(&mons[omndx])) {