Pokemon Emerald: Change Lilycove access logic (#3277)

* Pokemon Emerald: Change logical access to lilycove from east

* Pokemon Emerald: Add tests
This commit is contained in:
Bryce Wilson 2024-05-08 10:26:13 -06:00 committed by GitHub
parent 76962b8b3b
commit 0f1b16d640
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 44 additions and 1 deletions

View File

@ -2475,7 +2475,7 @@
], ],
"events": [], "events": [],
"exits": [ "exits": [
"REGION_LILYCOVE_CITY/MAIN", "REGION_LILYCOVE_CITY/SEA",
"REGION_MOSSDEEP_CITY/MAIN", "REGION_MOSSDEEP_CITY/MAIN",
"REGION_UNDERWATER_ROUTE124/BIG_AREA", "REGION_UNDERWATER_ROUTE124/BIG_AREA",
"REGION_UNDERWATER_ROUTE124/SMALL_AREA_1", "REGION_UNDERWATER_ROUTE124/SMALL_AREA_1",

View File

@ -994,6 +994,10 @@ def set_rules(world: "PokemonEmeraldWorld") -> None:
get_entrance("REGION_LILYCOVE_CITY/SEA -> REGION_ROUTE124/MAIN"), get_entrance("REGION_LILYCOVE_CITY/SEA -> REGION_ROUTE124/MAIN"),
lambda state: state.has("EVENT_CLEAR_AQUA_HIDEOUT", world.player) 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 # Magma Hideout
set_rule( set_rule(

View File

@ -77,6 +77,25 @@ class TestSurf(PokemonEmeraldTestBase):
self.assertTrue(self.can_reach_region("MAP_SLATEPORT_CITY_WATER_ENCOUNTERS")) 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): class TestFreeFly(PokemonEmeraldTestBase):
options = { options = {
"npc_gifts": Toggle.option_true, "npc_gifts": Toggle.option_true,
@ -100,6 +119,26 @@ class TestFreeFly(PokemonEmeraldTestBase):
self.assertTrue(self.can_reach_location(location_name_to_label("NPC_GIFT_RECEIVED_TM_BRICK_BREAK"))) 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): class TestFerry(PokemonEmeraldTestBase):
options = { options = {
"npc_gifts": Toggle.option_true "npc_gifts": Toggle.option_true