2024-03-15 15:05:14 +03:00
|
|
|
from functools import cached_property
|
2025-03-22 15:29:16 -04:00
|
|
|
from typing import Union
|
2024-03-15 15:05:14 +03:00
|
|
|
|
|
|
|
from Utils import cache_self1
|
|
|
|
from .base_logic import BaseLogic, BaseLogicMixin
|
|
|
|
from .building_logic import BuildingLogicMixin
|
|
|
|
from .has_logic import HasLogicMixin
|
|
|
|
from .received_logic import ReceivedLogicMixin
|
|
|
|
from .region_logic import RegionLogicMixin
|
|
|
|
from ..locations import LocationTags, locations_by_tag
|
2025-03-22 15:29:16 -04:00
|
|
|
from ..options import ExcludeGingerIsland
|
2024-03-15 15:05:14 +03:00
|
|
|
from ..options import SpecialOrderLocations
|
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 ..stardew_rule import StardewRule
|
2024-03-15 15:05:14 +03:00
|
|
|
from ..strings.building_names import Building
|
|
|
|
|
|
|
|
|
|
|
|
class ShippingLogicMixin(BaseLogicMixin):
|
|
|
|
def __init__(self, *args, **kwargs):
|
|
|
|
super().__init__(*args, **kwargs)
|
|
|
|
self.shipping = ShippingLogic(*args, **kwargs)
|
|
|
|
|
|
|
|
|
|
|
|
class ShippingLogic(BaseLogic[Union[ReceivedLogicMixin, ShippingLogicMixin, BuildingLogicMixin, RegionLogicMixin, HasLogicMixin]]):
|
|
|
|
|
|
|
|
@cached_property
|
|
|
|
def can_use_shipping_bin(self) -> StardewRule:
|
|
|
|
return self.logic.building.has_building(Building.shipping_bin)
|
|
|
|
|
|
|
|
@cache_self1
|
|
|
|
def can_ship(self, item: str) -> StardewRule:
|
2024-11-29 14:41:26 -05:00
|
|
|
return self.logic.shipping.can_use_shipping_bin & self.logic.has(item)
|
2024-03-15 15:05:14 +03:00
|
|
|
|
|
|
|
def can_ship_everything(self) -> StardewRule:
|
|
|
|
shipsanity_prefix = "Shipsanity: "
|
|
|
|
all_items_to_ship = []
|
|
|
|
exclude_island = self.options.exclude_ginger_island == ExcludeGingerIsland.option_true
|
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
|
|
|
exclude_qi = not (self.options.special_order_locations & SpecialOrderLocations.value_qi)
|
2024-03-15 15:05:14 +03:00
|
|
|
mod_list = self.options.mods.value
|
|
|
|
for location in locations_by_tag[LocationTags.SHIPSANITY_FULL_SHIPMENT]:
|
|
|
|
if exclude_island and LocationTags.GINGER_ISLAND in location.tags:
|
|
|
|
continue
|
|
|
|
if exclude_qi and LocationTags.REQUIRES_QI_ORDERS in location.tags:
|
|
|
|
continue
|
|
|
|
if location.mod_name and location.mod_name not in mod_list:
|
|
|
|
continue
|
|
|
|
all_items_to_ship.append(location.name[len(shipsanity_prefix):])
|
|
|
|
return self.logic.building.has_building(Building.shipping_bin) & self.logic.has_all(*all_items_to_ship)
|