Pokémon R/B: Another quiz fix
This commit is contained in:
parent
4ff282a384
commit
3ef0a56ec2
|
@ -577,10 +577,7 @@ def write_quizzes(self, data, random):
|
|||
for location in self.multiworld.get_filled_locations():
|
||||
if location.item.name == "Secret Key" and location.item.player == self.player:
|
||||
break
|
||||
if location.player == self.player:
|
||||
player_name = "yourself"
|
||||
else:
|
||||
player_name = self.multiworld.player_name[location.player]
|
||||
player_name = self.multiworld.player_name[location.player]
|
||||
if not a:
|
||||
if len(self.multiworld.player_name) > 1:
|
||||
old_name = player_name
|
||||
|
@ -588,7 +585,10 @@ def write_quizzes(self, data, random):
|
|||
player_name = random.choice(list(self.multiworld.player_name.values()))
|
||||
else:
|
||||
return encode_text("You're playing<LINE>in a multiworld<CONT>with other<CONT>players?<DONE>")
|
||||
return encode_text(f"The Secret Key was<LINE>found by<CONT>{player_name[:17]}?<DONE>")
|
||||
if player_name == self.multiworld.player_name[self.player]:
|
||||
player_name = "yourself"
|
||||
player_name = encode_text(player_name, force=True, safety=True)
|
||||
return encode_text(f"The Secret Key was<LINE>found by<CONT>") + player_name + encode_text("<DONE>")
|
||||
elif q == 2:
|
||||
if a:
|
||||
return encode_text(f"#mon is<LINE>pronounced<CONT>Po-kay-mon?<DONE>")
|
||||
|
|
|
@ -118,9 +118,9 @@ def encode_text(text: str, length: int=0, whitespace=False, force=False, safety=
|
|||
special = False
|
||||
for char in text:
|
||||
if char == ">":
|
||||
if spec_char in unsafe_chars and safety:
|
||||
raise KeyError(f"Disallowed Pokemon text special character '<{spec_char}>'")
|
||||
try:
|
||||
if spec_char in unsafe_chars and safety:
|
||||
raise KeyError(f"Disallowed Pokemon text special character '<{spec_char}>'")
|
||||
encoded_text.append(special_chars[spec_char])
|
||||
except KeyError:
|
||||
if force:
|
||||
|
@ -135,10 +135,10 @@ def encode_text(text: str, length: int=0, whitespace=False, force=False, safety=
|
|||
elif special is True:
|
||||
spec_char += char
|
||||
else:
|
||||
if char in unsafe_chars and safety:
|
||||
raise KeyError(f"Disallowed Pokemon text character '{char}'")
|
||||
try:
|
||||
encoded_text.append(char_map[char])
|
||||
if char in unsafe_chars and safety:
|
||||
raise KeyError(f"Disallowed Pokemon text character '{char}'")
|
||||
except KeyError:
|
||||
if force:
|
||||
encoded_text.append(char_map[" "])
|
||||
|
|
Loading…
Reference in New Issue