MCPcopy Create free account
hub / github.com/crawl/crawl / forget_map

Function forget_map

crawl-ref/source/player.cc:2368–2420  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2366}
2367
2368void forget_map(bool rot)
2369{
2370 ASSERT(!crawl_state.game_is_arena());
2371
2372 // If forgetting was intentional, clear the travel trail.
2373 if (!rot)
2374 clear_travel_trail();
2375
2376 const bool rot_resist = player_in_branch(BRANCH_ABYSS)
2377 && have_passive(passive_t::map_rot_res_abyss);
2378 const double geometric_chance = 0.99;
2379 const int radius = (rot_resist ? 200 : 100);
2380
2381 const int scalar = 0xFF;
2382 for (rectangle_iterator ri(0); ri; ++ri)
2383 {
2384 const coord_def &p = *ri;
2385 if (!env.map_knowledge(p).known() || you.see_cell(p))
2386 continue;
2387
2388 if (player_in_branch(BRANCH_ABYSS)
2389 && env.map_knowledge(p).item()
2390 && env.map_knowledge(p).item()->is_type(OBJ_RUNES, RUNE_ABYSSAL))
2391 {
2392 continue;
2393 }
2394
2395 if (rot)
2396 {
2397 const int dist = grid_distance(you.pos(), p);
2398 int chance = pow(geometric_chance,
2399 max(1, (dist * dist - radius) / 40)) * scalar;
2400 if (x_chance_in_y(chance, scalar))
2401 continue;
2402 }
2403
2404 if (you.see_cell(p))
2405 continue;
2406
2407 env.map_knowledge(p).clear();
2408 if (env.map_forgotten)
2409 (*env.map_forgotten)(p).clear();
2410 StashTrack.update_stash(p);
2411#ifdef USE_TILE
2412 tile_forget_map(p);
2413#endif
2414 }
2415
2416 ash_detect_portals(is_map_persistent());
2417#ifdef USE_TILE
2418 tiles.update_minimap_bounds();
2419#endif
2420}
2421
2422int get_exp_progress()
2423{

Callers 4

abyss_area_shiftFunction · 0.85
abyss_teleportFunction · 0.85
debug_test_exploreFunction · 0.85
handle_timeFunction · 0.85

Calls 15

clear_travel_trailFunction · 0.85
player_in_branchFunction · 0.85
have_passiveFunction · 0.85
grid_distanceFunction · 0.85
powFunction · 0.85
x_chance_in_yFunction · 0.85
tile_forget_mapFunction · 0.85
ash_detect_portalsFunction · 0.85
is_map_persistentFunction · 0.85
game_is_arenaMethod · 0.80
knownMethod · 0.80
itemMethod · 0.80

Tested by

no test coverage detected