Zillion: fix unreproducible seeds (#1166)
* fix zillion unreproducible seeds * world to multiworld merge
This commit is contained in:
parent
95ea0541e6
commit
962e48c078
|
@ -9,7 +9,7 @@ from worlds.AutoWorld import call_all
|
||||||
|
|
||||||
class WorldTestBase(unittest.TestCase):
|
class WorldTestBase(unittest.TestCase):
|
||||||
options: typing.Dict[str, typing.Any] = {}
|
options: typing.Dict[str, typing.Any] = {}
|
||||||
world: MultiWorld
|
multiworld: MultiWorld
|
||||||
|
|
||||||
game: typing.ClassVar[str] # define game name in subclass, example "Secret of Evermore"
|
game: typing.ClassVar[str] # define game name in subclass, example "Secret of Evermore"
|
||||||
auto_construct: typing.ClassVar[bool] = True
|
auto_construct: typing.ClassVar[bool] = True
|
||||||
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
from typing import cast
|
||||||
|
from test.worlds.zillion import ZillionTestBase
|
||||||
|
|
||||||
|
from worlds.zillion import ZillionWorld
|
||||||
|
|
||||||
|
|
||||||
|
class SeedTest(ZillionTestBase):
|
||||||
|
auto_construct = False
|
||||||
|
|
||||||
|
def test_reproduce_seed(self) -> None:
|
||||||
|
self.world_setup(42)
|
||||||
|
z_world = cast(ZillionWorld, self.multiworld.worlds[1])
|
||||||
|
r = z_world.zz_system.randomizer
|
||||||
|
assert r
|
||||||
|
randomized_requirements_first = tuple(
|
||||||
|
location.req.gun
|
||||||
|
for location in r.locations.values()
|
||||||
|
)
|
||||||
|
|
||||||
|
self.world_setup(42)
|
||||||
|
z_world = cast(ZillionWorld, self.multiworld.worlds[1])
|
||||||
|
r = z_world.zz_system.randomizer
|
||||||
|
assert r
|
||||||
|
randomized_requirements_second = tuple(
|
||||||
|
location.req.gun
|
||||||
|
for location in r.locations.values()
|
||||||
|
)
|
||||||
|
|
||||||
|
assert randomized_requirements_first == randomized_requirements_second
|
|
@ -133,6 +133,7 @@ class ZillionWorld(World):
|
||||||
self.zz_system.make_patcher(rom_dir_name)
|
self.zz_system.make_patcher(rom_dir_name)
|
||||||
self.zz_system.make_randomizer(zz_op)
|
self.zz_system.make_randomizer(zz_op)
|
||||||
|
|
||||||
|
self.zz_system.seed(self.multiworld.seed)
|
||||||
self.zz_system.make_map()
|
self.zz_system.make_map()
|
||||||
|
|
||||||
# just in case the options changed anything (I don't think they do)
|
# just in case the options changed anything (I don't think they do)
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
git+https://github.com/beauxq/zilliandomizer@c97298ecb1bca58c3dd3376a1e1609fad53788cf#egg=zilliandomizer==0.4.5
|
git+https://github.com/beauxq/zilliandomizer@10549a126b3293595ddb6816b896c1f88ce344c5#egg=zilliandomizer==0.4.6
|
||||||
|
|
Loading…
Reference in New Issue