Stardew Valley: Fix two logic bugs with the wizard on Entrance Randomizer (#2192)

* - Added a rule to vault bundles that require access to the wizard
- Fixed the region required to meet the wizard

* - Updated the location count in a test due to a previous coffee bean bugfix that added a location
This commit is contained in:
agilbert1412 2023-09-17 14:20:18 -04:00 committed by GitHub
parent b24037e9d9
commit d5d13a6d4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 5 deletions

View File

@ -39,6 +39,7 @@ oasis = (Region.oasis,)
sewers = (Region.sewer,)
island = (Region.island_east,)
secret_woods = (Region.secret_woods,)
wizard_tower = (Region.wizard_tower,)
golden_pumpkin = ("Golden Pumpkin",)
# magic_rock_candy = ("Magic Rock Candy",)
@ -314,7 +315,7 @@ milf = villager(NPC.robin, False, carpenter, Season.fall, universal_loves + robi
sandy = villager(NPC.sandy, False, oasis, Season.fall, universal_loves + sandy_loves, False)
vincent = villager(NPC.vincent, False, town, Season.spring, universal_loves + vincent_loves, True)
willy = villager(NPC.willy, False, beach, Season.summer, universal_loves + willy_loves, True)
wizard = villager(NPC.wizard, False, forest, Season.winter, universal_loves + wizard_loves, True)
wizard = villager(NPC.wizard, False, wizard_tower, Season.winter, universal_loves + wizard_loves, True)
# Custom NPCs
alec = villager(ModNPC.alec, True, forest, Season.winter, universal_loves + trilobite, True, ModNames.alec)

View File

@ -1166,14 +1166,15 @@ class StardewLogic:
def can_complete_bundle(self, bundle_requirements: List[BundleItem], number_required: int) -> StardewRule:
item_rules = []
highest_quality_yet = 0
can_speak_junimo = self.can_reach_region(Region.wizard_tower)
for bundle_item in bundle_requirements:
if bundle_item.item.item_id == -1:
return self.can_spend_money(bundle_item.amount)
return can_speak_junimo & self.can_spend_money(bundle_item.amount)
else:
item_rules.append(bundle_item.item.name)
if bundle_item.quality > highest_quality_yet:
highest_quality_yet = bundle_item.quality
return self.can_reach_region(Region.wizard_tower) & self.has(item_rules, number_required) & self.can_grow_gold_quality(highest_quality_yet)
return can_speak_junimo & self.has(item_rules, number_required) & self.can_grow_gold_quality(highest_quality_yet)
def can_grow_gold_quality(self, quality: int) -> StardewRule:
if quality <= 0:

View File

@ -214,7 +214,7 @@ class TestLocationAndItemCount(SVTestBase):
self.assertGreaterEqual(len(valid_locations), len(multiworld.itempool))
def test_allsanity_without_mods_has_at_least_locations(self):
expected_locations = 993
expected_locations = 994
allsanity_options = self.allsanity_options_without_mods()
multiworld = setup_solo_multiworld(allsanity_options)
number_locations = len(get_real_locations(self, multiworld))
@ -227,7 +227,7 @@ class TestLocationAndItemCount(SVTestBase):
f"\n\t\tActual: {number_locations}")
def test_allsanity_with_mods_has_at_least_locations(self):
expected_locations = 1245
expected_locations = 1246
allsanity_options = self.allsanity_options_with_mods()
multiworld = setup_solo_multiworld(allsanity_options)
number_locations = len(get_real_locations(self, multiworld))