a11y: give a message when monster moved */
| 30 | |
| 31 | /* a11y: give a message when monster moved */ |
| 32 | staticfn void |
| 33 | msg_mon_movement(struct monst *mtmp, coordxy omx, coordxy omy) |
| 34 | { |
| 35 | if (a11y.mon_movement && canspotmon(mtmp) && mtmp->mspotted) { |
| 36 | coordxy nix = mtmp->mx, niy = mtmp->my; |
| 37 | boolean n2u = next2u(nix, niy), |
| 38 | close = !n2u && (distu(nix, niy) <= (BOLT_LIM * BOLT_LIM)), |
| 39 | closer = !n2u && (distu(nix, niy) <= distu(omx, omy)); |
| 40 | |
| 41 | pline_xy(nix, niy, "%s %s%s.", Monnam(mtmp), |
| 42 | vtense((char *) 0, locomotion(mtmp->data, "move")), |
| 43 | n2u ? " next to you" |
| 44 | : (close && closer) ? " closer" |
| 45 | : (close && !closer) ? " further away" |
| 46 | : " in the distance"); |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | /* monster has triggered trapped door lock or was present when it got |
| 51 | triggered remotely (at door spot, door hit by zap); |
no test coverage detected