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
This commit is contained in:
agilbert1412
2024-07-07 16:04:25 +03:00
committed by GitHub
parent f99ee77325
commit 9b22458f44
210 changed files with 10298 additions and 4540 deletions

View File

@@ -1,26 +1,27 @@
from typing import List
from BaseClasses import ItemClassification, Item
from . import SVTestBase, allsanity_options_without_mods, \
allsanity_options_with_mods, minimal_locations_maximal_items, minimal_locations_maximal_items_with_island, get_minsanity_options, default_options
from . import SVTestBase
from .. import items, location_table, options
from ..data.villagers_data import all_villagers_by_name, all_villagers_by_mod_by_name
from ..items import Group, item_table
from ..items import Group
from ..locations import LocationTags
from ..mods.mod_data import ModNames
from ..options import Friendsanity, SpecialOrderLocations, Shipsanity, Chefsanity, SeasonRandomization, Craftsanity, ExcludeGingerIsland, ToolProgression, \
FriendsanityHeartSize
SkillProgression, Booksanity, Walnutsanity
from ..strings.region_names import Region
class TestBaseItemGeneration(SVTestBase):
options = {
Friendsanity.internal_name: Friendsanity.option_all_with_marriage,
SeasonRandomization.internal_name: SeasonRandomization.option_progressive,
SkillProgression.internal_name: SkillProgression.option_progressive_with_masteries,
ExcludeGingerIsland.internal_name: ExcludeGingerIsland.option_false,
SpecialOrderLocations.internal_name: SpecialOrderLocations.option_board_qi,
Friendsanity.internal_name: Friendsanity.option_all_with_marriage,
Shipsanity.internal_name: Shipsanity.option_everything,
Chefsanity.internal_name: Chefsanity.option_all,
Craftsanity.internal_name: Craftsanity.option_all,
Booksanity.internal_name: Booksanity.option_all,
Walnutsanity.internal_name: Walnutsanity.preset_all,
}
def test_all_progression_items_are_added_to_the_pool(self):
@@ -65,12 +66,14 @@ class TestBaseItemGeneration(SVTestBase):
class TestNoGingerIslandItemGeneration(SVTestBase):
options = {
Friendsanity.internal_name: Friendsanity.option_all_with_marriage,
SeasonRandomization.internal_name: SeasonRandomization.option_progressive,
ExcludeGingerIsland.internal_name: ExcludeGingerIsland.option_true,
SkillProgression.internal_name: SkillProgression.option_progressive_with_masteries,
Friendsanity.internal_name: Friendsanity.option_all_with_marriage,
Shipsanity.internal_name: Shipsanity.option_everything,
Chefsanity.internal_name: Chefsanity.option_all,
Craftsanity.internal_name: Craftsanity.option_all,
ExcludeGingerIsland.internal_name: ExcludeGingerIsland.option_true,
Booksanity.internal_name: Booksanity.option_all,
}
def test_all_progression_items_except_island_are_added_to_the_pool(self):
@@ -117,7 +120,16 @@ class TestNoGingerIslandItemGeneration(SVTestBase):
class TestMonstersanityNone(SVTestBase):
options = {options.Monstersanity.internal_name: options.Monstersanity.option_none}
options = {
options.Monstersanity.internal_name: options.Monstersanity.option_none,
# Not really necessary, but it adds more locations, so we don't have to remove useful items.
options.Fishsanity.internal_name: options.Fishsanity.option_all
}
@property
def run_default_tests(self) -> bool:
# None is default
return False
def test_when_generate_world_then_5_generic_weapons_in_the_pool(self):
item_pool = [item.name for item in self.multiworld.itempool]
@@ -367,408 +379,15 @@ class TestSkullCavernLogic(SVTestBase):
return [*combat_levels, *mining_levels, *pickaxes, *swords, bus, skull_key]
class TestLocationGeneration(SVTestBase):
def test_all_location_created_are_in_location_table(self):
for location in self.get_real_locations():
self.assertIn(location.name, location_table)
class TestMinLocationAndMaxItem(SVTestBase):
options = minimal_locations_maximal_items()
# They do not pass and I don't know why.
skip_base_tests = True
def test_minimal_location_maximal_items_still_valid(self):
valid_locations = self.get_real_locations()
number_locations = len(valid_locations)
number_items = len([item for item in self.multiworld.itempool
if Group.RESOURCE_PACK not in item_table[item.name].groups and Group.TRAP not in item_table[item.name].groups])
self.assertGreaterEqual(number_locations, number_items)
print(f"Stardew Valley - Minimum Locations: {number_locations}, Maximum Items: {number_items} [ISLAND EXCLUDED]")
class TestMinLocationAndMaxItemWithIsland(SVTestBase):
options = minimal_locations_maximal_items_with_island()
def test_minimal_location_maximal_items_with_island_still_valid(self):
valid_locations = self.get_real_locations()
number_locations = len(valid_locations)
number_items = len([item for item in self.multiworld.itempool
if Group.RESOURCE_PACK not in item_table[item.name].groups and Group.TRAP not in item_table[item.name].groups])
self.assertGreaterEqual(number_locations, number_items)
print(f"Stardew Valley - Minimum Locations: {number_locations}, Maximum Items: {number_items} [ISLAND INCLUDED]")
class TestMinSanityHasAllExpectedLocations(SVTestBase):
options = get_minsanity_options()
def test_minsanity_has_fewer_than_locations(self):
expected_locations = 76
real_locations = self.get_real_locations()
number_locations = len(real_locations)
self.assertLessEqual(number_locations, expected_locations)
print(f"Stardew Valley - Minsanity Locations: {number_locations}")
if number_locations != expected_locations:
print(f"\tDisappeared Locations Detected!"
f"\n\tPlease update test_minsanity_has_fewer_than_locations"
f"\n\t\tExpected: {expected_locations}"
f"\n\t\tActual: {number_locations}")
class TestDefaultSettingsHasAllExpectedLocations(SVTestBase):
options = default_options()
def test_default_settings_has_exactly_locations(self):
expected_locations = 422
real_locations = self.get_real_locations()
number_locations = len(real_locations)
print(f"Stardew Valley - Default options locations: {number_locations}")
if number_locations != expected_locations:
print(f"\tNew locations detected!"
f"\n\tPlease update test_default_settings_has_exactly_locations"
f"\n\t\tExpected: {expected_locations}"
f"\n\t\tActual: {number_locations}")
class TestAllSanitySettingsHasAllExpectedLocations(SVTestBase):
options = allsanity_options_without_mods()
def test_allsanity_without_mods_has_at_least_locations(self):
expected_locations = 1956
real_locations = self.get_real_locations()
number_locations = len(real_locations)
self.assertGreaterEqual(number_locations, expected_locations)
print(f"Stardew Valley - Allsanity Locations without mods: {number_locations}")
if number_locations != expected_locations:
print(f"\tNew locations detected!"
f"\n\tPlease update test_allsanity_without_mods_has_at_least_locations"
f"\n\t\tExpected: {expected_locations}"
f"\n\t\tActual: {number_locations}")
class TestAllSanityWithModsSettingsHasAllExpectedLocations(SVTestBase):
options = allsanity_options_with_mods()
def test_allsanity_with_mods_has_at_least_locations(self):
expected_locations = 2804
real_locations = self.get_real_locations()
number_locations = len(real_locations)
self.assertGreaterEqual(number_locations, expected_locations)
print(f"\nStardew Valley - Allsanity Locations with all mods: {number_locations}")
if number_locations != expected_locations:
print(f"\tNew locations detected!"
f"\n\tPlease update test_allsanity_with_mods_has_at_least_locations"
f"\n\t\tExpected: {expected_locations}"
f"\n\t\tActual: {number_locations}")
class TestFriendsanityNone(SVTestBase):
options = {
Friendsanity.internal_name: Friendsanity.option_none,
}
@property
def run_default_tests(self) -> bool:
# None is default
return False
def test_friendsanity_none(self):
with self.subTest("No Items"):
self.check_no_friendsanity_items()
with self.subTest("No Locations"):
self.check_no_friendsanity_locations()
def check_no_friendsanity_items(self):
for item in self.multiworld.itempool:
self.assertFalse(item.name.endswith(" <3"))
def check_no_friendsanity_locations(self):
for location_name in self.get_real_location_names():
self.assertFalse(location_name.startswith("Friendsanity"))
class TestFriendsanityBachelors(SVTestBase):
options = {
Friendsanity.internal_name: Friendsanity.option_bachelors,
FriendsanityHeartSize.internal_name: 1,
}
bachelors = {"Harvey", "Elliott", "Sam", "Alex", "Shane", "Sebastian", "Emily", "Haley", "Leah", "Abigail", "Penny",
"Maru"}
def test_friendsanity_only_bachelors(self):
with self.subTest("Items are valid"):
self.check_only_bachelors_items()
with self.subTest("Locations are valid"):
self.check_only_bachelors_locations()
def check_only_bachelors_items(self):
suffix = " <3"
for item in self.multiworld.itempool:
if item.name.endswith(suffix):
villager_name = item.name[:item.name.index(suffix)]
self.assertIn(villager_name, self.bachelors)
def check_only_bachelors_locations(self):
prefix = "Friendsanity: "
suffix = " <3"
for location_name in self.get_real_location_names():
if location_name.startswith(prefix):
name_no_prefix = location_name[len(prefix):]
name_trimmed = name_no_prefix[:name_no_prefix.index(suffix)]
parts = name_trimmed.split(" ")
name = parts[0]
hearts = parts[1]
self.assertIn(name, self.bachelors)
self.assertLessEqual(int(hearts), 8)
class TestFriendsanityStartingNpcs(SVTestBase):
options = {
Friendsanity.internal_name: Friendsanity.option_starting_npcs,
FriendsanityHeartSize.internal_name: 1,
}
excluded_npcs = {"Leo", "Krobus", "Dwarf", "Sandy", "Kent"}
def test_friendsanity_only_starting_npcs(self):
with self.subTest("Items are valid"):
self.check_only_starting_npcs_items()
with self.subTest("Locations are valid"):
self.check_only_starting_npcs_locations()
def check_only_starting_npcs_items(self):
suffix = " <3"
for item in self.multiworld.itempool:
if item.name.endswith(suffix):
villager_name = item.name[:item.name.index(suffix)]
self.assertNotIn(villager_name, self.excluded_npcs)
def check_only_starting_npcs_locations(self):
prefix = "Friendsanity: "
suffix = " <3"
for location_name in self.get_real_location_names():
if location_name.startswith(prefix):
name_no_prefix = location_name[len(prefix):]
name_trimmed = name_no_prefix[:name_no_prefix.index(suffix)]
parts = name_trimmed.split(" ")
name = parts[0]
hearts = parts[1]
self.assertNotIn(name, self.excluded_npcs)
self.assertTrue(name in all_villagers_by_mod_by_name[ModNames.vanilla] or name == "Pet")
if name == "Pet":
self.assertLessEqual(int(hearts), 5)
elif all_villagers_by_name[name].bachelor:
self.assertLessEqual(int(hearts), 8)
else:
self.assertLessEqual(int(hearts), 10)
class TestFriendsanityAllNpcs(SVTestBase):
options = {
Friendsanity.internal_name: Friendsanity.option_all,
FriendsanityHeartSize.internal_name: 4,
}
def test_friendsanity_all_npcs(self):
with self.subTest("Items are valid"):
self.check_items_are_valid()
with self.subTest("Correct number of items"):
self.check_correct_number_of_items()
with self.subTest("Locations are valid"):
self.check_locations_are_valid()
def check_items_are_valid(self):
suffix = " <3"
for item in self.multiworld.itempool:
if item.name.endswith(suffix):
villager_name = item.name[:item.name.index(suffix)]
self.assertTrue(villager_name in all_villagers_by_mod_by_name[ModNames.vanilla] or villager_name == "Pet")
def check_correct_number_of_items(self):
suffix = " <3"
item_names = [item.name for item in self.multiworld.itempool]
for villager_name in all_villagers_by_mod_by_name[ModNames.vanilla]:
heart_item_name = f"{villager_name}{suffix}"
number_heart_items = item_names.count(heart_item_name)
if all_villagers_by_name[villager_name].bachelor:
self.assertEqual(number_heart_items, 2)
else:
self.assertEqual(number_heart_items, 3)
self.assertEqual(item_names.count("Pet <3"), 2)
def check_locations_are_valid(self):
prefix = "Friendsanity: "
suffix = " <3"
for location_name in self.get_real_location_names():
if not location_name.startswith(prefix):
continue
name_no_prefix = location_name[len(prefix):]
name_trimmed = name_no_prefix[:name_no_prefix.index(suffix)]
parts = name_trimmed.split(" ")
name = parts[0]
hearts = int(parts[1])
self.assertTrue(name in all_villagers_by_mod_by_name[ModNames.vanilla] or name == "Pet")
if name == "Pet":
self.assertTrue(hearts == 4 or hearts == 5)
elif all_villagers_by_name[name].bachelor:
self.assertTrue(hearts == 4 or hearts == 8 or hearts == 12 or hearts == 14)
else:
self.assertTrue(hearts == 4 or hearts == 8 or hearts == 10)
class TestFriendsanityAllNpcsExcludingGingerIsland(SVTestBase):
options = {
Friendsanity.internal_name: Friendsanity.option_all,
FriendsanityHeartSize.internal_name: 4,
ExcludeGingerIsland.internal_name: ExcludeGingerIsland.option_true
}
def test_friendsanity_all_npcs_exclude_island(self):
with self.subTest("Items"):
self.check_items()
with self.subTest("Locations"):
self.check_locations()
def check_items(self):
suffix = " <3"
for item in self.multiworld.itempool:
if item.name.endswith(suffix):
villager_name = item.name[:item.name.index(suffix)]
self.assertNotEqual(villager_name, "Leo")
self.assertTrue(villager_name in all_villagers_by_mod_by_name[ModNames.vanilla] or villager_name == "Pet")
def check_locations(self):
prefix = "Friendsanity: "
suffix = " <3"
for location_name in self.get_real_location_names():
if location_name.startswith(prefix):
name_no_prefix = location_name[len(prefix):]
name_trimmed = name_no_prefix[:name_no_prefix.index(suffix)]
parts = name_trimmed.split(" ")
name = parts[0]
hearts = parts[1]
self.assertNotEqual(name, "Leo")
self.assertTrue(name in all_villagers_by_mod_by_name[ModNames.vanilla] or name == "Pet")
if name == "Pet":
self.assertLessEqual(int(hearts), 5)
elif all_villagers_by_name[name].bachelor:
self.assertLessEqual(int(hearts), 8)
else:
self.assertLessEqual(int(hearts), 10)
class TestFriendsanityHeartSize3(SVTestBase):
options = {
Friendsanity.internal_name: Friendsanity.option_all_with_marriage,
FriendsanityHeartSize.internal_name: 3,
}
def test_friendsanity_all_npcs_with_marriage(self):
with self.subTest("Items are valid"):
self.check_items_are_valid()
with self.subTest("Correct number of items"):
self.check_correct_number_of_items()
with self.subTest("Locations are valid"):
self.check_locations_are_valid()
def check_items_are_valid(self):
suffix = " <3"
for item in self.multiworld.itempool:
if item.name.endswith(suffix):
villager_name = item.name[:item.name.index(suffix)]
self.assertTrue(villager_name in all_villagers_by_mod_by_name[ModNames.vanilla] or villager_name == "Pet")
def check_correct_number_of_items(self):
suffix = " <3"
item_names = [item.name for item in self.multiworld.itempool]
for villager_name in all_villagers_by_mod_by_name[ModNames.vanilla]:
heart_item_name = f"{villager_name}{suffix}"
number_heart_items = item_names.count(heart_item_name)
if all_villagers_by_name[villager_name].bachelor:
self.assertEqual(number_heart_items, 5)
else:
self.assertEqual(number_heart_items, 4)
self.assertEqual(item_names.count("Pet <3"), 2)
def check_locations_are_valid(self):
prefix = "Friendsanity: "
suffix = " <3"
for location_name in self.get_real_location_names():
if not location_name.startswith(prefix):
continue
name_no_prefix = location_name[len(prefix):]
name_trimmed = name_no_prefix[:name_no_prefix.index(suffix)]
parts = name_trimmed.split(" ")
name = parts[0]
hearts = int(parts[1])
self.assertTrue(name in all_villagers_by_mod_by_name[ModNames.vanilla] or name == "Pet")
if name == "Pet":
self.assertTrue(hearts == 3 or hearts == 5)
elif all_villagers_by_name[name].bachelor:
self.assertTrue(hearts == 3 or hearts == 6 or hearts == 9 or hearts == 12 or hearts == 14)
else:
self.assertTrue(hearts == 3 or hearts == 6 or hearts == 9 or hearts == 10)
class TestFriendsanityHeartSize5(SVTestBase):
options = {
Friendsanity.internal_name: Friendsanity.option_all_with_marriage,
FriendsanityHeartSize.internal_name: 5,
}
def test_friendsanity_all_npcs_with_marriage(self):
with self.subTest("Items are valid"):
self.check_items_are_valid()
with self.subTest("Correct number of items"):
self.check_correct_number_of_items()
with self.subTest("Locations are valid"):
self.check_locations_are_valid()
def check_items_are_valid(self):
suffix = " <3"
for item in self.multiworld.itempool:
if item.name.endswith(suffix):
villager_name = item.name[:item.name.index(suffix)]
self.assertTrue(villager_name in all_villagers_by_mod_by_name[ModNames.vanilla] or villager_name == "Pet")
def check_correct_number_of_items(self):
suffix = " <3"
item_names = [item.name for item in self.multiworld.itempool]
for villager_name in all_villagers_by_mod_by_name[ModNames.vanilla]:
heart_item_name = f"{villager_name}{suffix}"
number_heart_items = item_names.count(heart_item_name)
if all_villagers_by_name[villager_name].bachelor:
self.assertEqual(number_heart_items, 3)
else:
self.assertEqual(number_heart_items, 2)
self.assertEqual(item_names.count("Pet <3"), 1)
def check_locations_are_valid(self):
prefix = "Friendsanity: "
suffix = " <3"
for location_name in self.get_real_location_names():
if not location_name.startswith(prefix):
continue
name_no_prefix = location_name[len(prefix):]
name_trimmed = name_no_prefix[:name_no_prefix.index(suffix)]
parts = name_trimmed.split(" ")
name = parts[0]
hearts = int(parts[1])
self.assertTrue(name in all_villagers_by_mod_by_name[ModNames.vanilla] or name == "Pet")
if name == "Pet":
self.assertTrue(hearts == 5)
elif all_villagers_by_name[name].bachelor:
self.assertTrue(hearts == 5 or hearts == 10 or hearts == 14)
else:
self.assertTrue(hearts == 5 or hearts == 10)
class TestShipsanityNone(SVTestBase):
options = {
Shipsanity.internal_name: Shipsanity.option_none
}
def run_default_tests(self) -> bool:
# None is default
return False
def test_no_shipsanity_locations(self):
for location in self.get_real_locations():
with self.subTest(location.name):
@@ -779,6 +398,7 @@ class TestShipsanityNone(SVTestBase):
class TestShipsanityCrops(SVTestBase):
options = {
Shipsanity.internal_name: Shipsanity.option_crops,
ExcludeGingerIsland.internal_name: ExcludeGingerIsland.option_false,
SpecialOrderLocations.internal_name: SpecialOrderLocations.option_board_qi
}
@@ -825,7 +445,7 @@ class TestShipsanityCropsExcludeIsland(SVTestBase):
class TestShipsanityCropsNoQiCropWithoutSpecialOrders(SVTestBase):
options = {
Shipsanity.internal_name: Shipsanity.option_crops,
SpecialOrderLocations.internal_name: SpecialOrderLocations.option_board_only
SpecialOrderLocations.internal_name: SpecialOrderLocations.option_board
}
def test_only_crop_shipsanity_locations(self):
@@ -848,6 +468,7 @@ class TestShipsanityCropsNoQiCropWithoutSpecialOrders(SVTestBase):
class TestShipsanityFish(SVTestBase):
options = {
Shipsanity.internal_name: Shipsanity.option_fish,
ExcludeGingerIsland.internal_name: ExcludeGingerIsland.option_false,
SpecialOrderLocations.internal_name: SpecialOrderLocations.option_board_qi
}
@@ -896,7 +517,7 @@ class TestShipsanityFishExcludeIsland(SVTestBase):
class TestShipsanityFishExcludeQiOrders(SVTestBase):
options = {
Shipsanity.internal_name: Shipsanity.option_fish,
SpecialOrderLocations.internal_name: SpecialOrderLocations.option_board_only
SpecialOrderLocations.internal_name: SpecialOrderLocations.option_board
}
def test_only_fish_shipsanity_locations(self):
@@ -920,6 +541,7 @@ class TestShipsanityFishExcludeQiOrders(SVTestBase):
class TestShipsanityFullShipment(SVTestBase):
options = {
Shipsanity.internal_name: Shipsanity.option_full_shipment,
ExcludeGingerIsland.internal_name: ExcludeGingerIsland.option_false,
SpecialOrderLocations.internal_name: SpecialOrderLocations.option_board_qi
}
@@ -973,7 +595,7 @@ class TestShipsanityFullShipmentExcludeIsland(SVTestBase):
class TestShipsanityFullShipmentExcludeQiBoard(SVTestBase):
options = {
Shipsanity.internal_name: Shipsanity.option_full_shipment,
SpecialOrderLocations.internal_name: SpecialOrderLocations.option_disabled
SpecialOrderLocations.internal_name: SpecialOrderLocations.option_vanilla
}
def test_only_full_shipment_shipsanity_locations(self):
@@ -1000,6 +622,7 @@ class TestShipsanityFullShipmentExcludeQiBoard(SVTestBase):
class TestShipsanityFullShipmentWithFish(SVTestBase):
options = {
Shipsanity.internal_name: Shipsanity.option_full_shipment_with_fish,
ExcludeGingerIsland.internal_name: ExcludeGingerIsland.option_false,
SpecialOrderLocations.internal_name: SpecialOrderLocations.option_board_qi
}
@@ -1069,7 +692,7 @@ class TestShipsanityFullShipmentWithFishExcludeIsland(SVTestBase):
class TestShipsanityFullShipmentWithFishExcludeQiBoard(SVTestBase):
options = {
Shipsanity.internal_name: Shipsanity.option_full_shipment_with_fish,
SpecialOrderLocations.internal_name: SpecialOrderLocations.option_board_only
SpecialOrderLocations.internal_name: SpecialOrderLocations.option_board
}
def test_only_full_shipment_and_fish_shipsanity_locations(self):