From: PatR Date: Sun, 20 Jun 2021 23:45:42 +0000 (-0700) Subject: " appears in cloud of smoke." X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0bb77f455d39359bcbab017c83921d7a0615171a;p=nethack " appears in cloud of smoke." Have water demons appear in a cloud of vapor rather than a cloud of smoke. This adds a few other alternatives but they'll never happen. Elementals could only be summoned by Angels but Angels never call msummon() as far as I can tell. Vortices aren't summoned at all but the smoke/vapor/&c routine has provisions for them. The cloud of smoke message used to be given only when the summoner is a demon. Now it will be given if the last--or only--summoned creature can be seen to arrive, no matter whether summoned by a demon, a non-demon (which I think isn't possible), or post-Wizard harassment. --- diff --git a/include/extern.h b/include/extern.h index 92ce774e8..b51c60cda 100644 --- a/include/extern.h +++ b/include/extern.h @@ -1,4 +1,4 @@ -/* NetHack 3.7 extern.h $NHDT-Date: 1620923916 2021/05/13 16:38:36 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.971 $ */ +/* NetHack 3.7 extern.h $NHDT-Date: 1624232719 2021/06/20 23:45:19 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.983 $ */ /* Copyright (c) Steve Creps, 1988. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1502,6 +1502,7 @@ extern boolean big_little_match(int, int); extern const char *locomotion(const struct permonst *, const char *); extern const char *stagger(const struct permonst *, const char *); extern const char *on_fire(struct permonst *, struct attack *); +extern const char *msummon_environ(struct permonst *); extern const struct permonst *raceptr(struct monst *); extern boolean olfaction(struct permonst *); unsigned long cvt_adtyp_to_mseenres(uchar); diff --git a/src/minion.c b/src/minion.c index faf30590c..f910fe4e8 100644 --- a/src/minion.c +++ b/src/minion.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 minion.c $NHDT-Date: 1596498180 2020/08/03 23:43:00 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.55 $ */ +/* NetHack 3.7 minion.c $NHDT-Date: 1624232728 2021/06/20 23:45:28 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.59 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2008. */ /* NetHack may be freely redistributed. See license for details. */ @@ -49,6 +49,10 @@ monster_census(boolean spotted) /* seen|sensed vs all */ int msummon(struct monst *mon) { + static const int elementals[4] = { + PM_AIR_ELEMENTAL, PM_FIRE_ELEMENTAL, + PM_EARTH_ELEMENTAL, PM_WATER_ELEMENTAL + }; struct permonst *ptr; int dtype = NON_PM, cnt = 0, result = 0, census; aligntyp atyp; @@ -64,10 +68,9 @@ msummon(struct monst *mon) } atyp = mon->ispriest ? EPRI(mon)->shralign - : mon->isminion ? EMIN(mon)->min_align - : (ptr->maligntyp == A_NONE) - ? A_NONE - : sgn(ptr->maligntyp); + : mon->isminion ? EMIN(mon)->min_align + : (ptr->maligntyp == A_NONE) ? A_NONE + : sgn(ptr->maligntyp); } else { ptr = &mons[PM_WIZARD_OF_YENDOR]; atyp = (ptr->maligntyp == A_NONE) ? A_NONE : sgn(ptr->maligntyp); @@ -98,7 +101,7 @@ msummon(struct monst *mon) if (!rn2(6)) { switch (atyp) { /* see summon_minion */ case A_NEUTRAL: - dtype = PM_AIR_ELEMENTAL + rn2(4); + dtype = elementals[rn2(SIZE(elementals))]; break; case A_CHAOTIC: case A_NONE: @@ -145,8 +148,16 @@ msummon(struct monst *mon) EMIN(mtmp)->renegade = (atyp != u.ualign.type) ^ !mtmp->mpeaceful; } - if (is_demon(ptr) && canseemon(mtmp)) - pline("%s appears in a cloud of smoke!", Amonnam(mtmp)); + + if (cnt == 1 && canseemon(mtmp)) { + const char *what = msummon_environ(mtmp->data), /* "smoke" */ + *cloud = !strcmpi(what, "sparks") ? "shower" + : !strcmpi(what, "flame") ? "burst" + : "cloud"; + + pline("%s appears in a %s of %s!", Amonnam(mtmp), + cloud, what); + } } cnt--; } diff --git a/src/mondata.c b/src/mondata.c index 07f79bc6a..d737123e2 100644 --- a/src/mondata.c +++ b/src/mondata.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 mondata.c $NHDT-Date: 1623489867 2021/06/12 09:24:27 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.95 $ */ +/* NetHack 3.7 mondata.c $NHDT-Date: 1624232729 2021/06/20 23:45:29 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.97 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2011. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1174,7 +1174,7 @@ stagger(const struct permonst* ptr, const char* def) /* return phrase describing the effect of fire attack on a type of monster */ const char * -on_fire(struct permonst* mptr, struct attack* mattk) +on_fire(struct permonst *mptr, struct attack *mattk) { const char *what; @@ -1210,6 +1210,40 @@ on_fire(struct permonst* mptr, struct attack* mattk) return what; } +/* similar to on_fire(); creature is summoned in a cloud of */ +const char * +msummon_environ(struct permonst *mptr) +{ + const char *what; + + switch (monsndx(mptr)) { + case PM_WATER_DEMON: + case PM_AIR_ELEMENTAL: + case PM_WATER_ELEMENTAL: + case PM_FOG_CLOUD: + case PM_ICE_VORTEX: + what = "vapor"; + break; + case PM_STEAM_VORTEX: + what = "steam"; + break; + case PM_ENERGY_VORTEX: + what = "sparks"; + break; + case PM_EARTH_ELEMENTAL: + case PM_DUST_VORTEX: + what = "dust"; + break; + case PM_FIRE_ELEMENTAL: + what = "flame"; + break; + default: + what = "smoke"; + break; + } + return what; +} + /* * Returns: * True if monster is presumed to have a sense of smell.