automatically unhide on #sit
trappers do not hide on the ceiling
non-magical whistles do not work underwater
-try to restrict whistle use to monsters that can blow a whistle
+try to restrict whistles and musical instruments to monsters that can blow
Platform- and/or Interface-Specific Fixes
E boolean FDECL(ranged_attk, (struct permonst *));
E boolean FDECL(hates_silver, (struct permonst *));
E boolean FDECL(passes_bars, (struct permonst *));
+E boolean FDECL(can_blow, (struct monst *));
E boolean FDECL(can_track, (struct permonst *));
E boolean FDECL(breakarm, (struct permonst *));
E boolean FDECL(sliparm, (struct permonst *));
use_whistle(obj)
struct obj *obj;
{
- if ((is_silent(youmonst.data) || youmonst.data->msound == MS_BUZZ) &&
- (breathless(youmonst.data) || verysmall(youmonst.data) ||
- !has_head(youmonst.data) || youmonst.data->mlet == S_EEL)) {
+ if (!can_blow(&youmonst)) {
You("are incapable of using the whistle.");
} else if(Underwater) {
You("blow bubbles through %s.", yname(obj));
{
register struct monst *mtmp, *nextmon;
- if ((is_silent(youmonst.data) || youmonst.data->msound == MS_BUZZ) &&
- (breathless(youmonst.data) || verysmall(youmonst.data) ||
- !has_head(youmonst.data) || youmonst.data->mlet == S_EEL)) {
+ if (!can_blow(&youmonst)) {
You("are incapable of using the whistle.");
} else if (obj->cursed && !rn2(2)) {
You("produce a %shigh-pitched humming noise.",
(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;
if (Underwater) {
You_cant("play music underwater!");
return(0);
+ } else if ((instr->otyp == WOODEN_FLUTE || instr->otyp == MAGIC_FLUTE ||
+ instr->otyp == TOOLED_HORN || instr->otyp == FROST_HORN ||
+ instr->otyp == FIRE_HORN || instr->otyp == BUGLE) &&
+ !can_blow(&youmonst)) {
+ You("are incapable of playing %s.", the(distant_name(instr, xname)));
+ return(0);
}
if (instr->otyp != LEATHER_DRUM && instr->otyp != DRUM_OF_EARTHQUAKE) {
c = yn("Improvise?");