It's probably better in general to just reset `you` instead of calling this. But that's not so convenient for some users of this function, notably lua tests. This leaves some state uninitialized, and probably should be immediately followed by a call to `initial_dungeon_setup` and something that moves the player to a level or regenerates a level. */
| 747 | player to a level or regenerates a level. |
| 748 | */ |
| 749 | void dgn_reset_player_data() |
| 750 | { |
| 751 | // vaults and map stuff |
| 752 | you.uniq_map_tags.clear(); |
| 753 | you.uniq_map_names.clear(); |
| 754 | you.uniq_map_tags_abyss.clear(); |
| 755 | you.uniq_map_names_abyss.clear(); |
| 756 | for (auto branch : branch_uniq_map_tags) |
| 757 | branch.clear(); |
| 758 | |
| 759 | you.vault_list.clear(); |
| 760 | you.branches_left.reset(); |
| 761 | you.zigs_completed = 0; |
| 762 | you.zig_max = 0; |
| 763 | you.exploration = 0; |
| 764 | you.seen_portals = 0; // should be just cosmetic |
| 765 | reset_portal_entrances(); |
| 766 | // would it be safe to just clear you.props? |
| 767 | you.props.erase(TEMPLE_SIZE_KEY); |
| 768 | you.props.erase(TEMPLE_MAP_KEY); |
| 769 | you.props.erase(OVERFLOW_TEMPLES_KEY); |
| 770 | you.props.erase(TEMPLE_GODS_KEY); |
| 771 | you.clear_place_info(); |
| 772 | // the following is supposed to clear any persistent lua state related to |
| 773 | // the builder. However, it's susceptible to custom dlua doing its own |
| 774 | // thing... |
| 775 | dlua.callfn("dgn_clear_persistant_data", ""); |
| 776 | |
| 777 | // monsters |
| 778 | you.unique_creatures.reset(); |
| 779 | |
| 780 | // item stuff that can interact with the builder |
| 781 | you.runes.reset(); |
| 782 | you.obtainable_runes = MAX_RUNES; |
| 783 | initialise_item_sets(true); |
| 784 | you.unique_items.init(UNIQ_NOT_EXISTS); |
| 785 | you.octopus_king_rings = 0x00; |
| 786 | you.item_description.init(255); // random names need reset after this, e.g. |
| 787 | // via debug.dungeon_setup() |
| 788 | you.attribute[ATTR_GOLD_GENERATED] = 0; |
| 789 | // potentially relevant for item placement in e.g. troves: |
| 790 | you.seen_weapon.init(0); |
| 791 | you.seen_armour.init(0); |
| 792 | you.seen_misc.reset(); |
| 793 | you.seen_talisman.reset(); |
| 794 | } |
| 795 | |
| 796 | static void _dgn_load_colour_grid() |
| 797 | { |
no test coverage detected