From 6f5287b3921c843a6b322ccbdfcbef00a8f16980 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Thu, 6 Jun 2024 15:51:32 -0400 Subject: Handle special cases (ECH + Sun Painting) --- src/subway_map.cpp | 34 +++++++++++++++++++++++++++++++++- src/tracker_state.cpp | 9 ++++++--- 2 files changed, 39 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/subway_map.cpp b/src/subway_map.cpp index b32c362..8364714 100644 --- a/src/subway_map.cpp +++ b/src/subway_map.cpp @@ -69,6 +69,12 @@ void SubwayMap::OnConnect() { std::map> tagged; for (const SubwayItem &subway_item : GD_GetSubwayItems()) { + if (AP_HasEarlyColorHallways() && + (subway_item.special == "starting_room_paintings" || + subway_item.special == "early_color_hallways")) { + tagged["early_color_hallways"].push_back(subway_item.id); + } + if (AP_IsPaintingShuffle() && !subway_item.paintings.empty()) { continue; } @@ -84,6 +90,12 @@ void SubwayMap::OnConnect() { tagged[tag.str()].push_back(subway_item.id); } + + if (!AP_IsPilgrimageEnabled() && + (subway_item.special == "sun_painting" || + subway_item.special == "sun_painting_exit")) { + tagged["sun_painting"].push_back(subway_item.id); + } } for (const auto &[tag, items] : tagged) { @@ -489,7 +501,27 @@ void SubwayMap::Redraw() { const wxBrush *brush_color = wxGREY_BRUSH; std::optional shade_color; - if (!subway_item.paintings.empty()) { + if (AP_HasEarlyColorHallways() && + (subway_item.special == "starting_room_paintings" || + subway_item.special == "early_color_hallways")) { + draw_type = ItemDrawType::kOwl; + + if (subway_item.special == "starting_room_paintings") { + shade_color = wxColour(0, 255, 0, 128); + } else { + shade_color = wxColour(255, 0, 0, 128); + } + } else if (subway_item.special == "sun_painting") { + if (!AP_IsPilgrimageEnabled()) { + if (IsDoorOpen(*subway_item.door)) { + draw_type = ItemDrawType::kOwl; + shade_color = wxColour(0, 255, 0, 128); + } else { + draw_type = ItemDrawType::kBox; + brush_color = wxRED_BRUSH; + } + } + } else if (!subway_item.paintings.empty()) { if (AP_IsPaintingShuffle()) { bool has_checked_painting = false; bool has_unchecked_painting = false; diff --git a/src/tracker_state.cpp b/src/tracker_state.cpp index 46bdbec..66e7751 100644 --- a/src/tracker_state.cpp +++ b/src/tracker_state.cpp @@ -52,9 +52,12 @@ class RequirementCalculator { Requirements requirements; const Door& door_obj = GD_GetDoor(door_id); - if (!AP_IsPilgrimageEnabled() && - door_obj.type == DoorType::kSunPainting) { - requirements.items.insert(door_obj.ap_item_id); + if (door_obj.type == DoorType::kSunPainting) { + if (!AP_IsPilgrimageEnabled()) { + requirements.items.insert(door_obj.ap_item_id); + } else { + requirements.disabled = true; + } } else if (door_obj.type == DoorType::kSunwarp) { switch (AP_GetSunwarpAccess()) { case kSUNWARP_ACCESS_NORMAL: -- cgit 1.4.1