Stardew Valley: Refactor Animals to use Content Packs (#4320)
This commit is contained in:
@@ -1,15 +1,19 @@
|
||||
from .pelican_town import pelican_town as pelican_town_content_pack
|
||||
from ..game_content import ContentPack, StardewContent
|
||||
from ...data import villagers_data, fish_data
|
||||
from ...data.game_item import ItemTag, Tag
|
||||
from ...data.animal import Animal, AnimalName, OstrichIncubatorSource
|
||||
from ...data.game_item import ItemTag, Tag, CustomRuleSource
|
||||
from ...data.harvest import ForagingSource, HarvestFruitTreeSource, HarvestCropSource
|
||||
from ...data.requirement import WalnutRequirement
|
||||
from ...data.shop import ShopSource
|
||||
from ...strings.animal_product_names import AnimalProduct
|
||||
from ...strings.book_names import Book
|
||||
from ...strings.building_names import Building
|
||||
from ...strings.crop_names import Fruit, Vegetable
|
||||
from ...strings.fish_names import Fish
|
||||
from ...strings.forageable_names import Forageable, Mushroom
|
||||
from ...strings.fruit_tree_names import Sapling
|
||||
from ...strings.generic_names import Generic
|
||||
from ...strings.metal_names import Fossil, Mineral
|
||||
from ...strings.region_names import Region, LogicRegion
|
||||
from ...strings.season_names import Season
|
||||
@@ -51,6 +55,13 @@ ginger_island_content_pack = GingerIslandContentPack(
|
||||
Vegetable.taro_root: (HarvestCropSource(seed=Seed.taro, seasons=(Season.summer,)),),
|
||||
Fruit.pineapple: (HarvestCropSource(seed=Seed.pineapple, seasons=(Season.summer,)),),
|
||||
|
||||
# Temporary animal stuff, will be moved once animal products are properly content-packed
|
||||
AnimalProduct.ostrich_egg_starter: (CustomRuleSource(lambda logic: logic.tool.can_forage(Generic.any, Region.island_north, True)
|
||||
& logic.has(Forageable.journal_scrap)
|
||||
& logic.region.can_reach(Region.volcano_floor_5)),),
|
||||
AnimalProduct.ostrich_egg: (CustomRuleSource(lambda logic: logic.has(AnimalProduct.ostrich_egg_starter)
|
||||
| logic.animal.has_animal(AnimalName.ostrich)),),
|
||||
|
||||
},
|
||||
shop_sources={
|
||||
Seed.taro: (ShopSource(items_price=((2, Fossil.bone_fragment),), shop_region=Region.island_trader),),
|
||||
@@ -81,5 +92,12 @@ ginger_island_content_pack = GingerIslandContentPack(
|
||||
),
|
||||
villagers=(
|
||||
villagers_data.leo,
|
||||
),
|
||||
animals=(
|
||||
Animal(AnimalName.ostrich,
|
||||
required_building=Building.barn,
|
||||
sources=(
|
||||
OstrichIncubatorSource(AnimalProduct.ostrich_egg_starter),
|
||||
)),
|
||||
)
|
||||
)
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
from .pelican_town import pelican_town as pelican_town_content_pack
|
||||
from ..game_content import ContentPack
|
||||
from ...data.animal import IncubatorSource, Animal, AnimalName
|
||||
from ...data.harvest import FruitBatsSource, MushroomCaveSource
|
||||
from ...data.shop import ShopSource
|
||||
from ...strings.animal_product_names import AnimalProduct
|
||||
from ...strings.building_names import Building
|
||||
from ...strings.forageable_names import Forageable, Mushroom
|
||||
from ...strings.region_names import Region
|
||||
|
||||
the_farm = ContentPack(
|
||||
"The Farm (Vanilla)",
|
||||
@@ -39,5 +44,64 @@ the_farm = ContentPack(
|
||||
Mushroom.red: (
|
||||
MushroomCaveSource(),
|
||||
),
|
||||
}
|
||||
},
|
||||
animals=(
|
||||
Animal(AnimalName.chicken,
|
||||
required_building=Building.coop,
|
||||
sources=(
|
||||
ShopSource(shop_region=Region.ranch, money_price=800),
|
||||
# For now there is no way to obtain the starter item, so this adds additional rules in the system for nothing.
|
||||
# IncubatorSource(AnimalProduct.egg_starter)
|
||||
)),
|
||||
Animal(AnimalName.cow,
|
||||
required_building=Building.barn,
|
||||
sources=(
|
||||
ShopSource(shop_region=Region.ranch, money_price=1500),
|
||||
)),
|
||||
Animal(AnimalName.goat,
|
||||
required_building=Building.big_barn,
|
||||
sources=(
|
||||
ShopSource(shop_region=Region.ranch, money_price=4000),
|
||||
)),
|
||||
Animal(AnimalName.duck,
|
||||
required_building=Building.big_coop,
|
||||
sources=(
|
||||
ShopSource(shop_region=Region.ranch, money_price=1200),
|
||||
# For now there is no way to obtain the starter item, so this adds additional rules in the system for nothing.
|
||||
# IncubatorSource(AnimalProduct.duck_egg_starter)
|
||||
)),
|
||||
Animal(AnimalName.sheep,
|
||||
required_building=Building.deluxe_barn,
|
||||
sources=(
|
||||
ShopSource(shop_region=Region.ranch, money_price=8000),
|
||||
)),
|
||||
Animal(AnimalName.rabbit,
|
||||
required_building=Building.deluxe_coop,
|
||||
sources=(
|
||||
ShopSource(shop_region=Region.ranch, money_price=8000),
|
||||
)),
|
||||
Animal(AnimalName.pig,
|
||||
required_building=Building.deluxe_barn,
|
||||
sources=(
|
||||
ShopSource(shop_region=Region.ranch, money_price=16000),
|
||||
)),
|
||||
Animal(AnimalName.void_chicken,
|
||||
required_building=Building.big_coop,
|
||||
sources=(
|
||||
IncubatorSource(AnimalProduct.void_egg_starter),
|
||||
)),
|
||||
Animal(AnimalName.golden_chicken,
|
||||
required_building=Building.big_coop,
|
||||
sources=(
|
||||
IncubatorSource(AnimalProduct.golden_egg_starter),
|
||||
)),
|
||||
Animal(AnimalName.dinosaur,
|
||||
required_building=Building.big_coop,
|
||||
sources=(
|
||||
# We should use the starter item here, but since the dinosaur egg is also an artifact, it's part of the museum rules
|
||||
# and I do not want to touch it yet.
|
||||
# IncubatorSource(AnimalProduct.dinosaur_egg_starter),
|
||||
IncubatorSource(AnimalProduct.dinosaur_egg),
|
||||
)),
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user