From 3d03fcd82991d201f32a8313d4b44a4b17de4526 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Sat, 7 Feb 2026 13:24:58 -0500 Subject: Add restrict_letter_placements option --- apworld/__init__.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'apworld/__init__.py') 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 from Options import OptionError from settings import Group, UserFilePath from worlds.AutoWorld import WebWorld, World -from .items import Lingo2Item, ANTI_COLLECTABLE_TRAPS +from .items import Lingo2Item, ANTI_COLLECTABLE_TRAPS, ALL_LETTERS_UPPER from .options import Lingo2Options from .player_logic import Lingo2PlayerLogic from .regions import create_regions, shuffle_entrances, connect_ports_from_ut @@ -70,6 +70,9 @@ class Lingo2World(World): self.player_logic = Lingo2PlayerLogic(self) self.port_pairings = {} + if self.options.restrict_letter_placements: + self.options.local_items.value |= set(ALL_LETTERS_UPPER) + def create_regions(self): if hasattr(self.multiworld, "re_gen_passthrough") and "Lingo 2" in self.multiworld.re_gen_passthrough: self.player_logic.rte_mapping = [self.world.static_logic.map_id_by_name[map_name] @@ -128,11 +131,14 @@ class Lingo2World(World): self.push_precollected(self.create_item(name)) def create_item(self, name: str) -> Item: - return Lingo2Item(name, ItemClassification.filler if name == self.get_filler_item_name() else + item = Lingo2Item(name, ItemClassification.filler if name == self.get_filler_item_name() else ItemClassification.trap if name in ANTI_COLLECTABLE_TRAPS else ItemClassification.progression, self.item_name_to_id.get(name), self.player) + item.is_letter = (name in ALL_LETTERS_UPPER) + return item + def set_rules(self): self.multiworld.completion_condition[self.player] = lambda state: state.has("Victory", self.player) -- cgit 1.4.1