From 22ed7ff9c3efca8c8cbc9040d9ecf328cce300b7 Mon Sep 17 00:00:00 2001 From: Doug Hoskisson Date: Tue, 25 Apr 2023 22:24:47 -0700 Subject: [PATCH] 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 --- worlds/zillion/__init__.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/worlds/zillion/__init__.py b/worlds/zillion/__init__.py index 241cb452..e52e7300 100644 --- a/worlds/zillion/__init__.py +++ b/worlds/zillion/__init__.py @@ -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']