3.7: fix #9397 - pronouns when hallucinating

Developed for 3.6 but deferred to 3.7.  Most of the testing was with
the earlier incarnation.

Report was that pronouns were accurate for the underlying monsters
when hallucination was describing something random, and also that the
gender prefix flag from bogusmon.txt wasn't being used.  The latter
is still the case, but pronouns are now chosen at random while under
the influence of hallucination.  One of the choices is plural and an
attempt is made to make the monster name and verb fit that usage.

|The homunculus picks up a wand of speed monster.
|The large cats zap themselves with a wand of speed monster!
|The blue dragon is suddenly moving faster.

There is no attempt to match gender for the singular cases; you might
get
|The succubus zaps himself [...]
or
|The incubus zaps herself [...]
This commit is contained in:
PatR
2019-11-24 18:29:14 -08:00
parent 8f5cca8e3d
commit 9adeff5e27
9 changed files with 132 additions and 33 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 extern.h $NHDT-Date: 1574646942 2019/11/25 01:55:42 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.759 $ */
/* NetHack 3.6 extern.h $NHDT-Date: 1574648937 2019/11/25 02:28:57 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.760 $ */
/* Copyright (c) Steve Creps, 1988. */
/* NetHack may be freely redistributed. See license for details. */
@@ -452,6 +452,8 @@ E char *FDECL(Amonnam, (struct monst *));
E char *FDECL(a_monnam, (struct monst *));
E char *FDECL(distant_monnam, (struct monst *, int, char *));
E char *FDECL(mon_nam_too, (struct monst *, struct monst *));
E char *FDECL(monverbself, (struct monst *, char *,
const char *, const char *));
E char *FDECL(minimal_monnam, (struct monst *, BOOLEAN_P));
E char *FDECL(rndmonnam, (char *));
E const char *FDECL(hcolor, (const char *));
@@ -1511,7 +1513,7 @@ E int FDECL(monsndx, (struct permonst *));
E int FDECL(name_to_mon, (const char *));
E int FDECL(name_to_monclass, (const char *, int *));
E int FDECL(gender, (struct monst *));
E int FDECL(pronoun_gender, (struct monst *, BOOLEAN_P));
E int FDECL(pronoun_gender, (struct monst *, unsigned));
E boolean FDECL(levl_follower, (struct monst *));
E int FDECL(little_to_big, (int));
E int FDECL(big_to_little, (int));

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 you.h $NHDT-Date: 1547514642 2019/01/15 01:10:42 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.35 $ */
/* NetHack 3.6 you.h $NHDT-Date: 1574648937 2019/11/25 02:28:57 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.41 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2016. */
/* NetHack may be freely redistributed. See license for details. */
@@ -237,14 +237,21 @@ extern const struct Gender genders[]; /* table of available genders */
#define uhe() (genders[flags.female ? 1 : 0].he)
#define uhim() (genders[flags.female ? 1 : 0].him)
#define uhis() (genders[flags.female ? 1 : 0].his)
/* pronoun_gender() flag masks */
#define PRONOUN_NORMAL 0 /* none of the below */
#define PRONOUN_NO_IT 1
#define PRONOUN_HALLU 2
/* corresponding pronouns for monsters; yields "it" when mtmp can't be seen */
#define mhe(mtmp) (genders[pronoun_gender(mtmp, FALSE)].he)
#define mhim(mtmp) (genders[pronoun_gender(mtmp, FALSE)].him)
#define mhis(mtmp) (genders[pronoun_gender(mtmp, FALSE)].his)
#define mhe(mtmp) (genders[pronoun_gender(mtmp, PRONOUN_HALLU)].he)
#define mhim(mtmp) (genders[pronoun_gender(mtmp, PRONOUN_HALLU)].him)
#define mhis(mtmp) (genders[pronoun_gender(mtmp, PRONOUN_HALLU)].his)
/* override "it" if reason is lack of visibility rather than neuter species */
#define noit_mhe(mtmp) (genders[pronoun_gender(mtmp, TRUE)].he)
#define noit_mhim(mtmp) (genders[pronoun_gender(mtmp, TRUE)].him)
#define noit_mhis(mtmp) (genders[pronoun_gender(mtmp, TRUE)].his)
#define noit_mhe(mtmp) \
(genders[pronoun_gender(mtmp, (PRONOUN_NO_IT | PRONOUN_HALLU))].he)
#define noit_mhim(mtmp) \
(genders[pronoun_gender(mtmp, (PRONOUN_NO_IT | PRONOUN_HALLU))].him)
#define noit_mhis(mtmp) \
(genders[pronoun_gender(mtmp, (PRONOUN_NO_IT | PRONOUN_HALLU))].his)
/*** Unified structure specifying alignment information ***/
struct Align {