From eb420604814dfdfa37fd542dda9ba7477c198b39 Mon Sep 17 00:00:00 2001 From: jbzdarkid Date: Mon, 19 Nov 2018 09:27:29 -0800 Subject: Cleanup packaging story, add more settings --- Source/Randomizer.cpp | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) (limited to 'Source/Randomizer.cpp') 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() { _memory->WritePanelData(0x09EEC, OPEN_RATE, {0.075f}); // 3x } +void Randomizer::RandomizeLasers() { + Randomize(lasers, SWAP::TARGETS); + // Read the target of keep front laser, and write it to keep back laser. + std::vector keepFrontLaserTarget = _memory->ReadPanelData(0x0360E, TARGET, 1); + _memory->WritePanelData(0x03317, TARGET, keepFrontLaserTarget); +} + +void Randomizer::PreventSnipes() +{ + // Distance-gate swamp snipe 1 to prevent RNG swamp snipe + _memory->WritePanelData(0x17C05, MAX_BROADCAST_DISTANCE, {15.0}); + // Distance-gate shadows laser to prevent sniping through the bars + _memory->WritePanelData(0x19650, MAX_BROADCAST_DISTANCE, {2.5}); +} + +// Private methods void Randomizer::RandomizeTutorial() { // Disable tutorial cursor speed modifications (not working?) _memory->WritePanelData(0x00295, CURSOR_SPEED_SCALE, {1.0}); @@ -130,8 +146,6 @@ void Randomizer::RandomizeKeep() { } void Randomizer::RandomizeShadows() { - // Distance-gate shadows laser to prevent sniping through the bars - _memory->WritePanelData(0x19650, MAX_BROADCAST_DISTANCE, {2.5}); // Change the shadows tutorial cable to only activate avoid _memory->WritePanelData(0x319A8, CABLE_TARGET_2, {0}); // Change shadows avoid 8 to power shadows follow @@ -182,13 +196,10 @@ void Randomizer::RandomizeJungle() { } void Randomizer::RandomizeSwamp() { - // Distance-gate swamp snipe 1 to prevent RNG swamp snipe - _memory->WritePanelData(0x17C05, MAX_BROADCAST_DISTANCE, {15.0}); } void Randomizer::RandomizeMountain() { - // Randomize lasers & some of mountain - Randomize(lasers, SWAP::TARGETS); + // Randomize multipanel Randomize(mountainMultipanel, SWAP::LINES); // Randomize final pillars order @@ -210,14 +221,10 @@ void Randomizer::RandomizeMountain() { // Turn on new starting panels _memory->WritePanelData(pillars[randomOrder[0]], POWER, {1.0f, 1.0f}); _memory->WritePanelData(pillars[randomOrder[5]], POWER, {1.0f, 1.0f}); - - // Read the target of keep front laser, and write it to keep back laser. - std::vector keepFrontLaserTarget = _memory->ReadPanelData(0x0360E, TARGET, 1); - _memory->WritePanelData(0x03317, TARGET, keepFrontLaserTarget); } void Randomizer::RandomizeChallenge() { - ChallengeRandomizer cr(_memory, Random::RandInt(1, 0x1000)); + ChallengeRandomizer cr(_memory, Random::RandInt(1, 0x7FFFFFFF)); // 0 will trigger an "RNG not initialized" block } void Randomizer::RandomizeAudioLogs() { -- cgit 1.4.1