From f8751699fc1bd0b2c9d8b387de37838109499f46 Mon Sep 17 00:00:00 2001 From: massimilianodelliubaldini <8584296+massimilianodelliubaldini@users.noreply.github.com> Date: Wed, 3 Jul 2024 13:25:34 -0400 Subject: [PATCH] Move rando fixes (#29) * Fix virtual regions in Snowy. Fix some GMC problems. * Fix Deathlink on sunken slides. * Removed unncessary code causing build failure. --- worlds/jakanddaxter/__init__.py | 6 -- worlds/jakanddaxter/client/MemoryReader.py | 2 + .../regs/GolAndMaiasCitadelRegions.py | 25 +++----- .../jakanddaxter/regs/SnowyMountainRegions.py | 61 +++++++++++-------- 4 files changed, 47 insertions(+), 47 deletions(-) diff --git a/worlds/jakanddaxter/__init__.py b/worlds/jakanddaxter/__init__.py index 2ba611d76b..7660bdd39d 100644 --- a/worlds/jakanddaxter/__init__.py +++ b/worlds/jakanddaxter/__init__.py @@ -23,7 +23,6 @@ def launch_client(): components.append(Component("Jak and Daxter Client", - "JakAndDaxterClient", func=launch_client, component_type=Type.CLIENT, icon="egg")) @@ -159,8 +158,3 @@ class JakAndDaxterWorld(World): def get_filler_item_name(self) -> str: return "Green Eco Pill" - - -def launch_client(): - from .Client import launch - launch_subprocess(launch, name="JakAndDaxterClient") diff --git a/worlds/jakanddaxter/client/MemoryReader.py b/worlds/jakanddaxter/client/MemoryReader.py index a446836457..8fd54b8b32 100644 --- a/worlds/jakanddaxter/client/MemoryReader.py +++ b/worlds/jakanddaxter/client/MemoryReader.py @@ -105,6 +105,8 @@ def autopsy(died: int) -> str: return "Jak got Flut Flut hurt." if died == 18: return "Jak poisoned the whole darn catch." + if died == 19: + return "Jak collided with too many obstacles." return "Jak died." diff --git a/worlds/jakanddaxter/regs/GolAndMaiasCitadelRegions.py b/worlds/jakanddaxter/regs/GolAndMaiasCitadelRegions.py index d9439e0be3..da3dabfe77 100644 --- a/worlds/jakanddaxter/regs/GolAndMaiasCitadelRegions.py +++ b/worlds/jakanddaxter/regs/GolAndMaiasCitadelRegions.py @@ -14,18 +14,9 @@ def build_regions(level_name: str, player: int, multiworld: MultiWorld) -> List[ or state.has("Jump Kick", p) or (state.has("Punch", p) and state.has("Punch Uppercut", p))) - def can_uppercut_spin(state: CollectionState, p: int) -> bool: - return (state.has("Punch", p) - and state.has("Punch Uppercut", p) - and state.has("Jump Kick", p)) - def can_triple_jump(state: CollectionState, p: int) -> bool: return state.has("Double Jump", p) and state.has("Jump Kick", p) - # Don't @ me on the name. - def can_move_fancy(state: CollectionState, p: int) -> bool: - return can_uppercut_spin(state, p) or can_triple_jump(state, p) - def can_jump_stairs(state: CollectionState, p: int) -> bool: return (state.has("Double Jump", p) or (state.has("Crouch", p) and state.has("Crouch Jump", p)) @@ -75,12 +66,14 @@ def build_regions(level_name: str, player: int, multiworld: MultiWorld) -> List[ robot_scaffolding.connect(main_area, rule=lambda state: state.has("Jump Dive", player)) robot_scaffolding.connect(blast_furnace, rule=lambda state: state.has("Jump Dive", player) + and can_jump_farther(state, player) and ((state.has("Roll", player) and state.has("Roll Jump", player)) - or can_uppercut_spin(state, player))) + or can_triple_jump(state, player))) robot_scaffolding.connect(bunny_room, rule=lambda state: - can_fight(state, player) - and (can_move_fancy(state, player) - or (state.has("Roll", player) and state.has("Roll Jump", player)))) + state.has("Jump Dive", player) + and can_jump_farther(state, player) + and ((state.has("Roll", player) and state.has("Roll Jump", player)) + or can_triple_jump(state, player))) jump_pad_room.connect(main_area) jump_pad_room.connect(robot_scaffolding, rule=lambda state: @@ -93,7 +86,7 @@ def build_regions(level_name: str, player: int, multiworld: MultiWorld) -> List[ bunny_room.connect(robot_scaffolding, rule=lambda state: state.has("Jump Dive", player) and ((state.has("Roll", player) and state.has("Roll Jump", player)) - or can_triple_jump(state, player))) + or can_jump_farther(state, player))) # Final climb. robot_scaffolding.connect(rotating_tower, rule=lambda state: @@ -104,10 +97,10 @@ def build_regions(level_name: str, player: int, multiworld: MultiWorld) -> List[ rotating_tower.connect(main_area) # Take stairs back down. - # You're going to need free-shooting yellow eco to defeat the robot. + # Final elevator. Need to break boxes at summit to get blue eco for platform. rotating_tower.connect(final_boss, rule=lambda state: state.has("Freed The Green Sage", player) - and state.has("Punch", player)) + and can_fight(state, player)) final_boss.connect(rotating_tower) # Take elevator back down. diff --git a/worlds/jakanddaxter/regs/SnowyMountainRegions.py b/worlds/jakanddaxter/regs/SnowyMountainRegions.py index 0c1ffe9428..dbd92c297c 100644 --- a/worlds/jakanddaxter/regs/SnowyMountainRegions.py +++ b/worlds/jakanddaxter/regs/SnowyMountainRegions.py @@ -8,17 +8,16 @@ from ..Rules import can_free_scout_flies, can_fight def build_regions(level_name: str, player: int, multiworld: MultiWorld) -> List[JakAndDaxterRegion]: # We need a few helper functions. - def can_uppercut_spin(state: CollectionState, p: int) -> bool: - return (state.has("Punch", p) - and state.has("Punch Uppercut", p) - and state.has("Jump Kick", p)) + def can_cross_main_gap(state: CollectionState, p: int) -> bool: + return ((state.has("Roll", player) + and state.has("Roll Jump", player)) + or (state.has("Double Jump", player) + and state.has("Jump Kick", player))) - def can_triple_jump(state: CollectionState, p: int) -> bool: - return state.has("Double Jump", p) and state.has("Jump Kick", p) - - # Don't @ me on the name. - def can_move_fancy(state: CollectionState, p: int) -> bool: - return can_uppercut_spin(state, p) or can_triple_jump(state, p) + def can_cross_frozen_cave(state: CollectionState, p: int) -> bool: + return (state.has("Jump Kick", p) + and (state.has("Double Jump", p) + or (state.has("Roll", p) and state.has("Roll Jump", p)))) def can_jump_blockers(state: CollectionState, p: int) -> bool: return (state.has("Double Jump", p) @@ -31,14 +30,29 @@ def build_regions(level_name: str, player: int, multiworld: MultiWorld) -> List[ main_area.add_fly_locations([65], access_rule=lambda state: can_free_scout_flies(state, player)) # We need a few virtual regions like we had for Dark Crystals in Spider Cave. - # First, a virtual region for the glacier lurkers, who all require combat. + # First, a virtual region for the glacier lurkers. glacier_lurkers = JakAndDaxterRegion("Glacier Lurkers", player, multiworld, level_name, 0) - glacier_lurkers.add_cell_locations([61], access_rule=lambda state: can_fight(state, player)) + + # Need to fight all the troops. + # Troop in snowball_canyon: cross main_area. + # Troop in ice_skating_rink: cross main_area and fort_exterior. + # Troop in fort_exterior: cross main_area and fort_exterior. + glacier_lurkers.add_cell_locations([61], access_rule=lambda state: + can_fight(state, player) + and can_cross_main_gap(state, player)) # Second, a virtual region for the precursor blockers. Unlike the others, this contains orbs: # the total number of orbs that sit on top of the blockers. Yes, there are only 8. blockers = JakAndDaxterRegion("Precursor Blockers", player, multiworld, level_name, 8) - blockers.add_cell_locations([66], access_rule=lambda state: can_fight(state, player)) + + # 1 in main_area + # 2 in snowball_canyon + # 4 in ice_skating_rink + # 3 in fort_exterior + # 3 in bunny_cave_start + blockers.add_cell_locations([66], access_rule=lambda state: + can_fight(state, player) + and can_cross_main_gap(state, player)) snowball_canyon = JakAndDaxterRegion("Snowball Canyon", player, multiworld, level_name, 28) @@ -96,35 +110,32 @@ def build_regions(level_name: str, player: int, multiworld: MultiWorld) -> List[ main_area.connect(glacier_lurkers, rule=lambda state: can_fight(state, player)) # Yes, the only way into the rest of the level requires advanced movement. - main_area.connect(snowball_canyon, rule=lambda state: - (state.has("Roll", player) and state.has("Roll Jump", player)) - or can_move_fancy(state, player)) + main_area.connect(snowball_canyon, rule=lambda state: can_cross_main_gap(state, player)) snowball_canyon.connect(main_area) # But you can just jump down and run up the ramp. snowball_canyon.connect(bunny_cave_start) # Jump down from the glacier troop cliff. snowball_canyon.connect(fort_exterior) # Jump down, to the left of frozen box cave. snowball_canyon.connect(frozen_box_cave, rule=lambda state: # More advanced movement. - can_move_fancy(state, player)) + can_cross_frozen_cave(state, player)) frozen_box_cave.connect(snowball_canyon, rule=lambda state: # Same movement to go back. - can_move_fancy(state, player)) + can_cross_frozen_cave(state, player)) frozen_box_cave.connect(frozen_box_cave_crates, rule=lambda state: # Same movement to get these crates. - state.has("Yellow Eco Switch", player) - and can_move_fancy(state, player)) + state.has("Yellow Eco Switch", player) # Plus YES. + and can_cross_frozen_cave(state, player)) frozen_box_cave.connect(ice_skating_rink, rule=lambda state: # Same movement to go forward. - can_move_fancy(state, player)) + can_cross_frozen_cave(state, player)) frozen_box_cave_crates.connect(frozen_box_cave) # Semi-virtual region, no moves req'd. ice_skating_rink.connect(frozen_box_cave, rule=lambda state: # Same movement to go back. - can_move_fancy(state, player)) + can_cross_frozen_cave(state, player)) ice_skating_rink.connect(flut_flut_course, rule=lambda state: # Duh. state.has("Flut Flut", player)) ice_skating_rink.connect(fort_exterior) # Just slide down the elevator ramp. - fort_exterior.connect(ice_skating_rink, rule=lambda state: # Twin elevators are tough to reach. - state.has("Double Jump", player) - or state.has("Jump Kick", player)) + fort_exterior.connect(ice_skating_rink, rule=lambda state: # Twin elevators OR scout fly ledge. + can_cross_main_gap(state, player)) # Both doable with main_gap logic. fort_exterior.connect(snowball_canyon) # Run across bridge. fort_exterior.connect(fort_interior, rule=lambda state: # Duh. state.has("Snowy Fort Gate", player))