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:
agilbert1412
2024-07-07 16:04:25 +03:00
committed by GitHub
parent f99ee77325
commit 9b22458f44
210 changed files with 10298 additions and 4540 deletions

View File

@@ -6,11 +6,9 @@ from .received_logic import ReceivedLogicMixin
from .region_logic import RegionLogicMixin
from .time_logic import TimeLogicMixin
from .tool_logic import ToolLogicMixin
from ..data.villagers_data import Villager
from ..options import Friendsanity
from ..content.feature.friendsanity import pet_heart_item_name
from ..stardew_rule import StardewRule, True_
from ..strings.region_names import Region
from ..strings.villager_names import NPC
class PetLogicMixin(BaseLogicMixin):
@@ -20,21 +18,25 @@ class PetLogicMixin(BaseLogicMixin):
class PetLogic(BaseLogic[Union[RegionLogicMixin, ReceivedLogicMixin, TimeLogicMixin, ToolLogicMixin]]):
def has_hearts(self, hearts: int = 1) -> StardewRule:
if hearts <= 0:
def has_pet_hearts(self, hearts: int = 1) -> StardewRule:
assert hearts >= 0, "You can't have negative hearts with a pet."
if hearts == 0:
return True_()
if self.options.friendsanity == Friendsanity.option_none or self.options.friendsanity == Friendsanity.option_bachelors:
return self.can_befriend_pet(hearts)
return self.received_hearts(NPC.pet, hearts)
def received_hearts(self, npc: Union[str, Villager], hearts: int) -> StardewRule:
if isinstance(npc, Villager):
return self.received_hearts(npc.name, hearts)
return self.logic.received(self.heart(npc), math.ceil(hearts / self.options.friendsanity_heart_size))
if self.content.features.friendsanity.is_pet_randomized:
return self.received_pet_hearts(hearts)
return self.can_befriend_pet(hearts)
def received_pet_hearts(self, hearts: int) -> StardewRule:
return self.logic.received(pet_heart_item_name,
math.ceil(hearts / self.content.features.friendsanity.heart_size))
def can_befriend_pet(self, hearts: int) -> StardewRule:
if hearts <= 0:
assert hearts >= 0, "You can't have negative hearts with a pet."
if hearts == 0:
return True_()
points = hearts * 200
points_per_month = 12 * 14
points_per_water_month = 18 * 14
@@ -43,8 +45,3 @@ class PetLogic(BaseLogic[Union[RegionLogicMixin, ReceivedLogicMixin, TimeLogicMi
time_without_water_rule = self.logic.time.has_lived_months(points // points_per_month)
time_rule = time_with_water_rule | time_without_water_rule
return farm_rule & time_rule
def heart(self, npc: Union[str, Villager]) -> str:
if isinstance(npc, str):
return f"{npc} <3"
return self.heart(npc.name)