True if mon is vulnerable to strangulation */
| 588 | |
| 589 | /* True if mon is vulnerable to strangulation */ |
| 590 | boolean |
| 591 | can_be_strangled(struct monst *mon) |
| 592 | { |
| 593 | struct obj *mamul; |
| 594 | boolean nonbreathing, nobrainer; |
| 595 | |
| 596 | /* For amulet of strangulation support: here we're considering |
| 597 | strangulation to be loss of blood flow to the brain due to |
| 598 | constriction of the arteries in the neck, so all headless |
| 599 | creatures are immune (no neck) as are mindless creatures |
| 600 | who don't need to breathe (brain, if any, doesn't care). |
| 601 | Mindless creatures who do need to breath are vulnerable, as |
| 602 | are non-breathing creatures which have higher brain function. */ |
| 603 | if (!has_head(mon->data)) |
| 604 | return FALSE; |
| 605 | if (mon == &gy.youmonst) { |
| 606 | /* hero can't be mindless but poly'ing into mindless form can |
| 607 | confer strangulation protection */ |
| 608 | nobrainer = mindless(gy.youmonst.data); |
| 609 | nonbreathing = Breathless; |
| 610 | } else { |
| 611 | nobrainer = mindless(mon->data); |
| 612 | /* monsters don't wear amulets of magical breathing, |
| 613 | so second part doesn't achieve anything useful... */ |
| 614 | nonbreathing = (breathless(mon->data) |
| 615 | || ((mamul = which_armor(mon, W_AMUL)) != 0 |
| 616 | && (mamul->otyp == AMULET_OF_MAGICAL_BREATHING))); |
| 617 | } |
| 618 | return (boolean) (!nobrainer || !nonbreathing); |
| 619 | } |
| 620 | |
| 621 | /* returns True if monster can track well */ |
| 622 | boolean |
no test coverage detected