diff --git a/Fill.py b/Fill.py index 4538bce5..3645e5d9 100644 --- a/Fill.py +++ b/Fill.py @@ -564,7 +564,7 @@ def sell_potions(world, player): loc_choices += [world.get_location(loc, player) for loc in shop_to_location_table[shop.region.name]] locations = [loc for loc in loc_choices if not loc.item] for potion in ['Green Potion', 'Blue Potion', 'Red Potion']: - location = random.choice(filter_locations(ItemFactory(potion, player), locations, world)) + location = random.choice(filter_locations(ItemFactory(potion, player), locations, world, potion=True)) locations.remove(location) p_item = next(item for item in world.itempool if item.name == potion and item.player == player) world.push_item(location, p_item, collect=False) diff --git a/Mystery.py b/Mystery.py index 9fb49394..5cdb4806 100644 --- a/Mystery.py +++ b/Mystery.py @@ -29,6 +29,7 @@ def main(): parser.add_argument('--teams', default=1, type=lambda value: max(int(value), 1)) parser.add_argument('--create_spoiler', action='store_true') parser.add_argument('--suppress_rom', action='store_true') + parser.add_argument('--bps', action='store_true') parser.add_argument('--rom') parser.add_argument('--enemizercli') parser.add_argument('--outputpath') @@ -63,6 +64,7 @@ def main(): erargs.names = args.names erargs.create_spoiler = args.create_spoiler erargs.suppress_rom = args.suppress_rom + erargs.bps = args.bps erargs.race = True erargs.outputname = seedname erargs.outputpath = args.outputpath @@ -138,12 +140,14 @@ def roll_settings(weights): ret.algorithm = get_choice('algorithm') + glitch_map = {'none': 'noglitches', 'no_logic': 'nologic', 'owglitches': 'owglitches', + 'minorglitches': 'minorglitches'} glitches_required = get_choice('glitches_required') if glitches_required is not None: - if glitches_required not in ['none', 'no_logic']: - print("Only NMG and No Logic supported") + if glitches_required not in glitch_map.keys(): + print(f'Logic did not match one of: {", ".join(glitch_map.keys())}') glitches_required = 'none' - ret.logic = {'none': 'noglitches', 'no_logic': 'nologic'}[glitches_required] + ret.logic = glitch_map[glitches_required] item_placement = get_choice('item_placement') # not supported in ER diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 5a3d5a85..9ec8d333 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -148,8 +148,12 @@ Same as above but both small keys and bigs keys of the dungeon are not allowed o #### Volatile * 1.0.1.7 + * Expanded Mystery logic options (e.g. owglitches) + * Allowed Mystery.py to create BPS patches * Allow creation of BPS and SFC files (no longer mutually exclusive) + * Fixed a bug with shopsanity + district algorithm where pre-placed potions messed up the placeholder count * Fixed usestartinventory flag (can be use on a per player basis) + * Fix for map indicators on keysanity menu not showing up * 1.0.1.6 * A couple new options for lighter pottery modes (Cave Pots and Dungeon Pots) * New option for Boss Shuffle: Unique (Prize bosses will be one of each, but GT bosses can be anything) diff --git a/Rom.py b/Rom.py index 96a093f4..20e9fce5 100644 --- a/Rom.py +++ b/Rom.py @@ -35,7 +35,7 @@ from source.item.FillUtil import valid_pot_items JAP10HASH = '03a63945398191337e896e5771f77173' -RANDOMIZERBASEHASH = '20444676b021133e7c8e50ecc152ebd4' +RANDOMIZERBASEHASH = '99f4c032651bb3c773f18280a182cd8f' class JsonRom(object): diff --git a/data/base2current.bps b/data/base2current.bps index b642cd45..d8226059 100644 Binary files a/data/base2current.bps and b/data/base2current.bps differ diff --git a/source/item/FillUtil.py b/source/item/FillUtil.py index 8b6a75a4..4fbafdd9 100644 --- a/source/item/FillUtil.py +++ b/source/item/FillUtil.py @@ -419,7 +419,7 @@ def vanilla_fallback(item_to_place, locations, world): return [] -def filter_locations(item_to_place, locations, world, vanilla_skip=False): +def filter_locations(item_to_place, locations, world, vanilla_skip=False, potion=False): if world.algorithm == 'vanilla_fill': config, filtered = world.item_pool_config, [] item_name = 'Bottle' if item_to_place.name.startswith('Bottle') else item_to_place.name @@ -452,6 +452,12 @@ def filter_locations(item_to_place, locations, world, vanilla_skip=False): restricted = config.location_groups[0].locations filtered = [l for l in locations if l.name in restricted and l.player in restricted[l.name]] return filtered if len(filtered) > 0 else locations + elif potion: + restricted = config.location_groups[0].locations + filtered = [l for l in locations if l.name not in restricted or l.player not in restricted[l.name]] + if len(filtered) == 0: + raise RuntimeError('Can\'t sell potion of a certain type due to district restriction') + return filtered return locations