diff options
Diffstat (limited to 'WitnessRandomizer')
-rw-r--r-- | WitnessRandomizer/WitnessRandomizer.cpp | 141 | ||||
-rw-r--r-- | WitnessRandomizer/WitnessRandomizer.h | 4 |
2 files changed, 65 insertions, 80 deletions
diff --git a/WitnessRandomizer/WitnessRandomizer.cpp b/WitnessRandomizer/WitnessRandomizer.cpp index 6c84803..cf98a3a 100644 --- a/WitnessRandomizer/WitnessRandomizer.cpp +++ b/WitnessRandomizer/WitnessRandomizer.cpp | |||
@@ -50,84 +50,69 @@ int main(int argc, char** argv) | |||
50 | srand(seed); | 50 | srand(seed); |
51 | } | 51 | } |
52 | 52 | ||
53 | randomizer.SwapPanels(0x28AC7, 0x00698, SWAP_LINES | SWAP_STYLE); // Symmetry Island Colored Dots 1 | 53 | // Content swaps -- must happen before squarePanels |
54 | randomizer.SwapPanels(0x28AC8, 0x0048F, SWAP_LINES | SWAP_STYLE); // Symmetry Island Colored Dots 2 | 54 | randomizer.Randomize(tallUpDownPanels, SWAP_LINES | SWAP_STYLE); |
55 | randomizer.SwapPanels(0x28ACA, 0x09F92, SWAP_LINES | SWAP_STYLE); // Symmetry Island Colored Dots 3 | 55 | randomizer.Randomize(upDownPanels, SWAP_LINES | SWAP_STYLE); |
56 | randomizer.SwapPanels(0x28ACB, 0x0A036, SWAP_LINES | SWAP_STYLE); // Symmetry Island Colored Dots 4 | 56 | randomizer.Randomize(leftForwardRightPanels, SWAP_LINES); |
57 | randomizer.SwapPanels(0x28ACC, 0x09DA6, SWAP_LINES | SWAP_STYLE); // Symmetry Island Colored Dots 5 | 57 | |
58 | 0x00079; // Symmetry Island Colored Dots 6 | 58 | randomizer.Randomize(squarePanels, SWAP_LINES | SWAP_STYLE); |
59 | 59 | ||
60 | 0x0005D; // Outside Tutorial Dots Tutorial 1 | 60 | // Frame swaps -- must happen after squarePanels |
61 | 0x0005E; // Outside Tutorial Dots Tutorial 2 | 61 | randomizer.Randomize(burnablePanels, SWAP_LINES | SWAP_STYLE); |
62 | 0x0005F; // Outside Tutorial Dots Tutorial 3 | 62 | |
63 | 0x00060; // Outside Tutorial Dots Tutorial 4 | 63 | // Target swaps, can happen whenever |
64 | 0x00061; // Outside Tutorial Dots Tutorial 5 | 64 | randomizer.Randomize(lasers, SWAP_TARGETS); |
65 | 65 | // Read the target of keep front laser, and write it to keep back laser. | |
66 | 66 | std::vector<int> keepFrontLaserTarget = randomizer.ReadPanelData<int>(0x0360E, TARGET, 1); | |
67 | 67 | randomizer.WritePanelData<int>(0x03317, TARGET, keepFrontLaserTarget); | |
68 | // // Content swaps -- must happen before squarePanels | 68 | |
69 | // randomizer.Randomize(tallUpDownPanels, SWAP_LINES | SWAP_STYLE); | 69 | std::vector<int> randomOrder; |
70 | // randomizer.Randomize(upDownPanels, SWAP_LINES | SWAP_STYLE); | 70 | |
71 | // randomizer.Randomize(leftForwardRightPanels, SWAP_LINES); | 71 | /* Jungle |
72 | // | 72 | randomOrder = std::vector(junglePanels.size(), 0); |
73 | // randomizer.Randomize(squarePanels, SWAP_LINES | SWAP_STYLE); | 73 | std::iota(randomOrder.begin(), randomOrder.end(), 0); |
74 | // | 74 | // Randomize Waves 2-7 |
75 | // // Frame swaps -- must happen after squarePanels | 75 | // Waves 1 cannot be randomized, since no other panel can start on |
76 | // randomizer.Randomize(burnablePanels, SWAP_LINES | SWAP_STYLE); | 76 | randomizer.RandomizeRange(randomOrder, SWAP_NONE, 1, 7); |
77 | // | 77 | // Randomize Pitches 1-6 onto themselves |
78 | // // Target swaps, can happen whenever | 78 | randomizer.RandomizeRange(randomOrder, SWAP_NONE, 7, 13); |
79 | // randomizer.Randomize(lasers, SWAP_TARGETS); | 79 | randomizer.ReassignTargets(junglePanels, randomOrder); |
80 | // // Read the target of keep front laser, and write it to keep back laser. | 80 | */ |
81 | // std::vector<int> keepFrontLaserTarget = randomizer.ReadPanelData<int>(0x0360E, TARGET, 1); | 81 | |
82 | // randomizer.WritePanelData<int>(0x03317, TARGET, keepFrontLaserTarget); | 82 | /* Bunker */ |
83 | // | 83 | randomOrder = std::vector(bunkerPanels.size(), 0); |
84 | // std::vector<int> randomOrder; | 84 | std::iota(randomOrder.begin(), randomOrder.end(), 0); |
85 | // | 85 | // Randomize Tutorial 2-Advanced Tutorial 4 + Glass 1 |
86 | // /* Jungle | 86 | // Tutorial 1 cannot be randomized, since no other panel can start on |
87 | // randomOrder = std::vector(junglePanels.size(), 0); | 87 | // Glass 1 will become door + glass 1, due to the targetting system |
88 | // std::iota(randomOrder.begin(), randomOrder.end(), 0); | 88 | randomizer.RandomizeRange(randomOrder, SWAP_NONE, 1, 10); |
89 | // // Randomize Waves 2-7 | 89 | // Randomize Glass 1-3 into everything after the door |
90 | // // Waves 1 cannot be randomized, since no other panel can start on | 90 | const size_t glassDoorIndex = find(randomOrder, 9) + 1; |
91 | // randomizer.RandomizeRange(randomOrder, SWAP_NONE, 1, 7); | 91 | randomizer.RandomizeRange(randomOrder, SWAP_NONE, glassDoorIndex, 12); |
92 | // // Randomize Pitches 1-6 onto themselves | 92 | randomizer.ReassignTargets(bunkerPanels, randomOrder); |
93 | // randomizer.RandomizeRange(randomOrder, SWAP_NONE, 7, 13); | 93 | |
94 | // randomizer.ReassignTargets(junglePanels, randomOrder); | 94 | /* Shadows */ |
95 | // */ | 95 | randomOrder = std::vector(shadowsPanels.size(), 0); |
96 | // | 96 | std::iota(randomOrder.begin(), randomOrder.end(), 0); |
97 | // /* Bunker */ | 97 | randomizer.RandomizeRange(randomOrder, SWAP_NONE, 0, 8); // Tutorial |
98 | // randomOrder = std::vector(bunkerPanels.size(), 0); | 98 | randomizer.RandomizeRange(randomOrder, SWAP_NONE, 8, 16); // Avoid |
99 | // std::iota(randomOrder.begin(), randomOrder.end(), 0); | 99 | randomizer.RandomizeRange(randomOrder, SWAP_NONE, 16, 21); // Follow |
100 | // // Randomize Tutorial 2-Advanced Tutorial 4 + Glass 1 | 100 | randomizer.ReassignTargets(shadowsPanels, randomOrder); |
101 | // // Tutorial 1 cannot be randomized, since no other panel can start on | 101 | // Turn off original starting panel |
102 | // // Glass 1 will become door + glass 1, due to the targetting system | 102 | randomizer.WritePanelData<float>(shadowsPanels[0], POWER, {0.0f, 0.0f}); |
103 | // randomizer.RandomizeRange(randomOrder, SWAP_NONE, 1, 10); | 103 | // Turn on new starting panel |
104 | // // Randomize Glass 1-3 into everything after the door | 104 | randomizer.WritePanelData<float>(shadowsPanels[randomOrder[0]], POWER, {1.0f, 1.0f}); |
105 | // const size_t glassDoorIndex = find(randomOrder, 9) + 1; | 105 | |
106 | // randomizer.RandomizeRange(randomOrder, SWAP_NONE, glassDoorIndex, 12); | 106 | /* Monastery |
107 | // randomizer.ReassignTargets(bunkerPanels, randomOrder); | 107 | randomOrder = std::vector(monasteryPanels.size(), 0); |
108 | // | 108 | std::iota(randomOrder.begin(), randomOrder.end(), 0); |
109 | // /* Shadows */ | 109 | randomizer.RandomizeRange(randomOrder, SWAP_NONE, 2, 6); // outer 2 & 3, inner 1 |
110 | // randomOrder = std::vector(shadowsPanels.size(), 0); | 110 | // Once outer 3 and right door are solved, inner 2-4 are accessible |
111 | // std::iota(randomOrder.begin(), randomOrder.end(), 0); | 111 | int innerPanelsIndex = max(find(randomOrder, 2), find(randomOrder, 4)); |
112 | // randomizer.RandomizeRange(randomOrder, SWAP_NONE, 0, 8); // Tutorial | 112 | randomizer.RandomizeRange(randomOrder, SWAP_NONE, innerPanelsIndex, 9); // Inner 2-4 |
113 | // randomizer.RandomizeRange(randomOrder, SWAP_NONE, 8, 16); // Avoid | 113 | |
114 | // randomizer.RandomizeRange(randomOrder, SWAP_NONE, 16, 21); // Follow | 114 | randomizer.ReassignTargets(monasteryPanels, randomOrder); |
115 | // randomizer.ReassignTargets(shadowsPanels, randomOrder); | 115 | */ |
116 | // // Turn off original starting panel | ||
117 | // randomizer.WritePanelData<float>(shadowsPanels[0], POWER, {0.0f, 0.0f}); | ||
118 | // // Turn on new starting panel | ||
119 | // randomizer.WritePanelData<float>(shadowsPanels[randomOrder[0]], POWER, {1.0f, 1.0f}); | ||
120 | // | ||
121 | // /* Monastery | ||
122 | // randomOrder = std::vector(monasteryPanels.size(), 0); | ||
123 | // std::iota(randomOrder.begin(), randomOrder.end(), 0); | ||
124 | // randomizer.RandomizeRange(randomOrder, SWAP_NONE, 2, 6); // outer 2 & 3, inner 1 | ||
125 | // // Once outer 3 and right door are solved, inner 2-4 are accessible | ||
126 | // int innerPanelsIndex = max(find(randomOrder, 2), find(randomOrder, 4)); | ||
127 | // randomizer.RandomizeRange(randomOrder, SWAP_NONE, innerPanelsIndex, 9); // Inner 2-4 | ||
128 | // | ||
129 | // randomizer.ReassignTargets(monasteryPanels, randomOrder); | ||
130 | // */ | ||
131 | } | 116 | } |
132 | 117 | ||
133 | WitnessRandomizer::WitnessRandomizer() | 118 | WitnessRandomizer::WitnessRandomizer() |
diff --git a/WitnessRandomizer/WitnessRandomizer.h b/WitnessRandomizer/WitnessRandomizer.h index bb9db44..d65cce3 100644 --- a/WitnessRandomizer/WitnessRandomizer.h +++ b/WitnessRandomizer/WitnessRandomizer.h | |||
@@ -1,7 +1,7 @@ | |||
1 | #pragma once | 1 | #pragma once |
2 | 2 | ||
3 | #define GLOBALS 0x5B28C0 | 3 | // #define GLOBALS 0x5B28C0 |
4 | // #define GLOBALS 0x62A080 | 4 | #define GLOBALS 0x62A080 |
5 | 5 | ||
6 | int SWAP_NONE = 0x0; | 6 | int SWAP_NONE = 0x0; |
7 | int SWAP_TARGETS = 0x1; | 7 | int SWAP_TARGETS = 0x1; |