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

@@ -487,6 +487,12 @@ struct obj *instr;
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?");