about summary refs log tree commit diff stats
path: root/WitnessRandomizer
diff options
context:
space:
mode:
Diffstat (limited to 'WitnessRandomizer')
-rw-r--r--WitnessRandomizer/Panels.h2
-rw-r--r--WitnessRandomizer/WitnessRandomizer.cpp33
-rw-r--r--WitnessRandomizer/WitnessRandomizer.h4
3 files changed, 31 insertions, 8 deletions
diff --git a/WitnessRandomizer/Panels.h b/WitnessRandomizer/Panels.h index 2995170..7b9c96c 100644 --- a/WitnessRandomizer/Panels.h +++ b/WitnessRandomizer/Panels.h
@@ -96,7 +96,7 @@ const std::vector<int> upDownPanels = {
96 0x335AB, // UTM In Elevator Control 96 0x335AB, // UTM In Elevator Control
97 0x3369D, // UTM Lower Elevator Control 97 0x3369D, // UTM Lower Elevator Control
98 0x335AC, // UTM Upper Elevator Control 98 0x335AC, // UTM Upper Elevator Control
99 0x09EEB, // Mountain 2 Elevator 99// 0x09EEB, // Mountain 2 Elevator
100}; 100};
101 101
102// Note: Some of these (non-controls) are duplicated elsewhere 102// Note: Some of these (non-controls) are duplicated elsewhere
diff --git a/WitnessRandomizer/WitnessRandomizer.cpp b/WitnessRandomizer/WitnessRandomizer.cpp index e7ab2aa..7827ddb 100644 --- a/WitnessRandomizer/WitnessRandomizer.cpp +++ b/WitnessRandomizer/WitnessRandomizer.cpp
@@ -1,8 +1,12 @@
1/* 1/*
2 * TODO: Split out main() logic into another file, and move into separate functions for easier testing. Then write tests.
2 * BUGS: 3 * BUGS:
3 * Shipwreck vault fails, possibly because of dot_reflection? 4 * Shipwreck vault fails, possibly because of dot_reflection? Sometimes?
4 * Treehouse pivots *should* work, but I need to not copy style_flags. 5 * Treehouse pivots *should* work, but I need to not copy style_flags.
5 This seems to cause crashes when pivots appear elsewhere in the world. 6 This seems to cause crashes when pivots appear elsewhere in the world.
7 * Some panels are impossible casually: (idc, I think)
8 ** Town Stars, Invisible dots
9 * Something is wrong with jungle
6 * FEATURES: 10 * FEATURES:
7 * SWAP_TARGETS should still require the full panel sequence (and have ways to prevent softlocks?) 11 * SWAP_TARGETS should still require the full panel sequence (and have ways to prevent softlocks?)
8 ** Think about: Jungle 12 ** Think about: Jungle
@@ -34,7 +38,6 @@ size_t find(const std::vector<T> &data, T search, size_t startIndex = 0) {
34 38
35int main(int argc, char** argv) 39int main(int argc, char** argv)
36{ 40{
37
38 WitnessRandomizer randomizer = WitnessRandomizer(); 41 WitnessRandomizer randomizer = WitnessRandomizer();
39 42
40 if (argc == 2) { 43 if (argc == 2) {
@@ -45,6 +48,22 @@ int main(int argc, char** argv)
45 srand(seed); 48 srand(seed);
46 } 49 }
47 50
51 /*
52 randomizer.SwapPanels(0x0007C, 0x0005D, SWAP_LINES | SWAP_STYLE); // Symmetry Island Colored Dots 1
53 randomizer.SwapPanels(0x0007E, 0x0005E, SWAP_LINES | SWAP_STYLE); // Symmetry Island Colored Dots 2
54 randomizer.SwapPanels(0x00075, 0x0005F, SWAP_LINES | SWAP_STYLE); // Symmetry Island Colored Dots 3
55 randomizer.SwapPanels(0x00073, 0x00060, SWAP_LINES | SWAP_STYLE); // Symmetry Island Colored Dots 4
56 randomizer.SwapPanels(0x00077, 0x00061, SWAP_LINES | SWAP_STYLE); // Symmetry Island Colored Dots 5
57 0x00079; // Symmetry Island Colored Dots 6
58
59 0x0005D; // Outside Tutorial Dots Tutorial 1
60 0x0005E; // Outside Tutorial Dots Tutorial 2
61 0x0005F; // Outside Tutorial Dots Tutorial 3
62 0x00060; // Outside Tutorial Dots Tutorial 4
63 0x00061; // Outside Tutorial Dots Tutorial 5
64 */
65
66
48 // Content swaps -- must happen before squarePanels 67 // Content swaps -- must happen before squarePanels
49 randomizer.Randomize(upDownPanels, SWAP_LINES | SWAP_STYLE); 68 randomizer.Randomize(upDownPanels, SWAP_LINES | SWAP_STYLE);
50 randomizer.Randomize(leftForwardRightPanels, SWAP_LINES); 69 randomizer.Randomize(leftForwardRightPanels, SWAP_LINES);
@@ -60,8 +79,10 @@ int main(int argc, char** argv)
60 std::vector<int> keepFrontLaserTarget = randomizer.ReadPanelData<int>(0x0360E, TARGET, 1); 79 std::vector<int> keepFrontLaserTarget = randomizer.ReadPanelData<int>(0x0360E, TARGET, 1);
61 randomizer.WritePanelData<int>(0x03317, TARGET, keepFrontLaserTarget); 80 randomizer.WritePanelData<int>(0x03317, TARGET, keepFrontLaserTarget);
62 81
63 /* Jungle */ 82 std::vector<int> randomOrder;
64 std::vector<int> randomOrder = std::vector(junglePanels.size(), 0); 83
84 /* Jungle
85 randomOrder = std::vector(junglePanels.size(), 0);
65 std::iota(randomOrder.begin(), randomOrder.end(), 0); 86 std::iota(randomOrder.begin(), randomOrder.end(), 0);
66 // Randomize Waves 2-7 87 // Randomize Waves 2-7
67 // Waves 1 cannot be randomized, since no other panel can start on 88 // Waves 1 cannot be randomized, since no other panel can start on
@@ -69,6 +90,7 @@ int main(int argc, char** argv)
69 // Randomize Pitches 1-6 onto themselves 90 // Randomize Pitches 1-6 onto themselves
70 randomizer.RandomizeRange(randomOrder, SWAP_NONE, 7, 13); 91 randomizer.RandomizeRange(randomOrder, SWAP_NONE, 7, 13);
71 randomizer.ReassignTargets(junglePanels, randomOrder); 92 randomizer.ReassignTargets(junglePanels, randomOrder);
93 */
72 94
73 /* Bunker */ 95 /* Bunker */
74 randomOrder = std::vector(bunkerPanels.size(), 0); 96 randomOrder = std::vector(bunkerPanels.size(), 0);
@@ -104,7 +126,6 @@ int main(int argc, char** argv)
104 126
105 randomizer.ReassignTargets(monasteryPanels, randomOrder); 127 randomizer.ReassignTargets(monasteryPanels, randomOrder);
106 */ 128 */
107
108} 129}
109 130
110WitnessRandomizer::WitnessRandomizer() 131WitnessRandomizer::WitnessRandomizer()
@@ -117,7 +138,7 @@ WitnessRandomizer::WitnessRandomizer()
117 // Distance-gate shadows laser to prevent sniping through the bars 138 // Distance-gate shadows laser to prevent sniping through the bars
118 WritePanelData<float>(0x19650, MAX_BROADCAST_DISTANCE, {2.5f}); 139 WritePanelData<float>(0x19650, MAX_BROADCAST_DISTANCE, {2.5f});
119 // Change the shadows tutorial cable to only activate avoid 140 // Change the shadows tutorial cable to only activate avoid
120 WritePanelData<int>(0x319A8, 0xD8, {0}); 141 WritePanelData<int>(0x319A8, CABLE_TARGET_2, {0});
121 // Change shadows avoid 8 to power shadows follow 142 // Change shadows avoid 8 to power shadows follow
122 WritePanelData<int>(0x1972F, TARGET, {0x1C34C}); 143 WritePanelData<int>(0x1972F, TARGET, {0x1C34C});
123 144
diff --git a/WitnessRandomizer/WitnessRandomizer.h b/WitnessRandomizer/WitnessRandomizer.h index 3d748d1..0c73b89 100644 --- a/WitnessRandomizer/WitnessRandomizer.h +++ b/WitnessRandomizer/WitnessRandomizer.h
@@ -91,6 +91,7 @@ private:
91#define COLORED_REGIONS 0x4A8 91#define COLORED_REGIONS 0x4A8
92#define PANEL_TARGET 0x4B0 92#define PANEL_TARGET 0x4B0
93#define SPECULAR_TEXTURE 0x4D8 93#define SPECULAR_TEXTURE 0x4D8
94#define CABLE_TARGET_2 0xD8
94#elif GLOBALS == 0x62A080 95#elif GLOBALS == 0x62A080
95#define PATH_COLOR 0xC0 96#define PATH_COLOR 0xC0
96#define REFLECTION_PATH_COLOR 0xD0 97#define REFLECTION_PATH_COLOR 0xD0
@@ -104,7 +105,7 @@ private:
104#define ERROR_COLOR 0x160 105#define ERROR_COLOR 0x160
105#define PATTERN_POINT_COLOR 0x180 106#define PATTERN_POINT_COLOR 0x180
106#define PATTERN_POINT_COLOR_A 0x190 107#define PATTERN_POINT_COLOR_A 0x190
107#define PATTERN_POINT_COLOR_B 0x200 108#define PATTERN_POINT_COLOR_B 0x1A0
108#define SYMBOL_A 0x1B0 109#define SYMBOL_A 0x1B0
109#define SYMBOL_B 0x1C0 110#define SYMBOL_B 0x1C0
110#define SYMBOL_C 0x1D0 111#define SYMBOL_C 0x1D0
@@ -151,4 +152,5 @@ private:
151#define COLORED_REGIONS 0x4A0 152#define COLORED_REGIONS 0x4A0
152#define PANEL_TARGET 0x4A8 153#define PANEL_TARGET 0x4A8
153#define SPECULAR_TEXTURE 0x4D0 154#define SPECULAR_TEXTURE 0x4D0
155#define CABLE_TARGET_2 0xD0
154#endif \ No newline at end of file 156#endif \ No newline at end of file