| 492 | } |
| 493 | |
| 494 | staticfn void |
| 495 | use_magic_whistle(struct obj *obj) |
| 496 | { |
| 497 | if (!can_blow(&gy.youmonst)) { |
| 498 | You("are incapable of using the whistle."); |
| 499 | } else if (obj->cursed && !rn2(2)) { |
| 500 | You("produce a %shigh-%s.", Underwater ? "very " : "", |
| 501 | Deaf ? "frequency vibration" : "pitched humming noise"); |
| 502 | wake_nearby(TRUE); |
| 503 | if (!rn2(2) && !noteleport_level(&gy.youmonst)) |
| 504 | tele_to_rnd_pet(); |
| 505 | } else { |
| 506 | /* it's magic! it works underwater too (at a higher pitch) */ |
| 507 | You(Deaf ? alt_whistle_str : whistle_str, |
| 508 | Hallucination ? "normal" |
| 509 | : (Underwater && !Deaf) ? "strange, high-pitched" |
| 510 | : "strange"); |
| 511 | Soundeffect(se_shrill_whistle, 80); |
| 512 | magic_whistled(obj); |
| 513 | } |
| 514 | } |
| 515 | |
| 516 | /* 'obj' is assumed to be a magic whistle */ |
| 517 | staticfn void |
no test coverage detected