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
2024-07-07 16:04:25 +03:00
|
|
|
import functools
|
2025-04-23 11:31:08 -04:00
|
|
|
from typing import Iterable
|
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
2024-07-07 16:04:25 +03:00
|
|
|
|
|
|
|
from .base_logic import BaseLogicMixin, BaseLogic
|
|
|
|
from ..data.game_item import Requirement
|
2024-07-25 02:22:46 -05:00
|
|
|
from ..data.requirement import ToolRequirement, BookRequirement, SkillRequirement, SeasonRequirement, YearRequirement, CombatRequirement, QuestRequirement, \
|
2025-04-08 12:37:45 -04:00
|
|
|
RelationshipRequirement, FishingRequirement, WalnutRequirement, RegionRequirement
|
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
2024-07-07 16:04:25 +03:00
|
|
|
|
|
|
|
|
|
|
|
class RequirementLogicMixin(BaseLogicMixin):
|
|
|
|
def __init__(self, *args, **kwargs):
|
|
|
|
super().__init__(*args, **kwargs)
|
|
|
|
self.requirement = RequirementLogic(*args, **kwargs)
|
|
|
|
|
|
|
|
|
2025-04-23 11:31:08 -04:00
|
|
|
class RequirementLogic(BaseLogic):
|
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
2024-07-07 16:04:25 +03:00
|
|
|
|
|
|
|
def meet_all_requirements(self, requirements: Iterable[Requirement]):
|
|
|
|
if not requirements:
|
|
|
|
return self.logic.true_
|
|
|
|
return self.logic.and_(*(self.logic.requirement.meet_requirement(requirement) for requirement in requirements))
|
|
|
|
|
|
|
|
@functools.singledispatchmethod
|
|
|
|
def meet_requirement(self, requirement: Requirement):
|
|
|
|
raise ValueError(f"Requirements of type{type(requirement)} have no rule registered.")
|
|
|
|
|
|
|
|
@meet_requirement.register
|
|
|
|
def _(self, requirement: ToolRequirement):
|
|
|
|
return self.logic.tool.has_tool(requirement.tool, requirement.tier)
|
|
|
|
|
|
|
|
@meet_requirement.register
|
|
|
|
def _(self, requirement: SkillRequirement):
|
|
|
|
return self.logic.skill.has_level(requirement.skill, requirement.level)
|
|
|
|
|
2025-04-08 12:37:45 -04:00
|
|
|
@meet_requirement.register
|
|
|
|
def _(self, requirement: RegionRequirement):
|
|
|
|
return self.logic.region.can_reach(requirement.region)
|
|
|
|
|
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
2024-07-07 16:04:25 +03:00
|
|
|
@meet_requirement.register
|
|
|
|
def _(self, requirement: BookRequirement):
|
|
|
|
return self.logic.book.has_book_power(requirement.book)
|
|
|
|
|
|
|
|
@meet_requirement.register
|
|
|
|
def _(self, requirement: SeasonRequirement):
|
|
|
|
return self.logic.season.has(requirement.season)
|
|
|
|
|
|
|
|
@meet_requirement.register
|
|
|
|
def _(self, requirement: YearRequirement):
|
|
|
|
return self.logic.time.has_year(requirement.year)
|
2024-07-23 01:36:42 +03:00
|
|
|
|
|
|
|
@meet_requirement.register
|
|
|
|
def _(self, requirement: WalnutRequirement):
|
|
|
|
return self.logic.walnut.has_walnut(requirement.amount)
|
2024-07-25 02:22:46 -05:00
|
|
|
|
|
|
|
@meet_requirement.register
|
|
|
|
def _(self, requirement: CombatRequirement):
|
|
|
|
return self.logic.combat.can_fight_at_level(requirement.level)
|
|
|
|
|
|
|
|
@meet_requirement.register
|
|
|
|
def _(self, requirement: QuestRequirement):
|
|
|
|
return self.logic.quest.can_complete_quest(requirement.quest)
|
|
|
|
|
|
|
|
@meet_requirement.register
|
|
|
|
def _(self, requirement: RelationshipRequirement):
|
|
|
|
return self.logic.relationship.has_hearts(requirement.npc, requirement.hearts)
|
|
|
|
|
|
|
|
@meet_requirement.register
|
|
|
|
def _(self, requirement: FishingRequirement):
|
|
|
|
return self.logic.fishing.can_fish_at(requirement.region)
|