Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Jouramie committed Jul 20, 2024
1 parent f9de5c6 commit 63556a0
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 32 deletions.
6 changes: 3 additions & 3 deletions worlds/stardew_valley/content/vanilla/pelican_town.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@
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),
GenericSource(regions=(Region.adventurer_guild_bedroom,)),
ShopSource(money_price=20000, shop_region=LogicRegion.bookseller_3),),
Book.monster_compendium: (
Tag(ItemTag.BOOK, ItemTag.BOOK_POWER),
Expand All @@ -243,12 +243,12 @@
ShopSource(money_price=3000, shop_region=LogicRegion.bookseller_2),),
Book.the_alleyway_buffet: (
Tag(ItemTag.BOOK, ItemTag.BOOK_POWER),
GenericSource(regions=Region.town,
GenericSource(regions=(Region.town,),
other_requirements=(ToolRequirement(Tool.axe, ToolMaterial.iron), ToolRequirement(Tool.pickaxe, ToolMaterial.iron))),
ShopSource(money_price=20000, shop_region=LogicRegion.bookseller_3),),
Book.the_art_o_crabbing: (
Tag(ItemTag.BOOK, ItemTag.BOOK_POWER),
GenericSource(regions=Region.beach,
GenericSource(regions=(Region.beach,),
other_requirements=(ToolRequirement(Tool.fishing_rod, ToolMaterial.iridium),
SkillRequirement(Skill.fishing, 6),
SeasonRequirement(Season.winter))),
Expand Down
4 changes: 0 additions & 4 deletions worlds/stardew_valley/data/game_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,6 @@ class GenericSource(ItemSource):
"""No region means it's available everywhere."""
other_requirements: Tuple[Requirement, ...] = ()

def __post_init__(self):
if isinstance(self.regions, str):
super().__setattr__("regions", (self.regions,))


@dataclass(frozen=True)
class CustomRuleSource(ItemSource):
Expand Down
20 changes: 0 additions & 20 deletions worlds/stardew_valley/data/harvest.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,6 @@ class ForagingSource(ItemSource):
seasons: Tuple[str, ...] = Season.all
other_requirements: Tuple[Requirement, ...] = ()

def __post_init__(self):
if isinstance(self.regions, str):
super().__setattr__("regions", (self.regions,))
if isinstance(self.seasons, str):
super().__setattr__("seasons", (self.seasons,))
if isinstance(self.other_requirements, Requirement):
super().__setattr__("other_requirements", (self.other_requirements,))


@dataclass(frozen=True, **kw_only)
class SeasonalForagingSource(ItemSource):
Expand All @@ -29,10 +21,6 @@ class SeasonalForagingSource(ItemSource):
def as_foraging_source(self) -> ForagingSource:
return ForagingSource(seasons=(self.season,), regions=self.regions)

def __post_init__(self):
if isinstance(self.regions, str):
super().__setattr__("regions", (self.regions,))


@dataclass(frozen=True, **kw_only)
class FruitBatsSource(ItemSource):
Expand All @@ -51,10 +39,6 @@ class HarvestFruitTreeSource(ItemSource):
sapling: str
seasons: Tuple[str, ...] = Season.all

def __post_init__(self):
if isinstance(self.seasons, str):
super().__setattr__("seasons", (self.seasons,))

@property
def requirement_tags(self) -> Mapping[str, Tuple[ItemTag, ...]]:
return {
Expand All @@ -70,10 +54,6 @@ class HarvestCropSource(ItemSource):
seasons: Tuple[str, ...] = Season.all
"""Empty means it can't be grown on the farm."""

def __post_init__(self):
if isinstance(self.seasons, str):
super().__setattr__("seasons", (self.seasons,))

@property
def requirement_tags(self) -> Mapping[str, Tuple[ItemTag, ...]]:
return {
Expand Down
5 changes: 0 additions & 5 deletions worlds/stardew_valley/data/shop.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ 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."

if isinstance(self.seasons, str):
super().__setattr__("seasons", (self.seasons,))
if isinstance(self.other_requirements, Requirement):
super().__setattr__("other_requirements", (self.other_requirements,))


@dataclass(frozen=True, **kw_only)
class MysteryBoxSource(ItemSource):
Expand Down

0 comments on commit 63556a0

Please sign in to comment.