mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21:32 -06:00
apply local items in no_logic
This commit is contained in:
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'))):
|
||||
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):
|
||||
|
13
Rules.py
13
Rules.py
@@ -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:
|
||||
|
Reference in New Issue
Block a user