Skip to content

Commit

Permalink
simplfy collect methods in test base
Browse files Browse the repository at this point in the history
  • Loading branch information
Jouramie committed Nov 25, 2024
1 parent e18d1c1 commit 1ed82fa
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions worlds/stardew_valley/test/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,20 +255,13 @@ def run_default_tests(self) -> bool:
return super().run_default_tests

def collect_lots_of_money(self, percent: float = 0.25):
self.multiworld.state.collect(self.create_item("Shipping Bin"))
real_total_prog_items = self.multiworld.worlds[self.player].total_progression_items
self.collect("Shipping Bin")
real_total_prog_items = self.world.total_progression_items
required_prog_items = int(round(real_total_prog_items * percent))
for i in range(required_prog_items):
self.multiworld.state.collect(self.create_item("Stardrop"))
self.multiworld.worlds[self.player].total_progression_items = real_total_prog_items
self.collect("Stardrop", required_prog_items)

def collect_all_the_money(self):
self.multiworld.state.collect(self.create_item("Shipping Bin"))
real_total_prog_items = self.multiworld.worlds[self.player].total_progression_items
required_prog_items = int(round(real_total_prog_items * 0.95))
for i in range(required_prog_items):
self.multiworld.state.collect(self.create_item("Stardrop"))
self.multiworld.worlds[self.player].total_progression_items = real_total_prog_items
self.collect_lots_of_money(0.95)

def collect_everything(self):
non_event_items = [item for item in self.multiworld.get_items() if item.code]
Expand Down

0 comments on commit 1ed82fa

Please sign in to comment.