MCPcopy Index your code
hub / github.com/NetHack/NetHack / msg_mon_movement

Function msg_mon_movement

src/monmove.c:32–48  ·  view source on GitHub ↗

a11y: give a message when monster moved */

Source from the content-addressed store, hash-verified

30
31/* a11y: give a message when monster moved */
32staticfn void
33msg_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);

Callers 1

m_moveFunction · 0.85

Calls 4

pline_xyFunction · 0.85
MonnamFunction · 0.85
vtenseFunction · 0.85
locomotionFunction · 0.85

Tested by

no test coverage detected