From cb5504b38e9359db6d860575fca7a15971223ff4 Mon Sep 17 00:00:00 2001 From: "nethack.rankin" Date: Sun, 6 May 2007 00:57:49 +0000 Subject: [PATCH] chatting with grunting monsters From the newsgroup: attempting to #chat to a gnome elicited "the gnome grunts" (because gnomes have MS_ORC sound, and MS_ORC is just a synonym for MS_GRUNT) even when the hero was a gnome. This patch makes MS_ORC (orcs, gnomes, kobolds, a couple of named demons) or MS_GRUNT (ogres, ettins, trolls, gargoyles) behave as MS_HUMANOID when the hero has same race. That by itself wasn't quite enough; hostile MS_HUMANOID monsters other than fake players wouldn't respond, so this gives those a generic message (threatening the hero). In a somewhat similar case, peaceful MS_CUSS monsters wouldn't respond; now they say something too. --- doc/fixes34.4 | 1 + src/sounds.c | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/doc/fixes34.4 b/doc/fixes34.4 index 84d0c58d4..44a114e8f 100644 --- a/doc/fixes34.4 +++ b/doc/fixes34.4 @@ -348,6 +348,7 @@ increase damage bonus applies when kicking while polymorphed into a monster form which has a kicking attack, just like for other kicks if magically removing steed's saddle is fatal, don't leave it saddled in bones charging prompt used wrong criteria when deciding whether to list rings +an orc (or gnome) will respond to #chat if hero is also an orc (or gnome) Platform- and/or Interface-Specific Fixes diff --git a/src/sounds.c b/src/sounds.c index 6dac8f1e2..fed6b13de 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)sounds.c 3.5 2007/03/23 */ +/* SCCS Id: @(#)sounds.c 3.5 2007/05/05 */ /* Copyright (c) 1989 Janet Walz, Mike Threepoint */ /* NetHack may be freely redistributed. See license for details. */ @@ -484,6 +484,11 @@ register struct monst *mtmp; /* make sure its your role's quest quardian; adjust if not */ else if (msound == MS_GUARDIAN && ptr != &mons[urole.guardnum]) msound = mons[genus(monsndx(ptr), 1)].msound; + /* some normally non-speaking types can/will speak if hero is similar */ + else if (msound == MS_ORC && /* note: MS_ORC is same as MS_GRUNT */ + (same_race(ptr, youmonst.data) || /* current form, */ + same_race(ptr, &mons[Race_switch]))) /* unpoly'd form */ + msound = MS_HUMANOID; /* be sure to do this before talking; the monster might teleport away, in * which case we want to check its pre-teleport position @@ -719,10 +724,11 @@ register struct monst *mtmp; /* else FALLTHRU */ case MS_HUMANOID: if (!mtmp->mpeaceful) { - if (In_endgame(&u.uz) && is_mplayer(ptr)) { + if (In_endgame(&u.uz) && is_mplayer(ptr)) mplayer_talk(mtmp); - break; - } else return 0; /* no sound */ + else + pline_msg = "threatens you."; + break; } /* Generic peaceful humanoid behaviour. */ if (mtmp->mflee) @@ -817,6 +823,10 @@ register struct monst *mtmp; case MS_CUSS: if (!mtmp->mpeaceful) cuss(mtmp); + else if (is_lminion(mtmp)) + verbl_msg = "It's not too late."; + else + verbl_msg = "We're all doomed."; break; case MS_SPELL: /* deliberately vague, since it's not actually casting any spell */