From 0e6b61f87b676028fcfd75bbf576f48a0ef91632 Mon Sep 17 00:00:00 2001 From: jbzdarkid Date: Fri, 8 Nov 2019 09:13:28 -0800 Subject: Add orchard + transparent swapping --- App/Version.h | 4 ++-- Installer/Installer.vdproj | 14 +++++++++++--- Source/Memory.h | 4 ++-- Source/Panel.cpp | 2 ++ Source/Panels.h | 29 ++++++++++++++++------------- Source/Randomizer.cpp | 18 ++++++++++++++++-- 6 files changed, 49 insertions(+), 22 deletions(-) diff --git a/App/Version.h b/App/Version.h index 32753aa..8068f03 100644 --- a/App/Version.h +++ b/App/Version.h @@ -4,8 +4,8 @@ #define TO_STRING(s) TO_STRING2(s) #define MAJOR 5 -#define MINOR 1 -#define PATCH 1 +#define MINOR 2 +#define PATCH 0 #define VERSION_STR TO_STRING(MAJOR) L"." TO_STRING(MINOR) L"." TO_STRING(PATCH) #define VERSION MAJOR, MINOR, PATCH diff --git a/Installer/Installer.vdproj b/Installer/Installer.vdproj index de202fb..e791590 100644 --- a/Installer/Installer.vdproj +++ b/Installer/Installer.vdproj @@ -44,6 +44,14 @@ "PrerequisitesLocation" = "2:1" "Url" = "8:" "ComponentsUrl" = "8:" + "Items" + { + "{EDC2488A-8267-493A-A98E-7D9C3B36CDF3}:.NETFramework,Version=v4.6.1" + { + "Name" = "8:Microsoft .NET Framework 4.6.1 (x86 and x64)" + "ProductCode" = "8:.NETFramework,Version=v4.6.1" + } + } } } "Release" @@ -154,15 +162,15 @@ { "Name" = "8:Microsoft Visual Studio" "ProductName" = "8:Witness Randomizer" - "ProductCode" = "8:{BF672BB2-4FD0-44B6-B279-C5F7346649DC}" - "PackageCode" = "8:{F55A05A7-103A-4E8D-B88F-94C00188B9A6}" + "ProductCode" = "8:{5A3C6188-EA4B-4FEE-94EE-BF7D91681792}" + "PackageCode" = "8:{E8C66354-4ED4-4958-9D6C-A0DC3BD6C3EA}" "UpgradeCode" = "8:{4CB5496B-A47E-41D3-B4A7-677E29AB7513}" "AspNetVersion" = "8:2.0.50727.0" "RestartWWWService" = "11:FALSE" "RemovePreviousVersions" = "11:TRUE" "DetectNewerInstalledVersion" = "11:TRUE" "InstallAllUsers" = "11:FALSE" - "ProductVersion" = "8:5.1.1" + "ProductVersion" = "8:5.2.0" "Manufacturer" = "8:jbzdarkid" "ARPHELPTELEPHONE" = "8:" "ARPHELPLINK" = "8:https://www.github.com/jbzdarkid/witness-randomizer/issues" diff --git a/Source/Memory.h b/Source/Memory.h index 6e0c7b1..c19d92b 100644 --- a/Source/Memory.h +++ b/Source/Memory.h @@ -5,8 +5,8 @@ #include #include -#define GLOBALS 0x5B28C0 -// #define GLOBALS 0x62D0A0 +// #define GLOBALS 0x5B28C0 +#define GLOBALS 0x62D0A0 #define HEARTBEAT 0x401 enum class ProcStatus { diff --git a/Source/Panel.cpp b/Source/Panel.cpp index ea65142..43e9763 100644 --- a/Source/Panel.cpp +++ b/Source/Panel.cpp @@ -4,6 +4,8 @@ #include "Randomizer.h" #include +#pragma warning (disable:26451) + template int find(const std::vector &data, T search, size_t startIndex = 0) { for (size_t i=startIndex ; i junglePanels = { 0x03616, // Jungle Laser }; - std::vector audiologs = { 0x3C0F7, // Boat Treehouse Rock 0x3C0FD, // Boat Broken Boat @@ -610,6 +609,22 @@ std::vector audiologs = { // 0x338CA, // UTM Invisible Dots }; +std::vector orchard { + 0x00143, // Orchard Apple Tree 1 + 0x0003B, // Orchard Apple Tree 2 + 0x00055, // Orchard Apple Tree 3 + 0x032F7, // Orchard Apple Tree 4 + 0x032FF, // Orchard Apple Tree 5 +}; + +std::vector transparent { + 0x009B8, // Symmetry Island Transparent 1 + 0x003E8, // Symmetry Island Transparent 2 + 0x00A15, // Symmetry Island Transparent 3 + 0x00B53, // Symmetry Island Transparent 4 + 0x00B8D, // Symmetry Island Transparent 5 +}; + // There might be something to do with these, I haven't decided yet. std::vector nothingPanels = { // Doors & Shortcuts & Shortcut doors & Door controls @@ -671,18 +686,6 @@ std::vector nothingPanels = { 0x09DB8, // Swamp Summon Boat 0x17CDF, // Jungle Summon Boat -// Identical sets - 0x00143, // Orchard Apple Tree 1 - 0x0003B, // Orchard Apple Tree 2 - 0x00055, // Orchard Apple Tree 3 - 0x032F7, // Orchard Apple Tree 4 - 0x032FF, // Orchard Apple Tree 5 - 0x009B8, // Symmetry Island Transparent 1 - 0x003E8, // Symmetry Island Transparent 2 - 0x00A15, // Symmetry Island Transparent 3 - 0x00B53, // Symmetry Island Transparent 4 - 0x00B8D, // Symmetry Island Transparent 5 - // Misc 0x03629, // Tutorial Gate Open 0x09FAA, // Desert Lightswitch diff --git a/Source/Randomizer.cpp b/Source/Randomizer.cpp index 9b877cd..14583f8 100644 --- a/Source/Randomizer.cpp +++ b/Source/Randomizer.cpp @@ -139,18 +139,18 @@ void Randomizer::Randomize() { // Individual area modifications RandomizeTutorial(); - RandomizeSymmetry(); RandomizeDesert(); RandomizeQuarry(); RandomizeTreehouse(); RandomizeKeep(); RandomizeShadows(); - RandomizeTown(); RandomizeMonastery(); RandomizeBunker(); RandomizeJungle(); RandomizeSwamp(); RandomizeMountain(); + RandomizeTown(); + RandomizeSymmetry(); // RandomizeAudioLogs(); } @@ -188,6 +188,10 @@ void Randomizer::RandomizeTutorial() { } void Randomizer::RandomizeSymmetry() { + std::vector randomOrder(transparent.size(), 0); + std::iota(randomOrder.begin(), randomOrder.end(), 0); + RandomizeRange(randomOrder, SWAP::NONE, 1, 5); + ReassignTargets(transparent, randomOrder); } void Randomizer::RandomizeDesert() { @@ -238,6 +242,16 @@ void Randomizer::RandomizeShadows() { } void Randomizer::RandomizeTown() { + // @Hack...? To open the gate at the end + std::vector randomOrder(orchard.size() + 1, 0); + std::iota(randomOrder.begin(), randomOrder.end(), 0); + RandomizeRange(randomOrder, SWAP::NONE, 1, 5); + // Ensure that we open the gate before the final puzzle (by swapping) + int panel3Index = find(randomOrder, 3); + int panel4Index = find(randomOrder, 4); + randomOrder[min(panel3Index, panel4Index)] = 3; + randomOrder[max(panel3Index, panel4Index)] = 4; + ReassignTargets(orchard, randomOrder); } void Randomizer::RandomizeMonastery() { -- cgit 1.4.1