BPS flag for Mystery

Expanded logic options for mystery
Fixed a shopsanity+district bug
Fixed the keysanity menu not showing map marks
This commit is contained in:
aerinon
2022-02-24 14:06:34 -07:00
parent 4717449c35
commit b7e307f4c1
6 changed files with 20 additions and 6 deletions

View File

@@ -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)

View File

@@ -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

View File

@@ -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)

2
Rom.py
View File

@@ -35,7 +35,7 @@ from source.item.FillUtil import valid_pot_items
JAP10HASH = '03a63945398191337e896e5771f77173'
RANDOMIZERBASEHASH = '20444676b021133e7c8e50ecc152ebd4'
RANDOMIZERBASEHASH = '99f4c032651bb3c773f18280a182cd8f'
class JsonRom(object):

Binary file not shown.

View File

@@ -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