diff --git a/Source/Archipelago/APGameData.h b/Source/Archipelago/APGameData.h index 1646515a..a66ca705 100644 --- a/Source/Archipelago/APGameData.h +++ b/Source/Archipelago/APGameData.h @@ -797,6 +797,8 @@ const inline std::set deathlinkExcludeList = { 0x00027, // UTM Invisible Dots Symmetry 1 0x00028, // UTM Invisible Dots Symmetry 2 0x00029, // UTM Invisible Dots Symmetry 3 + 0x0C373, // Patio Floor + 0x0A079, // Bunker Elevator Panel }; const inline std::set allEPs = { diff --git a/Source/Archipelago/APRandomizer.cpp b/Source/Archipelago/APRandomizer.cpp index c25e3efa..5e210b36 100644 --- a/Source/Archipelago/APRandomizer.cpp +++ b/Source/Archipelago/APRandomizer.cpp @@ -122,6 +122,7 @@ bool APRandomizer::Connect(std::string& server, std::string& user, std::string& if (slotData.contains("challenge_lasers")) ChallengeLasers = slotData["challenge_lasers"]; DisableNonRandomizedPuzzles = slotData.contains("disable_non_randomized_puzzles") ? slotData["disable_non_randomized_puzzles"] == true : false; EPShuffle = slotData.contains("shuffle_EPs") ? slotData["shuffle_EPs"] != 0 : false; + DeathLink = slotData.contains("death_link") ? slotData["death_link"] == true : false; if (!UnlockSymbols) { state.unlockedArrows = true; @@ -243,12 +244,10 @@ bool APRandomizer::Connect(std::string& server, std::string& user, std::string& } } - if (slotData.contains("death_link")) { - if(slotData["death_link"] == true) { - std::list newTags = { "DeathLink" }; + if (DeathLink) { + std::list newTags = { "DeathLink" }; - ap->ConnectUpdate(NULL, newTags); - } + ap->ConnectUpdate(NULL, newTags); } @@ -539,7 +538,7 @@ void APRandomizer::Init() { } void APRandomizer::GenerateNormal() { - async = new APWatchdog(ap, panelIdToLocationId, FinalPanel, panelLocker, entityToName, audioLogMessages, obeliskSideIDsToEPHexes, EPShuffle, PuzzleRandomization, &state, solveModeSpeedFactor); + async = new APWatchdog(ap, panelIdToLocationId, FinalPanel, panelLocker, entityToName, audioLogMessages, obeliskSideIDsToEPHexes, EPShuffle, PuzzleRandomization, &state, solveModeSpeedFactor, DeathLink); SeverDoors(); if (DisableNonRandomizedPuzzles) @@ -547,7 +546,7 @@ void APRandomizer::GenerateNormal() { } void APRandomizer::GenerateHard() { - async = new APWatchdog(ap, panelIdToLocationId, FinalPanel, panelLocker, entityToName, audioLogMessages, obeliskSideIDsToEPHexes, EPShuffle, PuzzleRandomization, &state, solveModeSpeedFactor); + async = new APWatchdog(ap, panelIdToLocationId, FinalPanel, panelLocker, entityToName, audioLogMessages, obeliskSideIDsToEPHexes, EPShuffle, PuzzleRandomization, &state, solveModeSpeedFactor, DeathLink); SeverDoors(); //Mess with Town targets diff --git a/Source/Archipelago/APRandomizer.h b/Source/Archipelago/APRandomizer.h index e9e406ff..a88f6847 100644 --- a/Source/Archipelago/APRandomizer.h +++ b/Source/Archipelago/APRandomizer.h @@ -22,6 +22,7 @@ class APRandomizer { bool EPShuffle = false; int MountainLasers = 7; int ChallengeLasers = 11; + bool DeathLink; int mostRecentItemId = -1; diff --git a/Source/Archipelago/APWatchdog.cpp b/Source/Archipelago/APWatchdog.cpp index 7bfb2c6c..84a03504 100644 --- a/Source/Archipelago/APWatchdog.cpp +++ b/Source/Archipelago/APWatchdog.cpp @@ -19,7 +19,7 @@ #define CHEAT_KEYS_ENABLED 0 #define SKIP_HOLD_DURATION 1.f -APWatchdog::APWatchdog(APClient* client, std::map mapping, int lastPanel, PanelLocker* p, std::map epn, std::map> a, std::map> o, bool ep, int puzzle_rando, APState* s, float smsf) : Watchdog(0.1f) { +APWatchdog::APWatchdog(APClient* client, std::map mapping, int lastPanel, PanelLocker* p, std::map epn, std::map> a, std::map> o, bool ep, int puzzle_rando, APState* s, float smsf, bool dl) : Watchdog(0.1f) { generator = std::make_shared(); ap = client; panelIdToLocationId = mapping; @@ -28,6 +28,7 @@ APWatchdog::APWatchdog(APClient* client, std::map mapping, int lastPan locationIdToPanelId_READ_ONLY[value] = key; } + DeathLink = dl; finalPanel = lastPanel; panelLocker = p; audioLogMessages = a; @@ -1658,8 +1659,10 @@ void APServerPoller::action() { void APWatchdog::CheckDeathLink() { + if (!DeathLink) return; if (mostRecentActivePanelId == -1 || !actuallyEveryPanel.count(mostRecentActivePanelId)) return; if (deathlinkExcludeList.count(mostRecentActivePanelId)) return; + if (PuzzleRandomization == SIGMA_EXPERT && 0x03C0C) return; int newState = ReadPanelData(mostRecentActivePanelId, FLASH_MODE); diff --git a/Source/Archipelago/APWatchdog.h b/Source/Archipelago/APWatchdog.h index 65526288..9c5f6f75 100644 --- a/Source/Archipelago/APWatchdog.h +++ b/Source/Archipelago/APWatchdog.h @@ -17,7 +17,7 @@ class PanelLocker; class APWatchdog : public Watchdog { public: - APWatchdog(APClient* client, std::map mapping, int lastPanel, PanelLocker* p, std::map epn, std::map> a, std::map> o, bool ep, int puzzle_rando, APState* s, float smsf); + APWatchdog(APClient* client, std::map mapping, int lastPanel, PanelLocker* p, std::map epn, std::map> a, std::map> o, bool ep, int puzzle_rando, APState* s, float smsf, bool dl); int spentPuzzleSkips = 0; int foundPuzzleSkips = 0; @@ -79,6 +79,7 @@ class APWatchdog : public Watchdog { std::shared_ptr hudManager; + bool DeathLink = false; bool EPShuffle = false; int PuzzleRandomization = 0;