fixing bunny revival, and other bunny stuff
This commit is contained in:
10
OWGSets.py
10
OWGSets.py
@@ -165,3 +165,13 @@ def get_mirror_clip_spots_lw():
|
|||||||
'Death Mountain Bunny Descent Mirror Spot',
|
'Death Mountain Bunny Descent Mirror Spot',
|
||||||
'Death Mountain Offset Mirror',
|
'Death Mountain Offset Mirror',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
def get_invalid_bunny_revival_dungeons():
|
||||||
|
'''
|
||||||
|
Dungeon regions that can't be bunny revived from.
|
||||||
|
'''
|
||||||
|
return [
|
||||||
|
'Tower of Hera (Bottom)',
|
||||||
|
'Swamp Palace (Entrance)',
|
||||||
|
]
|
||||||
|
|||||||
83
Rules.py
83
Rules.py
@@ -1572,17 +1572,16 @@ def set_bunny_rules(world, player):
|
|||||||
def options_to_access_rule(options):
|
def options_to_access_rule(options):
|
||||||
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, connecting_entrance = None):
|
||||||
# In OWG, a location can potentially be superbunny-mirror accessible or
|
# In OWG, a location can potentially be superbunny-mirror accessible or
|
||||||
# bunny revival accessible.
|
# bunny revival accessible.
|
||||||
if world.logic == 'owglitches':
|
if world.logic == 'owglitches' and connecting_entrance != None:
|
||||||
if region.name == 'Tower of Hera (Bottom)' and region.name not in OWGSets.get_invalid_mirror_bunny_entrances_dw():
|
if region.name == 'Tower of Hera (Bottom)' and connecting_entrance.name not in OWGSets.get_invalid_mirror_bunny_entrances_dw():
|
||||||
return lambda state: state.can_superbunny_mirror_with_sword(player) or state.has_Pearl(player)
|
return lambda state: state.can_superbunny_mirror_with_sword(player) or state.has_Pearl(player)
|
||||||
if region.name == 'Turtle Rock (Entrance)' and region.name not in OWGSets.get_invalid_mirror_bunny_entrances_dw():
|
if region.name == 'Turtle Rock (Entrance)' and connecting_entrance.name not in OWGSets.get_invalid_mirror_bunny_entrances_dw():
|
||||||
return lambda state: state.has_Mirror(player) or state.has_Pearl(player)
|
return lambda state: state.has_Mirror(player) or state.has_Pearl(player)
|
||||||
if not any([
|
if not any([
|
||||||
location in OWGSets.get_superbunny_accessible_locations() and region.name not in OWGSets.get_invalid_mirror_bunny_entrances_dw(),
|
location != None and location.name in OWGSets.get_superbunny_accessible_locations() and connecting_entrance.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]):
|
not region.is_dark_world]):
|
||||||
return lambda state: state.has_Pearl(player)
|
return lambda state: state.has_Pearl(player)
|
||||||
else:
|
else:
|
||||||
@@ -1638,17 +1637,24 @@ def set_bunny_rules(world, player):
|
|||||||
if paradox_shop.is_dark_world:
|
if paradox_shop.is_dark_world:
|
||||||
add_rule(paradox_shop.entrances[0], get_rule_to_add(paradox_shop))
|
add_rule(paradox_shop.entrances[0], get_rule_to_add(paradox_shop))
|
||||||
|
|
||||||
# Add requirements for all locations that are actually in the dark world, except those available to the bunny
|
for entrance in world.get_entrances():
|
||||||
for location in world.get_locations():
|
if entrance.player == player and entrance.parent_region.is_dark_world:
|
||||||
if location.player == player and location.parent_region.is_dark_world:
|
if world.logic == 'owglitches':
|
||||||
|
if entrance.connected_region.type == RegionType.Dungeon:
|
||||||
if location.name in bunny_accessible_locations:
|
if entrance.connected_region.name in OWGSets.get_invalid_bunny_revival_dungeons():
|
||||||
continue
|
add_rule(entrance, get_rule_to_add(entrance.connected_region, None, entrance))
|
||||||
if world.logic == 'owglitches' and location.parent_region.name not in OWGSets.get_invalid_mirror_bunny_entrances_dw() and location.name in OWGSets.get_superbunny_accessible_locations():
|
continue
|
||||||
add_rule(location, get_rule_to_add(location.parent_region, location.name))
|
if entrance.connected_region.name == 'Turtle Rock (Entrance)':
|
||||||
continue
|
add_rule(world.get_entrance('Turtle Rock Entrance Gap', player), get_rule_to_add(entrance.connected_region, None, entrance))
|
||||||
|
if entrance.name in OWGSets.get_invalid_mirror_bunny_entrances_dw():
|
||||||
add_rule(location, get_rule_to_add(location.parent_region, location.name))
|
continue
|
||||||
|
for location in entrance.connected_region.locations:
|
||||||
|
if world.logic == 'owglitches' and entrance.name in OWGSets.get_invalid_mirror_bunny_entrances_dw():
|
||||||
|
add_rule(location, get_rule_to_add(entrance.connected_region, location, entrance))
|
||||||
|
continue
|
||||||
|
if location.name in bunny_accessible_locations:
|
||||||
|
continue
|
||||||
|
add_rule(location, get_rule_to_add(entrance.connected_region, location))
|
||||||
|
|
||||||
def set_inverted_bunny_rules(world, player):
|
def set_inverted_bunny_rules(world, player):
|
||||||
|
|
||||||
@@ -1666,21 +1672,20 @@ def set_inverted_bunny_rules(world, player):
|
|||||||
def options_to_access_rule(options):
|
def options_to_access_rule(options):
|
||||||
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, connecting_entrance = None):
|
||||||
# In OWG, a location can potentially be superbunny-mirror accessible or
|
# In OWG, a location can potentially be superbunny-mirror accessible or
|
||||||
# bunny revival accessible.
|
# bunny revival accessible.
|
||||||
if world.logic == 'owglitches':
|
if world.logic == 'owglitches' and connecting_entrance != None:
|
||||||
if region.name == 'Tower of Hera (Bottom)' and region.name not in OWGSets.get_invalid_mirror_bunny_entrances_lw():
|
if region.name == 'Tower of Hera (Bottom)' and connecting_entrance.name not in OWGSets.get_invalid_mirror_bunny_entrances_lw():
|
||||||
return lambda state: state.can_superbunny_mirror_with_sword(player) or state.has_Pearl(player)
|
return lambda state: state.can_superbunny_mirror_with_sword(player) or state.has_Pearl(player)
|
||||||
if region.name == 'Turtle Rock (Entrance)' and region.name not in OWGSets.get_invalid_mirror_bunny_entrances_lw():
|
if region.name == 'Turtle Rock (Entrance)' and connecting_entrance.name not in OWGSets.get_invalid_mirror_bunny_entrances_lw():
|
||||||
return lambda state: state.has_Mirror(player) or state.has_Pearl(player)
|
return lambda state: state.has_Mirror(player) or state.has_Pearl(player)
|
||||||
if not any([
|
if not any([
|
||||||
location in OWGSets.get_superbunny_accessible_locations() and region.name not in OWGSets.get_invalid_mirror_bunny_entrances_lw(),
|
location != None and location.name in OWGSets.get_superbunny_accessible_locations() and connecting_entrance.name not in OWGSets.get_invalid_mirror_bunny_entrances_dw(),
|
||||||
region.type == RegionType.Dungeon and region.name != 'Swamp Palace (Entrance)',
|
not region.is_light_world]):
|
||||||
not region.is_dark_world]):
|
|
||||||
return lambda state: state.has_Pearl(player)
|
return lambda state: state.has_Pearl(player)
|
||||||
else:
|
else:
|
||||||
if not region.is_dark_world:
|
if not region.is_light_world:
|
||||||
return lambda state: state.has_Pearl(player)
|
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.
|
||||||
@@ -1733,15 +1738,23 @@ def set_inverted_bunny_rules(world, player):
|
|||||||
add_rule(paradox_shop.entrances[0], get_rule_to_add(paradox_shop))
|
add_rule(paradox_shop.entrances[0], get_rule_to_add(paradox_shop))
|
||||||
|
|
||||||
# Add requirements for all locations that are actually in the light world, except those available to the bunny
|
# Add requirements for all locations that are actually in the light world, except those available to the bunny
|
||||||
for location in world.get_locations():
|
for entrance in world.get_entrances():
|
||||||
if location.player == player and location.parent_region.is_light_world:
|
if entrance.player == player and entrance.parent_region.is_light_world:
|
||||||
|
if world.logic == 'owglitches':
|
||||||
if location.name in bunny_accessible_locations:
|
if entrance.connected_region.type == RegionType.Dungeon:
|
||||||
continue
|
if entrance.connected_region.name in OWGSets.get_invalid_bunny_revival_dungeons():
|
||||||
if world.logic == 'owglitches' and location.parent_region.name not in OWGSets.get_invalid_mirror_bunny_entrances_lw() and location.name in OWGSets.get_superbunny_accessible_locations():
|
add_rule(entrance, get_rule_to_add(entrance.connected_region, None, entrance))
|
||||||
add_rule(location, get_rule_to_add(location.parent_region, location.name))
|
continue
|
||||||
continue
|
if entrance.connected_region.name == 'Turtle Rock (Entrance)':
|
||||||
|
add_rule(world.get_entrance('Turtle Rock Entrance Gap', player), get_rule_to_add(entrance.connected_region, None, entrance))
|
||||||
add_rule(location, get_rule_to_add(location.parent_region, location.name))
|
if entrance.name in OWGSets.get_invalid_mirror_bunny_entrances_lw():
|
||||||
|
continue
|
||||||
|
for location in entrance.connected_region.locations:
|
||||||
|
if world.logic == 'owglitches' and entrance.name in OWGSets.get_invalid_mirror_bunny_entrances_lw():
|
||||||
|
add_rule(location, get_rule_to_add(entrance.connected_region, location, entrance))
|
||||||
|
continue
|
||||||
|
if location.name in bunny_accessible_locations:
|
||||||
|
continue
|
||||||
|
add_rule(location, get_rule_to_add(entrance.connected_region, location))
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user