Files
Grinch-AP/worlds/sc2/location_groups.py
Ziktofel 5f1835c546 SC2: Content update (#5312)
Feature highlights:
- Adds many content to the SC2 game
- Allows custom mission order
- Adds race-swapped missions for build missions (except Epilogue and NCO)
- Allows War Council Nerfs (Protoss units can get pre - War Council State, alternative units get another custom nerf to match the power level of base units)
- Revamps Predator's upgrade tree (never was considered strategically important)
- Adds some units and upgrades
- Locked and excluded items can specify quantity
- Key mode (if opt-in, missions require keys to be unlocked on top of their regular regular requirements
- Victory caches - Victory locations can grant multiple items to the multiworld instead of one 
- The generator is more resilient for generator failures as it validates logic for item excludes
- Fixes the following issues:
  - https://github.com/ArchipelagoMW/Archipelago/issues/3531 
  - https://github.com/ArchipelagoMW/Archipelago/issues/3548
2025-09-02 17:40:58 +02:00

41 lines
1.5 KiB
Python

"""
Location group definitions
"""
from typing import Dict, Set, Iterable
from .locations import DEFAULT_LOCATION_LIST, LocationData
from .mission_tables import lookup_name_to_mission, MissionFlag
def get_location_groups() -> Dict[str, Set[str]]:
result: Dict[str, Set[str]] = {}
locations: Iterable[LocationData] = DEFAULT_LOCATION_LIST
for location in locations:
if location.code is None:
# Beat events
continue
mission = lookup_name_to_mission.get(location.region)
if mission is None:
continue
if (MissionFlag.HasRaceSwap|MissionFlag.RaceSwap) & mission.flags:
# Location group including race-swapped variants of a location
agnostic_location_name = (
location.name
.replace(' (Terran)', '')
.replace(' (Protoss)', '')
.replace(' (Zerg)', '')
)
result.setdefault(agnostic_location_name, set()).add(location.name)
# Location group including all locations in all raceswaps
result.setdefault(mission.mission_name[:mission.mission_name.find(' (')], set()).add(location.name)
# Location group including all locations in a mission
result.setdefault(mission.mission_name, set()).add(location.name)
# Location group by location category
result.setdefault(location.type.name.title(), set()).add(location.name)
return result