caller has already decided that it's a tight diagonal; check whether a monster--who might be the hero--can fit through, and if not then return the reason why: 1: can't fit, 2: possessions won't fit, 3: sokoban returns 0 if we can squeeze through */
| 950 | the reason why: 1: can't fit, 2: possessions won't fit, 3: sokoban |
| 951 | returns 0 if we can squeeze through */ |
| 952 | int |
| 953 | cant_squeeze_thru(struct monst *mon) |
| 954 | { |
| 955 | int amt; |
| 956 | struct permonst *ptr = mon->data; |
| 957 | |
| 958 | if ((mon == &gy.youmonst) ? Passes_walls : passes_walls(ptr)) |
| 959 | return 0; |
| 960 | |
| 961 | /* too big? */ |
| 962 | if (bigmonst(ptr) |
| 963 | && !(amorphous(ptr) || is_whirly(ptr) || noncorporeal(ptr) |
| 964 | || slithy(ptr) || can_fog(mon))) |
| 965 | return 1; |
| 966 | |
| 967 | /* lugging too much junk? */ |
| 968 | amt = (mon == &gy.youmonst) ? inv_weight() + weight_cap() |
| 969 | : curr_mon_load(mon); |
| 970 | if (amt > WT_TOOMUCH_DIAGONAL) |
| 971 | return 2; |
| 972 | |
| 973 | /* Sokoban restriction applies to hero only */ |
| 974 | if (mon == &gy.youmonst && Sokoban) |
| 975 | return 3; |
| 976 | |
| 977 | /* can squeeze through */ |
| 978 | return 0; |
| 979 | } |
| 980 | |
| 981 | boolean |
| 982 | invocation_pos(coordxy x, coordxy y) |