return True if mon is a gecko or seems to look like one (hallucination) */
| 656 | |
| 657 | /* return True if mon is a gecko or seems to look like one (hallucination) */ |
| 658 | staticfn boolean |
| 659 | mon_is_gecko(struct monst *mon) |
| 660 | { |
| 661 | int glyph; |
| 662 | |
| 663 | /* return True if it is actually a gecko */ |
| 664 | if (mon->data == &mons[PM_GECKO]) |
| 665 | return TRUE; |
| 666 | /* return False if it is a long worm; we might be chatting to its tail |
| 667 | (not strictly needed; long worms are MS_SILENT so won't get here) */ |
| 668 | if (mon->data == &mons[PM_LONG_WORM]) |
| 669 | return FALSE; |
| 670 | /* result depends upon whether map spot shows a gecko, which will |
| 671 | be due to hallucination or to mimickery since mon isn't one */ |
| 672 | glyph = glyph_at(mon->mx, mon->my); |
| 673 | return (boolean) (glyph_to_mon(glyph) == PM_GECKO); |
| 674 | } |
| 675 | |
| 676 | DISABLE_WARNING_FORMAT_NONLITERAL |
| 677 |
no test coverage detected