diff --git a/worlds/stardew_valley/content/game_content.py b/worlds/stardew_valley/content/game_content.py index 1808abef543e..cd89e40f40de 100644 --- a/worlds/stardew_valley/content/game_content.py +++ b/worlds/stardew_valley/content/game_content.py @@ -21,6 +21,7 @@ class StardewContent: game_items: Dict[str, GameItem] = field(default_factory=dict) fishes: Dict[str, FishItem] = field(default_factory=dict) villagers: Dict[str, Villager] = field(default_factory=dict) + farm_buildings: Dict[str, Building] = field(default_factory=dict) skills: Dict[str, Skill] = field(default_factory=dict) quests: Dict[str, Any] = field(default_factory=dict) diff --git a/worlds/stardew_valley/content/unpacking.py b/worlds/stardew_valley/content/unpacking.py index c80d5966b35e..3d71ce991573 100644 --- a/worlds/stardew_valley/content/unpacking.py +++ b/worlds/stardew_valley/content/unpacking.py @@ -65,6 +65,10 @@ def register_pack(content: StardewContent, pack: ContentPack): content.villagers[villager.name] = villager pack.villager_hook(content) + for building in pack.farm_buildings: + content.farm_buildings[building.name] = building + pack.farm_building_hook(content) + for skill in pack.skills: content.skills[skill.name] = skill pack.skill_hook(content) diff --git a/worlds/stardew_valley/content/vanilla/pelican_town.py b/worlds/stardew_valley/content/vanilla/pelican_town.py index 3e882826d0d6..02038bb4a262 100644 --- a/worlds/stardew_valley/content/vanilla/pelican_town.py +++ b/worlds/stardew_valley/content/vanilla/pelican_town.py @@ -1,10 +1,12 @@ from ..game_content import ContentPack from ...data import villagers_data, fish_data +from ...data.building import Building from ...data.game_item import GenericSource, ItemTag, Tag, CustomRuleSource from ...data.harvest import ForagingSource, SeasonalForagingSource, ArtifactSpotSource from ...data.requirement import ToolRequirement, BookRequirement, SkillRequirement, RegionRequirement from ...data.shop import ShopSource, MysteryBoxSource, ArtifactTroveSource, PrizeMachineSource, FishingTreasureChestSource from ...strings.book_names import Book +from ...strings.building_names import Building as BuildingNames from ...strings.crop_names import Fruit from ...strings.fish_names import WaterItem from ...strings.food_names import Beverage, Meal @@ -385,5 +387,40 @@ villagers_data.vincent, villagers_data.willy, villagers_data.wizard, + ), + farm_buildings=( + Building( + BuildingNames.coop, + sources=( + ShopSource( + shop_region=Region.carpenter, + money_price=4000, + items_price=((300, Material.wood), (100, Material.stone)) + ), + # TODO add source for meadowslands farm + ), + ), + Building( + BuildingNames.big_coop, + sources=( + ShopSource( + shop_region=Region.carpenter, + money_price=10_000, + items_price=((400, Material.wood), (150, Material.stone)) + ), + ), + upgrade_from=BuildingNames.coop, + ), + Building( + BuildingNames.deluxe_coop, + sources=( + ShopSource( + shop_region=Region.carpenter, + money_price=20_000, + items_price=((500, Material.wood), (200, Material.stone)) + ), + ), + upgrade_from=BuildingNames.big_coop, + ), ) ) diff --git a/worlds/stardew_valley/data/building.py b/worlds/stardew_valley/data/building.py index 967243dfa27b..ae6e8f37d16a 100644 --- a/worlds/stardew_valley/data/building.py +++ b/worlds/stardew_valley/data/building.py @@ -1,11 +1,11 @@ -from dataclasses import dataclass +from dataclasses import dataclass, field from typing import Optional, Tuple -from .game_item import Source +from .game_item import Source, kw_only @dataclass(frozen=True) class Building: name: str - sources: Tuple[Source, ...] - upgrade_from: Optional[str] = None + sources: Tuple[Source, ...] = field(**kw_only) + upgrade_from: Optional[str] = field(default=None, **kw_only)