about summary refs log tree commit diff stats
path: root/Source/Randomizer.cpp
diff options
context:
space:
mode:
authorjbzdarkid <jbzdarkid@gmail.com>2018-11-19 09:27:29 -0800
committerjbzdarkid <jbzdarkid@gmail.com>2018-11-19 09:27:29 -0800
commiteb420604814dfdfa37fd542dda9ba7477c198b39 (patch)
tree449794ffbdbe111e48ec7d5dc05fe563339d8f3a /Source/Randomizer.cpp
parent0d4ebf34bfb93dbb215f49e9ca64b58fd7284a2b (diff)
downloadwitness-tutorializer-eb420604814dfdfa37fd542dda9ba7477c198b39.tar.gz
witness-tutorializer-eb420604814dfdfa37fd542dda9ba7477c198b39.tar.bz2
witness-tutorializer-eb420604814dfdfa37fd542dda9ba7477c198b39.zip
Cleanup packaging story, add more settings
Diffstat (limited to 'Source/Randomizer.cpp')
-rw-r--r--Source/Randomizer.cpp29
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
92void 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
99void 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
92void Randomizer::RandomizeTutorial() { 108void 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
132void Randomizer::RandomizeShadows() { 148void 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
184void Randomizer::RandomizeSwamp() { 198void 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
189void Randomizer::RandomizeMountain() { 201void 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
219void Randomizer::RandomizeChallenge() { 226void 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
223void Randomizer::RandomizeAudioLogs() { 230void Randomizer::RandomizeAudioLogs() {