Stardew Valley: Move all the goal logic into its own file (#4383)

This commit is contained in:
Jérémie Bolduc
2025-03-22 15:29:16 -04:00
committed by GitHub
parent 294a67a4b4
commit 9de49aa419
8 changed files with 223 additions and 156 deletions

View File

@@ -29,7 +29,7 @@ class FishingLogicMixin(BaseLogicMixin):
class FishingLogic(BaseLogic[Union[HasLogicMixin, FishingLogicMixin, ReceivedLogicMixin, RegionLogicMixin, SeasonLogicMixin, ToolLogicMixin,
SkillLogicMixin]]):
SkillLogicMixin]]):
def can_fish_in_freshwater(self) -> StardewRule:
return self.logic.skill.can_fish() & self.logic.region.can_reach_any((Region.forest, Region.town, Region.mountain))
@@ -97,19 +97,5 @@ class FishingLogic(BaseLogic[Union[HasLogicMixin, FishingLogicMixin, ReceivedLog
return self.logic.and_(*rules)
def can_catch_every_fish_for_fishsanity(self) -> StardewRule:
if not self.content.features.fishsanity.is_enabled:
return self.can_catch_every_fish()
rules = [self.has_max_fishing()]
rules.extend(
self.logic.fishing.can_catch_fish_for_fishsanity(fish)
for fish in self.content.fishes.values()
if self.content.features.fishsanity.is_included(fish)
)
return self.logic.and_(*rules)
def has_specific_bait(self, fish: FishItem) -> StardewRule:
return self.can_catch_fish(fish) & self.logic.has(Machine.bait_maker)