Stardew Valley: Fix generation fail with SVE and entrance rando when Wizard Tower is in place of Sprite Spring (#2970)

This commit is contained in:
Jérémie Bolduc 2024-03-28 04:27:49 -04:00 committed by GitHub
parent 1d4512590e
commit ca18121811
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 5 deletions

View File

@ -13,9 +13,9 @@ from ..strings.villager_names import NPC, ModNPC
class Villager: class Villager:
name: str name: str
bachelor: bool bachelor: bool
locations: Tuple[str] locations: Tuple[str, ...]
birthday: str birthday: str
gifts: Tuple[str] gifts: Tuple[str, ...]
available: bool available: bool
mod_name: str mod_name: str
@ -366,10 +366,11 @@ def villager(name: str, bachelor: bool, locations: Tuple[str, ...], birthday: st
return npc return npc
def make_bachelor(mod_name: str, npc: Villager): def adapt_wizard_to_sve(mod_name: str, npc: Villager):
if npc.mod_name: if npc.mod_name:
mod_name = 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): def register_villager_modification(mod_name: str, npc: Villager, modification_function):
@ -452,7 +453,7 @@ morris = villager(ModNPC.morris, False, jojamart, Season.spring, universal_loves
# Modified villagers; not included in all villagers # 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_name: Dict[str, Villager] = {villager.name: villager for villager in all_villagers}
all_villagers_by_mod: Dict[str, List[Villager]] = {} all_villagers_by_mod: Dict[str, List[Villager]] = {}

View File

@ -546,6 +546,7 @@ class StardewLogic(ReceivedLogicMixin, HasLogicMixin, RegionLogicMixin, BuffLogi
def can_succeed_grange_display(self) -> StardewRule: def can_succeed_grange_display(self) -> StardewRule:
if self.options.festival_locations != FestivalLocations.option_hard: if self.options.festival_locations != FestivalLocations.option_hard:
return True_() return True_()
animal_rule = self.animal.has_animal(Generic.any) animal_rule = self.animal.has_animal(Generic.any)
artisan_rule = self.artisan.can_keg(Generic.any) | self.artisan.can_preserves_jar(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 cooking_rule = self.money.can_spend_at(Region.saloon, 220) # Salads at the bar are good enough