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

Function lookaround_known_room

src/cmd.c:1275–1306  ·  view source on GitHub ↗

describe the room at x,y */

Source from the content-addressed store, hash-verified

1273
1274/* describe the room at x,y */
1275staticfn void
1276lookaround_known_room(coordxy x, coordxy y)
1277{
1278 struct selectionvar *sel = selection_new();
1279 int rmno = u.urooms[0] - ROOMOFFSET;
1280 char qbuf[QBUFSZ];
1281
1282 set_selection_floodfillchk(dolookaround_floodfill_findroom);
1283 selection_floodfill(sel, x, y, TRUE);
1284
1285 if (!u_at(x, y))
1286 set_msg_xy(x, y);
1287
1288 if (u_have_seen_whole_selection(sel)) {
1289 boolean u_in = (boolean) selection_getpoint(x, y, sel);
1290
1291 You("%s %s %s.",
1292 u_at(x, y) && u_in && u_can_see_whole_selection(sel) ? "are in"
1293 : (u_at(x, y)) ? "remember this as" : "remember that as",
1294 an(selection_size_description(sel, qbuf)),
1295 rmno >= 0 ? "room" : "area");
1296 } else if (u_have_seen_bounds_selection(sel)) {
1297 You("guess %s to be %s %s.",
1298 u_at(x, y) ? "this" : "that",
1299 an(selection_size_description(sel, qbuf)),
1300 rmno >= 0 ? "room" : "area");
1301 } else {
1302 You("can't guess the size of %s area.",
1303 u_at(x, y) ? "this" : "that");
1304 }
1305 selection_free(sel, TRUE);
1306}
1307
1308/* #lookaround - describe what the hero can see, in text */
1309int

Callers 1

dolookaroundFunction · 0.85

Calls 12

selection_newFunction · 0.85
selection_floodfillFunction · 0.85
set_msg_xyFunction · 0.85
selection_getpointFunction · 0.85
YouFunction · 0.85
anFunction · 0.85
selection_freeFunction · 0.85

Tested by

no test coverage detected