diff options
Diffstat (limited to 'Source/Randomizer.cpp')
-rw-r--r-- | Source/Randomizer.cpp | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/Source/Randomizer.cpp b/Source/Randomizer.cpp index 2f3e72a..48e9a4b 100644 --- a/Source/Randomizer.cpp +++ b/Source/Randomizer.cpp | |||
@@ -89,6 +89,22 @@ void Randomizer::AdjustSpeed() { | |||
89 | _memory->WritePanelData<float>(0x09EEC, OPEN_RATE, {0.075f}); // 3x | 89 | _memory->WritePanelData<float>(0x09EEC, OPEN_RATE, {0.075f}); // 3x |
90 | } | 90 | } |
91 | 91 | ||
92 | void Randomizer::RandomizeLasers() { | ||
93 | Randomize(lasers, SWAP::TARGETS); | ||
94 | // Read the target of keep front laser, and write it to keep back laser. | ||
95 | std::vector<int> keepFrontLaserTarget = _memory->ReadPanelData<int>(0x0360E, TARGET, 1); | ||
96 | _memory->WritePanelData<int>(0x03317, TARGET, keepFrontLaserTarget); | ||
97 | } | ||
98 | |||
99 | void Randomizer::PreventSnipes() | ||
100 | { | ||
101 | // Distance-gate swamp snipe 1 to prevent RNG swamp snipe | ||
102 | _memory->WritePanelData<float>(0x17C05, MAX_BROADCAST_DISTANCE, {15.0}); | ||
103 | // Distance-gate shadows laser to prevent sniping through the bars | ||
104 | _memory->WritePanelData<float>(0x19650, MAX_BROADCAST_DISTANCE, {2.5}); | ||
105 | } | ||
106 | |||
107 | // Private methods | ||
92 | void Randomizer::RandomizeTutorial() { | 108 | void Randomizer::RandomizeTutorial() { |
93 | // Disable tutorial cursor speed modifications (not working?) | 109 | // Disable tutorial cursor speed modifications (not working?) |
94 | _memory->WritePanelData<float>(0x00295, CURSOR_SPEED_SCALE, {1.0}); | 110 | _memory->WritePanelData<float>(0x00295, CURSOR_SPEED_SCALE, {1.0}); |
@@ -130,8 +146,6 @@ void Randomizer::RandomizeKeep() { | |||
130 | } | 146 | } |
131 | 147 | ||
132 | void Randomizer::RandomizeShadows() { | 148 | void Randomizer::RandomizeShadows() { |
133 | // Distance-gate shadows laser to prevent sniping through the bars | ||
134 | _memory->WritePanelData<float>(0x19650, MAX_BROADCAST_DISTANCE, {2.5}); | ||
135 | // Change the shadows tutorial cable to only activate avoid | 149 | // Change the shadows tutorial cable to only activate avoid |
136 | _memory->WritePanelData<int>(0x319A8, CABLE_TARGET_2, {0}); | 150 | _memory->WritePanelData<int>(0x319A8, CABLE_TARGET_2, {0}); |
137 | // Change shadows avoid 8 to power shadows follow | 151 | // Change shadows avoid 8 to power shadows follow |
@@ -182,13 +196,10 @@ void Randomizer::RandomizeJungle() { | |||
182 | } | 196 | } |
183 | 197 | ||
184 | void Randomizer::RandomizeSwamp() { | 198 | void Randomizer::RandomizeSwamp() { |
185 | // Distance-gate swamp snipe 1 to prevent RNG swamp snipe | ||
186 | _memory->WritePanelData<float>(0x17C05, MAX_BROADCAST_DISTANCE, {15.0}); | ||
187 | } | 199 | } |
188 | 200 | ||
189 | void Randomizer::RandomizeMountain() { | 201 | void Randomizer::RandomizeMountain() { |
190 | // Randomize lasers & some of mountain | 202 | // Randomize multipanel |
191 | Randomize(lasers, SWAP::TARGETS); | ||
192 | Randomize(mountainMultipanel, SWAP::LINES); | 203 | Randomize(mountainMultipanel, SWAP::LINES); |
193 | 204 | ||
194 | // Randomize final pillars order | 205 | // Randomize final pillars order |
@@ -210,14 +221,10 @@ void Randomizer::RandomizeMountain() { | |||
210 | // Turn on new starting panels | 221 | // Turn on new starting panels |
211 | _memory->WritePanelData<float>(pillars[randomOrder[0]], POWER, {1.0f, 1.0f}); | 222 | _memory->WritePanelData<float>(pillars[randomOrder[0]], POWER, {1.0f, 1.0f}); |
212 | _memory->WritePanelData<float>(pillars[randomOrder[5]], POWER, {1.0f, 1.0f}); | 223 | _memory->WritePanelData<float>(pillars[randomOrder[5]], POWER, {1.0f, 1.0f}); |
213 | |||
214 | // Read the target of keep front laser, and write it to keep back laser. | ||
215 | std::vector<int> keepFrontLaserTarget = _memory->ReadPanelData<int>(0x0360E, TARGET, 1); | ||
216 | _memory->WritePanelData<int>(0x03317, TARGET, keepFrontLaserTarget); | ||
217 | } | 224 | } |
218 | 225 | ||
219 | void Randomizer::RandomizeChallenge() { | 226 | void Randomizer::RandomizeChallenge() { |
220 | ChallengeRandomizer cr(_memory, Random::RandInt(1, 0x1000)); | 227 | ChallengeRandomizer cr(_memory, Random::RandInt(1, 0x7FFFFFFF)); // 0 will trigger an "RNG not initialized" block |
221 | } | 228 | } |
222 | 229 | ||
223 | void Randomizer::RandomizeAudioLogs() { | 230 | void Randomizer::RandomizeAudioLogs() { |