Files
dockipelago/worlds/stardew_valley/logic/harvesting_logic.py
agilbert1412 1de91fab67 Stardew Valley: 7.x.x - The Jojapocalypse Update (#5432)
Major Content update for Stardew Valley

### Features
- New BundleRandomization Value: Meme Bundles - Over 100 custom bundles, designed to be jokes, references, trolls, etc
- New Setting: Bundles Per Room modifier
- New Setting: Backpack Size
- New Setting: Secretsanity - Checks for triggering easter eggs and secrets
- New Setting: Moviesanity - Checks for watching movies and sharing snacks with Villagers
- New Setting: Eatsanity - Checks for eating items
- New Setting: Hatsanity - Checks for wearing Hats
- New Setting: Start Without - Allows you to select any combination of various "starting" items, that you will actually not start with. Notably, tools, backpack slots, Day5 unlocks, etc.
- New Setting: Allowed Filler Items - Allows you to customize the filler items you'll get
- New Setting: Endgame Locations - Checks for various expensive endgame tasks and purchases
- New Shipsanity value: Crops and Fish
- New Settings: Jojapocalypse and settings to customize it
- Bundle Plando: Replaced with BundleWhitelist and BundleBlacklist, for more customization freedom
- Added a couple of Host.yaml settings to help hosts allow or ban specific difficult settings that could cause problems if the people don't know what they are signing up for.

Plus a truckload of improvements on the mod side, not seen in this PR.

### Removed features
- Integration for Stardew Valley Expanded. It is simply disabled, the code is all still there, but I'm extremely tired of providing tech support for it, plus Stardew Valley 1.7 was announced and that will break it again, so I'm done. When a maintainer steps up, it can be re-enabled.
2026-02-15 18:02:21 +01:00

54 lines
2.2 KiB
Python

from functools import cached_property
from Utils import cache_self1
from .base_logic import BaseLogicMixin, BaseLogic
from ..data.harvest import ForagingSource, HarvestFruitTreeSource, HarvestCropSource
from ..stardew_rule import StardewRule
from ..strings.ap_names.community_upgrade_names import CommunityUpgrade
from ..strings.region_names import Region
class HarvestingLogicMixin(BaseLogicMixin):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.harvesting = HarvestingLogic(*args, **kwargs)
class HarvestingLogic(BaseLogic):
@cached_property
def can_harvest_from_fruit_bats(self) -> StardewRule:
return self.logic.region.can_reach(Region.farm_cave) & self.logic.received(CommunityUpgrade.fruit_bats)
@cached_property
def can_harvest_from_mushroom_cave(self) -> StardewRule:
return self.logic.region.can_reach(Region.farm_cave) & self.logic.received(CommunityUpgrade.mushroom_boxes)
@cache_self1
def can_forage_from(self, source: ForagingSource) -> StardewRule:
seasons_rule = self.logic.season.has_any(source.seasons)
if source.require_all_regions:
regions_rule = self.logic.region.can_reach_all(*source.regions)
else:
regions_rule = self.logic.region.can_reach_any(*source.regions)
if source.grind_months == 0:
return seasons_rule & regions_rule
else:
return seasons_rule & regions_rule & self.logic.time.has_lived_months(source.grind_months)
@cache_self1
def can_harvest_tree_from(self, source: HarvestFruitTreeSource) -> StardewRule:
# FIXME tool not required for this
region_to_grow_rule = self.logic.farming.can_plant_and_grow_item(source.seasons)
sapling_rule = self.logic.has(source.sapling)
# Because it takes 1 month to grow the sapling
time_rule = self.logic.time.has_lived_months(1)
return region_to_grow_rule & sapling_rule & time_rule
@cache_self1
def can_harvest_crop_from(self, source: HarvestCropSource) -> StardewRule:
region_to_grow_rule = self.logic.farming.can_plant_and_grow_item(source.seasons)
seed_rule = self.logic.has(source.seed)
return region_to_grow_rule & seed_rule