apply local items in no_logic

This commit is contained in:
Fabian Dill 2020-06-19 01:31:32 +02:00
parent a584e14f47
commit cb1d4cc39e
2 changed files with 10 additions and 6 deletions

3
Rom.py
View File

@ -76,8 +76,7 @@ class LocalRom(object):
if not os.path.exists(local_path(os.path.join('data', 'basepatch.bmbp'))):
create_patch_file(local_path('basepatch.sfc'))
return
logging.info(local_path(os.path.join('data', 'basepatch.bmbp')))
logging.info(os.path.isfile(local_path(os.path.join('data', 'basepatch.bmbp'))))
if os.path.isfile(local_path(os.path.join('data', 'basepatch.bmbp'))):
_, target, buffer = create_rom_bytes(local_path(os.path.join('data', 'basepatch.bmbp')))
if self.verify(buffer):

View File

@ -7,7 +7,7 @@ from OverworldGlitchRules import overworld_glitches_rules
def set_rules(world, player):
locality_rules(world, player)
if world.logic[player] == 'nologic':
logging.getLogger('').info('WARNING! Seeds generated under this logic often require major glitches and may be impossible!')
world.get_region('Menu', player).can_reach_private = lambda state: True
@ -130,15 +130,15 @@ def item_in_locations(state, item, player, locations):
return True
return False
def item_name(state, location, player):
location = state.world.get_location(location, player)
if location.item is None:
return None
return (location.item.name, location.item.player)
def global_rules(world, player):
# ganon can only carry triforce
add_item_rule(world.get_location('Ganon', player), lambda item: item.name == 'Triforce' and item.player == player)
def locality_rules(world, player):
if world.goal[player] == "localtriforcehunt":
world.local_items[player].add('Triforce Piece')
if world.local_items[player]:
@ -146,6 +146,11 @@ def global_rules(world, player):
if location.player != player:
for item in world.local_items[player]:
forbid_item(location, item, player)
def global_rules(world, player):
# ganon can only carry triforce
add_item_rule(world.get_location('Ganon', player), lambda item: item.name == 'Triforce' and item.player == player)
# determines which S&Q locations are available - hide from paths since it isn't an in-game location
world.get_region('Menu', player).can_reach_private = lambda state: True
for exit in world.get_region('Menu', player).exits: