general musical instrument use while polymorphed

Extend the previous patch to cover all blown instruments.  Also covers
the case of the player strangling.  The test is moved to a new can_blow
function to keep the test in one place.  It supports any monster, although
all current tests are for the player.
This commit is contained in:
cohrs
2004-01-27 00:23:31 +00:00
parent 661f91009b
commit 6f0fb33e9f
5 changed files with 22 additions and 7 deletions

View File

@@ -246,6 +246,18 @@ struct permonst *mptr;
(slithy(mptr) && !bigmonst(mptr)));
}
boolean
can_blow(mtmp) /* returns TRUE if monster can blow (whistle, etc) */
register struct monst *mtmp;
{
if ((is_silent(mtmp->data) || mtmp->data->msound == MS_BUZZ) &&
(breathless(mtmp->data) || verysmall(mtmp->data) ||
!has_head(mtmp->data) || mtmp->data->mlet == S_EEL))
return FALSE;
if ((mtmp == &youmonst) && Strangled) return FALSE;
return TRUE;
}
boolean
can_track(ptr) /* returns TRUE if monster can track well */
register struct permonst *ptr;