Added flipper and mire clip rules to hera clip, also some efficiency fixes
This commit is contained in:
@@ -173,23 +173,21 @@ def dungeon_reentry_rules(
|
|||||||
def underworld_glitches_rules(world, player):
|
def underworld_glitches_rules(world, player):
|
||||||
def mire_clip(state):
|
def mire_clip(state):
|
||||||
torches = world.get_region("Mire Torches Top", player)
|
torches = world.get_region("Mire Torches Top", player)
|
||||||
return state.can_reach(torches, player) and (
|
return (state.can_dash_clip(torches, player)
|
||||||
state.can_dash_clip(torches, player)
|
|
||||||
or (state.can_bomb_clip(torches, player) and state.has_fire_source(player))
|
or (state.can_bomb_clip(torches, player) and state.has_fire_source(player))
|
||||||
)
|
) and state.can_reach(torches, player)
|
||||||
|
|
||||||
def hera_clip(state):
|
def hera_clip(state):
|
||||||
hera = world.get_region("Hera 4F", player)
|
hera = world.get_region("Hera 4F", player)
|
||||||
return state.can_reach(hera) and (
|
return (state.can_bomb_clip(hera, player) or state.can_dash_clip(hera, player)) \
|
||||||
state.can_bomb_clip(hera, player) or state.can_dash_clip(hera, player)
|
and state.has("Flippers", player) and state.can_reach(hera) and mire_clip(state)
|
||||||
)
|
|
||||||
|
|
||||||
# We use these plus functool.partial because lambdas don't work in loops properly.
|
# We use these plus functool.partial because lambdas don't work in loops properly.
|
||||||
def bomb_clip(state, region, player):
|
def bomb_clip(state, region, player):
|
||||||
return state.can_reach(region, player) and state.can_bomb_clip(region, player)
|
return state.can_bomb_clip(region, player) and state.can_reach(region, player)
|
||||||
|
|
||||||
def dash_clip(state, region, player):
|
def dash_clip(state, region, player):
|
||||||
return state.can_reach(region, player) and state.can_dash_clip(region, player)
|
return state.can_dash_clip(region, player) and state.can_reach(region, player)
|
||||||
# Bomb clips
|
# Bomb clips
|
||||||
for clip in (
|
for clip in (
|
||||||
kikiskip_spots
|
kikiskip_spots
|
||||||
@@ -236,18 +234,24 @@ def underworld_glitches_rules(world, player):
|
|||||||
# Allow mire big key to be used in Hera
|
# Allow mire big key to be used in Hera
|
||||||
Rules.add_rule(
|
Rules.add_rule(
|
||||||
world.get_entrance("Hera Startile Corner NW", player),
|
world.get_entrance("Hera Startile Corner NW", player),
|
||||||
lambda state: mire_clip(state) and state.has("Big Key (Misery Mire)", player),
|
lambda state: state.has("Big Key (Misery Mire)", player) and mire_clip(state),
|
||||||
combine="or",
|
combine="or",
|
||||||
)
|
)
|
||||||
Rules.add_rule(
|
Rules.add_rule(
|
||||||
world.get_location("Tower of Hera - Big Chest", player),
|
world.get_location("Tower of Hera - Big Chest", player),
|
||||||
lambda state: mire_clip(state) and state.has("Big Key (Misery Mire)", player),
|
lambda state: state.has("Big Key (Misery Mire)", player) and mire_clip(state),
|
||||||
combine="or",
|
combine="or",
|
||||||
)
|
)
|
||||||
# This uses the mire clip because it's always expected to come from mire
|
# This uses the mire clip because it's always expected to come from mire
|
||||||
Rules.set_rule(
|
Rules.set_rule(
|
||||||
world.get_entrance("Hera to Swamp Clip", player),
|
world.get_entrance("Hera to Swamp Clip", player),
|
||||||
lambda state: mire_clip(state) and state.has("Flippers", player),
|
lambda state: state.has("Flippers", player) and mire_clip(state),
|
||||||
|
)
|
||||||
|
Rules.add_rule(
|
||||||
|
world.get_location("Swamp Palace - Big Chest", player),
|
||||||
|
lambda state: (state.has("Big Key (Misery Mire)", player) or state.has("Big Key (Tower of Hera)", player)) \
|
||||||
|
and state.has("Flippers", player) and mire_clip(state),
|
||||||
|
combine="or",
|
||||||
)
|
)
|
||||||
# We need to set _all_ swamp doors to be openable with mire keys, otherwise the small key can't be behind them - 6 keys because of Pots
|
# We need to set _all_ swamp doors to be openable with mire keys, otherwise the small key can't be behind them - 6 keys because of Pots
|
||||||
# Flippers required for all of these doors to prevent locks when flooding
|
# Flippers required for all of these doors to prevent locks when flooding
|
||||||
@@ -266,9 +270,9 @@ def underworld_glitches_rules(world, player):
|
|||||||
]:
|
]:
|
||||||
Rules.add_rule(
|
Rules.add_rule(
|
||||||
world.get_entrance(door, player),
|
world.get_entrance(door, player),
|
||||||
lambda state: mire_clip(state)
|
lambda state: state.has("Flippers", player)
|
||||||
and state.has("Small Key (Misery Mire)", player, count=6)
|
and state.has("Small Key (Misery Mire)", player, count=6)
|
||||||
and state.has("Flippers", player),
|
and mire_clip(state),
|
||||||
combine="or",
|
combine="or",
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -314,8 +318,8 @@ def underworld_glitches_rules(world, player):
|
|||||||
return (
|
return (
|
||||||
state.can_reach("Old Man S&Q", "Entrance", player)
|
state.can_reach("Old Man S&Q", "Entrance", player)
|
||||||
and state.has("Flippers", player)
|
and state.has("Flippers", player)
|
||||||
and mire_clip(state)
|
|
||||||
and (hera_rule(state) or gt_rule(state))
|
and (hera_rule(state) or gt_rule(state))
|
||||||
|
and mire_clip(state)
|
||||||
)
|
)
|
||||||
|
|
||||||
Rules.add_rule(
|
Rules.add_rule(
|
||||||
|
|||||||
Reference in New Issue
Block a user