From 8dffc0d1fb5fde81e534d6de8f9cab67483fcce3 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Sun, 31 Aug 2025 12:35:27 -0400 Subject: Handled cyan doors --- apworld/player_logic.py | 7 ++++++- data/maps/the_bearer/doors.txtpb | 2 +- data/maps/the_darkroom/doors.txtpb | 9 ++++----- data/maps/the_entry/doors.txtpb | 8 ++++---- data/maps/the_graveyard/doors.txtpb | 3 +-- data/maps/the_great/doors.txtpb | 2 +- data/maps/the_parthenon/doors.txtpb | 2 +- data/maps/the_unkempt/doors.txtpb | 4 +++- data/maps/the_unyielding/doors.txtpb | 2 +- proto/data.proto | 1 + proto/human.proto | 1 + tools/datapacker/main.cpp | 4 ++++ tools/validator/validator.cpp | 9 +++++++++ 13 files changed, 37 insertions(+), 17 deletions(-) diff --git a/apworld/player_logic.py b/apworld/player_logic.py index ae22818..36156e4 100644 --- a/apworld/player_logic.py +++ b/apworld/player_logic.py @@ -205,7 +205,7 @@ class Lingo2PlayerLogic: door = self.world.static_logic.objects.doors[door_id] reqs = AccessRequirements() - # TODO: control_center_color, switches + # TODO: lavender_cubes, endings if not door.HasField("complete_at") or door.complete_at == 0: for proxy in door.panels: panel_reqs = self.get_panel_reqs(proxy.panel, proxy.answer if proxy.HasField("answer") else None) @@ -219,9 +219,14 @@ class Lingo2PlayerLogic: pass if door.HasField("control_center_color"): + # TODO: Logic for ensuring two CC states aren't needed at once. reqs.rooms.add("Control Center - Main Area") reqs.add_solution(door.control_center_color) + if door.double_letters: + # TODO: When letter shuffle is on, change this to require any double letter instead. + reqs.rooms.add("The Repetitive - Main Room") + for keyholder_uses in door.keyholders: key_name = keyholder_uses.key.upper() if key_name not in reqs.letters: diff --git a/data/maps/the_bearer/doors.txtpb b/data/maps/the_bearer/doors.txtpb index 574ea8f..f1f5a57 100644 --- a/data/maps/the_bearer/doors.txtpb +++ b/data/maps/the_bearer/doors.txtpb @@ -248,5 +248,5 @@ doors { name: "Butterfly Entrance" type: ITEM_ONLY receivers: "Components/Doors/brown_2" - switches: "double_letters" + double_letters: true } diff --git a/data/maps/the_darkroom/doors.txtpb b/data/maps/the_darkroom/doors.txtpb index ba297e4..d7094ae 100644 --- a/data/maps/the_darkroom/doors.txtpb +++ b/data/maps/the_darkroom/doors.txtpb @@ -1,11 +1,10 @@ # TODO: gallery painting doors { name: "Double Letter Panel Blockers" - type: ITEM_ONLY - receivers: "Panels/Room 1/panel_3/visibilityListener" - receivers: "Panels/Room 2/panel_3/visibilityListener" - # TODO: honestly idk if this should even exist - switches: "double_letters" + type: EVENT + #receivers: "Panels/Room 1/panel_3/visibilityListener" + #receivers: "Panels/Room 2/panel_3/visibilityListener" + double_letters: true } doors { name: "Second Room Entrance" diff --git a/data/maps/the_entry/doors.txtpb b/data/maps/the_entry/doors.txtpb index 1473af2..78ffa52 100644 --- a/data/maps/the_entry/doors.txtpb +++ b/data/maps/the_entry/doors.txtpb @@ -196,7 +196,7 @@ doors { name: "Repetitive Entrance" type: ITEM_ONLY receivers: "Components/Doors/Entry/entry_proxied_9" - switches: "double_letters" + double_letters: true } doors { name: "Shop Entrance" @@ -214,9 +214,9 @@ doors { } doors { name: "Flipped Pyramid Area Entrance" - type: ITEM_ONLY + type: EVENT receivers: "Components/Doors/Entry/entry_proxied_12" - switches: "double_letters" + double_letters: true } doors { name: "Literate Entrance" @@ -251,7 +251,7 @@ doors { type: ITEM_ONLY receivers: "Components/Doors/Entry/d_3" receivers: "Components/Doors/Entry/d_4" - switches: "double_letters" + double_letters: true } doors { name: "D Room Panels" diff --git a/data/maps/the_graveyard/doors.txtpb b/data/maps/the_graveyard/doors.txtpb index f06d40d..5e5e929 100644 --- a/data/maps/the_graveyard/doors.txtpb +++ b/data/maps/the_graveyard/doors.txtpb @@ -19,6 +19,5 @@ doors { doors { name: "Double Letters" type: EVENT - switches: "double_letters" - # TODO: once again, not sure whether this is how it should work + double_letters: true } diff --git a/data/maps/the_great/doors.txtpb b/data/maps/the_great/doors.txtpb index 477c678..e768dc7 100644 --- a/data/maps/the_great/doors.txtpb +++ b/data/maps/the_great/doors.txtpb @@ -226,7 +226,7 @@ doors { name: "Tower Entrance" type: ITEM_ONLY receivers: "Components/Doors/entry_25" - switches: "double_letters" + double_letters: true } doors { name: "Maze Out/South Door" diff --git a/data/maps/the_parthenon/doors.txtpb b/data/maps/the_parthenon/doors.txtpb index 7bc41c1..bb57d12 100644 --- a/data/maps/the_parthenon/doors.txtpb +++ b/data/maps/the_parthenon/doors.txtpb @@ -1,7 +1,7 @@ doors { name: "Double Letters" type: EVENT - switches: "double_letters" + double_letters: true } doors { name: "Lavender Cubes" diff --git a/data/maps/the_unkempt/doors.txtpb b/data/maps/the_unkempt/doors.txtpb index 906a900..9a13c82 100644 --- a/data/maps/the_unkempt/doors.txtpb +++ b/data/maps/the_unkempt/doors.txtpb @@ -21,7 +21,7 @@ doors { doors { name: "Cyan Doors" type: EVENT - switches: "double_letters" + double_letters: true } doors { name: "Sun Temple Entrance" @@ -66,7 +66,9 @@ doors { name: "Control Center Orange Door" type: CONTROL_CENTER_COLOR receivers: "Components/Doors/entry_6" + receivers: "Components/Doors/entry_13" control_center_color: "orange" + double_letters: true } doors { name: "W2 Door" diff --git a/data/maps/the_unyielding/doors.txtpb b/data/maps/the_unyielding/doors.txtpb index 46da45c..b9d0d77 100644 --- a/data/maps/the_unyielding/doors.txtpb +++ b/data/maps/the_unyielding/doors.txtpb @@ -499,5 +499,5 @@ doors { doors { name: "Cyan Doors" type: EVENT - switches: "double_letters" + double_letters: true } diff --git a/proto/data.proto b/proto/data.proto index 032cf3a..60b603b 100644 --- a/proto/data.proto +++ b/proto/data.proto @@ -105,6 +105,7 @@ message Door { repeated uint64 rooms = 14; repeated uint64 doors = 15; repeated uint64 endings = 16; + optional bool double_letters = 18; optional DoorType type = 8; diff --git a/proto/human.proto b/proto/human.proto index 5f6354c..c7e2f5d 100644 --- a/proto/human.proto +++ b/proto/human.proto @@ -87,6 +87,7 @@ message HumanDoor { repeated RoomIdentifier rooms = 11; repeated DoorIdentifier doors = 12; repeated string endings = 13; + optional bool double_letters = 15; optional DoorType type = 4; optional string location_room = 5; diff --git a/tools/datapacker/main.cpp b/tools/datapacker/main.cpp index cc83ca1..4923fce 100644 --- a/tools/datapacker/main.cpp +++ b/tools/datapacker/main.cpp @@ -406,6 +406,10 @@ class DataPacker { if (h_door.has_location_name()) { door.set_location_name(h_door.location_name()); } + + if (h_door.has_double_letters()) { + door.set_double_letters(h_door.double_letters()); + } } void ProcessConnectionsFile(std::filesystem::path path, diff --git a/tools/validator/validator.cpp b/tools/validator/validator.cpp index f5524c3..9c66e09 100644 --- a/tools/validator/validator.cpp +++ b/tools/validator/validator.cpp @@ -198,6 +198,15 @@ class Validator { std::cout << "Door " << door_identifier.ShortDebugString() << " needs an explicit location name." << std::endl; } + + if (h_door.double_letters() && + (h_door.type() == DoorType::STANDARD || + h_door.type() == DoorType::LOCATION_ONLY || + h_door.type() == DoorType::GRAVESTONE)) { + std::cout << "Door " << door_identifier.ShortDebugString() + << " is a location that depends on double_letters." + << std::endl; + } } } -- cgit 1.4.1