diff --git a/worlds/stardew_valley/content/__init__.py b/worlds/stardew_valley/content/__init__.py index 9130873fa405..3d431b0c7933 100644 --- a/worlds/stardew_valley/content/__init__.py +++ b/worlds/stardew_valley/content/__init__.py @@ -1,8 +1,9 @@ from . import content_packs -from .feature import cropsanity, friendsanity, fishsanity, booksanity +from .feature import cropsanity, friendsanity, fishsanity, booksanity, building_progression from .game_content import ContentPack, StardewContent, StardewFeatures from .unpacking import unpack_content from .. import options +from ..strings.building_names import Building def create_content(player_options: options.StardewValleyOptions) -> StardewContent: @@ -105,3 +106,27 @@ def choose_friendsanity(friendsanity_option: options.Friendsanity, heart_size: o return friendsanity.FriendsanityAllWithMarriage(heart_size.value) raise ValueError(f"No friendsanity feature mapped to {str(friendsanity_option.value)}") + + +building_progression_by_option = { + options.BuildingProgression.option_vanilla: building_progression.BuildingProgressionVanilla({Building.farm_house}), +} + + +def choose_building_progression(option: options.BuildingProgression) -> building_progression.BuildingProgressionFeature: + if option == options.BuildingProgression.option_vanilla: + return building_progression + + if friendsanity_option == options.Friendsanity.option_bachelors: + return friendsanity.FriendsanityBachelors(heart_size.value) + + if friendsanity_option == options.Friendsanity.option_starting_npcs: + return friendsanity.FriendsanityStartingNpc(heart_size.value) + + if friendsanity_option == options.Friendsanity.option_all: + return friendsanity.FriendsanityAll(heart_size.value) + + if friendsanity_option == options.Friendsanity.option_all_with_marriage: + return friendsanity.FriendsanityAllWithMarriage(heart_size.value) + + raise ValueError(f"No friendsanity feature mapped to {str(friendsanity_option.value)}") diff --git a/worlds/stardew_valley/content/feature/__init__.py b/worlds/stardew_valley/content/feature/__init__.py index 74249c808257..459c6661ba06 100644 --- a/worlds/stardew_valley/content/feature/__init__.py +++ b/worlds/stardew_valley/content/feature/__init__.py @@ -1,4 +1,5 @@ from . import booksanity +from . import building_progression from . import cropsanity from . import fishsanity from . import friendsanity diff --git a/worlds/stardew_valley/content/feature/building_progression.py b/worlds/stardew_valley/content/feature/building_progression.py new file mode 100644 index 000000000000..bcadbe5d81c4 --- /dev/null +++ b/worlds/stardew_valley/content/feature/building_progression.py @@ -0,0 +1,18 @@ +from abc import ABC +from dataclasses import dataclass +from typing import ClassVar, Set + + +@dataclass(frozen=True) +class BuildingProgressionFeature(ABC): + is_progressive: ClassVar[bool] + starting_buildings: Set[str] + price_multiplier: float = 1.0 + + +class BuildingProgressionVanilla(BuildingProgressionFeature): + is_progressive = False + + +class BuildingProgressionProgressive(BuildingProgressionFeature): + is_progressive = True diff --git a/worlds/stardew_valley/strings/building_names.py b/worlds/stardew_valley/strings/building_names.py index b67808febc24..92457eb7366b 100644 --- a/worlds/stardew_valley/strings/building_names.py +++ b/worlds/stardew_valley/strings/building_names.py @@ -14,6 +14,7 @@ class Building: stable = "Stable" well = "Well" shipping_bin = "Shipping Bin" + farm_house = "Farm House" kitchen = "Kitchen" kids_room = "Kids Room" cellar = "Cellar" diff --git a/worlds/stardew_valley/test/TestFarmType.py b/worlds/stardew_valley/test/TestFarmType.py index f78edc3eece8..32438badfcc8 100644 --- a/worlds/stardew_valley/test/TestFarmType.py +++ b/worlds/stardew_valley/test/TestFarmType.py @@ -29,3 +29,5 @@ def test_start_inventory_progressive_coops(self): self.assertEqual(items["Progressive Coop"], 2) self.assertIn("Progressive Coop", start_items) self.assertEqual(start_items["Progressive Coop"], 1) + +# TODO test Meadowlands and Coop in BuildingVanilla