From ca99dfaeeb1e1c80920422409082c1512cc45770 Mon Sep 17 00:00:00 2001 From: PatR Date: Wed, 19 Jul 2023 12:12:41 -0700 Subject: [PATCH] avoid " slithers under the water" for fish Don't use "slither" for movement action when observing an aquatic monster go into hiding underwater. Use "dive" instead. Shark, pirahna, and jellyfish had been flagged M1_SLITHY but aren't anymore. Giant eel and electric eel are still M1_SLITHY and kraken wasn't and still isn't. There may be some odd cases that used to use slither and it went by unnoticed where now use of the default verb might become noticeable. --- include/monsters.h | 15 +++++++++++---- src/mon.c | 12 ++++++++---- src/mondata.c | 4 ++++ 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/include/monsters.h b/include/monsters.h index 6e3a2093e..be0f17557 100644 --- a/include/monsters.h +++ b/include/monsters.h @@ -1,4 +1,4 @@ -/* NetHack 3.7 monsters.h $NHDT-Date: 1665130023 2022/10/07 08:07:03 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.103 $ */ +/* NetHack 3.7 monsters.h $NHDT-Date: 1689793237 2023/07/19 19:00:37 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.109 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Michael Allison, 2006. */ /* NetHack may be freely redistributed. See license for details. */ @@ -2713,26 +2713,33 @@ M3_INFRAVISIBLE, 8, CLR_YELLOW, DJINNI), /* * sea monsters + * + * 3.7: all the fish except kraken used to specify M1_SLITHY, presumably + * cloned from giant eel. Using "slither" to describe their movmement + * wasn't appropriate. Unfortunately, locomotion() isn't able to choose + * "swim" as their movement description because it is only passed a + * monster type, not a specific monster (for ) or the relevant + * location, and therefore doesn't know whether water is involved. */ MON("jellyfish", S_EEL, LVL(3, 3, 6, 0, 0), (G_GENO | G_NOGEN), A(ATTK(AT_STNG, AD_DRST, 3, 3), NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK), SIZ(80, 20, MS_SILENT, MZ_SMALL), MR_POISON, MR_POISON, - M1_SWIM | M1_AMPHIBIOUS | M1_SLITHY | M1_NOLIMBS | M1_NOHEAD + M1_SWIM | M1_AMPHIBIOUS | M1_NOLIMBS | M1_NOHEAD | M1_NOTAKE | M1_POIS, M2_HOSTILE, 0, 5, CLR_BLUE, JELLYFISH), MON("piranha", S_EEL, LVL(5, 18, 4, 0, 0), (G_GENO | G_NOGEN | G_SGROUP), A(ATTK(AT_BITE, AD_PHYS, 2, 6), ATTK(AT_BITE, AD_PHYS, 2, 6), NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK), SIZ(60, 30, MS_SILENT, MZ_SMALL), 0, 0, - M1_SWIM | M1_AMPHIBIOUS | M1_ANIMAL | M1_SLITHY | M1_NOLIMBS + M1_SWIM | M1_AMPHIBIOUS | M1_ANIMAL | M1_NOLIMBS | M1_CARNIVORE | M1_OVIPAROUS | M1_NOTAKE, M2_HOSTILE, 0, 7, CLR_RED, PIRANHA), MON("shark", S_EEL, LVL(7, 12, 2, 0, 0), (G_GENO | G_NOGEN), A(ATTK(AT_BITE, AD_PHYS, 5, 6), NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK), SIZ(500, 350, MS_SILENT, MZ_LARGE), 0, 0, - M1_SWIM | M1_AMPHIBIOUS | M1_ANIMAL | M1_SLITHY | M1_NOLIMBS + M1_SWIM | M1_AMPHIBIOUS | M1_ANIMAL | M1_NOLIMBS | M1_CARNIVORE | M1_OVIPAROUS | M1_THICK_HIDE | M1_NOTAKE, M2_HOSTILE, 0, 9, CLR_GRAY, SHARK), MON("giant eel", S_EEL, LVL(5, 9, -1, 0, 0), (G_GENO | G_NOGEN), diff --git a/src/mon.c b/src/mon.c index 201092d90..40e296756 100644 --- a/src/mon.c +++ b/src/mon.c @@ -4259,7 +4259,8 @@ hideunder(struct monst *mtmp) { struct trap *t; struct obj *otmp; - const char *seenmon = (char *) 0, *seenobj = (char *) 0; + const char *seenmon = (char *) 0, *seenobj = (char *) 0, + *locomo = (char *) 0; int seeit = gi.in_mklev ? 0 : canseemon(mtmp); boolean oldundetctd, undetected = FALSE, is_u = (mtmp == &gy.youmonst); coordxy x = is_u ? u.ux : mtmp->mx, y = is_u ? u.uy : mtmp->my; @@ -4276,8 +4277,10 @@ hideunder(struct monst *mtmp) under water unless some obstacle blocks line-of-sight */ undetected = (is_pool(x, y) && !Is_waterlevel(&u.uz) && (!Underwater || !couldsee(x, y))); - if (seeit) + if (seeit) { seenobj = "the water"; + locomo = "dive"; + } } else if (hides_under(mtmp->data) /* hider-underers only hide under objects */ && (otmp = gl.level.objects[x][y]) != 0 @@ -4314,8 +4317,9 @@ hideunder(struct monst *mtmp) level creation because 'seeit' will be 0 so 'seenmon' and 'seenobj' will be Null */ if (undetected && seenmon && seenobj) { - You_see("%s %s under %s.", seenmon, - locomotion(mtmp->data, "hide"), seenobj); + if (!locomo) + locomo = locomotion(mtmp->data, "hide"); + You_see("%s %s under %s.", seenmon, locomo, seenobj); iflags.last_msg = PLNMSG_HIDE_UNDER; gl.last_hider = mtmp->m_id; } diff --git a/src/mondata.c b/src/mondata.c index d2440b548..312920c75 100644 --- a/src/mondata.c +++ b/src/mondata.c @@ -1283,6 +1283,10 @@ static locoverbs levitate = { "float", "Float", "wobble", "Wobble" }, flys = { "fly", "Fly", "flutter", "Flutter" }, flyl = { "fly", "Fly", "stagger", "Stagger" }, slither = { "slither", "Slither", "falter", "Falter" }, + /* it would be useful to incorporate "swim" but we lack + * sufficient information to know whether water is involved + swim = { "swim", "Swim", "flop", "Flop" }, + */ ooze = { "ooze", "Ooze", "tremble", "Tremble" }, immobile = { "wiggle", "Wiggle", "pulsate", "Pulsate" }, crawl = { "crawl", "Crawl", "falter", "Falter" };