diff options
Diffstat (limited to 'apworld/__init__.py')
| -rw-r--r-- | apworld/__init__.py | 10 |
1 files changed, 8 insertions, 2 deletions
| diff --git a/apworld/__init__.py b/apworld/__init__.py index 42350bc..ba5d7ea 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 | ||
