-/* 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. */
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);
-/* 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. */
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;
}
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);
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:
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--;
}
-/* 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. */
/* 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;
return what;
}
+/* similar to on_fire(); creature is summoned in a cloud of <something> */
+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.