summary refs log tree commit diff stats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/Memory.h4
-rw-r--r--Source/Panel.cpp2
-rw-r--r--Source/Panels.h29
-rw-r--r--Source/Randomizer.cpp18
4 files changed, 36 insertions, 17 deletions
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 @@
5#include <vector> 5#include <vector>
6#include <windows.h> 6#include <windows.h>
7 7
8#define GLOBALS 0x5B28C0 8// #define GLOBALS 0x5B28C0
9// #define GLOBALS 0x62D0A0 9#define GLOBALS 0x62D0A0
10 10
11#define HEARTBEAT 0x401 11#define HEARTBEAT 0x401
12enum class ProcStatus { 12enum 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 @@
4#include "Randomizer.h" 4#include "Randomizer.h"
5#include <sstream> 5#include <sstream>
6 6
7#pragma warning (disable:26451)
8
7template <class T> 9template <class T>
8int find(const std::vector<T> &data, T search, size_t startIndex = 0) { 10int find(const std::vector<T> &data, T search, size_t startIndex = 0) {
9 for (size_t i=startIndex ; i<data.size(); i++) { 11 for (size_t i=startIndex ; i<data.size(); i++) {
diff --git a/Source/Panels.h b/Source/Panels.h index 5b4e085..7959e21 100644 --- a/Source/Panels.h +++ b/Source/Panels.h
@@ -544,7 +544,6 @@ std::vector<int> junglePanels = {
544 0x03616, // Jungle Laser 544 0x03616, // Jungle Laser
545}; 545};
546 546
547
548std::vector<int> audiologs = { 547std::vector<int> audiologs = {
549 0x3C0F7, // Boat Treehouse Rock 548 0x3C0F7, // Boat Treehouse Rock
550 0x3C0FD, // Boat Broken Boat 549 0x3C0FD, // Boat Broken Boat
@@ -610,6 +609,22 @@ std::vector<int> audiologs = {
610// 0x338CA, // UTM Invisible Dots 609// 0x338CA, // UTM Invisible Dots
611}; 610};
612 611
612std::vector<int> orchard {
613 0x00143, // Orchard Apple Tree 1
614 0x0003B, // Orchard Apple Tree 2
615 0x00055, // Orchard Apple Tree 3
616 0x032F7, // Orchard Apple Tree 4
617 0x032FF, // Orchard Apple Tree 5
618};
619
620std::vector<int> transparent {
621 0x009B8, // Symmetry Island Transparent 1
622 0x003E8, // Symmetry Island Transparent 2
623 0x00A15, // Symmetry Island Transparent 3
624 0x00B53, // Symmetry Island Transparent 4
625 0x00B8D, // Symmetry Island Transparent 5
626};
627
613// There might be something to do with these, I haven't decided yet. 628// There might be something to do with these, I haven't decided yet.
614std::vector<int> nothingPanels = { 629std::vector<int> nothingPanels = {
615// Doors & Shortcuts & Shortcut doors & Door controls 630// Doors & Shortcuts & Shortcut doors & Door controls
@@ -671,18 +686,6 @@ std::vector<int> nothingPanels = {
671 0x09DB8, // Swamp Summon Boat 686 0x09DB8, // Swamp Summon Boat
672 0x17CDF, // Jungle Summon Boat 687 0x17CDF, // Jungle Summon Boat
673 688
674// Identical sets
675 0x00143, // Orchard Apple Tree 1
676 0x0003B, // Orchard Apple Tree 2
677 0x00055, // Orchard Apple Tree 3
678 0x032F7, // Orchard Apple Tree 4
679 0x032FF, // Orchard Apple Tree 5
680 0x009B8, // Symmetry Island Transparent 1
681 0x003E8, // Symmetry Island Transparent 2
682 0x00A15, // Symmetry Island Transparent 3
683 0x00B53, // Symmetry Island Transparent 4
684 0x00B8D, // Symmetry Island Transparent 5
685
686// Misc 689// Misc
687 0x03629, // Tutorial Gate Open 690 0x03629, // Tutorial Gate Open
688 0x09FAA, // Desert Lightswitch 691 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() {
139 139
140 // Individual area modifications 140 // Individual area modifications
141 RandomizeTutorial(); 141 RandomizeTutorial();
142 RandomizeSymmetry();
143 RandomizeDesert(); 142 RandomizeDesert();
144 RandomizeQuarry(); 143 RandomizeQuarry();
145 RandomizeTreehouse(); 144 RandomizeTreehouse();
146 RandomizeKeep(); 145 RandomizeKeep();
147 RandomizeShadows(); 146 RandomizeShadows();
148 RandomizeTown();
149 RandomizeMonastery(); 147 RandomizeMonastery();
150 RandomizeBunker(); 148 RandomizeBunker();
151 RandomizeJungle(); 149 RandomizeJungle();
152 RandomizeSwamp(); 150 RandomizeSwamp();
153 RandomizeMountain(); 151 RandomizeMountain();
152 RandomizeTown();
153 RandomizeSymmetry();
154 // RandomizeAudioLogs(); 154 // RandomizeAudioLogs();
155} 155}
156 156
@@ -188,6 +188,10 @@ void Randomizer::RandomizeTutorial() {
188} 188}
189 189
190void Randomizer::RandomizeSymmetry() { 190void Randomizer::RandomizeSymmetry() {
191 std::vector<int> randomOrder(transparent.size(), 0);
192 std::iota(randomOrder.begin(), randomOrder.end(), 0);
193 RandomizeRange(randomOrder, SWAP::NONE, 1, 5);
194 ReassignTargets(transparent, randomOrder);
191} 195}
192 196
193void Randomizer::RandomizeDesert() { 197void Randomizer::RandomizeDesert() {
@@ -238,6 +242,16 @@ void Randomizer::RandomizeShadows() {
238} 242}
239 243
240void Randomizer::RandomizeTown() { 244void Randomizer::RandomizeTown() {
245 // @Hack...? To open the gate at the end
246 std::vector<int> randomOrder(orchard.size() + 1, 0);
247 std::iota(randomOrder.begin(), randomOrder.end(), 0);
248 RandomizeRange(randomOrder, SWAP::NONE, 1, 5);
249 // Ensure that we open the gate before the final puzzle (by swapping)
250 int panel3Index = find(randomOrder, 3);
251 int panel4Index = find(randomOrder, 4);
252 randomOrder[min(panel3Index, panel4Index)] = 3;
253 randomOrder[max(panel3Index, panel4Index)] = 4;
254 ReassignTargets(orchard, randomOrder);
241} 255}
242 256
243void Randomizer::RandomizeMonastery() { 257void Randomizer::RandomizeMonastery() {