about summary refs log tree commit diff stats
path: root/apworld/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'apworld/__init__.py')
-rw-r--r--apworld/__init__.py41
1 files changed, 38 insertions, 3 deletions
diff --git a/apworld/__init__.py b/apworld/__init__.py index 14bb4bc..54f870f 100644 --- a/apworld/__init__.py +++ b/apworld/__init__.py
@@ -1,18 +1,27 @@
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
8from .player_logic import Lingo2PlayerLogic 8from .player_logic import Lingo2PlayerLogic
9from .regions import create_regions 9from .regions import create_regions
10from .static_logic import Lingo2StaticLogic 10from .static_logic import Lingo2StaticLogic
11from .version import APWORLD_VERSION
11 12
12 13
13class Lingo2WebWorld(WebWorld): 14class Lingo2WebWorld(WebWorld):
14 rich_text_options_doc = True 15 rich_text_options_doc = True
15 theme = "grass" 16 theme = "grass"
17 tutorials = [Tutorial(
18 "Multiworld Setup Guide",
19 "A guide to playing Lingo 2 with Archipelago.",
20 "English",
21 "en_Lingo_2.md",
22 "setup/en",
23 ["hatkirby"]
24 )]
16 25
17 26
18class Lingo2World(World): 27class Lingo2World(World):
@@ -32,6 +41,8 @@ class Lingo2World(World):
32 static_logic = Lingo2StaticLogic() 41 static_logic = Lingo2StaticLogic()
33 item_name_to_id = static_logic.item_name_to_id 42 item_name_to_id = static_logic.item_name_to_id
34 location_name_to_id = static_logic.location_name_to_id 43 location_name_to_id = static_logic.location_name_to_id
44 item_name_groups = static_logic.item_name_groups
45 location_name_groups = static_logic.location_name_groups
35 46
36 player_logic: Lingo2PlayerLogic 47 player_logic: Lingo2PlayerLogic
37 48
@@ -52,13 +63,37 @@ class Lingo2World(World):
52 63
53 item_difference = total_locations - len(pool) 64 item_difference = total_locations - len(pool)
54 for i in range(0, item_difference): 65 for i in range(0, item_difference):
55 pool.append(self.create_item("Nothing")) 66 pool.append(self.create_item(self.get_filler_item_name()))
56 67
57 self.multiworld.itempool += pool 68 self.multiworld.itempool += pool
58 69
59 def create_item(self, name: str) -> Item: 70 def create_item(self, name: str) -> Item:
60 return Lingo2Item(name, ItemClassification.filler if name == "Nothing" else ItemClassification.progression, 71 return Lingo2Item(name, ItemClassification.filler if name == self.get_filler_item_name() else
72 ItemClassification.progression,
61 self.item_name_to_id.get(name), self.player) 73 self.item_name_to_id.get(name), self.player)
62 74
63 def set_rules(self): 75 def set_rules(self):
64 self.multiworld.completion_condition[self.player] = lambda state: state.has("Victory", self.player) 76 self.multiworld.completion_condition[self.player] = lambda state: state.has("Victory", self.player)
77
78 def fill_slot_data(self):
79 slot_options = [
80 "cyan_door_behavior",
81 "daedalus_roof_access",
82 "keyholder_sanity",
83 "shuffle_control_center_colors",
84 "shuffle_doors",
85 "shuffle_gallery_paintings",
86 "shuffle_letters",
87 "shuffle_symbols",
88 "victory_condition",
89 ]
90
91 slot_data = {
92 **self.options.as_dict(*slot_options),
93 "version": [self.static_logic.get_data_version(), APWORLD_VERSION],
94 }
95
96 return slot_data
97
98 def get_filler_item_name(self) -> str:
99 return "A Job Well Done"