summary refs log tree commit diff stats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/Main.cpp8
-rw-r--r--Source/Panels.h138
-rw-r--r--Source/Randomizer.cpp12
-rw-r--r--Source/RandomizerCore.cpp4
-rw-r--r--Source/RandomizerCore.h1
5 files changed, 83 insertions, 80 deletions
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)
118 seed = _wtoi(text.c_str()); 118 seed = _wtoi(text.c_str());
119 } 119 }
120 srand(seed); 120 srand(seed);
121 Randomizer().Randomize(); 121 Randomizer randomizer;
122 randomizer.Randomize();
123 /*
124 if (adjustSpeed.isChecked()) {
125 randomizer.AdjustSpeed();
126 }
127 */
122 SetWindowText(hwndRandomize, L"Randomized!"); 128 SetWindowText(hwndRandomize, L"Randomized!");
123 } 129 }
124 } 130 }
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<int> leftRightPanels = {
32 0x17D02, // Town Windmill Control 32 0x17D02, // Town Windmill Control
33}; 33};
34 34
35// These panels are very tall (aka not square) and can't take symmetry panels on them.
36std::vector<int> tallUpDownPanels = {
37 0x09EEB, // Mountain 2 Elevator
38 0x17CC4, // Mill Elevator Control
39};
40
41// Note: Some of these (non-controls) are duplicated elsewhere 35// Note: Some of these (non-controls) are duplicated elsewhere
42std::vector<int> upDownPanels = { 36std::vector<int> upDownPanels = {
43 0x0008D, // Glass Factory Rotational Symmetry 1 37 0x0008D, // Glass Factory Rotational Symmetry 1
@@ -547,6 +541,72 @@ std::vector<int> junglePanels = {
547 0x03616, // Jungle Laser 541 0x03616, // Jungle Laser
548}; 542};
549 543
544
545std::vector<int> audiologs = {
546 0x3C0F7, // Boat Treehouse Rock
547 0x3C0FD, // Boat Broken Boat
548 0x32A00, // Bunker Green Room
549 0x3C0FE, // Desert Broken Wall
550// 0x338B0, // Easter Egg Ending Briefcase (?)
551// 0x338B7, // Easter Egg Ending Briefcase (?)
552// 0x338AD, // Easter Egg Ending Briefcase (iOS)
553// 0x338A5, // Easter Egg Ending Wine Table
554// 0x338AE, // Easter Egg Ending Briefcase
555// 0x338AF, // Easter Egg Ending Briefcase (?)
556// 0x338A7, // Easter Egg Ending Record
557// 0x338A3, // Easter Egg Ending Countertop
558// 0x338A4, // Easter Egg Ending Sunbathing
559// 0x3C108, // Easter Egg Ending Pool
560// 0x338EF, // Easter Egg Ending Pillow
561// 0x336E5, // Easter Egg Ending Apple
562// 0x338A6, // Easter Egg Ending Purple Flowers
563 0x3C100, // Jungle Entrance Right
564 0x3C0F4, // Jungle Entrance Left
565 0x3C102, // Jungle Laser
566 0x3C10D, // Jungle Beach
567 0x3C10E, // Keep Corridor
568 0x3C10B, // Keep Guitar Amp
569 0x0074F, // Keep Front Wall
570 0x012C7, // Keep Throne
571 0x329FF, // Mill Stairs
572 0x3C106, // Monastery Left Shutters
573 0x33AFF, // Mountain 1 Purple Path Panel
574 0x011F9, // Mountain 1 Junk Column
575 0x00763, // Mountain 1 Blue Panels
576 0x32A08, // Mountain 2 Blue Path Panel
577 0x3C101, // Mountain 3 Giant Floor
578 0x3C0FF, // Mountain 3 Peekaboo
579 0x3C103, // Mountainside Cloud Cycle
580 0x00A0F, // Mountaintop
581 0x339A9, // Outside Tutorial Discard
582 0x015C0, // Outside Tutorial Stones
583 0x33B36, // Peninsula
584 0x3C10C, // Shadows Laser
585 0x32A0E, // Shadows Orange Crate
586 0x329FE, // Shipwreck Bridge
587 0x32A07, // Swamp Purple Underwater
588 0x00761, // Swamp Shortcut
589 0x3C109, // Symmetry Island Behind Laser
590 0x33B37, // Symmetry Island Fading Lines
591 0x3C107, // Town Laser Redirect
592 0x3C0F3, // Town Bell Tower
593 0x015B7, // Town Obelisk
594 0x3C10A, // Town Lattice Panel Right
595 0x32A0A, // Town Lattice Panel Left
596 0x015C1, // Treehouse Green Bridge
597 0x3C12A, // Treehouse Shipwreck Shore
598 0x3C104, // Treehouse Docks
599// 0x3C105, // Tunnels Box
600 0x339A8, // Tutorial Patio Roof
601 0x0050A, // Tutorial Gate
602// 0x338BD, // UTM Town Shortcut
603// 0x3C135, // UTM Cave In
604// 0x338C9, // UTM Mountainside Shortcut
605// 0x338D7, // UTM Stairwell
606// 0x338C1, // UTM Challenge Water
607// 0x338CA, // UTM Invisible Dots
608};
609
550// There might be something to do with these, I haven't decided yet. 610// There might be something to do with these, I haven't decided yet.
551std::vector<int> nothingPanels = { 611std::vector<int> nothingPanels = {
552// Doors & Shortcuts & Shortcut doors & Door controls 612// Doors & Shortcuts & Shortcut doors & Door controls
@@ -684,69 +744,5 @@ std::vector<int> nothingPanels = {
684 0x0005C, // Glass Factory Vertical Symmetry 5 744 0x0005C, // Glass Factory Vertical Symmetry 5
685 0x17C31, // Desert Final Transparent 745 0x17C31, // Desert Final Transparent
686 0x19650, // Shadows Laser 746 0x19650, // Shadows Laser
687}; 747 0x09EEB, // Mountain 2 Elevator
688
689std::vector<int> audiologs = {
690 0x3C0F7, // Boat Treehouse Rock
691 0x3C0FD, // Boat Broken Boat
692 0x32A00, // Bunker Green Room
693 0x3C0FE, // Desert Broken Wall
694// 0x338B0, // Easter Egg Ending Briefcase (?)
695// 0x338B7, // Easter Egg Ending Briefcase (?)
696// 0x338AD, // Easter Egg Ending Briefcase (iOS)
697// 0x338A5, // Easter Egg Ending Wine Table
698// 0x338AE, // Easter Egg Ending Briefcase
699// 0x338AF, // Easter Egg Ending Briefcase (?)
700// 0x338A7, // Easter Egg Ending Record
701// 0x338A3, // Easter Egg Ending Countertop
702// 0x338A4, // Easter Egg Ending Sunbathing
703// 0x3C108, // Easter Egg Ending Pool
704// 0x338EF, // Easter Egg Ending Pillow
705// 0x336E5, // Easter Egg Ending Apple
706// 0x338A6, // Easter Egg Ending Purple Flowers
707 0x3C100, // Jungle Entrance Right
708 0x3C0F4, // Jungle Entrance Left
709 0x3C102, // Jungle Laser
710 0x3C10D, // Jungle Beach
711 0x3C10E, // Keep Corridor
712 0x3C10B, // Keep Guitar Amp
713 0x0074F, // Keep Front Wall
714 0x012C7, // Keep Throne
715 0x329FF, // Mill Stairs
716 0x3C106, // Monastery Left Shutters
717 0x33AFF, // Mountain 1 Purple Path Panel
718 0x011F9, // Mountain 1 Junk Column
719 0x00763, // Mountain 1 Blue Panels
720 0x32A08, // Mountain 2 Blue Path Panel
721 0x3C101, // Mountain 3 Giant Floor
722 0x3C0FF, // Mountain 3 Peekaboo
723 0x3C103, // Mountainside Cloud Cycle
724 0x00A0F, // Mountaintop
725 0x339A9, // Outside Tutorial Discard
726 0x015C0, // Outside Tutorial Stones
727 0x33B36, // Peninsula
728 0x3C10C, // Shadows Laser
729 0x32A0E, // Shadows Orange Crate
730 0x329FE, // Shipwreck Bridge
731 0x32A07, // Swamp Purple Underwater
732 0x00761, // Swamp Shortcut
733 0x3C109, // Symmetry Island Behind Laser
734 0x33B37, // Symmetry Island Fading Lines
735 0x3C107, // Town Laser Redirect
736 0x3C0F3, // Town Bell Tower
737 0x015B7, // Town Obelisk
738 0x3C10A, // Town Lattice Panel Right
739 0x32A0A, // Town Lattice Panel Left
740 0x015C1, // Treehouse Green Bridge
741 0x3C12A, // Treehouse Shipwreck Shore
742 0x3C104, // Treehouse Docks
743// 0x3C105, // Tunnels Box
744 0x339A8, // Tutorial Patio Roof
745 0x0050A, // Tutorial Gate
746// 0x338BD, // UTM Town Shortcut
747// 0x3C135, // UTM Cave In
748// 0x338C9, // UTM Mountainside Shortcut
749// 0x338D7, // UTM Stairwell
750// 0x338C1, // UTM Challenge Water
751// 0x338CA, // UTM Invisible Dots
752}; 748};
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 @@
1/* 1/*
2 * BUGS: 2 * BUGS:
3 * Tutorial back left is not protected anymore
4 * Shipwreck vault is solved reversed? 3 * Shipwreck vault is solved reversed?
5 * Verify UTM perspective?
6 * FEATURES: 4 * FEATURES:
7 * Speedrunner mode?
8 * Speed up some of the slow things (like swamp) 5 * Speed up some of the slow things (like swamp)
9 * Determine if the user has entered the seed, and re-randomize it if not 6 * Determine if the user has entered the seed, and re-randomize it if not
10 * Prevent re-randomization (?) 7 * Prevent re-randomization (?)
11 * Clear "Randomized" state on NG (?) 8 * Clear "Randomized" state on NG (?)
12 * Limit back distance to pillars (like before)
13 * Randomize audio logs -- Hard, seem to be unloaded some times? 9 * Randomize audio logs -- Hard, seem to be unloaded some times?
14 * Swap sounds in jungle (along with panels) -- maybe impossible 10 * Swap sounds in jungle (along with panels) -- maybe impossible
15 * Make orange 7 (all of oranges?) hard. Like big = hard. 11 * Make orange 7 (all of oranges?) hard. Like big = hard.
16 * Start the game if it isn't running? 12 * Start the game if it isn't running?
17 * Increase odds of mountain oranges garbage on other panels? [setting] 13 * SETTINGS:
14 * Speeds of certain things
15 * Speedrunner mode
16 * Increase odds of mountain oranges garbage on other panels
18*/ 17*/
19#include "Memory.h" 18#include "Memory.h"
20#include "Randomizer.h" 19#include "Randomizer.h"
@@ -36,7 +35,6 @@ int find(const std::vector<T> &data, T search, size_t startIndex = 0) {
36void Randomizer::Randomize() 35void Randomizer::Randomize()
37{ 36{
38 // Content swaps -- must happen before squarePanels 37 // Content swaps -- must happen before squarePanels
39 _core.Randomize(tallUpDownPanels, SWAP_LINES);
40 _core.Randomize(upDownPanels, SWAP_LINES); 38 _core.Randomize(upDownPanels, SWAP_LINES);
41 _core.Randomize(leftForwardRightPanels, SWAP_LINES); 39 _core.Randomize(leftForwardRightPanels, SWAP_LINES);
42 40
@@ -159,7 +157,7 @@ void Randomizer::RandomizeSwamp() {
159 157
160void Randomizer::RandomizeMountain() { 158void Randomizer::RandomizeMountain() {
161 _core.Randomize(lasers, SWAP_TARGETS); 159 _core.Randomize(lasers, SWAP_TARGETS);
162 _core.Randomize(pillars, SWAP_LINES); 160 _core.Randomize(pillars, SWAP_LINES | SWAP_BACK_DISTANCE);
163 _core.Randomize(mountainMultipanel, SWAP_LINES); 161 _core.Randomize(mountainMultipanel, SWAP_LINES);
164 162
165 // Read the target of keep front laser, and write it to keep back laser. 163 // 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) {
30 if (flags & SWAP_AUDIO_NAMES) { 30 if (flags & SWAP_AUDIO_NAMES) {
31 offsets[AUDIO_LOG_NAME] = sizeof(void*); 31 offsets[AUDIO_LOG_NAME] = sizeof(void*);
32 } 32 }
33 if (flags & SWAP_BACK_DISTANCE) {
34 offsets[EXTRA_BACK_DISTANCE] = sizeof(float);
35 }
33 if (flags & SWAP_LINES) { 36 if (flags & SWAP_LINES) {
34 offsets[PATH_COLOR] = 16; 37 offsets[PATH_COLOR] = 16;
35 offsets[REFLECTION_PATH_COLOR] = 16; 38 offsets[REFLECTION_PATH_COLOR] = 16;
@@ -52,7 +55,6 @@ void RandomizerCore::SwapPanels(int panel1, int panel2, int flags) {
52 offsets[PUSH_SYMBOL_COLORS] = sizeof(int); 55 offsets[PUSH_SYMBOL_COLORS] = sizeof(int);
53 offsets[OUTER_BACKGROUND] = 16; 56 offsets[OUTER_BACKGROUND] = 16;
54 offsets[OUTER_BACKGROUND_MODE] = sizeof(int); 57 offsets[OUTER_BACKGROUND_MODE] = sizeof(int);
55 offsets[EXTRA_BACK_DISTANCE] = sizeof(float);
56 offsets[TRACED_EDGES] = 16; 58 offsets[TRACED_EDGES] = 16;
57 offsets[AUDIO_PREFIX] = sizeof(void*); 59 offsets[AUDIO_PREFIX] = sizeof(void*);
58// offsets[IS_CYLINDER] = sizeof(int); 60// 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;
8__declspec(selectany) int SWAP_TARGETS = 0x1; 8__declspec(selectany) int SWAP_TARGETS = 0x1;
9__declspec(selectany) int SWAP_LINES = 0x2; 9__declspec(selectany) int SWAP_LINES = 0x2;
10__declspec(selectany) int SWAP_AUDIO_NAMES = 0x4; 10__declspec(selectany) int SWAP_AUDIO_NAMES = 0x4;
11__declspec(selectany) int SWAP_BACK_DISTANCE = 0x8;
11 12
12class RandomizerCore 13class RandomizerCore
13{ 14{