From 7a5d9d53da0b1c56a272dcfd535800e92dfd2e0b Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Mon, 8 Sep 2025 22:10:28 -0400 Subject: [Apworld] Added item/location groups --- apworld/__init__.py | 2 ++ apworld/static_logic.py | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/apworld/__init__.py b/apworld/__init__.py index c45e8b3..d05bd38 100644 --- a/apworld/__init__.py +++ b/apworld/__init__.py @@ -32,6 +32,8 @@ class Lingo2World(World): static_logic = Lingo2StaticLogic() item_name_to_id = static_logic.item_name_to_id location_name_to_id = static_logic.location_name_to_id + item_name_groups = static_logic.item_name_groups + location_name_groups = static_logic.location_name_groups player_logic: Lingo2PlayerLogic diff --git a/apworld/static_logic.py b/apworld/static_logic.py index 3f6cdea..0cc7e55 100644 --- a/apworld/static_logic.py +++ b/apworld/static_logic.py @@ -8,9 +8,14 @@ class Lingo2StaticLogic: item_name_to_id: dict[str, int] location_name_to_id: dict[str, int] + item_name_groups: dict[str, list[str]] + location_name_groups: dict[str, list[str]] + def __init__(self): self.item_id_to_name = {} self.location_id_to_name = {} + self.item_name_groups = {} + self.location_name_groups = {} file = pkgutil.get_data(__name__, "generated/data.binpb") self.objects = data_pb2.AllObjects() @@ -29,17 +34,21 @@ class Lingo2StaticLogic: letter_name = f"{letter.key.upper()}{'2' if letter.level2 else '1'}" location_name = f"{self.get_room_object_map_name(letter)} - {letter_name}" self.location_id_to_name[letter.ap_id] = location_name + self.location_name_groups.setdefault("Letters", []).append(location_name) if not letter.level2: self.item_id_to_name[letter.ap_id] = letter.key.upper() + self.item_name_groups.setdefault("Letters", []).append(letter.key.upper()) for mastery in self.objects.masteries: location_name = f"{self.get_room_object_map_name(mastery)} - Mastery" self.location_id_to_name[mastery.ap_id] = location_name + self.location_name_groups.setdefault("Masteries", []).append(location_name) for ending in self.objects.endings: location_name = f"{self.get_room_object_map_name(ending)} - {ending.name.title()} Ending" self.location_id_to_name[ending.ap_id] = location_name + self.location_name_groups.setdefault("Endings", []).append(location_name) for progressive in self.objects.progressives: self.item_id_to_name[progressive.ap_id] = progressive.name @@ -51,6 +60,7 @@ class Lingo2StaticLogic: if keyholder.HasField("key"): location_name = f"{self.get_room_object_location_prefix(keyholder)} - {keyholder.key.upper()} Keyholder" self.location_id_to_name[keyholder.ap_id] = location_name + self.location_name_groups.setdefault("Keyholders", []).append(location_name) self.item_id_to_name[self.objects.special_ids["A Job Well Done"]] = "A Job Well Done" -- cgit 1.4.1 From a825f800a04334ac8a4338c5fe88d7bbce49c022 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Mon, 8 Sep 2025 23:52:05 -0400 Subject: Made sure the apworld unit tests pass --- apworld/__init__.py | 10 +++++++++- apworld/docs/en_Lingo_2.md | 4 ++++ apworld/player_logic.py | 6 +++++- apworld/requirements.txt | 2 +- data/maps/the_owl/doors.txtpb | 2 +- 5 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 apworld/docs/en_Lingo_2.md diff --git a/apworld/__init__.py b/apworld/__init__.py index d05bd38..6eeee74 100644 --- a/apworld/__init__.py +++ b/apworld/__init__.py @@ -1,7 +1,7 @@ """ Archipelago init file for Lingo 2 """ -from BaseClasses import ItemClassification, Item +from BaseClasses import ItemClassification, Item, Tutorial from worlds.AutoWorld import WebWorld, World from .items import Lingo2Item from .options import Lingo2Options @@ -13,6 +13,14 @@ from .static_logic import Lingo2StaticLogic class Lingo2WebWorld(WebWorld): rich_text_options_doc = True theme = "grass" + tutorials = [Tutorial( + "Multiworld Setup Guide", + "A guide to playing Lingo 2 with Archipelago.", + "English", + "en_Lingo_2.md", + "setup/en", + ["hatkirby"] + )] class Lingo2World(World): diff --git a/apworld/docs/en_Lingo_2.md b/apworld/docs/en_Lingo_2.md new file mode 100644 index 0000000..977795a --- /dev/null +++ b/apworld/docs/en_Lingo_2.md @@ -0,0 +1,4 @@ +# Lingo 2 + +See [the project README](https://code.fourisland.com/lingo2-archipelago/about/) +for installation instructions and frequently asked questions. \ No newline at end of file diff --git a/apworld/player_logic.py b/apworld/player_logic.py index c94b809..dbd340c 100644 --- a/apworld/player_logic.py +++ b/apworld/player_logic.py @@ -335,7 +335,11 @@ class Lingo2PlayerLogic: for ending_id in door.endings: ending = self.world.static_logic.objects.endings[ending_id] - reqs.items.add(f"{ending.name.capitalize()} Ending (Achieved)") + + if self.world.options.victory_condition.current_key.removesuffix("_ending").upper() == ending.name: + reqs.items.add("Victory") + else: + reqs.items.add(f"{ending.name.capitalize()} Ending (Achieved)") for sub_door_id in door.doors: sub_reqs = self.get_door_open_reqs(sub_door_id) diff --git a/apworld/requirements.txt b/apworld/requirements.txt index 49ca0a7..dbc395b 100644 --- a/apworld/requirements.txt +++ b/apworld/requirements.txt @@ -1 +1 @@ -protobuf==3.20.3 \ No newline at end of file +protobuf==3.20.3 diff --git a/data/maps/the_owl/doors.txtpb b/data/maps/the_owl/doors.txtpb index 5ec34c6..9254c2a 100644 --- a/data/maps/the_owl/doors.txtpb +++ b/data/maps/the_owl/doors.txtpb @@ -235,7 +235,7 @@ doors { type: EVENT #receivers: "Panels/Colors/owl_2/animationListener2" panels { room: "Connected Area" name: "RANGE" } - panels { room: "R2C3 Bottom" name: "BLACK" } + panels { room: "Connected Area" name: "WHITE" } panels { room: "Blue Room" name: "SKY" } } doors { -- cgit 1.4.1