Skip to content

Commit

Permalink
Stardew Valley: Fix generation fail with SVE and entrance rando when …
Browse files Browse the repository at this point in the history
…Wizard Tower is in place of Sprite Spring (ArchipelagoMW#2970)
  • Loading branch information
Jouramie authored Mar 28, 2024
1 parent 1d45125 commit ca18121
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
11 changes: 6 additions & 5 deletions worlds/stardew_valley/data/villagers_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
class Villager:
name: str
bachelor: bool
locations: Tuple[str]
locations: Tuple[str, ...]
birthday: str
gifts: Tuple[str]
gifts: Tuple[str, ...]
available: bool
mod_name: str

Expand Down Expand Up @@ -366,10 +366,11 @@ def villager(name: str, bachelor: bool, locations: Tuple[str, ...], birthday: st
return npc


def make_bachelor(mod_name: str, npc: Villager):
def adapt_wizard_to_sve(mod_name: str, npc: Villager):
if npc.mod_name:
mod_name = npc.mod_name
return Villager(npc.name, True, npc.locations, npc.birthday, npc.gifts, npc.available, mod_name)
# The wizard leaves his tower on sunday, for like 1 hour... Good enough to meet him!
return Villager(npc.name, True, npc.locations + forest, npc.birthday, npc.gifts, npc.available, mod_name)


def register_villager_modification(mod_name: str, npc: Villager, modification_function):
Expand Down Expand Up @@ -452,7 +453,7 @@ def register_villager_modification(mod_name: str, npc: Villager, modification_fu

# Modified villagers; not included in all villagers

register_villager_modification(ModNames.sve, wizard, make_bachelor)
register_villager_modification(ModNames.sve, wizard, adapt_wizard_to_sve)

all_villagers_by_name: Dict[str, Villager] = {villager.name: villager for villager in all_villagers}
all_villagers_by_mod: Dict[str, List[Villager]] = {}
Expand Down
1 change: 1 addition & 0 deletions worlds/stardew_valley/logic/logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,7 @@ def can_succeed_luau_soup(self) -> StardewRule:
def can_succeed_grange_display(self) -> StardewRule:
if self.options.festival_locations != FestivalLocations.option_hard:
return True_()

animal_rule = self.animal.has_animal(Generic.any)
artisan_rule = self.artisan.can_keg(Generic.any) | self.artisan.can_preserves_jar(Generic.any)
cooking_rule = self.money.can_spend_at(Region.saloon, 220) # Salads at the bar are good enough
Expand Down

0 comments on commit ca18121

Please sign in to comment.