hera and tr superbunny logic

This commit is contained in:
qadan 2020-02-12 19:48:36 -04:00
parent 4707c36007
commit 3d021356b8
2 changed files with 30 additions and 16 deletions

View File

@ -552,6 +552,9 @@ class CollectionState(object):
rules.append(self.has_Pearl(player)) rules.append(self.has_Pearl(player))
return all(rules) return all(rules)
def can_superbunny_mirror_with_sword(self, player):
return self.has_Mirror(player) and self.has_sword(player)
def can_get_glitched_speed_dw(self, player): def can_get_glitched_speed_dw(self, player):
rules = [self.has_Boots(player), any([self.has('Hookshot', player), self.has_sword(player)])] rules = [self.has_Boots(player), any([self.has('Hookshot', player), self.has_sword(player)])]
if self.world.mode[player] != 'inverted': if self.world.mode[player] != 'inverted':

View File

@ -767,13 +767,12 @@ def overworld_glitches_rules(world, player):
set_rule(world.get_entrance(clip_spot, player), lambda state: state.has_Mirror(player)) set_rule(world.get_entrance(clip_spot, player), lambda state: state.has_Mirror(player))
# Locations that you can superbunny mirror into, but need a sword to clear. # Locations that you can superbunny mirror into, but need a sword to clear.
superbunny_mirror_weapon = lambda state: state.has_Mirror(player) and state.has_sword(player)
mini_moldorm_cave = world.get_region('Mini Moldorm Cave', player) mini_moldorm_cave = world.get_region('Mini Moldorm Cave', player)
for superbunny_mirror_weapon_region in OWGSets.get_sword_required_superbunny_mirror_regions(): for superbunny_mirror_weapon_region in OWGSets.get_sword_required_superbunny_mirror_regions():
region = world.get_region(superbunny_mirror_weapon_region, player) region = world.get_region(superbunny_mirror_weapon_region, player)
if check_is_dark_world(region): if check_is_dark_world(region):
for spot in region.locations: for spot in region.locations:
add_rule(world.get_location(spot, player), superbunny_mirror_weapon, 'or') add_rule(world.get_location(spot, player), lambda state: state.can_superbunny_mirror_with_sword(player), 'or')
# Regions that require the boots and some other stuff. # Regions that require the boots and some other stuff.
if world.mode[player] != 'inverted': if world.mode[player] != 'inverted':
@ -1341,13 +1340,19 @@ def set_bunny_rules(world, player):
return lambda state: any(rule(state) for rule in options) return lambda state: any(rule(state) for rule in options)
def get_rule_to_add(region, location = None): def get_rule_to_add(region, location = None):
if world.logic[player] == 'owglitches' and not any([ if world.logic['player'] == 'owglitches':
location in OWGSets.get_superbunny_accessible_locations() and region.name not in OWGSets.get_invalid_mirror_bunny_entrances_dw(), if region.name == 'Tower of Hera (Bottom)' and region.name not in OWGSets.get_invalid_mirror_bunny_entrances_dw():
region.type == RegionType.Dungeon and region.name != 'Swamp Palace (Entrance)', return lambda state: state.can_superbunny_mirror_with_sword(player) or state.has_Pearl(player)
not region.is_light_world]): if region.name == 'Turtle Rock (Entrance)' and region.name not in OWGSets.get_invalid_mirror_bunny_entrances_dw():
return lambda state: state.has_Pearl(player) return lambda state: state.has_Mirror(player) or state.has_Pearl(player)
elif world.logic[player] != 'owglitches' and not region.is_light_world: if not any([
return lambda state: state.has_Pearl(player) location in OWGSets.get_superbunny_accessible_locations() and region.name not in OWGSets.get_invalid_mirror_bunny_entrances_dw(),
region.type == RegionType.Dungeon and region.name != 'Swamp Palace (Entrance)',
not region.is_dark_world]):
return lambda state: state.has_Pearl(player)
else:
if not region.is_dark_world:
return lambda state: state.has_Pearl(player)
# in this case we are mixed region. # in this case we are mixed region.
# we collect possible options. # we collect possible options.
@ -1425,13 +1430,19 @@ def set_inverted_bunny_rules(world, player):
return lambda state: any(rule(state) for rule in options) return lambda state: any(rule(state) for rule in options)
def get_rule_to_add(region, location = None): def get_rule_to_add(region, location = None):
if world.logic[player] == 'owglitches' and not any([ if world.logic['player'] == 'owglitches':
location in OWGSets.get_superbunny_accessible_locations() and region.name not in OWGSets.get_invalid_mirror_bunny_entrances_dw(), if region.name == 'Tower of Hera (Bottom)' and region.name not in OWGSets.get_invalid_mirror_bunny_entrances_lw():
region.type == RegionType.Dungeon and region.name != 'Swamp Palace (Entrance)', return lambda state: state.can_superbunny_mirror_with_sword(player) or state.has_Pearl(player)
not region.is_dark_world]): if region.name == 'Turtle Rock (Entrance)' and region.name not in OWGSets.get_invalid_mirror_bunny_entrances_lw():
return lambda state: state.has_Pearl(player) return lambda state: state.has_Mirror(player) or state.has_Pearl(player)
elif world.logic[player] != 'owglitches' and not region.is_dark_world: if not any([
return lambda state: state.has_Pearl(player) location in OWGSets.get_superbunny_accessible_locations() and region.name not in OWGSets.get_invalid_mirror_bunny_entrances_lw(),
region.type == RegionType.Dungeon and region.name != 'Swamp Palace (Entrance)',
not region.is_dark_world]):
return lambda state: state.has_Pearl(player)
else:
if not region.is_dark_world:
return lambda state: state.has_Pearl(player)
# in this case we are mixed region. # in this case we are mixed region.
# we collect possible options. # we collect possible options.