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

Function wizard_recreate_level

crawl-ref/source/wiz-dgn.cc:808–856  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

806}
807
808void wizard_recreate_level()
809{
810 mpr("Regenerating level.");
811
812 // Need to allow reuse of vaults, otherwise we'd run out of them fast.
813 #ifndef DEBUG_VETO_RESUME
814 _free_all_vaults();
815 #endif
816
817 for (monster_iterator mi; mi; ++mi)
818 {
819 if (mons_is_unique(mi->type))
820 {
821 remove_unique_annotation(*mi);
822 you.unique_creatures.set(mi->type, false);
823 mi->flags |= MF_TAKING_STAIRS; // no Abyss transit
824 }
825 }
826
827 level_id lev = level_id::current();
828 _wizard_level_target = lev;
829 dungeon_feature_type stair_taken = DNGN_STONE_STAIRS_DOWN_I;
830
831 if (lev.branch == BRANCH_ABYSS)
832 {
833 // abyss generation is different, and regenerating the abyss
834 // with the below code leads to strange behavior
835 abyss_teleport(true);
836 return;
837 }
838
839 if (lev.depth == 1 && lev != BRANCH_DUNGEON)
840 stair_taken = branches[lev.branch].entry_stairs;
841
842 leaving_level_now(stair_taken);
843 delete_level(lev);
844 load_level(stair_taken, LOAD_START_GAME, lev);
845 if (you.get_place_info().levels_seen > 1)
846 you.get_place_info().levels_seen--; // this getting to 0 -> crashes
847
848 if (!crawl_state.test)
849 save_game_state();
850 new_level();
851 seen_monsters_react();
852 viewwindow();
853 update_screen();
854
855 trackers_init_new_level();
856}
857
858void wizard_clear_used_vaults()
859{

Callers 2

_do_wizard_commandFunction · 0.85
debug_load_map_by_nameFunction · 0.85

Calls 15

mprFunction · 0.85
_free_all_vaultsFunction · 0.85
mons_is_uniqueFunction · 0.85
remove_unique_annotationFunction · 0.85
abyss_teleportFunction · 0.85
leaving_level_nowFunction · 0.85
delete_levelFunction · 0.85
load_levelFunction · 0.85
save_game_stateFunction · 0.85
new_levelFunction · 0.85
seen_monsters_reactFunction · 0.85
viewwindowFunction · 0.85

Tested by

no test coverage detected