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.
This commit is contained in:
nethack.rankin
2007-05-06 00:57:49 +00:00
parent cfdc51dbde
commit cb5504b38e
2 changed files with 15 additions and 4 deletions

View File

@@ -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

View File

@@ -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 */