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

Function u_simple_floortyp

src/hack.c:1832–1848  ·  view source on GitHub ↗

Return a simplified floor solid/liquid state based on hero's state */

Source from the content-addressed store, hash-verified

1830
1831/* Return a simplified floor solid/liquid state based on hero's state */
1832staticfn schar
1833u_simple_floortyp(coordxy x, coordxy y)
1834{
1835 boolean u_in_air = (Levitation || Flying || !grounded(gy.youmonst.data));
1836
1837 if (is_waterwall(x, y))
1838 return WATER; /* wall of water, fly/lev does not matter */
1839 if (levl[x][y].typ == LAVAWALL)
1840 return LAVAWALL; /* wall of lava, fly/lev does not matter */
1841 if (!u_in_air) {
1842 if (is_pool(x, y))
1843 return POOL;
1844 if (is_lava(x, y))
1845 return LAVAPOOL;
1846 }
1847 return ROOM;
1848}
1849
1850/* maybe show a helpful gameplay tip? returns True if tip gets shown */
1851boolean

Callers 1

swim_move_dangerFunction · 0.85

Calls 3

is_waterwallFunction · 0.85
is_poolFunction · 0.85
is_lavaFunction · 0.85

Tested by

no test coverage detected