Files
Grinch-AP/worlds/stardew_valley/test/rules/TestDonations.py
Jérémie Bolduc 9ac921380f Stardew Valley: Refactor buildings to use content packs (#4239)
* create building data object and rename ItemSource to Source to be more generic

# Conflicts:
#	worlds/stardew_valley/content/game_content.py

# Conflicts:
#	worlds/stardew_valley/data/artisan.py
#	worlds/stardew_valley/data/game_item.py
#	worlds/stardew_valley/data/harvest.py
#	worlds/stardew_valley/data/shop.py

* remove compound sources, replace by other requirements which already handle this usecase

* add coops to content packs

* add building progression in game features

* add shippping bin to starting building; remove has_house

* replace config check with feature

* add other buildings in content packs

* not passing

* tests passes, unbelievable

* use newly create methods more

* use new assets to ease readability

* self review

* fix flake8 maybe

* properly split rule for mapping cave systems

* fix tractor garage name

* self review

* add upgrade_from to farm house buldings

* don't override building name variable in logic

* remove has_group from buildings

* mark some items easy in grinding logic so blueprints buildings can be in more early spheres

* move stuff around to maybe avoid future conflicts cuz I have like 10 PRs opened right now

* remove price_multiplier, turns out it's unused during generation

* disable shop source for mapping cave systems

* bunch of code review changes

* add petbowl and farmhouse to autobuilding

* set min easy items to 300

* fix farm type
2025-04-08 12:37:45 -04:00

74 lines
2.9 KiB
Python

from ... import options
from ...locations import locations_by_tag, LocationTags, location_table
from ...strings.entrance_names import Entrance
from ...strings.region_names import Region
from ...test import SVTestBase
class TestDonationLogicAll(SVTestBase):
options = {
options.Museumsanity.internal_name: options.Museumsanity.option_all
}
def test_cannot_make_any_donation_without_museum_access(self):
railroad_item = "Railroad Boulder Removed"
swap_museum_and_bathhouse(self.multiworld, self.player)
self.collect_all_except(railroad_item)
for donation in locations_by_tag[LocationTags.MUSEUM_DONATIONS]:
self.assert_cannot_reach_location(donation.name)
self.multiworld.state.collect(self.create_item(railroad_item))
for donation in locations_by_tag[LocationTags.MUSEUM_DONATIONS]:
self.assert_can_reach_location(donation.name)
class TestDonationLogicRandomized(SVTestBase):
options = {
options.Museumsanity.internal_name: options.Museumsanity.option_randomized
}
def test_cannot_make_any_donation_without_museum_access(self):
railroad_item = "Railroad Boulder Removed"
swap_museum_and_bathhouse(self.multiworld, self.player)
self.collect_all_except(railroad_item)
donation_locations = [location for location in self.get_real_locations() if
LocationTags.MUSEUM_DONATIONS in location_table[location.name].tags]
for donation in donation_locations:
self.assert_cannot_reach_location(donation.name)
self.multiworld.state.collect(self.create_item(railroad_item))
for donation in donation_locations:
self.assert_can_reach_location(donation.name)
class TestDonationLogicMilestones(SVTestBase):
options = {
options.Museumsanity.internal_name: options.Museumsanity.option_milestones
}
def test_cannot_make_any_donation_without_museum_access(self):
railroad_item = "Railroad Boulder Removed"
swap_museum_and_bathhouse(self.multiworld, self.player)
self.collect_all_except(railroad_item)
for donation in locations_by_tag[LocationTags.MUSEUM_MILESTONES]:
self.assert_cannot_reach_location(donation.name)
self.multiworld.state.collect(self.create_item(railroad_item))
for donation in locations_by_tag[LocationTags.MUSEUM_MILESTONES]:
self.assert_can_reach_location(donation.name)
def swap_museum_and_bathhouse(multiworld, player):
museum_region = multiworld.get_region(Region.museum, player)
bathhouse_region = multiworld.get_region(Region.bathhouse_entrance, player)
museum_entrance = multiworld.get_entrance(Entrance.town_to_museum, player)
bathhouse_entrance = multiworld.get_entrance(Entrance.enter_bathhouse_entrance, player)
museum_entrance.connect(bathhouse_region)
bathhouse_entrance.connect(museum_region)