fix #H6285 - speaking vs strangulation

Reading a scroll while blind is permitted if you know its label, but
message is "as you pronounce the words, the scroll vanishes" unless
you are poly'd into a form which can't make sounds, in which case you
"cogitate" rather than "pronouce".  Switch to the cogitate variant if
you are suffering from strangulation.

Casting spells didn't even have the distinction; you could cast them
without regard to speech capability.  Check for that.  Unlike with
scrolls, now you can't cast if you can't speak (or grunt or bark or
whatever) instead of having a variant description of the action, so
this is a bigger change.
This commit is contained in:
PatR
2017-10-19 23:08:46 -07:00
parent da9c3f0ed4
commit 4fad1ba3cc
5 changed files with 37 additions and 12 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 mondata.c $NHDT-Date: 1492733172 2017/04/21 00:06:12 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.62 $ */
/* NetHack 3.6 mondata.c $NHDT-Date: 1508479720 2017/10/20 06:08:40 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.63 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -325,7 +325,7 @@ struct permonst *mptr;
/* returns True if monster can blow (whistle, etc) */
boolean
can_blow(mtmp)
register struct monst *mtmp;
struct monst *mtmp;
{
if ((is_silent(mtmp->data) || mtmp->data->msound == MS_BUZZ)
&& (breathless(mtmp->data) || verysmall(mtmp->data)
@@ -336,6 +336,18 @@ register struct monst *mtmp;
return TRUE;
}
/* for casting spells and reading scrolls while blind */
boolean
can_chant(mtmp)
struct monst *mtmp;
{
if ((mtmp == &youmonst && Strangled)
|| is_silent(mtmp->data) || !has_head(mtmp->data)
|| mtmp->data->msound == MS_BUZZ || mtmp->data->msound == MS_BURBLE)
return FALSE;
return TRUE;
}
/* True if mon is vulnerable to strangulation */
boolean
can_be_strangled(mon)