Files
Grinch-AP/worlds/stardew_valley/data/shop.py
Witchybun 205ca7fa37 Stardew Valley: Fix Daggerfish, Cropsanity; Move Some Rules to Content Packs; Add Missing Shipsanity Location (#3626)
* Fix logic bug on daggerfish

* Make new region for pond.

* Fix SVE logic for crops

* Fix Distant Lands Cropsanity

* Fix failing tests.

* Reverting removing these for now.

* Fix bugs, add combat requirement

* convert str into tuple directly

* add ginger island to mod tests

* Move a lot of mod item logic to content pack

* Gut the rules from DL while we're at it.

* Import nuke

* Fix alecto

* Move back some rules for now.

* Move archaeology rules

* Add some comments why its done.

* Clean up archaeology and fix sve

* Moved dulse to water item class

* Remove digging like worms for now

* fix

* Add missing shipsanity location

* Move background names around or something idk

* Revert ArchaeologyTrash for now

---------

Co-authored-by: Jouramie <jouramie@hotmail.com>
2024-07-25 09:22:46 +02:00

41 lines
1.1 KiB
Python

from dataclasses import dataclass
from typing import Tuple, Optional
from .game_item import ItemSource, kw_only, Requirement
from ..strings.season_names import Season
ItemPrice = Tuple[int, str]
@dataclass(frozen=True, **kw_only)
class ShopSource(ItemSource):
shop_region: str
money_price: Optional[int] = None
items_price: Optional[Tuple[ItemPrice, ...]] = None
seasons: Tuple[str, ...] = Season.all
other_requirements: Tuple[Requirement, ...] = ()
def __post_init__(self):
assert self.money_price is not None or self.items_price is not None, "At least money price or items price need to be defined."
assert self.items_price is None or all(isinstance(p, tuple) for p in self.items_price), "Items price should be a tuple."
@dataclass(frozen=True, **kw_only)
class MysteryBoxSource(ItemSource):
amount: int
@dataclass(frozen=True, **kw_only)
class ArtifactTroveSource(ItemSource):
amount: int
@dataclass(frozen=True, **kw_only)
class PrizeMachineSource(ItemSource):
amount: int
@dataclass(frozen=True, **kw_only)
class FishingTreasureChestSource(ItemSource):
amount: int