Files
Grinch-AP/worlds/stardew_valley/test/rules/TestShipping.py
agilbert1412 9b22458f44 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 15:04:25 +02:00

83 lines
3.4 KiB
Python

from ...locations import LocationTags, location_table
from ...options import BuildingProgression, Shipsanity
from ...test import SVTestBase
class TestShipsanityNone(SVTestBase):
options = {
Shipsanity.internal_name: Shipsanity.option_none
}
def test_no_shipsanity_locations(self):
for location in self.get_real_locations():
self.assertFalse("Shipsanity" in location.name)
self.assertNotIn(LocationTags.SHIPSANITY, location_table[location.name].tags)
class TestShipsanityCrops(SVTestBase):
options = {
Shipsanity.internal_name: Shipsanity.option_crops
}
def test_only_crop_shipsanity_locations(self):
for location in self.get_real_locations():
if LocationTags.SHIPSANITY in location_table[location.name].tags:
self.assertIn(LocationTags.SHIPSANITY_CROP, location_table[location.name].tags)
class TestShipsanityFish(SVTestBase):
options = {
Shipsanity.internal_name: Shipsanity.option_fish
}
def test_only_fish_shipsanity_locations(self):
for location in self.get_real_locations():
if LocationTags.SHIPSANITY in location_table[location.name].tags:
self.assertIn(LocationTags.SHIPSANITY_FISH, location_table[location.name].tags)
class TestShipsanityFullShipment(SVTestBase):
options = {
Shipsanity.internal_name: Shipsanity.option_full_shipment
}
def test_only_full_shipment_shipsanity_locations(self):
for location in self.get_real_locations():
if LocationTags.SHIPSANITY in location_table[location.name].tags:
self.assertIn(LocationTags.SHIPSANITY_FULL_SHIPMENT, location_table[location.name].tags)
self.assertNotIn(LocationTags.SHIPSANITY_FISH, location_table[location.name].tags)
class TestShipsanityFullShipmentWithFish(SVTestBase):
options = {
Shipsanity.internal_name: Shipsanity.option_full_shipment_with_fish
}
def test_only_full_shipment_and_fish_shipsanity_locations(self):
for location in self.get_real_locations():
if LocationTags.SHIPSANITY in location_table[location.name].tags:
self.assertTrue(LocationTags.SHIPSANITY_FULL_SHIPMENT in location_table[location.name].tags or
LocationTags.SHIPSANITY_FISH in location_table[location.name].tags)
class TestShipsanityEverything(SVTestBase):
options = {
Shipsanity.internal_name: Shipsanity.option_everything,
BuildingProgression.internal_name: BuildingProgression.option_progressive
}
def test_all_shipsanity_locations_require_shipping_bin(self):
bin_name = "Shipping Bin"
self.collect_all_except(bin_name)
shipsanity_locations = [location for location in self.get_real_locations() if
LocationTags.SHIPSANITY in location_table[location.name].tags]
bin_item = self.create_item(bin_name)
for location in shipsanity_locations:
with self.subTest(location.name):
self.remove(bin_item)
self.assertFalse(self.world.logic.region.can_reach_location(location.name)(self.multiworld.state))
self.multiworld.state.collect(bin_item, event=False)
shipsanity_rule = self.world.logic.region.can_reach_location(location.name)
self.assert_rule_true(shipsanity_rule, self.multiworld.state)
self.remove(bin_item)