apply local items in no_logic
This commit is contained in:
parent
a584e14f47
commit
cb1d4cc39e
3
Rom.py
3
Rom.py
|
@ -76,8 +76,7 @@ class LocalRom(object):
|
||||||
if not os.path.exists(local_path(os.path.join('data', 'basepatch.bmbp'))):
|
if not os.path.exists(local_path(os.path.join('data', 'basepatch.bmbp'))):
|
||||||
create_patch_file(local_path('basepatch.sfc'))
|
create_patch_file(local_path('basepatch.sfc'))
|
||||||
return
|
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'))):
|
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')))
|
_, target, buffer = create_rom_bytes(local_path(os.path.join('data', 'basepatch.bmbp')))
|
||||||
if self.verify(buffer):
|
if self.verify(buffer):
|
||||||
|
|
13
Rules.py
13
Rules.py
|
@ -7,7 +7,7 @@ from OverworldGlitchRules import overworld_glitches_rules
|
||||||
|
|
||||||
|
|
||||||
def set_rules(world, player):
|
def set_rules(world, player):
|
||||||
|
locality_rules(world, player)
|
||||||
if world.logic[player] == 'nologic':
|
if world.logic[player] == 'nologic':
|
||||||
logging.getLogger('').info('WARNING! Seeds generated under this logic often require major glitches and may be impossible!')
|
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
|
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 True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
def item_name(state, location, player):
|
def item_name(state, location, player):
|
||||||
location = state.world.get_location(location, player)
|
location = state.world.get_location(location, player)
|
||||||
if location.item is None:
|
if location.item is None:
|
||||||
return None
|
return None
|
||||||
return (location.item.name, location.item.player)
|
return (location.item.name, location.item.player)
|
||||||
|
|
||||||
def global_rules(world, player):
|
|
||||||
# ganon can only carry triforce
|
def locality_rules(world, player):
|
||||||
add_item_rule(world.get_location('Ganon', player), lambda item: item.name == 'Triforce' and item.player == player)
|
|
||||||
if world.goal[player] == "localtriforcehunt":
|
if world.goal[player] == "localtriforcehunt":
|
||||||
world.local_items[player].add('Triforce Piece')
|
world.local_items[player].add('Triforce Piece')
|
||||||
if world.local_items[player]:
|
if world.local_items[player]:
|
||||||
|
@ -146,6 +146,11 @@ def global_rules(world, player):
|
||||||
if location.player != player:
|
if location.player != player:
|
||||||
for item in world.local_items[player]:
|
for item in world.local_items[player]:
|
||||||
forbid_item(location, item, 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
|
# 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
|
world.get_region('Menu', player).can_reach_private = lambda state: True
|
||||||
for exit in world.get_region('Menu', player).exits:
|
for exit in world.get_region('Menu', player).exits:
|
||||||
|
|
Loading…
Reference in New Issue