CONFIG,
DUNGEONS,
applyLogic,
+ configureDungeons,
makeEmptyState,
mergeStates,
} from '../helpers/tracker';
}, []);
React.useEffect(() => {
- const newDungeons = DUNGEONS.map(dungeon => {
- const newDungeon = JSON.parse(JSON.stringify(dungeon));
- if (config.wildMap && dungeon.map) {
- ++newDungeon.items;
- }
- if (config.wildCompass && dungeon.compass) {
- ++newDungeon.items;
- }
- if (config.wildSmall) {
- newDungeon.items += dungeon.sk;
- }
- if (config.wildBig && dungeon.bk && !dungeon.dropBk) {
- ++newDungeon.items;
- }
- if (!config.bossShuffle && dungeon.boss) {
- newDungeon.bosses = [dungeon.boss];
- }
- return newDungeon;
- });
+ const newDungeons = configureDungeons(config);
setDungeons(newDungeons);
}, [config]);