'blue-potion',
'fairy',
'bottle-bee',
- 'bottle-bee',
+ 'bottle-good-bee',
];
export const BOSSES = [
export const getConfigValue = (config, name, fallback) =>
Object.prototype.hasOwnProperty.call(config, name) ? config[name] : fallback;
+export const configureDungeons = config => 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 (dungeon.boss) {
+ newDungeon.bosses = config.bossShuffle ? BOSSES : [dungeon.boss];
+ }
+ return newDungeon;
+});
+
export const applyLogic = (config, dungeons, state) => {
const logic = Logic[config.worldState];
const map = {};
});
};
-export const computeState = (config, data, prizeMap) => {
- const state = {};
- collectInventory(state, data.slice(SRAM_ADDR.INV_START), prizeMap);
- collectOverworld(state, data);
- collectUnderworld(state, data.slice(SRAM_ADDR.ROOM_DATA_START));
- const amounts = getDungeonAmounts(config, state);
- DUNGEONS.forEach(dungeon => {
- state[`${dungeon.id}-checks`] = amounts[dungeon.id];
- });
- return state;
-};
-
const getDungeonAmounts = (config, state) => {
const amounts = {};
DUNGEONS.forEach(dungeon => {
return amounts;
};
+export const computeState = (config, data, prizeMap) => {
+ const state = {};
+ collectInventory(state, data.slice(SRAM_ADDR.INV_START), prizeMap);
+ collectOverworld(state, data);
+ collectUnderworld(state, data.slice(SRAM_ADDR.ROOM_DATA_START));
+ const amounts = getDungeonAmounts(config, state);
+ DUNGEONS.forEach(dungeon => {
+ state[`${dungeon.id}-checks`] = amounts[dungeon.id];
+ });
+ return state;
+};
+
export const mergeStates = (autoState, manualState) => {
const next = { ...autoState };
BOOLEAN_STATES.forEach(name => {