monster avoids a location nx, ny, if we're in sokoban, and there's a boulder between the location and hero */
| 1310 | /* monster avoids a location nx, ny, if we're in sokoban, and |
| 1311 | there's a boulder between the location and hero */ |
| 1312 | boolean |
| 1313 | m_avoid_soko_push_loc(struct monst *mtmp, coordxy nx, coordxy ny) |
| 1314 | { |
| 1315 | if (Sokoban |
| 1316 | && (mtmp->mpeaceful || mtmp->mtame) |
| 1317 | && !mtmp->mconf && !mtmp->mstun |
| 1318 | && !Conflict |
| 1319 | && (dist2(nx, ny, u.ux, u.uy) == 4) |
| 1320 | && sobj_at(BOULDER, nx + sgn(u.ux - nx), ny + sgn(u.uy - ny))) |
| 1321 | return TRUE; |
| 1322 | return FALSE; |
| 1323 | } |
| 1324 | |
| 1325 | /* max distmin() distance for monster to look for items */ |
| 1326 | #define SQSRCHRADIUS 5 |