avoid "It turns into it"

<Someone> drew attention to the silly message in the newsgroup

Since I'm not sure if the act of polymorphing has a sound,
I opted to use a new usmellmon() routine to put out a
message based on the smell of the resulting monster
under those circumstances.

Not every monster has a recognizable smell, so no
message at all is given in that case.

olfactory(youmonst.data) will determine whether
you are capable of detecting smells.

There is lots of room for enhancement, and some of the
existing smell-related messages in the source should perhaps
be checking olfactory(youmonst.data) too, but this patch
doesn't go that far.
This commit is contained in:
nethack.allison
2004-01-17 20:42:14 +00:00
parent 569cb15070
commit f2101638db
5 changed files with 203 additions and 4 deletions
+26
View File
@@ -720,4 +720,30 @@ struct attack *mattk;
return what;
}
/*
* Returns:
* TRUE if monster is presumed to have a sense of smell.
* FALSE if monster definitely does not have a sense of smell.
*
* Do not base this on presence of a head or nose, since many
* creatures sense smells other ways (feelers, forked-tongues, etc.)
* We're assuming all insects can smell at a distance too.
*/
boolean
olfaction(mdat)
struct permonst *mdat;
{
if (mdat && (is_golem(mdat) ||
mdat->mlet == S_EYE || /* spheres */
mdat->mlet == S_JELLY ||
mdat->mlet == S_PUDDING ||
mdat->mlet == S_BLOB ||
mdat->mlet == S_VORTEX ||
mdat->mlet == S_ELEMENTAL ||
mdat->mlet == S_FUNGUS || /* mushrooms and fungi */
mdat->mlet == S_LIGHT))
return FALSE;
return TRUE;
}
/*mondata.c*/