Added &O command to show the number of turns used by explore to fully-explore the (reachable areas of) the current level.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1983 c06c8d41-db1a-0410-9941-cceddc491573
X5OHFTHRXTI5KHFIYFJ6DB3W5MY3JUJKNTL4HF37MKABYNCOBOZAC
FSD7GIK3YLZXWLEH37BU6KV3IUCFGXPQL6IZ7H65YWNRBEKDBX5AC
SSCG2FLJMUTTIRXBFSPLAUUBUIN375ZGL5UOAF3SC62ZIILSMMKAC
SDLKLUNFGVKDS55DDJZCBAVIB7NL3RRYPTACAY65SCUQKV6APFSAC
WLX2RQMMOMP2PYPAGJRM4VFD2WTLJTOAZZPPY3MV76FU2EGEJ54QC
K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC
KFZYPFHHOWRUZEK2PW26EI73Z6I6DLHW2YEJV2CB5XBWFRRNBFXQC
RPOZZWKG5GLPHVZZ7ZKMKS64ZMV2LDCQSARBJFJ6FZOTOKCQO7FAC
IGHO5UHUXYBLIHLUMLZ672YHAYUSK4FSFX7SA42XARIKLIMCVLUAC
H3552BCIAVBLKAYKE4DHFLBLFW5RGRMYBMRRYHYEB5IPIJRUVU5QC
T6YW32VLZX2KKDMIS4G562ER73VHCAQZOQ6P4LSLVGVN25UD5UJQC
CI5VTLSMB2L5W5ZVKDZEJFUARGSZP2FUSTRFV3MG6U44TDDUYH5AC
GQL5SIGBHLU3FMCE54XVGLRY5AZHRM6DUEB722REA2DPLGJSN6EQC
}
void debug_dismiss_all_monsters()
{
// Genocide... "unsummon" all the monsters from the level.
for (int mon = 0; mon < MAX_MONSTERS; mon++)
{
monsters *monster = &menv[mon];
if (monster->alive())
monster_die(monster, KILL_DISMISSED, 0);
}
}
void debug_kill_traps()
{
for (int y = 0; y < GYM; ++y)
for (int x = 0; x < GXM; ++x)
if (grid_is_trap(grd[x][y]) || grd[x][y] == DNGN_UNDISCOVERED_TRAP)
grd[x][y] = DNGN_FLOOR;
unwind_var<int> es(Options.explore_stop, 0);
const long start = you.num_turns;
while (you_are_delayed())
{
you.turn_is_over = false;
handle_delay();
you.num_turns++;
}
return (you.num_turns - start);
}
static void debug_destroy_doors()
{
for (int y = 0; y < GYM; ++y)
{
for (int x = 0; x < GXM; ++x)
{
const dungeon_feature_type feat = grd[x][y];
if (feat == DNGN_CLOSED_DOOR || feat == DNGN_SECRET_DOOR)
grd[x][y] = DNGN_FLOOR;
}
}
}
// Turns off greedy explore, then:
// a) Destroys all traps on the level.
// b) Kills all monsters on the level.
// c) Suppresses monster generation.
// d) Converts all closed doors and secret doors to floor.
// e) Forgets map.
// f) Counts number of turns needed to explore the level.
void debug_test_explore()
{
debug_dismiss_all_monsters();
debug_kill_traps();
forget_map(100);
debug_destroy_doors();
// Remember where we are now.
const coord_def where = you.pos();
const int explore_turns = debug_time_explore();
mprf("Explore took %d turns.", explore_turns);
}
// Genocide... "unsummon" all the monsters from the level.
for (int mon = 0; mon < MAX_MONSTERS; mon++)
{
struct monsters *monster = &menv[mon];
if (monster->type == -1)
continue;
monster_die(monster, KILL_RESET, 0);
}
debug_dismiss_all_monsters();