From ca04c5b67843baf2f20b0f923f6b0c0c51ae5fa4 Mon Sep 17 00:00:00 2001 From: Alex Gilbert Date: Mon, 5 Aug 2024 17:06:39 -0400 Subject: [PATCH] - Use the compound source of the monster compoundium (ironic, I know) --- worlds/stardew_valley/content/vanilla/pelican_town.py | 8 +++++--- worlds/stardew_valley/test/__init__.py | 4 ++-- worlds/stardew_valley/test/rules/TestBooks.py | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/worlds/stardew_valley/content/vanilla/pelican_town.py b/worlds/stardew_valley/content/vanilla/pelican_town.py index 220b46eae2a4..73cc8f119a3e 100644 --- a/worlds/stardew_valley/content/vanilla/pelican_town.py +++ b/worlds/stardew_valley/content/vanilla/pelican_town.py @@ -1,6 +1,6 @@ from ..game_content import ContentPack from ...data import villagers_data, fish_data -from ...data.game_item import GenericSource, ItemTag, Tag, CustomRuleSource +from ...data.game_item import GenericSource, ItemTag, Tag, CustomRuleSource, CompoundSource from ...data.harvest import ForagingSource, SeasonalForagingSource, ArtifactSpotSource from ...data.requirement import ToolRequirement, BookRequirement, SkillRequirement, SeasonRequirement from ...data.shop import ShopSource, MysteryBoxSource, ArtifactTroveSource, PrizeMachineSource, FishingTreasureChestSource @@ -229,8 +229,10 @@ ShopSource(money_price=20000, shop_region=LogicRegion.bookseller_3),), Book.mapping_cave_systems: ( Tag(ItemTag.BOOK, ItemTag.BOOK_POWER), - GenericSource(regions=(Region.adventurer_guild_bedroom,)), - ShopSource(money_price=20000, shop_region=LogicRegion.bookseller_3),), + CompoundSource(sources=( + GenericSource(regions=(Region.adventurer_guild_bedroom,)), + ShopSource(money_price=20000, shop_region=LogicRegion.bookseller_3), + ))), Book.monster_compendium: ( Tag(ItemTag.BOOK, ItemTag.BOOK_POWER), CustomRuleSource(create_rule=lambda logic: logic.monster.can_kill_many(Generic.any)), diff --git a/worlds/stardew_valley/test/__init__.py b/worlds/stardew_valley/test/__init__.py index 7e82ea91e434..0eae151dd378 100644 --- a/worlds/stardew_valley/test/__init__.py +++ b/worlds/stardew_valley/test/__init__.py @@ -256,9 +256,9 @@ def run_default_tests(self) -> bool: return False return super().run_default_tests - def collect_lots_of_money(self): + def collect_lots_of_money(self, percent: float = 0.25): self.multiworld.state.collect(self.world.create_item("Shipping Bin"), event=False) - required_prog_items = int(round(self.multiworld.worlds[self.player].total_progression_items * 0.25)) + required_prog_items = int(round(self.multiworld.worlds[self.player].total_progression_items * percent)) for i in range(required_prog_items): self.multiworld.state.collect(self.world.create_item("Stardrop"), event=False) diff --git a/worlds/stardew_valley/test/rules/TestBooks.py b/worlds/stardew_valley/test/rules/TestBooks.py index 41eb86b90f19..c7872daec6c5 100644 --- a/worlds/stardew_valley/test/rules/TestBooks.py +++ b/worlds/stardew_valley/test/rules/TestBooks.py @@ -8,7 +8,7 @@ class TestBooksLogic(SVTestBase): } def test_need_weapon_for_mapping_cave_systems(self): - self.collect_all_the_money() + self.collect_lots_of_money(0.5) location = self.multiworld.get_location("Read Mapping Cave Systems", self.player)