MCPcopy Create free account
hub / github.com/NetHack/NetHack / display_spell_target_positions

Function display_spell_target_positions

src/spell.c:1626–1651  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1624}
1625
1626staticfn void
1627display_spell_target_positions(boolean on_off)
1628{
1629 coordxy x, y, dx, dy;
1630 int dist = 10;
1631
1632 if (on_off) {
1633 /* on */
1634 tmp_at(DISP_BEAM, cmap_to_glyph(S_goodpos));
1635 for (dx = -dist; dx <= dist; dx++)
1636 for (dy = -dist; dy <= dist; dy++) {
1637 x = u.ux + dx;
1638 y = u.uy + dy;
1639 /* hero's location is allowed but highlighting the hero's
1640 spot makes map harder to read (if using '$' rather than
1641 by changing background color) */
1642 if (u_at(x, y))
1643 continue;
1644 if (can_center_spell_location(x, y))
1645 tmp_at(x, y);
1646 }
1647 } else {
1648 /* off */
1649 tmp_at(DISP_END, 0);
1650 }
1651}
1652
1653/* Choose location where spell takes effect. */
1654staticfn int

Callers

nothing calls this directly

Calls 2

tmp_atFunction · 0.85

Tested by

no test coverage detected