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

Function find_trap

src/detect.c:1934–1962  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1932}
1933
1934void
1935find_trap(struct trap *trap)
1936{
1937 boolean cleared = FALSE;
1938
1939 trap->tseen = 1;
1940 exercise(A_WIS, TRUE);
1941 feel_newsym(trap->tx, trap->ty);
1942
1943 /* The "Hallucination ||" is to preserve 3.6.1 behavior, but this
1944 behavior might need a rework in the hallucination case
1945 (e.g. to not prompt if any trap glyph appears on the square). */
1946 if (Hallucination ||
1947 levl[trap->tx][trap->ty].glyph != trap_to_glyph(trap)) {
1948 /* There's too much clutter to see your find otherwise */
1949 cls();
1950 map_trap(trap, 1);
1951 display_self();
1952 cleared = TRUE;
1953 }
1954
1955 set_msg_xy(trap->tx, trap->ty);
1956 You("find %s.", an(trapname(trap->ttyp, FALSE)));
1957
1958 if (cleared) {
1959 display_nhwindow(WIN_MAP, TRUE); /* wait */
1960 docrt();
1961 }
1962}
1963
1964staticfn int
1965mfind0(struct monst *mtmp, boolean via_warning)

Callers 2

dosearch0Function · 0.85
really_kick_objectFunction · 0.85

Calls 9

exerciseFunction · 0.85
feel_newsymFunction · 0.85
clsFunction · 0.85
map_trapFunction · 0.85
set_msg_xyFunction · 0.85
YouFunction · 0.85
anFunction · 0.85
trapnameFunction · 0.85
docrtFunction · 0.85

Tested by

no test coverage detected