From b4eb0a19f88a5839f5a4d9d0050aa7d60d7af8f5 Mon Sep 17 00:00:00 2001 From: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com> Date: Tue, 5 Dec 2023 21:19:06 -0500 Subject: [PATCH 1/5] Adding laser datastorage IDs --- scripts/ap_location_mapping.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/scripts/ap_location_mapping.lua b/scripts/ap_location_mapping.lua index 4c376d3c..20ed17ea 100644 --- a/scripts/ap_location_mapping.lua +++ b/scripts/ap_location_mapping.lua @@ -516,3 +516,17 @@ EP_DATASTORAGE_IDS = { [0x33A20] = {"@Theater EPs/Flowers EP (Town Side 6)"}, [0x33B06] = {"@Theater EPs/Church EP (Town Side 6)"}, } + +LASER_DATASTORAGE_ID = { + [628] = {"@Jungle Laser/Laser Activation",{8}}, + [1289] = {"@Symmetry Island/Laser Activation",{1}}, + [3062] = {"@Swamp Laser/Laser Activation",{10}}, + [4859] = {"@Desert/Laser Activation",{2}}, + [5307] = {"@Keep Tower/Laser Activation",{5}}, + [5433] = {"@Quarry Laser/Laser Activation",{3}}, + [10404] = {"@Treehouse Laser House/Laser Activation",{11}}, + [13049] = {"@Town Tower/Laser Activation",{7}}, + [49842] = {"@Color Bunker/Laser Activation", {9, "@Town Cargo Box Area/Discard", "@Mountainside Discard/Discard"} }, + [97381] = {"@Monastery/Laser Activation",{6, "@Desert Discard/Discard", "@Treehouse Right Side/Green Bridge Discard"}}, + [98739] = {"@Shadows Laser/Laser Activation",{4, "@Shipwreck Discard/Discard", "@Town Red Rooftop/Discard"}} +} From 4fa99f786e652587b30d57711839efc3a106b9ae Mon Sep 17 00:00:00 2001 From: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com> Date: Tue, 5 Dec 2023 21:31:48 -0500 Subject: [PATCH 2/5] Maybe this is a speedup --- scripts/logic.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/logic.lua b/scripts/logic.lua index 0f081e87..64662269 100644 --- a/scripts/logic.lua +++ b/scripts/logic.lua @@ -123,9 +123,9 @@ function parseIds(ids) end +require(getLogicFile()) function canSolve(ids) ids = parseIds(ids) - require(getLogicFile()) for id in ids:gmatch("%S+") do requiredSymbols = getLogic()[tonumber(id)] for k, v in pairs(requiredSymbols) do From b6c122d418d71943e54c717cd3098178bfe15387 Mon Sep 17 00:00:00 2001 From: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com> Date: Tue, 5 Dec 2023 21:33:01 -0500 Subject: [PATCH 3/5] Maybe a speedup --- scripts/archipelago.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/archipelago.lua b/scripts/archipelago.lua index c10e868e..58357dcb 100644 --- a/scripts/archipelago.lua +++ b/scripts/archipelago.lua @@ -263,6 +263,7 @@ function onClear(slot_data) obj.CurrentStage = value elseif k == "puzzle_randomization" then Tracker:FindObjectForCode("puzzleRandomization").CurrentStage = value + require(getLogicFile()) else obj.Active = value end @@ -497,6 +498,9 @@ function laser(num) return (lasers[tonumber(num)] > 0) end +function randomizationChanged() + require(getLogicFile()) +end -- add AP callbacks -- un-/comment as needed @@ -505,3 +509,5 @@ Archipelago:AddItemHandler("item handler", onItem) Archipelago:AddLocationHandler("location handler", onLocation) Archipelago:AddSetReplyHandler("setReply", setReply) Archipelago:AddRetrievedHandler("setReply", setReply) + +ScriptHost:AddWatchForCode("RandomizationChanged", "puzzleRandomization", randomizationChanged) From 66db430600bef1da378bcf61e291ad863f75cff5 Mon Sep 17 00:00:00 2001 From: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com> Date: Tue, 5 Dec 2023 22:45:05 -0500 Subject: [PATCH 4/5] Update ap_location_mapping.lua --- scripts/ap_location_mapping.lua | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/scripts/ap_location_mapping.lua b/scripts/ap_location_mapping.lua index 20ed17ea..4c376d3c 100644 --- a/scripts/ap_location_mapping.lua +++ b/scripts/ap_location_mapping.lua @@ -516,17 +516,3 @@ EP_DATASTORAGE_IDS = { [0x33A20] = {"@Theater EPs/Flowers EP (Town Side 6)"}, [0x33B06] = {"@Theater EPs/Church EP (Town Side 6)"}, } - -LASER_DATASTORAGE_ID = { - [628] = {"@Jungle Laser/Laser Activation",{8}}, - [1289] = {"@Symmetry Island/Laser Activation",{1}}, - [3062] = {"@Swamp Laser/Laser Activation",{10}}, - [4859] = {"@Desert/Laser Activation",{2}}, - [5307] = {"@Keep Tower/Laser Activation",{5}}, - [5433] = {"@Quarry Laser/Laser Activation",{3}}, - [10404] = {"@Treehouse Laser House/Laser Activation",{11}}, - [13049] = {"@Town Tower/Laser Activation",{7}}, - [49842] = {"@Color Bunker/Laser Activation", {9, "@Town Cargo Box Area/Discard", "@Mountainside Discard/Discard"} }, - [97381] = {"@Monastery/Laser Activation",{6, "@Desert Discard/Discard", "@Treehouse Right Side/Green Bridge Discard"}}, - [98739] = {"@Shadows Laser/Laser Activation",{4, "@Shipwreck Discard/Discard", "@Town Red Rooftop/Discard"}} -} From e12964060ab5dfee962ff11035bf7de7fc02c84e Mon Sep 17 00:00:00 2001 From: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com> Date: Tue, 5 Dec 2023 22:45:47 -0500 Subject: [PATCH 5/5] Update archipelago.lua --- scripts/archipelago.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/archipelago.lua b/scripts/archipelago.lua index 58357dcb..fc4d0870 100644 --- a/scripts/archipelago.lua +++ b/scripts/archipelago.lua @@ -263,7 +263,6 @@ function onClear(slot_data) obj.CurrentStage = value elseif k == "puzzle_randomization" then Tracker:FindObjectForCode("puzzleRandomization").CurrentStage = value - require(getLogicFile()) else obj.Active = value end