diff options
Diffstat (limited to 'apworld/__init__.py')
| -rw-r--r-- | apworld/__init__.py | 13 |
1 files changed, 11 insertions, 2 deletions
| diff --git a/apworld/__init__.py b/apworld/__init__.py index 42350bc..6b5338e 100644 --- a/apworld/__init__.py +++ b/apworld/__init__.py | |||
| @@ -7,7 +7,7 @@ from BaseClasses import ItemClassification, Item, Tutorial | |||
| 7 | from Options import OptionError | 7 | from Options import OptionError |
| 8 | from settings import Group, UserFilePath | 8 | from settings import Group, UserFilePath |
| 9 | from worlds.AutoWorld import WebWorld, World | 9 | from worlds.AutoWorld import WebWorld, World |
| 10 | from .items import Lingo2Item, ANTI_COLLECTABLE_TRAPS | 10 | from .items import Lingo2Item, ANTI_COLLECTABLE_TRAPS, ALL_LETTERS_UPPER |
| 11 | from .options import Lingo2Options | 11 | from .options import Lingo2Options |
| 12 | from .player_logic import Lingo2PlayerLogic | 12 | from .player_logic import Lingo2PlayerLogic |
| 13 | from .regions import create_regions, shuffle_entrances, connect_ports_from_ut | 13 | from .regions import create_regions, shuffle_entrances, connect_ports_from_ut |
| @@ -70,6 +70,9 @@ 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): |
| 74 | if hasattr(self.multiworld, "re_gen_passthrough") and "Lingo 2" in self.multiworld.re_gen_passthrough: | 77 | if hasattr(self.multiworld, "re_gen_passthrough") and "Lingo 2" in self.multiworld.re_gen_passthrough: |
| 75 | self.player_logic.rte_mapping = [self.world.static_logic.map_id_by_name[map_name] | 78 | self.player_logic.rte_mapping = [self.world.static_logic.map_id_by_name[map_name] |
| @@ -128,11 +131,14 @@ class Lingo2World(World): | |||
| 128 | self.push_precollected(self.create_item(name)) | 131 | self.push_precollected(self.create_item(name)) |
| 129 | 132 | ||
| 130 | def create_item(self, name: str) -> Item: | 133 | def create_item(self, name: str) -> Item: |
| 131 | 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 |
| 132 | ItemClassification.trap if name in ANTI_COLLECTABLE_TRAPS else | 135 | ItemClassification.trap if name in ANTI_COLLECTABLE_TRAPS else |
| 133 | ItemClassification.progression, | 136 | ItemClassification.progression, |
| 134 | self.item_name_to_id.get(name), self.player) | 137 | self.item_name_to_id.get(name), self.player) |
| 135 | 138 | ||
| 139 | item.is_letter = (name in ALL_LETTERS_UPPER) | ||
| 140 | return item | ||
| 141 | |||
| 136 | def set_rules(self): | 142 | def set_rules(self): |
| 137 | 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) |
| 138 | 144 | ||
| @@ -151,6 +157,7 @@ class Lingo2World(World): | |||
| 151 | "shuffle_doors", | 157 | "shuffle_doors", |
| 152 | "shuffle_gallery_paintings", | 158 | "shuffle_gallery_paintings", |
| 153 | "shuffle_letters", | 159 | "shuffle_letters", |
| 160 | "shuffle_music", | ||
| 154 | "shuffle_symbols", | 161 | "shuffle_symbols", |
| 155 | "shuffle_worldports", | 162 | "shuffle_worldports", |
| 156 | "strict_cyan_ending", | 163 | "strict_cyan_ending", |
| @@ -160,7 +167,9 @@ class Lingo2World(World): | |||
| 160 | 167 | ||
| 161 | slot_data: dict[str, object] = { | 168 | slot_data: dict[str, object] = { |
| 162 | **self.options.as_dict(*slot_options), | 169 | **self.options.as_dict(*slot_options), |
| 170 | "custom_mint_ending": self.player_logic.custom_mint_ending or "", | ||
| 163 | "rte": [self.static_logic.objects.maps[map_id].name for map_id in self.player_logic.rte_mapping], | 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), | ||
| 164 | "version": self.static_logic.get_data_version(), | 173 | "version": self.static_logic.get_data_version(), |
| 165 | } | 174 | } |
| 166 | 175 | ||
