shk catches thrown pick-axe */
| 4359 | |
| 4360 | /* shk catches thrown pick-axe */ |
| 4361 | struct monst * |
| 4362 | shkcatch( |
| 4363 | struct obj *obj, |
| 4364 | coordxy x, coordxy y) |
| 4365 | { |
| 4366 | struct monst *shkp; |
| 4367 | |
| 4368 | shkp = shop_keeper(inside_shop(x, y)); |
| 4369 | if (!shkp || !inhishop(shkp)) |
| 4370 | return 0; |
| 4371 | |
| 4372 | if (!helpless(shkp) |
| 4373 | && (*u.ushops != ESHK(shkp)->shoproom || !inside_shop(u.ux, u.uy)) |
| 4374 | && dist2(shkp->mx, shkp->my, x, y) < 3 |
| 4375 | /* if it is the shk's pos, you hit and anger him */ |
| 4376 | && (shkp->mx != x || shkp->my != y)) { |
| 4377 | if (mnearto(shkp, x, y, TRUE, RLOC_NOMSG) == 2 |
| 4378 | && !Deaf && !muteshk(shkp)) { |
| 4379 | SetVoice(shkp, 0, 80, 0); |
| 4380 | verbalize("Out of my way, scum!"); |
| 4381 | } |
| 4382 | if (cansee(x, y)) { |
| 4383 | pline("%s nimbly%s catches %s.", Shknam(shkp), |
| 4384 | (x == shkp->mx && y == shkp->my) ? "" : " reaches over and", |
| 4385 | the(xname(obj))); |
| 4386 | if (!canspotmon(shkp)) |
| 4387 | map_invisible(x, y); |
| 4388 | nh_delay_output(); |
| 4389 | mark_synch(); |
| 4390 | } |
| 4391 | subfrombill(obj, shkp); |
| 4392 | (void) mpickobj(shkp, obj); |
| 4393 | return shkp; |
| 4394 | } |
| 4395 | return (struct monst *) 0; |
| 4396 | } |
| 4397 | |
| 4398 | void |
| 4399 | add_damage( |
no test coverage detected