Skip to content

Commit

Permalink
Added Achievements location group
Browse files Browse the repository at this point in the history
  • Loading branch information
hatkirby committed Feb 2, 2024
1 parent 8d0db6c commit 3179efe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion worlds/lingo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from BaseClasses import Item, ItemClassification, Tutorial
from worlds.AutoWorld import WebWorld, World
from .items import ALL_ITEM_TABLE, ITEMS_BY_GROUP, LingoItem
from .locations import ALL_LOCATION_TABLE
from .locations import ALL_LOCATION_TABLE, LOCATIONS_BY_GROUP
from .options import LingoOptions
from .player_logic import LingoPlayerLogic
from .regions import create_regions
Expand Down Expand Up @@ -47,6 +47,7 @@ class LingoWorld(World):
name: data.code for name, data in ALL_LOCATION_TABLE.items()
}
item_name_groups = ITEMS_BY_GROUP
location_name_groups = LOCATIONS_BY_GROUP

player_logic: LingoPlayerLogic

Expand Down
6 changes: 5 additions & 1 deletion worlds/lingo/locations.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ class LingoLocation(Location):


ALL_LOCATION_TABLE: Dict[str, LocationData] = {}
LOCATIONS_BY_GROUP: Dict[str, List[str]] = {}


def load_location_data():
global ALL_LOCATION_TABLE
global ALL_LOCATION_TABLE, LOCATIONS_BY_GROUP

for room_name, panels in PANELS_BY_ROOM.items():
for panel_name, panel in panels.items():
Expand All @@ -57,6 +58,9 @@ def load_location_data():
LocationData(get_panel_location_id(room_name, panel_name), room_name,
[RoomAndPanel(None, panel_name)], classification)

if panel.achievement:
LOCATIONS_BY_GROUP.setdefault("Achievements", []).append(location_name)

for room_name, doors in DOORS_BY_ROOM.items():
for door_name, door in doors.items():
if door.skip_location or door.event or door.panels is None:
Expand Down

0 comments on commit 3179efe

Please sign in to comment.