| 4422 | } |
| 4423 | |
| 4424 | void |
| 4425 | mhitm_ad_legs( |
| 4426 | struct monst *magr, struct attack *mattk, |
| 4427 | struct monst *mdef, struct mhitm_data *mhm) |
| 4428 | { |
| 4429 | if (magr == &gy.youmonst) { |
| 4430 | /* uhitm */ |
| 4431 | #if 0 |
| 4432 | if (u.ucancelled) { |
| 4433 | mhm->damage = 0; |
| 4434 | return; |
| 4435 | } |
| 4436 | #endif |
| 4437 | mhitm_ad_phys(magr, mattk, mdef, mhm); |
| 4438 | if (mhm->done) |
| 4439 | return; |
| 4440 | } else if (mdef == &gy.youmonst) { |
| 4441 | /* mhitu */ |
| 4442 | long side = rn2(2) ? RIGHT_SIDE : LEFT_SIDE; |
| 4443 | const char *sidestr = (side == RIGHT_SIDE) ? "right" : "left", |
| 4444 | *Monst_name = Monnam(magr), *leg = body_part(LEG); |
| 4445 | |
| 4446 | /* This case is too obvious to ignore, but Nethack is not in |
| 4447 | * general very good at considering height--most short monsters |
| 4448 | * still _can_ attack you when you're flying or mounted. |
| 4449 | */ |
| 4450 | if ((u.usteed || Levitation || Flying) && !is_flyer(magr->data)) { |
| 4451 | pline("%s tries to reach your %s %s!", Monst_name, sidestr, leg); |
| 4452 | mhm->damage = 0; |
| 4453 | } else if (magr->mcan) { |
| 4454 | pline_mon(magr, "%s nuzzles against your %s %s!", Monnam(magr), |
| 4455 | sidestr, leg); |
| 4456 | mhm->damage = 0; |
| 4457 | } else { |
| 4458 | if (uarmf) { |
| 4459 | if (rn2(2) && (uarmf->otyp == LOW_BOOTS |
| 4460 | || uarmf->otyp == IRON_SHOES)) { |
| 4461 | pline("%s pricks the exposed part of your %s %s!", |
| 4462 | Monst_name, sidestr, leg); |
| 4463 | } else if (!rn2(5)) { |
| 4464 | pline("%s pricks through your %s boot!", Monst_name, |
| 4465 | sidestr); |
| 4466 | } else { |
| 4467 | pline("%s scratches your %s boot!", Monst_name, |
| 4468 | sidestr); |
| 4469 | mhm->damage = 0; |
| 4470 | return; |
| 4471 | } |
| 4472 | } else |
| 4473 | pline("%s pricks your %s %s!", Monst_name, sidestr, leg); |
| 4474 | |
| 4475 | set_wounded_legs(side, rnd(60 - ACURR(A_DEX))); |
| 4476 | exercise(A_STR, FALSE); |
| 4477 | exercise(A_DEX, FALSE); |
| 4478 | } |
| 4479 | } else { |
| 4480 | /* mhitm */ |
| 4481 | if (magr->mcan) { |
no test coverage detected