Stardew Valley 6.x.x: The Content Update (#3478)
Focus of the Update: Compatibility with Stardew Valley 1.6 Released on March 19th 2024 This includes randomization for pretty much all of the new content, including but not limited to - Raccoon Bundles - Booksanity - Skill Masteries - New Recipes, Craftables, Fish, Maps, Farm Type, Festivals and Quests This also includes a significant reorganisation of the code into "Content Packs", to allow for easier modularity of various game mechanics between the settings and the supported mods. This improves maintainability quite a bit. In addition to that, a few **very** requested new features have been introduced, although they weren't the focus of this update - Walnutsanity - Player Buffs - More customizability in settings, such as shorter special orders, ER without farmhouse - New Remixed Bundles
This commit is contained in:
@@ -1,18 +1,21 @@
|
||||
from typing import Union, List
|
||||
from typing import Union
|
||||
|
||||
from Utils import cache_self1
|
||||
from .base_logic import BaseLogicMixin, BaseLogic
|
||||
from .has_logic import HasLogicMixin
|
||||
from .received_logic import ReceivedLogicMixin
|
||||
from .region_logic import RegionLogicMixin
|
||||
from .season_logic import SeasonLogicMixin
|
||||
from .skill_logic import SkillLogicMixin
|
||||
from .tool_logic import ToolLogicMixin
|
||||
from ..data import FishItem, fish_data
|
||||
from ..locations import LocationTags, locations_by_tag
|
||||
from ..options import ExcludeGingerIsland, Fishsanity
|
||||
from ..data import fish_data
|
||||
from ..data.fish_data import FishItem
|
||||
from ..options import ExcludeGingerIsland
|
||||
from ..options import SpecialOrderLocations
|
||||
from ..stardew_rule import StardewRule, True_, False_, And
|
||||
from ..stardew_rule import StardewRule, True_, False_
|
||||
from ..strings.ap_names.mods.mod_items import SVEQuestItem
|
||||
from ..strings.fish_names import SVEFish
|
||||
from ..strings.machine_names import Machine
|
||||
from ..strings.quality_names import FishQuality
|
||||
from ..strings.region_names import Region
|
||||
from ..strings.skill_names import Skill
|
||||
@@ -24,17 +27,16 @@ class FishingLogicMixin(BaseLogicMixin):
|
||||
self.fishing = FishingLogic(*args, **kwargs)
|
||||
|
||||
|
||||
class FishingLogic(BaseLogic[Union[FishingLogicMixin, ReceivedLogicMixin, RegionLogicMixin, SeasonLogicMixin, ToolLogicMixin, SkillLogicMixin]]):
|
||||
class FishingLogic(BaseLogic[Union[HasLogicMixin, FishingLogicMixin, ReceivedLogicMixin, RegionLogicMixin, SeasonLogicMixin, ToolLogicMixin,
|
||||
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))
|
||||
|
||||
def has_max_fishing(self) -> StardewRule:
|
||||
skill_rule = self.logic.skill.has_level(Skill.fishing, 10)
|
||||
return self.logic.tool.has_fishing_rod(4) & skill_rule
|
||||
return self.logic.tool.has_fishing_rod(4) & self.logic.skill.has_level(Skill.fishing, 10)
|
||||
|
||||
def can_fish_chests(self) -> StardewRule:
|
||||
skill_rule = self.logic.skill.has_level(Skill.fishing, 6)
|
||||
return self.logic.tool.has_fishing_rod(4) & skill_rule
|
||||
return self.logic.tool.has_fishing_rod(4) & self.logic.skill.has_level(Skill.fishing, 6)
|
||||
|
||||
def can_fish_at(self, region: str) -> StardewRule:
|
||||
return self.logic.skill.can_fish() & self.logic.region.can_reach(region)
|
||||
@@ -51,17 +53,23 @@ class FishingLogic(BaseLogic[Union[FishingLogicMixin, ReceivedLogicMixin, Region
|
||||
else:
|
||||
difficulty_rule = self.logic.skill.can_fish(difficulty=(120 if fish.legendary else fish.difficulty))
|
||||
if fish.name == SVEFish.kittyfish:
|
||||
item_rule = self.logic.received("Kittyfish Spell")
|
||||
item_rule = self.logic.received(SVEQuestItem.kittyfish_spell)
|
||||
else:
|
||||
item_rule = True_()
|
||||
return quest_rule & region_rule & season_rule & difficulty_rule & item_rule
|
||||
|
||||
def can_catch_fish_for_fishsanity(self, fish: FishItem) -> StardewRule:
|
||||
""" Rule could be different from the basic `can_catch_fish`. Imagine a fishsanity setting where you need to catch every fish with gold quality.
|
||||
"""
|
||||
return self.logic.fishing.can_catch_fish(fish)
|
||||
|
||||
def can_start_extended_family_quest(self) -> StardewRule:
|
||||
if self.options.exclude_ginger_island == ExcludeGingerIsland.option_true:
|
||||
return False_()
|
||||
if self.options.special_order_locations != SpecialOrderLocations.option_board_qi:
|
||||
if not self.options.special_order_locations & SpecialOrderLocations.value_qi:
|
||||
return False_()
|
||||
return self.logic.region.can_reach(Region.qi_walnut_room) & And(*(self.logic.fishing.can_catch_fish(fish) for fish in fish_data.legendary_fish))
|
||||
return (self.logic.region.can_reach(Region.qi_walnut_room) &
|
||||
self.logic.and_(*(self.logic.fishing.can_catch_fish(fish) for fish in fish_data.vanilla_legendary_fish)))
|
||||
|
||||
def can_catch_quality_fish(self, fish_quality: str) -> StardewRule:
|
||||
if fish_quality == FishQuality.basic:
|
||||
@@ -78,24 +86,27 @@ class FishingLogic(BaseLogic[Union[FishingLogicMixin, ReceivedLogicMixin, Region
|
||||
|
||||
def can_catch_every_fish(self) -> StardewRule:
|
||||
rules = [self.has_max_fishing()]
|
||||
exclude_island = self.options.exclude_ginger_island == ExcludeGingerIsland.option_true
|
||||
exclude_extended_family = self.options.special_order_locations != SpecialOrderLocations.option_board_qi
|
||||
for fish in fish_data.get_fish_for_mods(self.options.mods.value):
|
||||
if exclude_island and fish in fish_data.island_fish:
|
||||
continue
|
||||
if exclude_extended_family and fish in fish_data.extended_family:
|
||||
continue
|
||||
rules.append(self.logic.fishing.can_catch_fish(fish))
|
||||
return And(*rules)
|
||||
|
||||
def can_catch_every_fish_in_slot(self, all_location_names_in_slot: List[str]) -> StardewRule:
|
||||
if self.options.fishsanity == Fishsanity.option_none:
|
||||
rules.extend(
|
||||
self.logic.fishing.can_catch_fish(fish)
|
||||
for fish in self.content.fishes.values()
|
||||
)
|
||||
|
||||
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()]
|
||||
|
||||
for fishsanity_location in locations_by_tag[LocationTags.FISHSANITY]:
|
||||
if fishsanity_location.name not in all_location_names_in_slot:
|
||||
continue
|
||||
rules.append(self.logic.region.can_reach_location(fishsanity_location.name))
|
||||
return And(*rules)
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user