Zillion: fix empty 1st Sphere (#1770)

There was a low probability that the Zillion 1st sphere could be empty.
caused this test failure: https://github.com/ArchipelagoMW/Archipelago/actions/runs/4791795268/jobs/8522615992
This commit is contained in:
Doug Hoskisson 2023-04-25 22:24:47 -07:00 committed by GitHub
parent 173513c9f4
commit 22ed7ff9c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

View File

@ -147,6 +147,16 @@ class ZillionWorld(World):
self.my_locations = []
self.zz_system.randomizer.place_canister_gun_reqs()
# low probability that place_canister_gun_reqs() results in empty 1st sphere
# testing code to force low probability event:
# for zz_room_name in ["r01c2", "r02c0", "r02c7", "r03c5"]:
# for zz_loc in self.zz_system.randomizer.regions[zz_room_name].locations:
# zz_loc.req.gun = 2
if len(self.zz_system.randomizer.get_locations(Req(gun=1, jump=1))) == 0:
self.logger.info("Zillion avoided rare empty 1st sphere.")
for zz_loc in self.zz_system.randomizer.regions["r03c5"].locations:
zz_loc.req.gun = 1
assert len(self.zz_system.randomizer.get_locations(Req(gun=1, jump=1))) != 0
start = self.zz_system.randomizer.regions['start']