about summary refs log tree commit diff stats
path: root/apworld
diff options
context:
space:
mode:
Diffstat (limited to 'apworld')
-rw-r--r--apworld/__init__.py12
-rw-r--r--apworld/docs/en_Lingo_2.md4
-rw-r--r--apworld/player_logic.py6
-rw-r--r--apworld/requirements.txt2
-rw-r--r--apworld/static_logic.py10
5 files changed, 31 insertions, 3 deletions
diff --git a/apworld/__init__.py b/apworld/__init__.py index c45e8b3..6eeee74 100644 --- a/apworld/__init__.py +++ b/apworld/__init__.py
@@ -1,7 +1,7 @@
1""" 1"""
2Archipelago init file for Lingo 2 2Archipelago init file for Lingo 2
3""" 3"""
4from BaseClasses import ItemClassification, Item 4from BaseClasses import ItemClassification, Item, Tutorial
5from worlds.AutoWorld import WebWorld, World 5from worlds.AutoWorld import WebWorld, World
6from .items import Lingo2Item 6from .items import Lingo2Item
7from .options import Lingo2Options 7from .options import Lingo2Options
@@ -13,6 +13,14 @@ from .static_logic import Lingo2StaticLogic
13class Lingo2WebWorld(WebWorld): 13class Lingo2WebWorld(WebWorld):
14 rich_text_options_doc = True 14 rich_text_options_doc = True
15 theme = "grass" 15 theme = "grass"
16 tutorials = [Tutorial(
17 "Multiworld Setup Guide",
18 "A guide to playing Lingo 2 with Archipelago.",
19 "English",
20 "en_Lingo_2.md",
21 "setup/en",
22 ["hatkirby"]
23 )]
16 24
17 25
18class Lingo2World(World): 26class Lingo2World(World):
@@ -32,6 +40,8 @@ class Lingo2World(World):
32 static_logic = Lingo2StaticLogic() 40 static_logic = Lingo2StaticLogic()
33 item_name_to_id = static_logic.item_name_to_id 41 item_name_to_id = static_logic.item_name_to_id
34 location_name_to_id = static_logic.location_name_to_id 42 location_name_to_id = static_logic.location_name_to_id
43 item_name_groups = static_logic.item_name_groups
44 location_name_groups = static_logic.location_name_groups
35 45
36 player_logic: Lingo2PlayerLogic 46 player_logic: Lingo2PlayerLogic
37 47
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 @@
1# Lingo 2
2
3See [the project README](https://code.fourisland.com/lingo2-archipelago/about/)
4for 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:
335 335
336 for ending_id in door.endings: 336 for ending_id in door.endings:
337 ending = self.world.static_logic.objects.endings[ending_id] 337 ending = self.world.static_logic.objects.endings[ending_id]
338 reqs.items.add(f"{ending.name.capitalize()} Ending (Achieved)") 338
339 if self.world.options.victory_condition.current_key.removesuffix("_ending").upper() == ending.name:
340 reqs.items.add("Victory")
341 else:
342 reqs.items.add(f"{ending.name.capitalize()} Ending (Achieved)")
339 343
340 for sub_door_id in door.doors: 344 for sub_door_id in door.doors:
341 sub_reqs = self.get_door_open_reqs(sub_door_id) 345 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/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:
8 item_name_to_id: dict[str, int] 8 item_name_to_id: dict[str, int]
9 location_name_to_id: dict[str, int] 9 location_name_to_id: dict[str, int]
10 10
11 item_name_groups: dict[str, list[str]]
12 location_name_groups: dict[str, list[str]]
13
11 def __init__(self): 14 def __init__(self):
12 self.item_id_to_name = {} 15 self.item_id_to_name = {}
13 self.location_id_to_name = {} 16 self.location_id_to_name = {}
17 self.item_name_groups = {}
18 self.location_name_groups = {}
14 19
15 file = pkgutil.get_data(__name__, "generated/data.binpb") 20 file = pkgutil.get_data(__name__, "generated/data.binpb")
16 self.objects = data_pb2.AllObjects() 21 self.objects = data_pb2.AllObjects()
@@ -29,17 +34,21 @@ class Lingo2StaticLogic:
29 letter_name = f"{letter.key.upper()}{'2' if letter.level2 else '1'}" 34 letter_name = f"{letter.key.upper()}{'2' if letter.level2 else '1'}"
30 location_name = f"{self.get_room_object_map_name(letter)} - {letter_name}" 35 location_name = f"{self.get_room_object_map_name(letter)} - {letter_name}"
31 self.location_id_to_name[letter.ap_id] = location_name 36 self.location_id_to_name[letter.ap_id] = location_name
37 self.location_name_groups.setdefault("Letters", []).append(location_name)
32 38
33 if not letter.level2: 39 if not letter.level2:
34 self.item_id_to_name[letter.ap_id] = letter.key.upper() 40 self.item_id_to_name[letter.ap_id] = letter.key.upper()
41 self.item_name_groups.setdefault("Letters", []).append(letter.key.upper())
35 42
36 for mastery in self.objects.masteries: 43 for mastery in self.objects.masteries:
37 location_name = f"{self.get_room_object_map_name(mastery)} - Mastery" 44 location_name = f"{self.get_room_object_map_name(mastery)} - Mastery"
38 self.location_id_to_name[mastery.ap_id] = location_name 45 self.location_id_to_name[mastery.ap_id] = location_name
46 self.location_name_groups.setdefault("Masteries", []).append(location_name)
39 47
40 for ending in self.objects.endings: 48 for ending in self.objects.endings:
41 location_name = f"{self.get_room_object_map_name(ending)} - {ending.name.title()} Ending" 49 location_name = f"{self.get_room_object_map_name(ending)} - {ending.name.title()} Ending"
42 self.location_id_to_name[ending.ap_id] = location_name 50 self.location_id_to_name[ending.ap_id] = location_name
51 self.location_name_groups.setdefault("Endings", []).append(location_name)
43 52
44 for progressive in self.objects.progressives: 53 for progressive in self.objects.progressives:
45 self.item_id_to_name[progressive.ap_id] = progressive.name 54 self.item_id_to_name[progressive.ap_id] = progressive.name
@@ -51,6 +60,7 @@ class Lingo2StaticLogic:
51 if keyholder.HasField("key"): 60 if keyholder.HasField("key"):
52 location_name = f"{self.get_room_object_location_prefix(keyholder)} - {keyholder.key.upper()} Keyholder" 61 location_name = f"{self.get_room_object_location_prefix(keyholder)} - {keyholder.key.upper()} Keyholder"
53 self.location_id_to_name[keyholder.ap_id] = location_name 62 self.location_id_to_name[keyholder.ap_id] = location_name
63 self.location_name_groups.setdefault("Keyholders", []).append(location_name)
54 64
55 self.item_id_to_name[self.objects.special_ids["A Job Well Done"]] = "A Job Well Done" 65 self.item_id_to_name[self.objects.special_ids["A Job Well Done"]] = "A Job Well Done"
56 66