mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21:32 -06:00
Major Content update for Stardew Valley, including the following features - Major performance improvements all across the Stardew Valley apworld, including a significant reduction in the test time - Randomized Farm Type - Bundles rework (Remixed Bundles and Missing Bundle!) - New Settings: * Shipsanity - Shipping individual items * Monstersanity - Slaying monsters * Cooksanity - Cooking individual recipes * Chefsanity - Learning individual recipes * Craftsanity - Crafting individual items - New Goals: * Protector of the Valley - Complete every monster slayer goal * Full Shipment - Ship every item * Craftmaster - Craft every item * Gourmet Chef - Cook every recipe * Legend - Earn 10 000 000g * Mystery of the Stardrops - Find every stardrop (Maguffin Hunt) * Allsanity - Complete every check in your slot - Building Shuffle: Cheaper options - Tool Shuffle: Cheaper options - Money rework - New traps - New isolated checks and items, including the farm cave, the movie theater, etc - Mod Support: SVE [Albrekka] - Mod Support: Distant Lands [Albrekka] - Mod Support: Hat Mouse Lacey [Albrekka] - Mod Support: Boarding House [Albrekka] Co-authored-by: Witchybun <elnendil@gmail.com> Co-authored-by: Witchybun <96719127+Witchybun@users.noreply.github.com> Co-authored-by: Jouramie <jouramie@hotmail.com> Co-authored-by: Alchav <59858495+Alchav@users.noreply.github.com>
74 lines
2.4 KiB
Python
74 lines
2.4 KiB
Python
from __future__ import annotations
|
|
|
|
from abc import ABC, abstractmethod
|
|
from dataclasses import dataclass
|
|
|
|
from ..options import StardewValleyOptions, ExcludeGingerIsland, FestivalLocations
|
|
from ..strings.crop_names import Fruit
|
|
from ..strings.currency_names import Currency
|
|
from ..strings.quality_names import CropQuality, FishQuality, ForageQuality
|
|
|
|
|
|
class BundleItemSource(ABC):
|
|
@abstractmethod
|
|
def can_appear(self, options: StardewValleyOptions) -> bool:
|
|
...
|
|
|
|
|
|
class VanillaItemSource(BundleItemSource):
|
|
def can_appear(self, options: StardewValleyOptions) -> bool:
|
|
return True
|
|
|
|
|
|
class IslandItemSource(BundleItemSource):
|
|
def can_appear(self, options: StardewValleyOptions) -> bool:
|
|
return options.exclude_ginger_island == ExcludeGingerIsland.option_false
|
|
|
|
|
|
class FestivalItemSource(BundleItemSource):
|
|
def can_appear(self, options: StardewValleyOptions) -> bool:
|
|
return options.festival_locations != FestivalLocations.option_disabled
|
|
|
|
|
|
@dataclass(frozen=True, order=True)
|
|
class BundleItem:
|
|
class Sources:
|
|
vanilla = VanillaItemSource()
|
|
island = IslandItemSource()
|
|
festival = FestivalItemSource()
|
|
|
|
item_name: str
|
|
amount: int = 1
|
|
quality: str = CropQuality.basic
|
|
source: BundleItemSource = Sources.vanilla
|
|
|
|
@staticmethod
|
|
def money_bundle(amount: int) -> BundleItem:
|
|
return BundleItem(Currency.money, amount)
|
|
|
|
def as_amount(self, amount: int) -> BundleItem:
|
|
return BundleItem(self.item_name, amount, self.quality, self.source)
|
|
|
|
def as_quality(self, quality: str) -> BundleItem:
|
|
return BundleItem(self.item_name, self.amount, quality, self.source)
|
|
|
|
def as_quality_crop(self) -> BundleItem:
|
|
amount = 5
|
|
difficult_crops = [Fruit.sweet_gem_berry, Fruit.ancient_fruit]
|
|
if self.item_name in difficult_crops:
|
|
amount = 1
|
|
return self.as_quality(CropQuality.gold).as_amount(amount)
|
|
|
|
def as_quality_fish(self) -> BundleItem:
|
|
return self.as_quality(FishQuality.gold)
|
|
|
|
def as_quality_forage(self) -> BundleItem:
|
|
return self.as_quality(ForageQuality.gold)
|
|
|
|
def __repr__(self):
|
|
quality = "" if self.quality == CropQuality.basic else self.quality
|
|
return f"{self.amount} {quality} {self.item_name}"
|
|
|
|
def can_appear(self, options: StardewValleyOptions) -> bool:
|
|
return self.source.can_appear(options)
|