give a message when entering an untended shop (caller has verified that) */
| 720 | |
| 721 | /* give a message when entering an untended shop (caller has verified that) */ |
| 722 | staticfn void |
| 723 | deserted_shop(/*const*/ char *enterstring) |
| 724 | { |
| 725 | struct monst *mtmp; |
| 726 | struct mkroom *r = &svr.rooms[(int) *enterstring - ROOMOFFSET]; |
| 727 | int x, y, m = 0, n = 0; |
| 728 | |
| 729 | for (x = r->lx; x <= r->hx; ++x) |
| 730 | for (y = r->ly; y <= r->hy; ++y) { |
| 731 | if (u_at(x, y)) |
| 732 | continue; |
| 733 | if ((mtmp = m_at(x, y)) != 0) { |
| 734 | ++n; |
| 735 | if (sensemon(mtmp) || ((M_AP_TYPE(mtmp) == M_AP_NOTHING |
| 736 | || M_AP_TYPE(mtmp) == M_AP_MONSTER) |
| 737 | && canseemon(mtmp))) |
| 738 | ++m; |
| 739 | } |
| 740 | } |
| 741 | |
| 742 | if (Blind && !(Blind_telepat || Detect_monsters)) |
| 743 | ++n; /* force feedback to be less specific */ |
| 744 | |
| 745 | pline("This shop %s %s.", (m < n) ? "seems to be" : "is", |
| 746 | !n ? "deserted" : "untended"); |
| 747 | } |
| 748 | |
| 749 | /* called from check_special_room(hack.c) */ |
| 750 | void |
no test coverage detected