From 0e6b61f87b676028fcfd75bbf576f48a0ef91632 Mon Sep 17 00:00:00 2001 From: jbzdarkid Date: Fri, 8 Nov 2019 09:13:28 -0800 Subject: Add orchard + transparent swapping --- Source/Memory.h | 4 ++-- Source/Panel.cpp | 2 ++ Source/Panels.h | 29 ++++++++++++++++------------- Source/Randomizer.cpp | 18 ++++++++++++++++-- 4 files changed, 36 insertions(+), 17 deletions(-) (limited to 'Source') diff --git a/Source/Memory.h b/Source/Memory.h index 6e0c7b1..c19d92b 100644 --- a/Source/Memory.h +++ b/Source/Memory.h @@ -5,8 +5,8 @@ #include #include -#define GLOBALS 0x5B28C0 -// #define GLOBALS 0x62D0A0 +// #define GLOBALS 0x5B28C0 +#define GLOBALS 0x62D0A0 #define HEARTBEAT 0x401 enum class ProcStatus { diff --git a/Source/Panel.cpp b/Source/Panel.cpp index ea65142..43e9763 100644 --- a/Source/Panel.cpp +++ b/Source/Panel.cpp @@ -4,6 +4,8 @@ #include "Randomizer.h" #include +#pragma warning (disable:26451) + template int find(const std::vector &data, T search, size_t startIndex = 0) { for (size_t i=startIndex ; i junglePanels = { 0x03616, // Jungle Laser }; - std::vector audiologs = { 0x3C0F7, // Boat Treehouse Rock 0x3C0FD, // Boat Broken Boat @@ -610,6 +609,22 @@ std::vector audiologs = { // 0x338CA, // UTM Invisible Dots }; +std::vector orchard { + 0x00143, // Orchard Apple Tree 1 + 0x0003B, // Orchard Apple Tree 2 + 0x00055, // Orchard Apple Tree 3 + 0x032F7, // Orchard Apple Tree 4 + 0x032FF, // Orchard Apple Tree 5 +}; + +std::vector transparent { + 0x009B8, // Symmetry Island Transparent 1 + 0x003E8, // Symmetry Island Transparent 2 + 0x00A15, // Symmetry Island Transparent 3 + 0x00B53, // Symmetry Island Transparent 4 + 0x00B8D, // Symmetry Island Transparent 5 +}; + // There might be something to do with these, I haven't decided yet. std::vector nothingPanels = { // Doors & Shortcuts & Shortcut doors & Door controls @@ -671,18 +686,6 @@ std::vector nothingPanels = { 0x09DB8, // Swamp Summon Boat 0x17CDF, // Jungle Summon Boat -// Identical sets - 0x00143, // Orchard Apple Tree 1 - 0x0003B, // Orchard Apple Tree 2 - 0x00055, // Orchard Apple Tree 3 - 0x032F7, // Orchard Apple Tree 4 - 0x032FF, // Orchard Apple Tree 5 - 0x009B8, // Symmetry Island Transparent 1 - 0x003E8, // Symmetry Island Transparent 2 - 0x00A15, // Symmetry Island Transparent 3 - 0x00B53, // Symmetry Island Transparent 4 - 0x00B8D, // Symmetry Island Transparent 5 - // Misc 0x03629, // Tutorial Gate Open 0x09FAA, // Desert Lightswitch diff --git a/Source/Randomizer.cpp b/Source/Randomizer.cpp index 9b877cd..14583f8 100644 --- a/Source/Randomizer.cpp +++ b/Source/Randomizer.cpp @@ -139,18 +139,18 @@ void Randomizer::Randomize() { // Individual area modifications RandomizeTutorial(); - RandomizeSymmetry(); RandomizeDesert(); RandomizeQuarry(); RandomizeTreehouse(); RandomizeKeep(); RandomizeShadows(); - RandomizeTown(); RandomizeMonastery(); RandomizeBunker(); RandomizeJungle(); RandomizeSwamp(); RandomizeMountain(); + RandomizeTown(); + RandomizeSymmetry(); // RandomizeAudioLogs(); } @@ -188,6 +188,10 @@ void Randomizer::RandomizeTutorial() { } void Randomizer::RandomizeSymmetry() { + std::vector randomOrder(transparent.size(), 0); + std::iota(randomOrder.begin(), randomOrder.end(), 0); + RandomizeRange(randomOrder, SWAP::NONE, 1, 5); + ReassignTargets(transparent, randomOrder); } void Randomizer::RandomizeDesert() { @@ -238,6 +242,16 @@ void Randomizer::RandomizeShadows() { } void Randomizer::RandomizeTown() { + // @Hack...? To open the gate at the end + std::vector randomOrder(orchard.size() + 1, 0); + std::iota(randomOrder.begin(), randomOrder.end(), 0); + RandomizeRange(randomOrder, SWAP::NONE, 1, 5); + // Ensure that we open the gate before the final puzzle (by swapping) + int panel3Index = find(randomOrder, 3); + int panel4Index = find(randomOrder, 4); + randomOrder[min(panel3Index, panel4Index)] = 3; + randomOrder[max(panel3Index, panel4Index)] = 4; + ReassignTargets(orchard, randomOrder); } void Randomizer::RandomizeMonastery() { -- cgit 1.4.1