Skip to content

Commit 7069c38

Browse files
committed
More tweaks to cave shuffle
Mitigated a potential unwinnable situation. Fixed a grammatical error in output.
1 parent c72dd20 commit 7069c38

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

dwrandomizer.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def randomize(args):
3232
rom_data = bytearray(input_file.read())
3333

3434
if args.force:
35-
print("Verifying checksums...")
35+
print("Verifying checksum...")
3636
result = verify_checksum(rom_data)
3737
if result is False:
3838
print("Checksum does not match any known ROM, aborting.")
@@ -43,7 +43,7 @@ def randomize(args):
4343
prg = "PRG%d" % result
4444

4545
else:
46-
print("Skipping checksums...")
46+
print("Skipping checksum...")
4747

4848
print("Fixing functionality of the fighter's ring (+2 atk)...")
4949
rom_data = fix_fighters_ring(rom_data)
@@ -202,11 +202,12 @@ def shuffle_towns(warp_data):
202202
warp_data[210:213]]
203203
random.shuffle(towns)
204204
random.shuffle(caves)
205-
# if rimuldar is in the normal spot...
206-
if (towns[3][0] == 11):
207-
#make sure the rimuldar cave doesn't end up in garinham or tantegel
208-
while (24 in (caves[3][0], caves[5][0], caves[6][0])):
209-
random.shuffle(caves)
205+
# make sure the rimuldar cave isn't inaccessible
206+
# this could happen if it ends up in southern shrine position or
207+
# behind a locked door when rimuldar is in it's normal location.
208+
while (caves[3][0] == 24 or
209+
(towns[3][0] == 11 and 24 in (caves[5][0], caves[6][0]))):
210+
random.shuffle(caves)
210211
warp_data[153:156] = towns[0]
211212
warp_data[159:162] = towns[1]
212213
warp_data[162:165] = towns[2]

0 commit comments

Comments
 (0)