Skip to content

Commit

Permalink
Fix some bugs, comment out things I can't fix rn
Browse files Browse the repository at this point in the history
  • Loading branch information
jbzdarkid committed Oct 27, 2018
1 parent c39e705 commit 2ec60cc
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 12 deletions.
2 changes: 1 addition & 1 deletion WitnessRandomizer/Panels.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ const std::vector<int> upDownPanels = {
0x335AB, // UTM In Elevator Control
0x3369D, // UTM Lower Elevator Control
0x335AC, // UTM Upper Elevator Control
0x09EEB, // Mountain 2 Elevator
// 0x09EEB, // Mountain 2 Elevator
};

// Note: Some of these (non-controls) are duplicated elsewhere
Expand Down
33 changes: 27 additions & 6 deletions WitnessRandomizer/WitnessRandomizer.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
/*
* TODO: Split out main() logic into another file, and move into separate functions for easier testing. Then write tests.
* BUGS:
* Shipwreck vault fails, possibly because of dot_reflection?
* Shipwreck vault fails, possibly because of dot_reflection? Sometimes?
* Treehouse pivots *should* work, but I need to not copy style_flags.
This seems to cause crashes when pivots appear elsewhere in the world.
* Some panels are impossible casually: (idc, I think)
** Town Stars, Invisible dots
* Something is wrong with jungle
* FEATURES:
* SWAP_TARGETS should still require the full panel sequence (and have ways to prevent softlocks?)
** Think about: Jungle
Expand Down Expand Up @@ -34,7 +38,6 @@ size_t find(const std::vector<T> &data, T search, size_t startIndex = 0) {

int main(int argc, char** argv)
{

WitnessRandomizer randomizer = WitnessRandomizer();

if (argc == 2) {
Expand All @@ -45,6 +48,22 @@ int main(int argc, char** argv)
srand(seed);
}

/*
randomizer.SwapPanels(0x0007C, 0x0005D, SWAP_LINES | SWAP_STYLE); // Symmetry Island Colored Dots 1
randomizer.SwapPanels(0x0007E, 0x0005E, SWAP_LINES | SWAP_STYLE); // Symmetry Island Colored Dots 2
randomizer.SwapPanels(0x00075, 0x0005F, SWAP_LINES | SWAP_STYLE); // Symmetry Island Colored Dots 3
randomizer.SwapPanels(0x00073, 0x00060, SWAP_LINES | SWAP_STYLE); // Symmetry Island Colored Dots 4
randomizer.SwapPanels(0x00077, 0x00061, SWAP_LINES | SWAP_STYLE); // Symmetry Island Colored Dots 5
0x00079; // Symmetry Island Colored Dots 6
0x0005D; // Outside Tutorial Dots Tutorial 1
0x0005E; // Outside Tutorial Dots Tutorial 2
0x0005F; // Outside Tutorial Dots Tutorial 3
0x00060; // Outside Tutorial Dots Tutorial 4
0x00061; // Outside Tutorial Dots Tutorial 5
*/


// Content swaps -- must happen before squarePanels
randomizer.Randomize(upDownPanels, SWAP_LINES | SWAP_STYLE);
randomizer.Randomize(leftForwardRightPanels, SWAP_LINES);
Expand All @@ -60,15 +79,18 @@ int main(int argc, char** argv)
std::vector<int> keepFrontLaserTarget = randomizer.ReadPanelData<int>(0x0360E, TARGET, 1);
randomizer.WritePanelData<int>(0x03317, TARGET, keepFrontLaserTarget);

/* Jungle */
std::vector<int> randomOrder = std::vector(junglePanels.size(), 0);
std::vector<int> randomOrder;

/* Jungle
randomOrder = std::vector(junglePanels.size(), 0);
std::iota(randomOrder.begin(), randomOrder.end(), 0);
// Randomize Waves 2-7
// Waves 1 cannot be randomized, since no other panel can start on
randomizer.RandomizeRange(randomOrder, SWAP_NONE, 1, 7);
// Randomize Pitches 1-6 onto themselves
randomizer.RandomizeRange(randomOrder, SWAP_NONE, 7, 13);
randomizer.ReassignTargets(junglePanels, randomOrder);
*/

/* Bunker */
randomOrder = std::vector(bunkerPanels.size(), 0);
Expand Down Expand Up @@ -104,7 +126,6 @@ int main(int argc, char** argv)
randomizer.ReassignTargets(monasteryPanels, randomOrder);
*/

}

