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,11 +1,27 @@
|
||||
from typing import Union
|
||||
from functools import cached_property
|
||||
from typing import Union, Tuple
|
||||
|
||||
from Utils import cache_self1
|
||||
from .base_logic import BaseLogicMixin, BaseLogic
|
||||
from .has_logic import HasLogicMixin
|
||||
from .skill_logic import SkillLogicMixin
|
||||
from ..stardew_rule import StardewRule, True_, False_
|
||||
from .received_logic import ReceivedLogicMixin
|
||||
from .region_logic import RegionLogicMixin
|
||||
from .season_logic import SeasonLogicMixin
|
||||
from .tool_logic import ToolLogicMixin
|
||||
from .. import options
|
||||
from ..stardew_rule import StardewRule, True_, false_
|
||||
from ..strings.ap_names.event_names import Event
|
||||
from ..strings.fertilizer_names import Fertilizer
|
||||
from ..strings.quality_names import CropQuality
|
||||
from ..strings.region_names import Region
|
||||
from ..strings.season_names import Season
|
||||
from ..strings.tool_names import Tool
|
||||
|
||||
farming_event_by_season = {
|
||||
Season.spring: Event.spring_farming,
|
||||
Season.summer: Event.summer_farming,
|
||||
Season.fall: Event.fall_farming,
|
||||
Season.winter: Event.winter_farming,
|
||||
}
|
||||
|
||||
|
||||
class FarmingLogicMixin(BaseLogicMixin):
|
||||
@@ -14,7 +30,12 @@ class FarmingLogicMixin(BaseLogicMixin):
|
||||
self.farming = FarmingLogic(*args, **kwargs)
|
||||
|
||||
|
||||
class FarmingLogic(BaseLogic[Union[HasLogicMixin, SkillLogicMixin, FarmingLogicMixin]]):
|
||||
class FarmingLogic(BaseLogic[Union[HasLogicMixin, ReceivedLogicMixin, RegionLogicMixin, SeasonLogicMixin, ToolLogicMixin, FarmingLogicMixin]]):
|
||||
|
||||
@cached_property
|
||||
def has_farming_tools(self) -> StardewRule:
|
||||
return self.logic.tool.has_tool(Tool.hoe) & self.logic.tool.can_water(0)
|
||||
|
||||
def has_fertilizer(self, tier: int) -> StardewRule:
|
||||
if tier <= 0:
|
||||
return True_()
|
||||
@@ -25,17 +46,17 @@ class FarmingLogic(BaseLogic[Union[HasLogicMixin, SkillLogicMixin, FarmingLogicM
|
||||
if tier >= 3:
|
||||
return self.logic.has(Fertilizer.deluxe)
|
||||
|
||||
def can_grow_crop_quality(self, quality: str) -> StardewRule:
|
||||
if quality == CropQuality.basic:
|
||||
return True_()
|
||||
if quality == CropQuality.silver:
|
||||
return self.logic.skill.has_farming_level(5) | (self.logic.farming.has_fertilizer(1) & self.logic.skill.has_farming_level(2)) | (
|
||||
self.logic.farming.has_fertilizer(2) & self.logic.skill.has_farming_level(1)) | self.logic.farming.has_fertilizer(3)
|
||||
if quality == CropQuality.gold:
|
||||
return self.logic.skill.has_farming_level(10) | (
|
||||
self.logic.farming.has_fertilizer(1) & self.logic.skill.has_farming_level(5)) | (
|
||||
self.logic.farming.has_fertilizer(2) & self.logic.skill.has_farming_level(3)) | (
|
||||
self.logic.farming.has_fertilizer(3) & self.logic.skill.has_farming_level(2))
|
||||
if quality == CropQuality.iridium:
|
||||
return self.logic.farming.has_fertilizer(3) & self.logic.skill.has_farming_level(4)
|
||||
return False_()
|
||||
@cache_self1
|
||||
def can_plant_and_grow_item(self, seasons: Union[str, Tuple[str]]) -> StardewRule:
|
||||
if seasons == (): # indoor farming
|
||||
return (self.logic.region.can_reach(Region.greenhouse) | self.logic.farming.has_island_farm()) & self.logic.farming.has_farming_tools
|
||||
|
||||
if isinstance(seasons, str):
|
||||
seasons = (seasons,)
|
||||
|
||||
return self.logic.or_(*(self.logic.received(farming_event_by_season[season]) for season in seasons))
|
||||
|
||||
def has_island_farm(self) -> StardewRule:
|
||||
if self.options.exclude_ginger_island == options.ExcludeGingerIsland.option_false:
|
||||
return self.logic.region.can_reach(Region.island_west)
|
||||
return false_
|
||||
|
||||
Reference in New Issue
Block a user