From 592792631411765f2e1e67d615abbf09410fca5a Mon Sep 17 00:00:00 2001 From: Mysteryem Date: Fri, 3 Jan 2025 12:03:30 +0000 Subject: [PATCH] Blasphemous: Fix starting_location: random affecting all Blasphemous worlds (#4428) Option resolution for the `StartingLocation` option (the only `ChoiceIsRandom` subclass) was writing to the `randomized` attribute on the class instead of on the instance, meaning that `self.options.starting_location.randomized` would be `True` for all Blasphemous players in the multiworld if any one of the players set their `StartingLocation` option to `"random"`. This patch fixes the issue by writing to the `randomized` attribute on the new instance instead of on the class. --- worlds/blasphemous/Options.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/worlds/blasphemous/Options.py b/worlds/blasphemous/Options.py index e0bbcd77..2cb2d8a1 100644 --- a/worlds/blasphemous/Options.py +++ b/worlds/blasphemous/Options.py @@ -4,14 +4,17 @@ import random class ChoiceIsRandom(Choice): - randomized: bool = False + randomized: bool + + def __init__(self, value: int, randomized: bool = False): + super().__init__(value) + self.randomized = randomized @classmethod def from_text(cls, text: str) -> Choice: text = text.lower() if text == "random": - cls.randomized = True - return cls(random.choice(list(cls.name_lookup))) + return cls(random.choice(list(cls.name_lookup)), True) for option_name, value in cls.options.items(): if option_name == text: return cls(value)