From 27b93148c0b9ff8d905e79d023bf908f921d6cc3 Mon Sep 17 00:00:00 2001 From: PatR Date: Wed, 18 Nov 2020 11:16:21 -0800 Subject: [PATCH] ki-rin's horn Let ki-rin cure themselves (of being stunned, confused, or blinded) with their own horn, and make them be poison resistant. They aren't unicorns but their horn is very much like a unicorn horn. They're flagged no-corpse so this hasn't changed them to leave behind a horn upon death. They were flagged as animals who neighed but they are also spell casters. I took the animal flag off (they're still no-hands so shouldn't be able to use items; also, unicorns aren't flagged as animals either) and changed sound to 'ms_spell'. --- dat/data.base | 11 ++++++----- doc/fixes37.0 | 6 +++++- src/monst.c | 8 +++++--- src/muse.c | 30 ++++++++++++++++++++---------- 4 files changed, 36 insertions(+), 19 deletions(-) diff --git a/dat/data.base b/dat/data.base index 66f32e68a..117d28fe3 100644 --- a/dat/data.base +++ b/dat/data.base @@ -1,5 +1,5 @@ # NetHack 3.7 data.base -# $NHDT-Date: 1596498239 2020/08/03 23:43:59 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.97 $ +# $NHDT-Date: 1605726848 2020/11/18 19:14:08 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.98 $ # Copyright (c) 1994, 1995, 1996 by the NetHack Development Team # Copyright (c) 1994 by Boudewijn Wayers # NetHack may be freely redistributed. See license for details. @@ -2699,10 +2699,11 @@ kelp* specimens in their native setting. [ 20,000 Leagues Under the Sea, by Jules Verne ] ki-rin - The ki-rin is a strange-looking flying creature. It has - scales, a mane like a lion, a tail, hooves, and a horn. It - is brightly colored, and can usually be found flying in the - sky looking for good deeds to reward. + The ki-rin is a strange-looking wingless flying creature. + It has scales, a mane like a lion, a tail, four legs with + hooves, and a horn like a unicorn's. It is brightly colored, + and can usually be found flying in the sky looking for good + deeds to reward. king arthur *arthur Ector took both his sons to the church before which the diff --git a/doc/fixes37.0 b/doc/fixes37.0 index ac28534c6..caaf3fa64 100644 --- a/doc/fixes37.0 +++ b/doc/fixes37.0 @@ -1,4 +1,4 @@ -NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.354 $ $NHDT-Date: 1605578879 2020/11/17 02:07:59 $ +NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.356 $ $NHDT-Date: 1605726848 2020/11/18 19:14:08 $ General Fixes and Modified Features ----------------------------------- @@ -296,6 +296,10 @@ hero could break a wand ("raising the wand high over your head, you break it if a monster threw a cocktrice egg at the hero but hit and petrified another monster, the hero would get credit/blame for killing it update persistent inventory when putting on a helmet causes it to auto-curse +since ki-rin look quite a bit like unicorns, make them be more like one: + allow them to use their own horn to cure themselves; remove M1_ANIMAL, + change MS_NEIGH to MS_SPELL, add MR_POISON; they're still 'A' rather + than 'u' and don't care about gems Fixes to 3.7.0-x Problems that Were Exposed Via git Repository diff --git a/src/monst.c b/src/monst.c index 9bbce0a27..1955f37a0 100644 --- a/src/monst.c +++ b/src/monst.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 monst.c $NHDT-Date: 1596498187 2020/08/03 23:43:07 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.76 $ */ +/* NetHack 3.7 monst.c $NHDT-Date: 1605726850 2020/11/18 19:14:10 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.78 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Michael Allison, 2006. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1020,13 +1020,15 @@ NEARDATA struct permonst mons_init[] = { M1_FLY | M1_HUMANOID | M1_SEE_INVIS, M2_NOPOLY | M2_MINION | M2_STALK | M2_STRONG | M2_NASTY | M2_COLLECT, M3_INFRAVISIBLE | M3_INFRAVISION, 19, CLR_WHITE), + /* the AD&D Monster Manual depicts ki-rin as very similar to unicorns + except that they fly (without wings) and can cast spells */ MON("ki-rin", S_ANGEL, LVL(16, 18, -5, 90, 15), (G_NOHELL | G_NOCORPSE | 1), A(ATTK(AT_KICK, AD_PHYS, 2, 4), ATTK(AT_KICK, AD_PHYS, 2, 4), ATTK(AT_BUTT, AD_PHYS, 3, 6), ATTK(AT_MAGC, AD_SPEL, 2, 6), NO_ATTK, NO_ATTK), - SIZ(WT_HUMAN, 400, MS_NEIGH, MZ_LARGE), 0, 0, - M1_FLY | M1_ANIMAL | M1_NOHANDS | M1_SEE_INVIS, + SIZ(WT_HUMAN, 400, MS_SPELL, MZ_LARGE), MR_POISON, 0, + M1_FLY | M1_NOHANDS | M1_SEE_INVIS, M2_NOPOLY | M2_MINION | M2_STALK | M2_STRONG | M2_NASTY | M2_LORD, M3_INFRAVISIBLE | M3_INFRAVISION, 21, HI_GOLD), MON("Archon", S_ANGEL, LVL(19, 16, -6, 80, 15), diff --git a/src/muse.c b/src/muse.c index 12e2cb6d6..d82792d4a 100644 --- a/src/muse.c +++ b/src/muse.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 muse.c $NHDT-Date: 1603509297 2020/10/24 03:14:57 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.132 $ */ +/* NetHack 3.7 muse.c $NHDT-Date: 1605726852 2020/11/18 19:14:12 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.134 $ */ /* Copyright (C) 1990 by Ken Arromdee */ /* NetHack may be freely redistributed. See license for details. */ @@ -331,13 +331,16 @@ boolean find_defensive(mtmp) struct monst *mtmp; { - register struct obj *obj = 0; + struct obj *obj; struct trap *t; int fraction, x = mtmp->mx, y = mtmp->my; boolean stuck = (mtmp == u.ustuck), immobile = (mtmp->data->mmove == 0); stairway *stway; + g.m.defensive = (struct obj *) 0; + g.m.has_defense = 0; + if (is_animal(mtmp->data) || mindless(mtmp->data)) return FALSE; if (dist2(x, y, mtmp->mux, mtmp->muy) > 25) @@ -345,19 +348,25 @@ struct monst *mtmp; if (u.uswallow && stuck) return FALSE; - g.m.defensive = (struct obj *) 0; - g.m.has_defense = 0; - - /* since unicorn horns don't get used up, the monster would look - * silly trying to use the same cursed horn round after round + /* + * Since unicorn horns don't get used up, the monster would look + * silly trying to use the same cursed horn round after round, + * so skip cursed unicorn horns. + * + * Unicorns use their own horns; they're excluded from inventory + * scanning by nohands(). Ki-rin is depicted in the AD&D Monster + * Manual with same horn as a unicorn, so let it use its horn too. + * is_unicorn() doesn't include it; the class differs and it has + * no interest in gems. */ if (mtmp->mconf || mtmp->mstun || !mtmp->mcansee) { - if (!is_unicorn(mtmp->data) && !nohands(mtmp->data)) { + obj = 0; + if (!nohands(mtmp->data)) { for (obj = mtmp->minvent; obj; obj = obj->nobj) if (obj->otyp == UNICORN_HORN && !obj->cursed) break; } - if (obj || is_unicorn(mtmp->data)) { + if (obj || is_unicorn(mtmp->data) || mtmp->data == &mons[PM_KI_RIN]) { g.m.defensive = obj; g.m.has_defense = MUSE_UNICORN_HORN; return TRUE; @@ -2363,7 +2372,8 @@ struct obj *obj; if (typ == PICK_AXE) return (boolean) needspick(mon->data); if (typ == UNICORN_HORN) - return (boolean) (!obj->cursed && !is_unicorn(mon->data)); + return (boolean) (!obj->cursed && !is_unicorn(mon->data) + && mon->data != &mons[PM_KI_RIN]); if (typ == FROST_HORN || typ == FIRE_HORN) return (obj->spe > 0 && can_blow(mon)); if (Is_container(obj) && !(Is_mbag(obj) && obj->cursed))