used by magic mapping, clairvoyance, and wand of probing */
| 1369 | |
| 1370 | /* used by magic mapping, clairvoyance, and wand of probing */ |
| 1371 | void |
| 1372 | show_map_spot(coordxy x, coordxy y, boolean cnf) |
| 1373 | { |
| 1374 | struct rm *lev; |
| 1375 | struct trap *t; |
| 1376 | struct engr *ep; |
| 1377 | int oldglyph; |
| 1378 | |
| 1379 | if (cnf && rn2(7)) |
| 1380 | return; |
| 1381 | lev = &levl[x][y]; |
| 1382 | |
| 1383 | lev->seenv = SVALL; |
| 1384 | |
| 1385 | /* Secret corridors are found, but not secret doors. */ |
| 1386 | if (lev->typ == SCORR) { |
| 1387 | lev->typ = CORR; |
| 1388 | unblock_point(x, y); |
| 1389 | } |
| 1390 | |
| 1391 | /* |
| 1392 | * Force the real background, then if it's not furniture and there's |
| 1393 | * a known trap there, display the trap, else if there was an object |
| 1394 | * shown there, redisplay the object. So during mapping, furniture |
| 1395 | * takes precedence over traps, which take precedence over objects, |
| 1396 | * opposite to how normal vision behaves. |
| 1397 | */ |
| 1398 | oldglyph = glyph_at(x, y); |
| 1399 | if (svl.level.flags.hero_memory) { |
| 1400 | magic_map_background(x, y, 0); |
| 1401 | newsym(x, y); /* show it, if not blocked */ |
| 1402 | } else { |
| 1403 | magic_map_background(x, y, 1); /* display it */ |
| 1404 | } |
| 1405 | if (!IS_FURNITURE(lev->typ)) { |
| 1406 | if ((t = t_at(x, y)) != 0 && t->tseen) { |
| 1407 | map_trap(t, 1); |
| 1408 | } else if ((ep = engr_at(x, y)) != 0 && !cnf) { |
| 1409 | map_engraving(ep, 1); |
| 1410 | } else if (glyph_is_trap(oldglyph) || glyph_is_object(oldglyph)) { |
| 1411 | show_glyph(x, y, oldglyph); |
| 1412 | if (svl.level.flags.hero_memory) |
| 1413 | lev->glyph = oldglyph; |
| 1414 | } |
| 1415 | } |
| 1416 | /* possibly update #overview */ |
| 1417 | if (!cnf && lev->roomno >= ROOMOFFSET) |
| 1418 | room_discovered(lev->roomno - ROOMOFFSET); |
| 1419 | } |
| 1420 | |
| 1421 | void |
| 1422 | do_mapping(void) |
no test coverage detected