From 9552a5df4c9d267b788211a2316e7fd86effa7d7 Mon Sep 17 00:00:00 2001 From: jbzdarkid Date: Sun, 9 Dec 2018 12:19:53 -0800 Subject: un-fix what was not actuall broken, make challenge RNG better --- Source/ChallengeRandomizer.cpp | 4 ++-- Source/Memory.h | 4 ++-- Source/Panels.h | 8 ++++---- Source/Randomizer.cpp | 4 +++- Source/Randomizer.h | 2 ++ 5 files changed, 13 insertions(+), 9 deletions(-) (limited to 'Source') diff --git a/Source/ChallengeRandomizer.cpp b/Source/ChallengeRandomizer.cpp index fcd4e4a..1ecfdd3 100644 --- a/Source/ChallengeRandomizer.cpp +++ b/Source/ChallengeRandomizer.cpp @@ -94,8 +94,8 @@ ChallengeRandomizer::ChallengeRandomizer(const std::shared_ptr& memory, }); // Entity_Record_Player::reroll_lotus_eater_stuff _memory->AddSigScan({0xB8, 0xAB, 0xAA, 0xAA, 0xAA, 0x41, 0xC1, 0xE8}, [&](int index) { - AdjustRng(index - 0x52); - AdjustRng(index - 0xB); + AdjustRng(index - 0x13); + AdjustRng(index + 0x34); }); // These disable the random locations on timer panels, which would otherwise increment the RNG. diff --git a/Source/Memory.h b/Source/Memory.h index fa9eb60..fad6a38 100644 --- a/Source/Memory.h +++ b/Source/Memory.h @@ -4,8 +4,8 @@ #include #include -// #define GLOBALS 0x5B28C0 -#define GLOBALS 0x62A080 +#define GLOBALS 0x5B28C0 +// #define GLOBALS 0x62A080 // https://github.com/erayarslan/WriteProcessMemory-Example // http://stackoverflow.com/q/32798185 diff --git a/Source/Panels.h b/Source/Panels.h index 85fa28b..9eb1a8e 100644 --- a/Source/Panels.h +++ b/Source/Panels.h @@ -92,11 +92,11 @@ std::vector challengePanels = { 0x00CDB, // Challenge Column Top Left 0x00CD4, // Challenge Column Far Panel 0x00C80, // Challenge Triple 1 Left -// 0x00CA1, // Challenge Triple 1 Center -// 0x00CB9, // Challenge Triple 1 Right + 0x00CA1, // Challenge Triple 1 Center + 0x00CB9, // Challenge Triple 1 Right 0x00C22, // Challenge Triple 2 Left -// 0x00C59, // Challenge Triple 2 Center -// 0x00C68, // Challenge Triple 2 Right + 0x00C59, // Challenge Triple 2 Center + 0x00C68, // Challenge Triple 2 Right // 0x04CB3, // Challenge Left Timer // 0x04CB5, // Challenge Middle Timer // 0x04CB6, // Challenge Right Timer diff --git a/Source/Randomizer.cpp b/Source/Randomizer.cpp index 3078b22..baae8c3 100644 --- a/Source/Randomizer.cpp +++ b/Source/Randomizer.cpp @@ -7,7 +7,6 @@ * Speed up *everything* ? Or maybe we'll just stop using this setting entirely. - * Disable "power off on fail" for challenge * Add setting for "Don't reset the challenge seed on new challenge" * Don't rerandomize anything outside of challenge on re-click * Change re-randomization prevention? @@ -234,6 +233,9 @@ void Randomizer::RandomizeMountain() { void Randomizer::RandomizeChallenge() { ChallengeRandomizer cr(_memory, Random::RandInt(1, 0x7FFFFFFF)); // 0 will trigger an "RNG not initialized" block + for (int panel : challengePanels) { + _memory->WritePanelData(panel, POWER_OFF_ON_FAIL, {0}); + } } void Randomizer::RandomizeAudioLogs() { diff --git a/Source/Randomizer.h b/Source/Randomizer.h index c0b2d87..aeccbeb 100644 --- a/Source/Randomizer.h +++ b/Source/Randomizer.h @@ -76,6 +76,7 @@ private: #define AUDIO_PREFIX 0x278 #define POWER 0x2A8 #define TARGET 0x2BC +#define POWER_OFF_ON_FAIL 0x2C0 #define IS_CYLINDER 0x2FC #define CYLINDER_Z0 0x300 #define CYLINDER_Z1 0x304 @@ -142,6 +143,7 @@ private: #define AUDIO_PREFIX 0x270 #define POWER 0x2A0 #define TARGET 0x2B4 +#define POWER_OFF_ON_FAIL 0x2B8 #define IS_CYLINDER 0x2F4 #define CYLINDER_Z0 0x2F8 #define CYLINDER_Z1 0x2FC -- cgit 1.4.1