summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--WitnessRandomizer/WitnessRandomizer.cpp30
-rw-r--r--WitnessRandomizer/WitnessRandomizer.h3
2 files changed, 14 insertions, 19 deletions
diff --git a/WitnessRandomizer/WitnessRandomizer.cpp b/WitnessRandomizer/WitnessRandomizer.cpp index 4b91dac..f8bd4ee 100644 --- a/WitnessRandomizer/WitnessRandomizer.cpp +++ b/WitnessRandomizer/WitnessRandomizer.cpp
@@ -1,6 +1,6 @@
1/* 1/*
2 * BUGS: 2 * BUGS:
3 * Something is wrong with bunker 3 * Bunker has physical panel objects which I can't move :(
4 * Shipwreck vault does not copy well 4 * Shipwreck vault does not copy well
5 * Pillars can be swapped but they don't zoom you out enough. Maybe SWAP_DISTANCE? 5 * Pillars can be swapped but they don't zoom you out enough. Maybe SWAP_DISTANCE?
6 * FEATURES: 6 * FEATURES:
@@ -29,8 +29,8 @@ int main(int argc, char** argv)
29 srand(atoi(argv[1])); // Seed with RNG from command line 29 srand(atoi(argv[1])); // Seed with RNG from command line
30 } 30 }
31 31
32 // randomizer.Randomize(bunkerPanels, SWAP_LINES | SWAP_COLORS); 32 // randomizer.Randomize(bunkerPanels, SWAP_LINES | SWAP_STYLE);
33 //* 33 /*
34 randomizer.Randomize(lasers, SWAP_TARGETS); 34 randomizer.Randomize(lasers, SWAP_TARGETS);
35 randomizer.Randomize(tutorialPanels, SWAP_TARGETS); 35 randomizer.Randomize(tutorialPanels, SWAP_TARGETS);
36 randomizer.Randomize(monasteryPanels, SWAP_TARGETS); 36 randomizer.Randomize(monasteryPanels, SWAP_TARGETS);
@@ -43,11 +43,11 @@ int main(int argc, char** argv)
43 for (auto panelSet : {outsideTutorialPanels, symmetryPanels, quarryPanels, keepPanels, townPanels, bunkerPanels, swampPanels, mountainPanels, utmPanels}) { 43 for (auto panelSet : {outsideTutorialPanels, symmetryPanels, quarryPanels, keepPanels, townPanels, bunkerPanels, swampPanels, mountainPanels, utmPanels}) {
44 squarePanels.insert(squarePanels.end(), panelSet.begin(), panelSet.end()); 44 squarePanels.insert(squarePanels.end(), panelSet.begin(), panelSet.end());
45 } 45 }
46 randomizer.Randomize(squarePanels, SWAP_LINES | SWAP_COLORS); 46 randomizer.Randomize(squarePanels, SWAP_LINES | SWAP_STYLE);
47 47
48 randomizer.Randomize(junglePanels, SWAP_LINES | SWAP_COLORS); 48 randomizer.Randomize(junglePanels, SWAP_LINES | SWAP_STYLE);
49 randomizer.Randomize(mountainMultipanel, SWAP_LINES | SWAP_COLORS); 49 randomizer.Randomize(mountainMultipanel, SWAP_LINES | SWAP_STYLE);
50 randomizer.Randomize(pillars, SWAP_LINES | SWAP_COLORS); 50 randomizer.Randomize(pillars, SWAP_LINES | SWAP_STYLE | SWAP_BACK_DISTANCE);
51 /*/ 51 /*/
52 int BOATH_3_1 = 0x21B5; 52 int BOATH_3_1 = 0x21B5;
53 int MILL_L_1 = 0xE0C; 53 int MILL_L_1 = 0xE0C;
@@ -59,8 +59,11 @@ int main(int argc, char** argv)
59 int BUNKER_T_1 = 0x9F7D; 59 int BUNKER_T_1 = 0x9F7D;
60 int TUT_PILLAR = 0xC335; 60 int TUT_PILLAR = 0xC335;
61 int TUT_F_C = 0x293; 61 int TUT_F_C = 0x293;
62 int PILLAR_L_1 = 0x383D;
63 int PILLAR_L_4 = 0x339BB;
64 int PILLAR_C = 0x9DD5;
62 65
63 randomizer.SwapPanels(TUT_PILLAR, TUT_F_C, SWAP_LINES | SWAP_COLORS); 66 randomizer.SwapPanels(PILLAR_L_1, PILLAR_C, SWAP_LINES | SWAP_STYLE | SWAP_BACK_DISTANCE);
64 //*/ 67 //*/
65} 68}
66 69
@@ -124,18 +127,8 @@ void WitnessRandomizer::SwapPanels(int panel1, int panel2, int flags) {
124 offsets[0x480] = sizeof(void*); // *dot_sequence_reflection 127 offsets[0x480] = sizeof(void*); // *dot_sequence_reflection
125 offsets[0x4B0] = sizeof(void*); // *panel_target 128 offsets[0x4B0] = sizeof(void*); // *panel_target
126 offsets[0x4D8] = sizeof(void*); // *specular_texture 129 offsets[0x4D8] = sizeof(void*); // *specular_texture
127
128 // TODO: Try using is_cylinder to swap into tutorial pillar. If it fails, discard.
129 // Probably not: Extra back distance
130 // SwapPanelData(panels[i], panels[target], 0x2FC, 125); // is_cylinder through max_connections
131 } 130 }
132 /*
133 if (flags & SWAP_STYLE) { 131 if (flags & SWAP_STYLE) {
134 // 340 - pattern_scale
135 // 288 - flash_mode
136 }
137 */
138 if (flags & SWAP_COLORS) {
139 offsets[0xC8] = 16; // path_color 132 offsets[0xC8] = 16; // path_color
140 offsets[0xD8] = 16; // reflection_path_color 133 offsets[0xD8] = 16; // reflection_path_color
141// offsets[0xE8] = 16; // deprecated_finished_path_color 134// offsets[0xE8] = 16; // deprecated_finished_path_color
@@ -159,6 +152,7 @@ void WitnessRandomizer::SwapPanels(int panel1, int panel2, int flags) {
159 offsets[0x208] = sizeof(int); // push_symbol_colors 152 offsets[0x208] = sizeof(int); // push_symbol_colors
160 offsets[0x20C] = 16; // outer_background 153 offsets[0x20C] = 16; // outer_background
161 offsets[0x21C] = sizeof(int); // outer_background_mode 154 offsets[0x21C] = sizeof(int); // outer_background_mode
155 offsets[0x278] = sizeof(void*); // *audio_prefix
162 offsets[0x430] = sizeof(void*); // *decoration_colors 156 offsets[0x430] = sizeof(void*); // *decoration_colors
163 offsets[0x4A0] = sizeof(int); // num_colored_regions 157 offsets[0x4A0] = sizeof(int); // num_colored_regions
164 offsets[0x4A8] = sizeof(void*); // *colored_regions 158 offsets[0x4A8] = sizeof(void*); // *colored_regions
diff --git a/WitnessRandomizer/WitnessRandomizer.h b/WitnessRandomizer/WitnessRandomizer.h index 9e84a46..af1f785 100644 --- a/WitnessRandomizer/WitnessRandomizer.h +++ b/WitnessRandomizer/WitnessRandomizer.h
@@ -2,7 +2,8 @@
2 2
3int SWAP_TARGETS = 0x1; 3int SWAP_TARGETS = 0x1;
4int SWAP_LINES = 0x2; 4int SWAP_LINES = 0x2;
5int SWAP_COLORS = 0x4; 5int SWAP_STYLE = 0x4;
6int SWAP_BACK_DISTANCE = 0x8;
6 7
7class WitnessRandomizer { 8class WitnessRandomizer {
8public: 9public: