Skip to content

Commit d8164d2

Browse files
agilbert1412FlySniper
authored andcommitted
Stardew Valley: Fix two logic bugs with the wizard on Entrance Randomizer (ArchipelagoMW#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
1 parent ef9560b commit d8164d2

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

worlds/stardew_valley/data/villagers_data.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ def __repr__(self):
3939
sewers = (Region.sewer,)
4040
island = (Region.island_east,)
4141
secret_woods = (Region.secret_woods,)
42+
wizard_tower = (Region.wizard_tower,)
4243

4344
golden_pumpkin = ("Golden Pumpkin",)
4445
# magic_rock_candy = ("Magic Rock Candy",)
@@ -314,7 +315,7 @@ def villager(name: str, bachelor: bool, locations: Tuple[str, ...], birthday: st
314315
sandy = villager(NPC.sandy, False, oasis, Season.fall, universal_loves + sandy_loves, False)
315316
vincent = villager(NPC.vincent, False, town, Season.spring, universal_loves + vincent_loves, True)
316317
willy = villager(NPC.willy, False, beach, Season.summer, universal_loves + willy_loves, True)
317-
wizard = villager(NPC.wizard, False, forest, Season.winter, universal_loves + wizard_loves, True)
318+
wizard = villager(NPC.wizard, False, wizard_tower, Season.winter, universal_loves + wizard_loves, True)
318319

319320
# Custom NPCs
320321
alec = villager(ModNPC.alec, True, forest, Season.winter, universal_loves + trilobite, True, ModNames.alec)

worlds/stardew_valley/logic.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1166,14 +1166,15 @@ def can_befriend_pet(self, hearts: int):
11661166
def can_complete_bundle(self, bundle_requirements: List[BundleItem], number_required: int) -> StardewRule:
11671167
item_rules = []
11681168
highest_quality_yet = 0
1169+
can_speak_junimo = self.can_reach_region(Region.wizard_tower)
11691170
for bundle_item in bundle_requirements:
11701171
if bundle_item.item.item_id == -1:
1171-
return self.can_spend_money(bundle_item.amount)
1172+
return can_speak_junimo & self.can_spend_money(bundle_item.amount)
11721173
else:
11731174
item_rules.append(bundle_item.item.name)
11741175
if bundle_item.quality > highest_quality_yet:
11751176
highest_quality_yet = bundle_item.quality
1176-
return self.can_reach_region(Region.wizard_tower) & self.has(item_rules, number_required) & self.can_grow_gold_quality(highest_quality_yet)
1177+
return can_speak_junimo & self.has(item_rules, number_required) & self.can_grow_gold_quality(highest_quality_yet)
11771178

11781179
def can_grow_gold_quality(self, quality: int) -> StardewRule:
11791180
if quality <= 0:

worlds/stardew_valley/test/TestGeneration.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ def test_minimal_location_maximal_items_still_valid(self):
214214
self.assertGreaterEqual(len(valid_locations), len(multiworld.itempool))
215215

216216
def test_allsanity_without_mods_has_at_least_locations(self):
217-
expected_locations = 993
217+
expected_locations = 994
218218
allsanity_options = self.allsanity_options_without_mods()
219219
multiworld = setup_solo_multiworld(allsanity_options)
220220
number_locations = len(get_real_locations(self, multiworld))
@@ -227,7 +227,7 @@ def test_allsanity_without_mods_has_at_least_locations(self):
227227
f"\n\t\tActual: {number_locations}")
228228

229229
def test_allsanity_with_mods_has_at_least_locations(self):
230-
expected_locations = 1245
230+
expected_locations = 1246
231231
allsanity_options = self.allsanity_options_with_mods()
232232
multiworld = setup_solo_multiworld(allsanity_options)
233233
number_locations = len(get_real_locations(self, multiworld))

0 commit comments

Comments
 (0)