forked from mirror/Archipelago
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.
103 lines
2.3 KiB
Python
103 lines
2.3 KiB
Python
from abc import ABC, abstractmethod
|
|
from dataclasses import dataclass
|
|
from typing import ClassVar
|
|
|
|
from .base import FeatureBase
|
|
from ...data.fish_data import FishItem
|
|
from ...strings.fish_names import Fish
|
|
|
|
location_prefix = "Fishsanity: "
|
|
|
|
|
|
def to_location_name(fish: str) -> str:
|
|
return location_prefix + fish
|
|
|
|
|
|
def extract_fish_from_location_name(location_name: str) -> str | None:
|
|
if not location_name.startswith(location_prefix):
|
|
return None
|
|
|
|
return location_name[len(location_prefix):]
|
|
|
|
|
|
@dataclass(frozen=True)
|
|
class FishsanityFeature(FeatureBase, ABC):
|
|
is_enabled: ClassVar[bool]
|
|
|
|
randomization_ratio: float = 1
|
|
|
|
to_location_name = staticmethod(to_location_name)
|
|
extract_fish_from_location_name = staticmethod(extract_fish_from_location_name)
|
|
|
|
@property
|
|
def is_randomized(self) -> bool:
|
|
return self.randomization_ratio != 1
|
|
|
|
@abstractmethod
|
|
def is_included(self, fish: FishItem) -> bool:
|
|
...
|
|
|
|
|
|
class FishsanityNone(FishsanityFeature):
|
|
is_enabled = False
|
|
|
|
def is_included(self, fish: FishItem) -> bool:
|
|
return False
|
|
|
|
|
|
class FishsanityLegendaries(FishsanityFeature):
|
|
is_enabled = True
|
|
|
|
def is_included(self, fish: FishItem) -> bool:
|
|
return fish.legendary
|
|
|
|
|
|
class FishsanitySpecial(FishsanityFeature):
|
|
is_enabled = True
|
|
|
|
included_fishes = {
|
|
Fish.angler,
|
|
Fish.crimsonfish,
|
|
Fish.glacierfish,
|
|
Fish.legend,
|
|
Fish.mutant_carp,
|
|
Fish.blobfish,
|
|
Fish.lava_eel,
|
|
Fish.octopus,
|
|
Fish.scorpion_carp,
|
|
Fish.ice_pip,
|
|
Fish.super_cucumber,
|
|
Fish.dorado
|
|
}
|
|
|
|
def is_included(self, fish: FishItem) -> bool:
|
|
return fish.name in self.included_fishes
|
|
|
|
|
|
class FishsanityAll(FishsanityFeature):
|
|
is_enabled = True
|
|
|
|
def is_included(self, fish: FishItem) -> bool:
|
|
return True
|
|
|
|
|
|
class FishsanityExcludeLegendaries(FishsanityFeature):
|
|
is_enabled = True
|
|
|
|
def is_included(self, fish: FishItem) -> bool:
|
|
return not fish.legendary
|
|
|
|
|
|
class FishsanityExcludeHardFish(FishsanityFeature):
|
|
is_enabled = True
|
|
|
|
def is_included(self, fish: FishItem) -> bool:
|
|
return fish.difficulty < 80
|
|
|
|
|
|
class FishsanityOnlyEasyFish(FishsanityFeature):
|
|
is_enabled = True
|
|
|
|
def is_included(self, fish: FishItem) -> bool:
|
|
return fish.difficulty < 50
|