fix issue #351 - summoned critters while Hallu
If a monster uses the 'summon insects' spell (which will resort to snakes if all 'a' class critters are genocided or extinct) while the hero is hallucinating, report the summoning of something unusual rather than of insects or snakes. I bypassed "random creature" direct to "hallucinatory creature" for the something unusual. Fixes #351
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 config.h $NHDT-Date: 1575245033 2019/12/02 00:03:53 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.126 $ */
|
||||
/* NetHack 3.6 config.h $NHDT-Date: 1590902639 2020/05/31 05:23:59 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.135 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Robert Patrick Rankin, 2016. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -6,6 +6,12 @@
|
||||
#ifndef CONFIG_H /* make sure the compiler does not see the typedefs twice */
|
||||
#define CONFIG_H
|
||||
|
||||
#define MONITOR_HEAP
|
||||
#define EXTRA_SANITY_CHECKS
|
||||
#define DUMPLOG
|
||||
#define SCORE_ON_BOTL
|
||||
#define EDIT_GETLIN
|
||||
|
||||
/*
|
||||
* Section 1: Operating and window systems selection.
|
||||
* Select the version of the OS you are using.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 extern.h $NHDT-Date: 1590870784 2020/05/30 20:33:04 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.844 $ */
|
||||
/* NetHack 3.6 extern.h $NHDT-Date: 1590902647 2020/05/31 05:24:07 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.845 $ */
|
||||
/* Copyright (c) Steve Creps, 1988. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -464,6 +464,7 @@ 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(bogusmon, (char *, char *));
|
||||
E char *FDECL(rndmonnam, (char *));
|
||||
E const char *FDECL(hcolor, (const char *));
|
||||
E const char *NDECL(rndcolor);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 do_name.c $NHDT-Date: 1586940208 2020/04/15 08:43:28 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.178 $ */
|
||||
/* NetHack 3.6 do_name.c $NHDT-Date: 1590902650 2020/05/31 05:24:10 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.179 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Pasi Kallinen, 2018. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -22,7 +22,6 @@ static boolean FDECL(alreadynamed, (struct monst *, char *, char *));
|
||||
static void FDECL(do_oname, (struct obj *));
|
||||
static char *FDECL(docall_xname, (struct obj *));
|
||||
static void NDECL(namefloorobj);
|
||||
static char *FDECL(bogusmon, (char *,char *));
|
||||
|
||||
extern const char what_is_an_unknown_object[]; /* from pager.c */
|
||||
|
||||
@@ -2059,7 +2058,7 @@ boolean ckloc;
|
||||
}
|
||||
|
||||
/* fake monsters used to be in a hard-coded array, now in a data file */
|
||||
static char *
|
||||
char *
|
||||
bogusmon(buf, code)
|
||||
char *buf, *code;
|
||||
{
|
||||
|
||||
50
src/mcastu.c
50
src/mcastu.c
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 mcastu.c $NHDT-Date: 1580633721 2020/02/02 08:55:21 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.64 $ */
|
||||
/* NetHack 3.6 mcastu.c $NHDT-Date: 1590902653 2020/05/31 05:24:13 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.65 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Robert Patrick Rankin, 2011. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -584,11 +584,11 @@ int spellnum;
|
||||
left, go for (sticks to) snakes. -3. */
|
||||
struct permonst *pm = mkclass(S_ANT, 0);
|
||||
struct monst *mtmp2 = (struct monst *) 0;
|
||||
char let = (pm ? S_ANT : S_SNAKE);
|
||||
char whatbuf[QBUFSZ], let = (pm ? S_ANT : S_SNAKE);
|
||||
boolean success = FALSE, seecaster;
|
||||
int i, quan, oldseen, newseen;
|
||||
coord bypos;
|
||||
const char *fmt;
|
||||
const char *fmt, *what;
|
||||
|
||||
oldseen = monster_census(TRUE);
|
||||
quan = (mtmp->m_lev < 2) ? 1 : rnd((int) mtmp->m_lev / 2);
|
||||
@@ -606,22 +606,26 @@ int spellnum;
|
||||
}
|
||||
newseen = monster_census(TRUE);
|
||||
|
||||
/* not canspotmon(), which includes unseen things sensed via warning
|
||||
*/
|
||||
/* not canspotmon() which includes unseen things sensed via warning */
|
||||
seecaster = canseemon(mtmp) || tp_sensemon(mtmp) || Detect_monsters;
|
||||
what = (let == S_SNAKE) ? "snakes" : "insects";
|
||||
if (Hallucination)
|
||||
what = makeplural(bogusmon(whatbuf, (char *) 0));
|
||||
|
||||
fmt = 0;
|
||||
if (!seecaster) {
|
||||
char *arg; /* [not const: upstart(N==1 ? an() : makeplural())] */
|
||||
const char *what = (let == S_SNAKE) ? "snake" : "insect";
|
||||
|
||||
if (newseen <= oldseen || Unaware) {
|
||||
/* unseen caster fails or summons unseen critters,
|
||||
or unconscious hero ("You dream that you hear...") */
|
||||
You_hear("someone summoning %s.", makeplural(what));
|
||||
You_hear("someone summoning %s.", what);
|
||||
} else {
|
||||
char *arg;
|
||||
|
||||
if (what != whatbuf)
|
||||
what = strcpy(whatbuf, what);
|
||||
/* unseen caster summoned seen critter(s) */
|
||||
arg = (newseen == oldseen + 1) ? an(what) : makeplural(what);
|
||||
arg = (newseen == oldseen + 1) ? an(makesingular(what))
|
||||
: whatbuf;
|
||||
if (!Deaf)
|
||||
You_hear("someone summoning something, and %s %s.", arg,
|
||||
vtense(arg, "appear"));
|
||||
@@ -634,19 +638,21 @@ int spellnum;
|
||||
observe complete accuracy of that caster's results (in other
|
||||
words, no need to fuss with visibility or singularization;
|
||||
player is told what's happening even if hero is unconscious) */
|
||||
} else if (!success)
|
||||
fmt = "%s casts at a clump of sticks, but nothing happens.";
|
||||
else if (let == S_SNAKE)
|
||||
fmt = "%s transforms a clump of sticks into snakes!";
|
||||
else if (Invis && !perceives(mtmp->data)
|
||||
&& (mtmp->mux != u.ux || mtmp->muy != u.uy))
|
||||
fmt = "%s summons insects around a spot near you!";
|
||||
else if (Displaced && (mtmp->mux != u.ux || mtmp->muy != u.uy))
|
||||
fmt = "%s summons insects around your displaced image!";
|
||||
else
|
||||
fmt = "%s summons insects!";
|
||||
} else if (!success) {
|
||||
fmt = "%s casts at a clump of sticks, but nothing happens.%s";
|
||||
what = "";
|
||||
} else if (let == S_SNAKE) {
|
||||
fmt = "%s transforms a clump of sticks into %s!";
|
||||
} else if (Invis && !perceives(mtmp->data)
|
||||
&& (mtmp->mux != u.ux || mtmp->muy != u.uy)) {
|
||||
fmt = "%s summons %s around a spot near you!";
|
||||
} else if (Displaced && (mtmp->mux != u.ux || mtmp->muy != u.uy)) {
|
||||
fmt = "%s summons %s around your displaced image!";
|
||||
} else {
|
||||
fmt = "%s summons %s!";
|
||||
}
|
||||
if (fmt)
|
||||
pline(fmt, Monnam(mtmp));
|
||||
pline(fmt, Monnam(mtmp), what);
|
||||
|
||||
dmg = 0;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user