summary refs log tree commit diff stats
path: root/Source/Randomizer.cpp
diff options
context:
space:
mode:
authorjbzdarkid <jbzdarkid@gmail.com>2019-11-08 09:13:28 -0800
committerjbzdarkid <jbzdarkid@gmail.com>2019-11-08 09:14:09 -0800
commit0e6b61f87b676028fcfd75bbf576f48a0ef91632 (patch)
treef727207008e55cc3d56ea549206d09705037f153 /Source/Randomizer.cpp
parent0f568de726da77bfb0964f20d5be6691245b3da9 (diff)
downloadwitness-tutorializer-0e6b61f87b676028fcfd75bbf576f48a0ef91632.tar.gz
witness-tutorializer-0e6b61f87b676028fcfd75bbf576f48a0ef91632.tar.bz2
witness-tutorializer-0e6b61f87b676028fcfd75bbf576f48a0ef91632.zip
Add orchard + transparent swapping
Diffstat (limited to 'Source/Randomizer.cpp')
-rw-r--r--Source/Randomizer.cpp18
1 files changed, 16 insertions, 2 deletions
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() {
139 139
140 // Individual area modifications 140 // Individual area modifications
141 RandomizeTutorial(); 141 RandomizeTutorial();
142 RandomizeSymmetry();
143 RandomizeDesert(); 142 RandomizeDesert();
144 RandomizeQuarry(); 143 RandomizeQuarry();
145 RandomizeTreehouse(); 144 RandomizeTreehouse();
146 RandomizeKeep(); 145 RandomizeKeep();
147 RandomizeShadows(); 146 RandomizeShadows();
148 RandomizeTown();
149 RandomizeMonastery(); 147 RandomizeMonastery();
150 RandomizeBunker(); 148 RandomizeBunker();
151 RandomizeJungle(); 149 RandomizeJungle();
152 RandomizeSwamp(); 150 RandomizeSwamp();
153 RandomizeMountain(); 151 RandomizeMountain();
152 RandomizeTown();
153 RandomizeSymmetry();
154 // RandomizeAudioLogs(); 154 // RandomizeAudioLogs();
155} 155}
156 156
@@ -188,6 +188,10 @@ void Randomizer::RandomizeTutorial() {
188} 188}
189 189
190void Randomizer::RandomizeSymmetry() { 190void Randomizer::RandomizeSymmetry() {
191 std::vector<int> randomOrder(transparent.size(), 0);
192 std::iota(randomOrder.begin(), randomOrder.end(), 0);
193 RandomizeRange(randomOrder, SWAP::NONE, 1, 5);
194 ReassignTargets(transparent, randomOrder);
191} 195}
192 196
193void Randomizer::RandomizeDesert() { 197void Randomizer::RandomizeDesert() {
@@ -238,6 +242,16 @@ void Randomizer::RandomizeShadows() {
238} 242}
239 243
240void Randomizer::RandomizeTown() { 244void Randomizer::RandomizeTown() {
245 // @Hack...? To open the gate at the end
246 std::vector<int> randomOrder(orchard.size() + 1, 0);
247 std::iota(randomOrder.begin(), randomOrder.end(), 0);
248 RandomizeRange(randomOrder, SWAP::NONE, 1, 5);
249 // Ensure that we open the gate before the final puzzle (by swapping)
250 int panel3Index = find(randomOrder, 3);
251 int panel4Index = find(randomOrder, 4);
252 randomOrder[min(panel3Index, panel4Index)] = 3;
253 randomOrder[max(panel3Index, panel4Index)] = 4;
254 ReassignTargets(orchard, randomOrder);
241} 255}
242 256
243void Randomizer::RandomizeMonastery() { 257void Randomizer::RandomizeMonastery() {