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__.py19
1 files changed, 17 insertions, 2 deletions
diff --git a/apworld/__init__.py b/apworld/__init__.py index 5bad63e..6b5338e 100644 --- a/apworld/__init__.py +++ b/apworld/__init__.py
@@ -7,7 +7,7 @@ from BaseClasses import ItemClassification, Item, Tutorial
7from Options import OptionError 7from Options import OptionError
8from settings import Group, UserFilePath 8from settings import Group, UserFilePath
9from worlds.AutoWorld import WebWorld, World 9from worlds.AutoWorld import WebWorld, World
10from .items import Lingo2Item, ANTI_COLLECTABLE_TRAPS 10from .items import Lingo2Item, ANTI_COLLECTABLE_TRAPS, ALL_LETTERS_UPPER
11from .options import Lingo2Options 11from .options import Lingo2Options
12from .player_logic import Lingo2PlayerLogic 12from .player_logic import Lingo2PlayerLogic
13from .regions import create_regions, shuffle_entrances, connect_ports_from_ut 13from .regions import create_regions, shuffle_entrances, connect_ports_from_ut
@@ -70,7 +70,14 @@ class Lingo2World(World):
70 self.player_logic = Lingo2PlayerLogic(self) 70 self.player_logic = Lingo2PlayerLogic(self)
71 self.port_pairings = {} 71 self.port_pairings = {}
72 72
73 if self.options.restrict_letter_placements:
74 self.options.local_items.value |= set(ALL_LETTERS_UPPER)
75
73 def create_regions(self): 76 def create_regions(self):
77 if hasattr(self.multiworld, "re_gen_passthrough") and "Lingo 2" in self.multiworld.re_gen_passthrough:
78 self.player_logic.rte_mapping = [self.world.static_logic.map_id_by_name[map_name]
79 for map_name in self.multiworld.re_gen_passthrough["Lingo 2"]["rte"]]
80
74 create_regions(self) 81 create_regions(self)
75 82
76 def connect_entrances(self): 83 def connect_entrances(self):
@@ -124,11 +131,14 @@ class Lingo2World(World):
124 self.push_precollected(self.create_item(name)) 131 self.push_precollected(self.create_item(name))
125 132
126 def create_item(self, name: str) -> Item: 133 def create_item(self, name: str) -> Item:
127 return Lingo2Item(name, ItemClassification.filler if name == self.get_filler_item_name() else 134 item = Lingo2Item(name, ItemClassification.filler if name == self.get_filler_item_name() else
128 ItemClassification.trap if name in ANTI_COLLECTABLE_TRAPS else 135 ItemClassification.trap if name in ANTI_COLLECTABLE_TRAPS else
129 ItemClassification.progression, 136 ItemClassification.progression,
130 self.item_name_to_id.get(name), self.player) 137 self.item_name_to_id.get(name), self.player)
131 138
139 item.is_letter = (name in ALL_LETTERS_UPPER)
140 return item
141
132 def set_rules(self): 142 def set_rules(self):
133 self.multiworld.completion_condition[self.player] = lambda state: state.has("Victory", self.player) 143 self.multiworld.completion_condition[self.player] = lambda state: state.has("Victory", self.player)
134 144
@@ -140,12 +150,14 @@ class Lingo2World(World):
140 "enable_gift_maps", 150 "enable_gift_maps",
141 "enable_icarus", 151 "enable_icarus",
142 "endings_requirement", 152 "endings_requirement",
153 "fast_travel_access",
143 "keyholder_sanity", 154 "keyholder_sanity",
144 "masteries_requirement", 155 "masteries_requirement",
145 "shuffle_control_center_colors", 156 "shuffle_control_center_colors",
146 "shuffle_doors", 157 "shuffle_doors",
147 "shuffle_gallery_paintings", 158 "shuffle_gallery_paintings",
148 "shuffle_letters", 159 "shuffle_letters",
160 "shuffle_music",
149 "shuffle_symbols", 161 "shuffle_symbols",
150 "shuffle_worldports", 162 "shuffle_worldports",
151 "strict_cyan_ending", 163 "strict_cyan_ending",
@@ -155,6 +167,9 @@ class Lingo2World(World):
155 167
156 slot_data: dict[str, object] = { 168 slot_data: dict[str, object] = {
157 **self.options.as_dict(*slot_options), 169 **self.options.as_dict(*slot_options),
170 "custom_mint_ending": self.player_logic.custom_mint_ending or "",
171 "rte": [self.static_logic.objects.maps[map_id].name for map_id in self.player_logic.rte_mapping],
172 "seed": self.random.randint(0, 1000000),
158 "version": self.static_logic.get_data_version(), 173 "version": self.static_logic.get_data_version(),
159 } 174 }
160 175