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/regions.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'apworld/regions.py') diff --git a/apworld/regions.py b/apworld/regions.py index 500139f..076c143 100644 --- a/apworld/regions.py +++ b/apworld/regions.py @@ -4,7 +4,7 @@ import BaseClasses from BaseClasses import Region, ItemClassification, Entrance from entrance_rando import randomize_entrances from .items import Lingo2Item -from .locations import Lingo2Location +from .locations import Lingo2Location, LetterPlacementType from .options import FastTravelAccess from .player_logic import AccessRequirements from .rules import make_location_lambda @@ -25,6 +25,11 @@ def create_locations(room, new_region: Region, world: "Lingo2World", regions: di new_location = Lingo2Location(world.player, world.static_logic.location_id_to_name[location.code], location.code, new_region) new_location.access_rule = make_location_lambda(reqs, world, regions) + if world.options.restrict_letter_placements: + if location.is_letter: + new_location.set_up_letter_rule(LetterPlacementType.FORCE) + else: + new_location.set_up_letter_rule(LetterPlacementType.DISALLOW) new_region.locations.append(new_location) for event_name, item_name in world.player_logic.event_loc_item_by_room.get(room.id, {}).items(): -- cgit 1.4.1