| 2366 | } |
| 2367 | |
| 2368 | void 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 | |
| 2422 | int get_exp_progress() |
| 2423 | { |
no test coverage detected