Files
Archipelago/worlds/stardew_valley/test/TestDynamicGoals.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

113 lines
6.4 KiB
Python

from typing import List, Tuple
from .assertion import WorldAssertMixin
from .bases import SVTestBase
from .. import options, StardewItem
from ..strings.ap_names.ap_weapon_names import APWeapon
from ..strings.ap_names.transport_names import Transportation
from ..strings.fish_names import Fish
from ..strings.tool_names import APTool
from ..strings.wallet_item_names import Wallet
def collect_fishing_abilities(tester: SVTestBase):
for i in range(4):
tester.multiworld.state.collect(tester.world.create_item(APTool.fishing_rod), prevent_sweep=False)
tester.multiworld.state.collect(tester.world.create_item(APTool.pickaxe), prevent_sweep=False)
tester.multiworld.state.collect(tester.world.create_item(APTool.axe), prevent_sweep=False)
tester.multiworld.state.collect(tester.world.create_item(APWeapon.weapon), prevent_sweep=False)
for i in range(10):
tester.multiworld.state.collect(tester.world.create_item("Fishing Level"), prevent_sweep=False)
tester.multiworld.state.collect(tester.world.create_item("Combat Level"), prevent_sweep=False)
tester.multiworld.state.collect(tester.world.create_item("Mining Level"), prevent_sweep=False)
for i in range(17):
tester.multiworld.state.collect(tester.world.create_item("Progressive Mine Elevator"), prevent_sweep=False)
tester.multiworld.state.collect(tester.world.create_item("Shipping Bin"), prevent_sweep=False)
tester.multiworld.state.collect(tester.world.create_item("Fishing Mastery"), prevent_sweep=False)
tester.multiworld.state.collect(tester.world.create_item("Landslide Removed"), prevent_sweep=False)
tester.multiworld.state.collect(tester.world.create_item("Spring"), prevent_sweep=False)
tester.multiworld.state.collect(tester.world.create_item("Summer"), prevent_sweep=False)
tester.multiworld.state.collect(tester.world.create_item("Fall"), prevent_sweep=False)
tester.multiworld.state.collect(tester.world.create_item("Winter"), prevent_sweep=False)
tester.multiworld.state.collect(tester.world.create_item(Transportation.bus_repair), prevent_sweep=False)
tester.multiworld.state.collect(tester.world.create_item("Beach Bridge"), prevent_sweep=False)
tester.multiworld.state.collect(tester.world.create_item("Railroad Boulder Removed"), prevent_sweep=False)
tester.multiworld.state.collect(tester.world.create_item("Island North Turtle"), prevent_sweep=False)
tester.multiworld.state.collect(tester.world.create_item("Island West Turtle"), prevent_sweep=False)
def create_and_collect(tester: SVTestBase, item_name: str) -> StardewItem:
item = tester.world.create_item(item_name)
tester.multiworld.state.collect(item, prevent_sweep=False)
return item
def create_and_collect_fishing_access_items(tester: SVTestBase) -> List[Tuple[StardewItem, str]]:
items = [(create_and_collect(tester, Wallet.dark_talisman), Fish.void_salmon),
(create_and_collect(tester, Wallet.rusty_key), Fish.slimejack),
(create_and_collect(tester, "Progressive Mine Elevator"), Fish.lava_eel),
(create_and_collect(tester, Transportation.boat_repair), Fish.lionfish),
(create_and_collect(tester, "Island Resort"), Fish.stingray)]
return items
class TestMasterAnglerNoFishsanity(WorldAssertMixin, SVTestBase):
options = {
options.Goal.internal_name: options.Goal.option_master_angler,
options.Fishsanity.internal_name: options.Fishsanity.option_none,
options.ExcludeGingerIsland.internal_name: options.ExcludeGingerIsland.option_false
}
def test_need_all_fish_to_win(self):
collect_fishing_abilities(self)
self.assert_cannot_reach_victory(self.multiworld)
critical_items = create_and_collect_fishing_access_items(self)
self.assert_can_reach_victory(self.multiworld)
for item, fish in critical_items:
with self.subTest(f"Needed: {fish}"):
self.assert_item_was_necessary_for_victory(item, self.multiworld)
class TestMasterAnglerNoFishsanityNoGingerIsland(WorldAssertMixin, SVTestBase):
options = {
options.Goal.internal_name: options.Goal.option_master_angler,
options.Fishsanity.internal_name: options.Fishsanity.option_none,
options.ExcludeGingerIsland.internal_name: options.ExcludeGingerIsland.option_true
}
def test_need_fish_to_win(self):
collect_fishing_abilities(self)
self.assert_cannot_reach_victory(self.multiworld)
items = create_and_collect_fishing_access_items(self)
self.assert_can_reach_victory(self.multiworld)
unecessary_items = [(item, fish) for (item, fish) in items if fish in [Fish.lionfish, Fish.stingray]]
necessary_items = [(item, fish) for (item, fish) in items if (item, fish) not in unecessary_items]
for item, fish in necessary_items:
with self.subTest(f"Needed: {fish}"):
self.assert_item_was_necessary_for_victory(item, self.multiworld)
for item, fish in unecessary_items:
with self.subTest(f"Not Needed: {fish}"):
self.assert_item_was_not_necessary_for_victory(item, self.multiworld)
class TestMasterAnglerFishsanityNoHardFish(WorldAssertMixin, SVTestBase):
options = {
options.Goal.internal_name: options.Goal.option_master_angler,
options.Fishsanity.internal_name: options.Fishsanity.option_exclude_hard_fish,
options.ExcludeGingerIsland.internal_name: options.ExcludeGingerIsland.option_false
}
def test_need_fish_to_win(self):
collect_fishing_abilities(self)
self.assert_cannot_reach_victory(self.multiworld)
items = create_and_collect_fishing_access_items(self)
self.assert_can_reach_victory(self.multiworld)
unecessary_items = [(item, fish) for (item, fish) in items if fish in [Fish.void_salmon, Fish.stingray, Fish.lava_eel]]
necessary_items = [(item, fish) for (item, fish) in items if (item, fish) not in unecessary_items]
for item, fish in necessary_items:
with self.subTest(f"Needed: {fish}"):
self.assert_item_was_necessary_for_victory(item, self.multiworld)
for item, fish in unecessary_items:
with self.subTest(f"Not Needed: {fish}"):
self.assert_item_was_not_necessary_for_victory(item, self.multiworld)