From caddad668bd8fe0a2b4fbed410787f7134b8d701 Mon Sep 17 00:00:00 2001 From: jbzdarkid Date: Mon, 29 Oct 2018 18:49:30 -0700 Subject: Fix mountain elevator, fix back distance --- Source/Main.cpp | 8 ++- Source/Panels.h | 138 ++++++++++++++++++++++------------------------ Source/Randomizer.cpp | 12 ++-- Source/RandomizerCore.cpp | 4 +- Source/RandomizerCore.h | 1 + 5 files changed, 83 insertions(+), 80 deletions(-) (limited to 'Source') diff --git a/Source/Main.cpp b/Source/Main.cpp index 0081808..86a784b 100644 --- a/Source/Main.cpp +++ b/Source/Main.cpp @@ -118,7 +118,13 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) seed = _wtoi(text.c_str()); } srand(seed); - Randomizer().Randomize(); + Randomizer randomizer; + randomizer.Randomize(); + /* + if (adjustSpeed.isChecked()) { + randomizer.AdjustSpeed(); + } + */ SetWindowText(hwndRandomize, L"Randomized!"); } } diff --git a/Source/Panels.h b/Source/Panels.h index d7690b8..6aa0d47 100644 --- a/Source/Panels.h +++ b/Source/Panels.h @@ -32,12 +32,6 @@ std::vector leftRightPanels = { 0x17D02, // Town Windmill Control }; -// These panels are very tall (aka not square) and can't take symmetry panels on them. -std::vector tallUpDownPanels = { - 0x09EEB, // Mountain 2 Elevator - 0x17CC4, // Mill Elevator Control -}; - // Note: Some of these (non-controls) are duplicated elsewhere std::vector upDownPanels = { 0x0008D, // Glass Factory Rotational Symmetry 1 @@ -547,6 +541,72 @@ std::vector junglePanels = { 0x03616, // Jungle Laser }; + +std::vector audiologs = { + 0x3C0F7, // Boat Treehouse Rock + 0x3C0FD, // Boat Broken Boat + 0x32A00, // Bunker Green Room + 0x3C0FE, // Desert Broken Wall +// 0x338B0, // Easter Egg Ending Briefcase (?) +// 0x338B7, // Easter Egg Ending Briefcase (?) +// 0x338AD, // Easter Egg Ending Briefcase (iOS) +// 0x338A5, // Easter Egg Ending Wine Table +// 0x338AE, // Easter Egg Ending Briefcase +// 0x338AF, // Easter Egg Ending Briefcase (?) +// 0x338A7, // Easter Egg Ending Record +// 0x338A3, // Easter Egg Ending Countertop +// 0x338A4, // Easter Egg Ending Sunbathing +// 0x3C108, // Easter Egg Ending Pool +// 0x338EF, // Easter Egg Ending Pillow +// 0x336E5, // Easter Egg Ending Apple +// 0x338A6, // Easter Egg Ending Purple Flowers + 0x3C100, // Jungle Entrance Right + 0x3C0F4, // Jungle Entrance Left + 0x3C102, // Jungle Laser + 0x3C10D, // Jungle Beach + 0x3C10E, // Keep Corridor + 0x3C10B, // Keep Guitar Amp + 0x0074F, // Keep Front Wall + 0x012C7, // Keep Throne + 0x329FF, // Mill Stairs + 0x3C106, // Monastery Left Shutters + 0x33AFF, // Mountain 1 Purple Path Panel + 0x011F9, // Mountain 1 Junk Column + 0x00763, // Mountain 1 Blue Panels + 0x32A08, // Mountain 2 Blue Path Panel + 0x3C101, // Mountain 3 Giant Floor + 0x3C0FF, // Mountain 3 Peekaboo + 0x3C103, // Mountainside Cloud Cycle + 0x00A0F, // Mountaintop + 0x339A9, // Outside Tutorial Discard + 0x015C0, // Outside Tutorial Stones + 0x33B36, // Peninsula + 0x3C10C, // Shadows Laser + 0x32A0E, // Shadows Orange Crate + 0x329FE, // Shipwreck Bridge + 0x32A07, // Swamp Purple Underwater + 0x00761, // Swamp Shortcut + 0x3C109, // Symmetry Island Behind Laser + 0x33B37, // Symmetry Island Fading Lines + 0x3C107, // Town Laser Redirect + 0x3C0F3, // Town Bell Tower + 0x015B7, // Town Obelisk + 0x3C10A, // Town Lattice Panel Right + 0x32A0A, // Town Lattice Panel Left + 0x015C1, // Treehouse Green Bridge + 0x3C12A, // Treehouse Shipwreck Shore + 0x3C104, // Treehouse Docks +// 0x3C105, // Tunnels Box + 0x339A8, // Tutorial Patio Roof + 0x0050A, // Tutorial Gate +// 0x338BD, // UTM Town Shortcut +// 0x3C135, // UTM Cave In +// 0x338C9, // UTM Mountainside Shortcut +// 0x338D7, // UTM Stairwell +// 0x338C1, // UTM Challenge Water +// 0x338CA, // UTM Invisible Dots +}; + // There might be something to do with these, I haven't decided yet. std::vector nothingPanels = { // Doors & Shortcuts & Shortcut doors & Door controls @@ -684,69 +744,5 @@ std::vector nothingPanels = { 0x0005C, // Glass Factory Vertical Symmetry 5 0x17C31, // Desert Final Transparent 0x19650, // Shadows Laser -}; - -std::vector audiologs = { - 0x3C0F7, // Boat Treehouse Rock - 0x3C0FD, // Boat Broken Boat - 0x32A00, // Bunker Green Room - 0x3C0FE, // Desert Broken Wall -// 0x338B0, // Easter Egg Ending Briefcase (?) -// 0x338B7, // Easter Egg Ending Briefcase (?) -// 0x338AD, // Easter Egg Ending Briefcase (iOS) -// 0x338A5, // Easter Egg Ending Wine Table -// 0x338AE, // Easter Egg Ending Briefcase -// 0x338AF, // Easter Egg Ending Briefcase (?) -// 0x338A7, // Easter Egg Ending Record -// 0x338A3, // Easter Egg Ending Countertop -// 0x338A4, // Easter Egg Ending Sunbathing -// 0x3C108, // Easter Egg Ending Pool -// 0x338EF, // Easter Egg Ending Pillow -// 0x336E5, // Easter Egg Ending Apple -// 0x338A6, // Easter Egg Ending Purple Flowers - 0x3C100, // Jungle Entrance Right - 0x3C0F4, // Jungle Entrance Left - 0x3C102, // Jungle Laser - 0x3C10D, // Jungle Beach - 0x3C10E, // Keep Corridor - 0x3C10B, // Keep Guitar Amp - 0x0074F, // Keep Front Wall - 0x012C7, // Keep Throne - 0x329FF, // Mill Stairs - 0x3C106, // Monastery Left Shutters - 0x33AFF, // Mountain 1 Purple Path Panel - 0x011F9, // Mountain 1 Junk Column - 0x00763, // Mountain 1 Blue Panels - 0x32A08, // Mountain 2 Blue Path Panel - 0x3C101, // Mountain 3 Giant Floor - 0x3C0FF, // Mountain 3 Peekaboo - 0x3C103, // Mountainside Cloud Cycle - 0x00A0F, // Mountaintop - 0x339A9, // Outside Tutorial Discard - 0x015C0, // Outside Tutorial Stones - 0x33B36, // Peninsula - 0x3C10C, // Shadows Laser - 0x32A0E, // Shadows Orange Crate - 0x329FE, // Shipwreck Bridge - 0x32A07, // Swamp Purple Underwater - 0x00761, // Swamp Shortcut - 0x3C109, // Symmetry Island Behind Laser - 0x33B37, // Symmetry Island Fading Lines - 0x3C107, // Town Laser Redirect - 0x3C0F3, // Town Bell Tower - 0x015B7, // Town Obelisk - 0x3C10A, // Town Lattice Panel Right - 0x32A0A, // Town Lattice Panel Left - 0x015C1, // Treehouse Green Bridge - 0x3C12A, // Treehouse Shipwreck Shore - 0x3C104, // Treehouse Docks -// 0x3C105, // Tunnels Box - 0x339A8, // Tutorial Patio Roof - 0x0050A, // Tutorial Gate -// 0x338BD, // UTM Town Shortcut -// 0x3C135, // UTM Cave In -// 0x338C9, // UTM Mountainside Shortcut -// 0x338D7, // UTM Stairwell -// 0x338C1, // UTM Challenge Water -// 0x338CA, // UTM Invisible Dots + 0x09EEB, // Mountain 2 Elevator }; diff --git a/Source/Randomizer.cpp b/Source/Randomizer.cpp index 4d99461..508dff1 100644 --- a/Source/Randomizer.cpp +++ b/Source/Randomizer.cpp @@ -1,20 +1,19 @@ /* * BUGS: - * Tutorial back left is not protected anymore * Shipwreck vault is solved reversed? - * Verify UTM perspective? * FEATURES: - * Speedrunner mode? * Speed up some of the slow things (like swamp) * Determine if the user has entered the seed, and re-randomize it if not * Prevent re-randomization (?) * Clear "Randomized" state on NG (?) - * Limit back distance to pillars (like before) * Randomize audio logs -- Hard, seem to be unloaded some times? * Swap sounds in jungle (along with panels) -- maybe impossible * Make orange 7 (all of oranges?) hard. Like big = hard. * Start the game if it isn't running? - * Increase odds of mountain oranges garbage on other panels? [setting] + * SETTINGS: + * Speeds of certain things + * Speedrunner mode + * Increase odds of mountain oranges garbage on other panels */ #include "Memory.h" #include "Randomizer.h" @@ -36,7 +35,6 @@ int find(const std::vector &data, T search, size_t startIndex = 0) { void Randomizer::Randomize() { // Content swaps -- must happen before squarePanels - _core.Randomize(tallUpDownPanels, SWAP_LINES); _core.Randomize(upDownPanels, SWAP_LINES); _core.Randomize(leftForwardRightPanels, SWAP_LINES); @@ -159,7 +157,7 @@ void Randomizer::RandomizeSwamp() { void Randomizer::RandomizeMountain() { _core.Randomize(lasers, SWAP_TARGETS); - _core.Randomize(pillars, SWAP_LINES); + _core.Randomize(pillars, SWAP_LINES | SWAP_BACK_DISTANCE); _core.Randomize(mountainMultipanel, SWAP_LINES); // Read the target of keep front laser, and write it to keep back laser. diff --git a/Source/RandomizerCore.cpp b/Source/RandomizerCore.cpp index 11802f5..c673e2d 100644 --- a/Source/RandomizerCore.cpp +++ b/Source/RandomizerCore.cpp @@ -30,6 +30,9 @@ void RandomizerCore::SwapPanels(int panel1, int panel2, int flags) { if (flags & SWAP_AUDIO_NAMES) { offsets[AUDIO_LOG_NAME] = sizeof(void*); } + if (flags & SWAP_BACK_DISTANCE) { + offsets[EXTRA_BACK_DISTANCE] = sizeof(float); + } if (flags & SWAP_LINES) { offsets[PATH_COLOR] = 16; offsets[REFLECTION_PATH_COLOR] = 16; @@ -52,7 +55,6 @@ void RandomizerCore::SwapPanels(int panel1, int panel2, int flags) { offsets[PUSH_SYMBOL_COLORS] = sizeof(int); offsets[OUTER_BACKGROUND] = 16; offsets[OUTER_BACKGROUND_MODE] = sizeof(int); - offsets[EXTRA_BACK_DISTANCE] = sizeof(float); offsets[TRACED_EDGES] = 16; offsets[AUDIO_PREFIX] = sizeof(void*); // offsets[IS_CYLINDER] = sizeof(int); diff --git a/Source/RandomizerCore.h b/Source/RandomizerCore.h index 21ed0b6..2a8e42e 100644 --- a/Source/RandomizerCore.h +++ b/Source/RandomizerCore.h @@ -8,6 +8,7 @@ __declspec(selectany) int SWAP_NONE = 0x0; __declspec(selectany) int SWAP_TARGETS = 0x1; __declspec(selectany) int SWAP_LINES = 0x2; __declspec(selectany) int SWAP_AUDIO_NAMES = 0x4; +__declspec(selectany) int SWAP_BACK_DISTANCE = 0x8; class RandomizerCore { -- cgit 1.4.1