summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorjbzdarkid <jbzdarkid@gmail.com>2018-10-27 12:55:54 -0700
committerjbzdarkid <jbzdarkid@gmail.com>2018-10-27 12:55:54 -0700
commit2ec60ccdf374cdcaff95b7ec8d536f38bdad916e (patch)
tree43ac7f80773309edb29bde6a93de1751e46cbbd5
parentc39e7052b1221b886b6b207029ab2111cbfbe758 (diff)
downloadwitness-tutorializer-2ec60ccdf374cdcaff95b7ec8d536f38bdad916e.tar.gz
witness-tutorializer-2ec60ccdf374cdcaff95b7ec8d536f38bdad916e.tar.bz2
witness-tutorializer-2ec60ccdf374cdcaff95b7ec8d536f38bdad916e.zip
Fix some bugs, comment out things I can't fix rn
-rw-r--r--WitnessRandomizer/Panels.h2
-rw-r--r--WitnessRandomizer/WitnessRandomizer.cpp33
-rw-r--r--WitnessRandomizer/WitnessRandomizer.h4
-rw-r--r--WitnessRandomizerInstaller/WitnessRandomizerInstaller.vdproj24
4 files changed, 51 insertions, 12 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
diff --git a/WitnessRandomizerInstaller/WitnessRandomizerInstaller.vdproj b/WitnessRandomizerInstaller/WitnessRandomizerInstaller.vdproj index 7951e39..a2cf517 100644 --- a/WitnessRandomizerInstaller/WitnessRandomizerInstaller.vdproj +++ b/WitnessRandomizerInstaller/WitnessRandomizerInstaller.vdproj
@@ -37,6 +37,14 @@
37 "PrivateKeyFile" = "8:" 37 "PrivateKeyFile" = "8:"
38 "TimeStampServer" = "8:" 38 "TimeStampServer" = "8:"
39 "InstallerBootstrapper" = "3:2" 39 "InstallerBootstrapper" = "3:2"
40 "BootstrapperCfg:{63ACBE69-63AA-4F98-B2B6-99F9E24495F2}"
41 {
42 "Enabled" = "11:TRUE"
43 "PromptEnabled" = "11:TRUE"
44 "PrerequisitesLocation" = "2:1"
45 "Url" = "8:"
46 "ComponentsUrl" = "8:"
47 }
40 } 48 }
41 "Release" 49 "Release"
42 { 50 {
@@ -53,6 +61,14 @@
53 "PrivateKeyFile" = "8:" 61 "PrivateKeyFile" = "8:"
54 "TimeStampServer" = "8:" 62 "TimeStampServer" = "8:"
55 "InstallerBootstrapper" = "3:2" 63 "InstallerBootstrapper" = "3:2"
64 "BootstrapperCfg:{63ACBE69-63AA-4F98-B2B6-99F9E24495F2}"
65 {
66 "Enabled" = "11:TRUE"
67 "PromptEnabled" = "11:TRUE"
68 "PrerequisitesLocation" = "2:1"
69 "Url" = "8:"
70 "ComponentsUrl" = "8:"
71 }
56 } 72 }
57 } 73 }
58 "Deployable" 74 "Deployable"
@@ -130,15 +146,15 @@
130 { 146 {
131 "Name" = "8:Microsoft Visual Studio" 147 "Name" = "8:Microsoft Visual Studio"
132 "ProductName" = "8:WitnessRandomizer" 148 "ProductName" = "8:WitnessRandomizer"
133 "ProductCode" = "8:{1D8F70FD-4741-4C9F-B0FE-9207F15FEC1A}" 149 "ProductCode" = "8:{9EB4E1F3-2D4E-4D2B-B8AA-B51C12F8149B}"
134 "PackageCode" = "8:{FF874506-B46A-40E9-B6C2-C87CFE189AFF}" 150 "PackageCode" = "8:{2D819EE6-D857-426F-A0B0-48CDB593BCD3}"
135 "UpgradeCode" = "8:{B2AF0F34-4917-4AEC-B892-FE4FD4B9584A}" 151 "UpgradeCode" = "8:{B2AF0F34-4917-4AEC-B892-FE4FD4B9584A}"
136 "AspNetVersion" = "8:2.0.50727.0" 152 "AspNetVersion" = "8:2.0.50727.0"
137 "RestartWWWService" = "11:FALSE" 153 "RestartWWWService" = "11:FALSE"
138 "RemovePreviousVersions" = "11:FALSE" 154 "RemovePreviousVersions" = "11:TRUE"
139 "DetectNewerInstalledVersion" = "11:TRUE" 155 "DetectNewerInstalledVersion" = "11:TRUE"
140 "InstallAllUsers" = "11:FALSE" 156 "InstallAllUsers" = "11:FALSE"
141 "ProductVersion" = "8:1.0.1" 157 "ProductVersion" = "8:1.0.2"
142 "Manufacturer" = "8:jbzdarkid" 158 "Manufacturer" = "8:jbzdarkid"
143 "ARPHELPTELEPHONE" = "8:" 159 "ARPHELPTELEPHONE" = "8:"
144 "ARPHELPLINK" = "8:" 160 "ARPHELPLINK" = "8:"