hero has teleported out of vault while a guard is active */
| 253 | |
| 254 | /* hero has teleported out of vault while a guard is active */ |
| 255 | void |
| 256 | uleftvault(struct monst *grd) |
| 257 | { |
| 258 | /* only called if caller has checked vault_occupied() and findgd() */ |
| 259 | if (!grd || !grd->isgd || DEADMONSTER(grd)) { |
| 260 | impossible("escaping vault without guard?"); |
| 261 | return; |
| 262 | } |
| 263 | /* if carrying gold and arriving anywhere other than next to the guard, |
| 264 | set the guard loose */ |
| 265 | if ((money_cnt(gi.invent) || hidden_gold(TRUE)) |
| 266 | && um_dist(grd->mx, grd->my, 1)) { |
| 267 | if (grd->mpeaceful) { |
| 268 | if (canspotmon(grd)) /* see or sense via telepathy */ |
| 269 | pline("%s becomes irate.", Monnam(grd)); |
| 270 | grd->mpeaceful = 0; /* bypass setmangry() */ |
| 271 | } |
| 272 | /* if arriving outside guard's temporary corridor, give the |
| 273 | guard an extra move to deliver message(s) and to teleport |
| 274 | out of and remove that corridor */ |
| 275 | if (!in_fcorridor(grd, u.ux, u.uy)) |
| 276 | (void) gd_move(grd); |
| 277 | } |
| 278 | } |
| 279 | |
| 280 | staticfn boolean |
| 281 | find_guard_dest(struct monst *guard, coordxy *rx, coordxy *ry) |
no test coverage detected