used in domove to block diagonal shop-entry; u.ux, u.uy should always be a door */
| 5823 | /* used in domove to block diagonal shop-entry; |
| 5824 | u.ux, u.uy should always be a door */ |
| 5825 | boolean |
| 5826 | block_entry(coordxy x, coordxy y) |
| 5827 | { |
| 5828 | coordxy sx, sy; |
| 5829 | int roomno; |
| 5830 | struct monst *shkp; |
| 5831 | |
| 5832 | if (!(IS_DOOR(levl[u.ux][u.uy].typ) |
| 5833 | && levl[u.ux][u.uy].doormask == D_BROKEN)) |
| 5834 | return FALSE; |
| 5835 | |
| 5836 | roomno = *in_rooms(x, y, SHOPBASE); |
| 5837 | if (roomno < 0 || !IS_SHOP(roomno)) |
| 5838 | return FALSE; |
| 5839 | shkp = shop_keeper((char) roomno); |
| 5840 | if (!shkp || !inhishop(shkp)) |
| 5841 | return FALSE; |
| 5842 | |
| 5843 | if (ESHK(shkp)->shd.x != u.ux || ESHK(shkp)->shd.y != u.uy) |
| 5844 | return FALSE; |
| 5845 | |
| 5846 | sx = ESHK(shkp)->shk.x; |
| 5847 | sy = ESHK(shkp)->shk.y; |
| 5848 | |
| 5849 | if (shkp->mx == sx && shkp->my == sy && !helpless(shkp) |
| 5850 | && (x == sx - 1 || x == sx + 1 || y == sy - 1 || y == sy + 1) |
| 5851 | && (Invis || carrying(PICK_AXE) || carrying(DWARVISH_MATTOCK) |
| 5852 | || u.usteed)) { |
| 5853 | pline("%s%s blocks your way!", Shknam(shkp), |
| 5854 | Invis ? " senses your motion and" : ""); |
| 5855 | return TRUE; |
| 5856 | } |
| 5857 | return FALSE; |
| 5858 | } |
| 5859 | |
| 5860 | /* "your " or "Foobar's " (note the trailing space) */ |
| 5861 | char * |