WitnessRandomizer::WitnessRandomizer()
Expand All @@ -117,7 +138,7 @@ WitnessRandomizer::WitnessRandomizer()
// Distance-gate shadows laser to prevent sniping through the bars
WritePanelData<float>(0x19650, MAX_BROADCAST_DISTANCE, {2.5f});
// Change the shadows tutorial cable to only activate avoid
WritePanelData<int>(0x319A8, 0xD8, {0});
WritePanelData<int>(0x319A8, CABLE_TARGET_2, {0});
// Change shadows avoid 8 to power shadows follow
WritePanelData<int>(0x1972F, TARGET, {0x1C34C});

Expand Down
4 changes: 3 additions & 1 deletion WitnessRandomizer/WitnessRandomizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ class WitnessRandomizer {
#define COLORED_REGIONS 0x4A8
#define PANEL_TARGET 0x4B0
#define SPECULAR_TEXTURE 0x4D8
#define CABLE_TARGET_2 0xD8
#elif GLOBALS == 0x62A080
#define PATH_COLOR 0xC0
#define REFLECTION_PATH_COLOR 0xD0
Expand All @@ -104,7 +105,7 @@ class WitnessRandomizer {
#define ERROR_COLOR 0x160
#define PATTERN_POINT_COLOR 0x180
#define PATTERN_POINT_COLOR_A 0x190
#define PATTERN_POINT_COLOR_B 0x200
#define PATTERN_POINT_COLOR_B 0x1A0
#define SYMBOL_A 0x1B0
#define SYMBOL_B 0x1C0
#define SYMBOL_C 0x1D0
Expand Down Expand Up @@ -151,4 +152,5 @@ class WitnessRandomizer {
#define COLORED_REGIONS 0x4A0
#define PANEL_TARGET 0x4A8
#define SPECULAR_TEXTURE 0x4D0
#define CABLE_TARGET_2 0xD0
#endif
24 changes: 20 additions & 4 deletions WitnessRandomizerInstaller/WitnessRandomizerInstaller.vdproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@
"PrivateKeyFile" = "8:"
"TimeStampServer" = "8:"
"InstallerBootstrapper" = "3:2"
"BootstrapperCfg:{63ACBE69-63AA-4F98-B2B6-99F9E24495F2}"
{
"Enabled" = "11:TRUE"
"PromptEnabled" = "11:TRUE"
"PrerequisitesLocation" = "2:1"
"Url" = "8:"
"ComponentsUrl" = "8:"
}
}
"Release"
{
Expand All @@ -53,6 +61,14 @@
"PrivateKeyFile" = "8:"
"TimeStampServer" = "8:"
"InstallerBootstrapper" = "3:2"
"BootstrapperCfg:{63ACBE69-63AA-4F98-B2B6-99F9E24495F2}"
{
"Enabled" = "11:TRUE"
"PromptEnabled" = "11:TRUE"
"PrerequisitesLocation" = "2:1"
"Url" = "8:"
"ComponentsUrl" = "8:"
}
}
}
"Deployable"
Expand Down Expand Up @@ -130,15 +146,15 @@
{
"Name" = "8:Microsoft Visual Studio"
"ProductName" = "8:WitnessRandomizer"
"ProductCode" = "8:{1D8F70FD-4741-4C9F-B0FE-9207F15FEC1A}"
"PackageCode" = "8:{FF874506-B46A-40E9-B6C2-C87CFE189AFF}"
"ProductCode" = "8:{9EB4E1F3-2D4E-4D2B-B8AA-B51C12F8149B}"
"PackageCode" = "8:{2D819EE6-D857-426F-A0B0-48CDB593BCD3}"
"UpgradeCode" = "8:{B2AF0F34-4917-4AEC-B892-FE4FD4B9584A}"
"AspNetVersion" = "8:2.0.50727.0"
"RestartWWWService" = "11:FALSE"
"RemovePreviousVersions" = "11:FALSE"
"RemovePreviousVersions" = "11:TRUE"
"DetectNewerInstalledVersion" = "11:TRUE"
"InstallAllUsers" = "11:FALSE"
"ProductVersion" = "8:1.0.1"
"ProductVersion" = "8:1.0.2"
"Manufacturer" = "8:jbzdarkid"
"ARPHELPTELEPHONE" = "8:"
"ARPHELPLINK" = "8:"
Expand Down

0 comments on commit 2ec60cc

Please sign in to comment.