Skip to content

Commit

Permalink
Pokemon Emerald: Change Lilycove access logic (ArchipelagoMW#3277)
Browse files Browse the repository at this point in the history
* Pokemon Emerald: Change logical access to lilycove from east

* Pokemon Emerald: Add tests
  • Loading branch information
Zunawe authored May 8, 2024
1 parent 76962b8 commit 0f1b16d
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 1 deletion.
2 changes: 1 addition & 1 deletion worlds/pokemon_emerald/data/regions/routes.json
Original file line number Diff line number Diff line change
Expand Up @@ -2475,7 +2475,7 @@
],
"events": [],
"exits": [
"REGION_LILYCOVE_CITY/MAIN",
"REGION_LILYCOVE_CITY/SEA",
"REGION_MOSSDEEP_CITY/MAIN",
"REGION_UNDERWATER_ROUTE124/BIG_AREA",
"REGION_UNDERWATER_ROUTE124/SMALL_AREA_1",
Expand Down
4 changes: 4 additions & 0 deletions worlds/pokemon_emerald/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -994,6 +994,10 @@ def get_location(location: str):
get_entrance("REGION_LILYCOVE_CITY/SEA -> REGION_ROUTE124/MAIN"),
lambda state: state.has("EVENT_CLEAR_AQUA_HIDEOUT", world.player)
)
set_rule(
get_entrance("REGION_ROUTE124/MAIN -> REGION_LILYCOVE_CITY/SEA"),
lambda state: state.has("EVENT_CLEAR_AQUA_HIDEOUT", world.player)
)

# Magma Hideout
set_rule(
Expand Down
39 changes: 39 additions & 0 deletions worlds/pokemon_emerald/test/test_accessibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,25 @@ def test_accessible_with_surf_only(self) -> None:
self.assertTrue(self.can_reach_region("MAP_SLATEPORT_CITY_WATER_ENCOUNTERS"))


class TestModify118(PokemonEmeraldTestBase):
options = {
"modify_118": Toggle.option_true,
"bikes": Toggle.option_true,
"rods": Toggle.option_true
}

def test_inaccessible_with_nothing(self) -> None:
self.assertFalse(self.can_reach_location(location_name_to_label("NPC_GIFT_RECEIVED_GOOD_ROD")))

def test_inaccessible_with_only_surf(self) -> None:
self.collect_by_name(["HM03 Surf", "Balance Badge"])
self.assertFalse(self.can_reach_location(location_name_to_label("NPC_GIFT_RECEIVED_GOOD_ROD")))

def test_accessible_with_surf_and_acro_bike(self) -> None:
self.collect_by_name(["HM03 Surf", "Balance Badge", "Acro Bike"])
self.assertTrue(self.can_reach_location(location_name_to_label("NPC_GIFT_RECEIVED_GOOD_ROD")))


class TestFreeFly(PokemonEmeraldTestBase):
options = {
"npc_gifts": Toggle.option_true,
Expand All @@ -100,6 +119,26 @@ def test_sootopolis_gift_accessible_with_surf(self) -> None:
self.assertTrue(self.can_reach_location(location_name_to_label("NPC_GIFT_RECEIVED_TM_BRICK_BREAK")))


class TestLilycoveFromEast(PokemonEmeraldTestBase):
options = {
"modify_118": Toggle.option_true,
"bikes": Toggle.option_true,
"free_fly_location": Toggle.option_true
}

def setUp(self) -> None:
super(PokemonEmeraldTestBase, self).setUp()

# Swap free fly to Mossdeep
free_fly_location = self.multiworld.get_location("FREE_FLY_LOCATION", 1)
free_fly_location.item = None
free_fly_location.place_locked_item(self.multiworld.worlds[1].create_event("EVENT_VISITED_MOSSDEEP_CITY"))

def test_lilycove_inaccessible_from_east(self) -> None:
self.collect_by_name(["HM03 Surf", "Balance Badge", "HM02 Fly", "Feather Badge"])
self.assertFalse(self.can_reach_region("REGION_LILYCOVE_CITY/MAIN"))


class TestFerry(PokemonEmeraldTestBase):
options = {
"npc_gifts": Toggle.option_true
Expand Down

0 comments on commit 0f1b16d

Please sign in to comment.