Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion worlds/stardew_valley/data/villagers_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def __repr__(self):
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",)
Expand Down Expand Up @@ -314,7 +315,7 @@ def villager(name: str, bachelor: bool, locations: Tuple[str, ...], birthday: st
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)
Expand Down
5 changes: 3 additions & 2 deletions worlds/stardew_valley/logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1166,14 +1166,15 @@ def can_befriend_pet(self, hearts: int):
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:
Expand Down
4 changes: 2 additions & 2 deletions worlds/stardew_valley/test/TestGeneration.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def test_minimal_location_maximal_items_still_valid(self):
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))
Expand All @@ -227,7 +227,7 @@ def test_allsanity_without_mods_has_at_least_locations(self):
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))
Expand Down