summary refs log tree commit diff stats
path: root/WitnessRandomizer
diff options
context:
space:
mode:
authorjbzdarkid <jbzdarkid@gmail.com>2018-10-26 22:06:40 -0700
committerjbzdarkid <jbzdarkid@gmail.com>2018-10-26 22:06:40 -0700
commit223f7244fccfc67685fcefe889ea49414e32b715 (patch)
tree5f47e65fd3408e92e332f0f957b611b90e1907c3 /WitnessRandomizer
parent1d4763bc94c9887bc4171374202a5d12be1fc10f (diff)
downloadwitness-tutorializer-223f7244fccfc67685fcefe889ea49414e32b715.tar.gz
witness-tutorializer-223f7244fccfc67685fcefe889ea49414e32b715.tar.bz2
witness-tutorializer-223f7244fccfc67685fcefe889ea49414e32b715.zip
Tried and failed to do monastery.
Diffstat (limited to 'WitnessRandomizer')
-rw-r--r--WitnessRandomizer/Panels.h2
-rw-r--r--WitnessRandomizer/WitnessRandomizer.cpp20
2 files changed, 18 insertions, 4 deletions
diff --git a/WitnessRandomizer/Panels.h b/WitnessRandomizer/Panels.h index 4f7ff2d..cd815bc 100644 --- a/WitnessRandomizer/Panels.h +++ b/WitnessRandomizer/Panels.h
@@ -480,8 +480,8 @@ std::vector<int> shadowsPanels = {
480 480
481std::vector<int> monasteryPanels = { 481std::vector<int> monasteryPanels = {
482 0x00B10, // Monastery Left Door 482 0x00B10, // Monastery Left Door
483 0x00C92, // Monastery Right Door
484 0x00290, // Monastery Exterior 1 483 0x00290, // Monastery Exterior 1
484 0x00C92, // Monastery Right Door
485 0x00038, // Monastery Exterior 2 485 0x00038, // Monastery Exterior 2
486 0x00037, // Monastery Exterior 3 486 0x00037, // Monastery Exterior 3
487// 0x09D9B, // Monastery Bonsai 487// 0x09D9B, // Monastery Bonsai
diff --git a/WitnessRandomizer/WitnessRandomizer.cpp b/WitnessRandomizer/WitnessRandomizer.cpp index c5cf0bb..efe18b5 100644 --- a/WitnessRandomizer/WitnessRandomizer.cpp +++ b/WitnessRandomizer/WitnessRandomizer.cpp
@@ -31,9 +31,9 @@ int main(int argc, char** argv)
31 WitnessRandomizer randomizer = WitnessRandomizer(); 31 WitnessRandomizer randomizer = WitnessRandomizer();
32 32
33 if (argc == 2) { 33 if (argc == 2) {
34 srand(atoi(argv[1])); // Seed with RNG from command line 34 srand(atoi(argv[1])); // Seed from the command line
35 } else { 35 } else {
36 int seed = rand() % (1 << 16); 36 int seed = time(0) % (1 << 16); // Seed from the time in milliseconds
37 std::cout << "Selected seed: " << seed << std::endl; 37 std::cout << "Selected seed: " << seed << std::endl;
38 srand(seed); 38 srand(seed);
39 } 39 }
@@ -53,6 +53,7 @@ int main(int argc, char** argv)
53 std::vector<int> keepFrontLaserTarget = randomizer.ReadPanelData<int>(0x0360E, TARGET, 1); 53 std::vector<int> keepFrontLaserTarget = randomizer.ReadPanelData<int>(0x0360E, TARGET, 1);
54 randomizer.WritePanelData<int>(0x03317, TARGET, keepFrontLaserTarget); 54 randomizer.WritePanelData<int>(0x03317, TARGET, keepFrontLaserTarget);
55 55
56 /* Jungle */
56 std::vector<int> randomOrder = std::vector(junglePanels.size(), 0); 57 std::vector<int> randomOrder = std::vector(junglePanels.size(), 0);
57 std::iota(randomOrder.begin(), randomOrder.end(), 0); 58 std::iota(randomOrder.begin(), randomOrder.end(), 0);
58 // Randomize Waves 2-7 59 // Randomize Waves 2-7
@@ -62,6 +63,7 @@ int main(int argc, char** argv)
62 randomizer.RandomizeRange(randomOrder, SWAP_NONE, 7, 13); 63 randomizer.RandomizeRange(randomOrder, SWAP_NONE, 7, 13);
63 randomizer.ReassignTargets(junglePanels, randomOrder); 64 randomizer.ReassignTargets(junglePanels, randomOrder);
64 65
66 /* Bunker */
65 randomOrder = std::vector(bunkerPanels.size(), 0); 67 randomOrder = std::vector(bunkerPanels.size(), 0);
66 std::iota(randomOrder.begin(), randomOrder.end(), 0); 68 std::iota(randomOrder.begin(), randomOrder.end(), 0);
67 // Randomize Tutorial 2-Advanced Tutorial 4 + Glass 1 69 // Randomize Tutorial 2-Advanced Tutorial 4 + Glass 1
@@ -73,17 +75,29 @@ int main(int argc, char** argv)
73 randomizer.RandomizeRange(randomOrder, SWAP_NONE, glassDoorIndex, 12); 75 randomizer.RandomizeRange(randomOrder, SWAP_NONE, glassDoorIndex, 12);
74 randomizer.ReassignTargets(bunkerPanels, randomOrder); 76 randomizer.ReassignTargets(bunkerPanels, randomOrder);
75 77
78 /* Shadows */
76 randomOrder = std::vector(shadowsPanels.size(), 0); 79 randomOrder = std::vector(shadowsPanels.size(), 0);
77 std::iota(randomOrder.begin(), randomOrder.end(), 0); 80 std::iota(randomOrder.begin(), randomOrder.end(), 0);
78 randomizer.RandomizeRange(randomOrder, SWAP_NONE, 0, 8); // Tutorial 81 randomizer.RandomizeRange(randomOrder, SWAP_NONE, 0, 8); // Tutorial
79 randomizer.RandomizeRange(randomOrder, SWAP_NONE, 8, 16); // Avoid 82 randomizer.RandomizeRange(randomOrder, SWAP_NONE, 8, 16); // Avoid
80 randomizer.RandomizeRange(randomOrder, SWAP_NONE, 16, 21); // Follow 83 randomizer.RandomizeRange(randomOrder, SWAP_NONE, 16, 21); // Follow
81 randomizer.ReassignTargets(shadowsPanels, randomOrder); 84 randomizer.ReassignTargets(shadowsPanels, randomOrder);
82
83 // Turn off original starting panel 85 // Turn off original starting panel
84 randomizer.WritePanelData<float>(shadowsPanels[0], POWER, {0.0f, 0.0f}); 86 randomizer.WritePanelData<float>(shadowsPanels[0], POWER, {0.0f, 0.0f});
85 // Turn on new starting panel 87 // Turn on new starting panel
86 randomizer.WritePanelData<float>(shadowsPanels[randomOrder[0]], POWER, {1.0f, 1.0f}); 88 randomizer.WritePanelData<float>(shadowsPanels[randomOrder[0]], POWER, {1.0f, 1.0f});
89
90 /* Monastery
91 randomOrder = std::vector(monasteryPanels.size(), 0);
92 std::iota(randomOrder.begin(), randomOrder.end(), 0);
93 randomizer.RandomizeRange(randomOrder, SWAP_NONE, 2, 6); // outer 2 & 3, inner 1
94 // Once outer 3 and right door are solved, inner 2-4 are accessible
95 int innerPanelsIndex = max(find(randomOrder, 2), find(randomOrder, 4));
96 randomizer.RandomizeRange(randomOrder, SWAP_NONE, innerPanelsIndex, 9); // Inner 2-4
97
98 randomizer.ReassignTargets(monasteryPanels, randomOrder);
99 */
100
87} 101}
88 102
89WitnessRandomizer::WitnessRandomizer() 103WitnessRandomizer::WitnessRandomizer()