Pokemon Emerald: Rework tags/dynamically create item and location groups (#3263)

* Pokemon Emerald: Rework location tags to categories

* Pokemon Emerald: Rework item tags, automatically create item/location groups

* Pokemon Emerald: Move item and location groups to data.py, add some regional location groups

* Map Regions

* Pokemon Emerald: Fix up location groups

* Pokemon Emerald: Move groups to their own file

* Pokemon Emerald: Add meta groups for location groups

* Pokemon Emerald: Fix has_group using updated item group name

* Pokemon Emerald: Add sanity check for maps in location groups

* Pokemon Emerald: Remove missed use of location.tags

* Pokemon Emerald: Reclassify white and black flutes

* Pokemon Emerald: Update changelog

* Pokemon Emerald: Adjust changelog

---------

Co-authored-by: Tsukino <16899482+Tsukino-uwu@users.noreply.github.com>
This commit is contained in:
Bryce Wilson
2024-11-29 00:24:24 -08:00
committed by GitHub
parent 91185f4f7c
commit 6f2464d4ad
10 changed files with 3550 additions and 1511 deletions

View File

@@ -6,7 +6,8 @@ from typing import TYPE_CHECKING, Callable, Dict
from BaseClasses import CollectionState
from worlds.generic.Rules import add_rule, set_rule
from .data import NATIONAL_ID_TO_SPECIES_ID, NUM_REAL_SPECIES, data
from .data import LocationCategory, NATIONAL_ID_TO_SPECIES_ID, NUM_REAL_SPECIES, data
from .locations import PokemonEmeraldLocation
from .options import DarkCavesRequireFlash, EliteFourRequirement, NormanRequirement, Goal
if TYPE_CHECKING:
@@ -23,7 +24,7 @@ def set_rules(world: "PokemonEmeraldWorld") -> None:
state.has(hm, world.player) and state.has_all(badges, world.player)
else:
hm_rules[hm] = lambda state, hm=hm, badges=badges: \
state.has(hm, world.player) and state.has_group_unique("Badges", world.player, badges)
state.has(hm, world.player) and state.has_group_unique("Badge", world.player, badges)
def has_acro_bike(state: CollectionState):
return state.has("Acro Bike", world.player)
@@ -236,11 +237,11 @@ def set_rules(world: "PokemonEmeraldWorld") -> None:
if world.options.norman_requirement == NormanRequirement.option_badges:
set_rule(
get_entrance("MAP_PETALBURG_CITY_GYM:2/MAP_PETALBURG_CITY_GYM:3"),
lambda state: state.has_group_unique("Badges", world.player, world.options.norman_count.value)
lambda state: state.has_group_unique("Badge", world.player, world.options.norman_count.value)
)
set_rule(
get_entrance("MAP_PETALBURG_CITY_GYM:5/MAP_PETALBURG_CITY_GYM:6"),
lambda state: state.has_group_unique("Badges", world.player, world.options.norman_count.value)
lambda state: state.has_group_unique("Badge", world.player, world.options.norman_count.value)
)
else:
set_rule(
@@ -1506,7 +1507,7 @@ def set_rules(world: "PokemonEmeraldWorld") -> None:
if world.options.elite_four_requirement == EliteFourRequirement.option_badges:
set_rule(
get_entrance("REGION_EVER_GRANDE_CITY_POKEMON_LEAGUE_1F/MAIN -> REGION_EVER_GRANDE_CITY_POKEMON_LEAGUE_1F/BEHIND_BADGE_CHECKERS"),
lambda state: state.has_group_unique("Badges", world.player, world.options.elite_four_count.value)
lambda state: state.has_group_unique("Badge", world.player, world.options.elite_four_count.value)
)
else:
set_rule(
@@ -1659,7 +1660,8 @@ def set_rules(world: "PokemonEmeraldWorld") -> None:
# Add Itemfinder requirement to hidden items
if world.options.require_itemfinder:
for location in world.multiworld.get_locations(world.player):
if location.tags is not None and "HiddenItem" in location.tags:
assert isinstance(location, PokemonEmeraldLocation)
if location.key is not None and data.locations[location.key].category == LocationCategory.HIDDEN_ITEM:
add_rule(
location,
lambda state: state.has("Itemfinder", world.player)