Core: recontextualize CollectionState.collect (#3723)

* Core: renamed `CollectionState.collect` arg from `event` to `prevent_sweep` and remove forced collection

* Update TestDungeon.py

---------

Co-authored-by: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com>
This commit is contained in:
Aaron Wagener
2024-08-13 15:28:05 -05:00
committed by GitHub
parent dcaa2f7b97
commit 96d48a923a
19 changed files with 146 additions and 150 deletions

View File

@@ -23,11 +23,11 @@ class TestBuildingLogic(SVTestBase):
self.assertFalse(big_coop_blueprint_rule(self.multiworld.state),
f"Rule is {repr(self.multiworld.get_location('Big Coop Blueprint', self.player).access_rule)}")
self.multiworld.state.collect(self.create_item("Can Construct Buildings"), event=True)
self.multiworld.state.collect(self.create_item("Can Construct Buildings"), prevent_sweep=True)
self.assertFalse(big_coop_blueprint_rule(self.multiworld.state),
f"Rule is {repr(self.multiworld.get_location('Big Coop Blueprint', self.player).access_rule)}")
self.multiworld.state.collect(self.create_item("Progressive Coop"), event=False)
self.multiworld.state.collect(self.create_item("Progressive Coop"), prevent_sweep=False)
self.assertTrue(big_coop_blueprint_rule(self.multiworld.state),
f"Rule is {repr(self.multiworld.get_location('Big Coop Blueprint', self.player).access_rule)}")
@@ -35,13 +35,13 @@ class TestBuildingLogic(SVTestBase):
self.assertFalse(self.world.logic.region.can_reach_location("Deluxe Coop Blueprint")(self.multiworld.state))
self.collect_lots_of_money()
self.multiworld.state.collect(self.create_item("Can Construct Buildings"), event=True)
self.multiworld.state.collect(self.create_item("Can Construct Buildings"), prevent_sweep=True)
self.assertFalse(self.world.logic.region.can_reach_location("Deluxe Coop Blueprint")(self.multiworld.state))
self.multiworld.state.collect(self.create_item("Progressive Coop"), event=True)
self.multiworld.state.collect(self.create_item("Progressive Coop"), prevent_sweep=True)
self.assertFalse(self.world.logic.region.can_reach_location("Deluxe Coop Blueprint")(self.multiworld.state))
self.multiworld.state.collect(self.create_item("Progressive Coop"), event=True)
self.multiworld.state.collect(self.create_item("Progressive Coop"), prevent_sweep=True)
self.assertTrue(self.world.logic.region.can_reach_location("Deluxe Coop Blueprint")(self.multiworld.state))
def test_big_shed_blueprint(self):
@@ -53,10 +53,10 @@ class TestBuildingLogic(SVTestBase):
self.assertFalse(big_shed_rule(self.multiworld.state),
f"Rule is {repr(self.multiworld.get_location('Big Shed Blueprint', self.player).access_rule)}")
self.multiworld.state.collect(self.create_item("Can Construct Buildings"), event=True)
self.multiworld.state.collect(self.create_item("Can Construct Buildings"), prevent_sweep=True)
self.assertFalse(big_shed_rule(self.multiworld.state),
f"Rule is {repr(self.multiworld.get_location('Big Shed Blueprint', self.player).access_rule)}")
self.multiworld.state.collect(self.create_item("Progressive Shed"), event=True)
self.multiworld.state.collect(self.create_item("Progressive Shed"), prevent_sweep=True)
self.assertTrue(big_shed_rule(self.multiworld.state),
f"Rule is {repr(self.multiworld.get_location('Big Shed Blueprint', self.player).access_rule)}")