Core: move PlandoConnections and PlandoTexts to the options system (#2904)

Co-authored-by: Doug Hoskisson <[email protected]>
Co-authored-by: Scipio Wright <[email protected]>
Co-authored-by: beauxq <[email protected]>
Co-authored-by: alwaysintreble <[email protected]>
This commit is contained in:
Silvris
2024-06-01 06:34:41 -05:00
committed by GitHub
co-authored by Doug Hoskisson Scipio Wright beauxq alwaysintreble
parent f40b10dc97
commit 4e5b6bb3d2
19 changed files with 767 additions and 71 deletions
+8 -1
View File
@@ -1,6 +1,7 @@
import typing
import random
from Options import Option, DefaultOnToggle, Toggle, Range, OptionList, OptionSet, DeathLink
from Options import Option, DefaultOnToggle, Toggle, Range, OptionList, OptionSet, DeathLink, PlandoConnections
from .EntranceShuffle import entrance_shuffle_table
from .LogicTricks import normalized_name_tricks
from .ColorSFXOptions import *
@@ -29,6 +30,11 @@ class TrackRandomRange(Range):
raise RuntimeError(f"All options specified in \"{cls.display_name}\" are weighted as zero.")
class OoTPlandoConnections(PlandoConnections):
entrances = set([connection[1][0] for connection in entrance_shuffle_table])
exits = set([connection[2][0] for connection in entrance_shuffle_table if len(connection) > 2])
class Logic(Choice):
"""Set the logic used for the generator.
Glitchless: Normal gameplay. Can enable more difficult logical paths using the Logic Tricks option.
@@ -1277,6 +1283,7 @@ class LogicTricks(OptionList):
# All options assembled into a single dict
oot_options: typing.Dict[str, type(Option)] = {
"plando_connections": OoTPlandoConnections,
"logic_rules": Logic,
"logic_no_night_tokens_without_suns_song": NightTokens,
**open_options,
+3 -1
View File
@@ -32,7 +32,7 @@ from .Cosmetics import patch_cosmetics
from Utils import get_options
from BaseClasses import MultiWorld, CollectionState, Tutorial, LocationProgressType
from Options import Range, Toggle, VerifyKeys, Accessibility
from Options import Range, Toggle, VerifyKeys, Accessibility, PlandoConnections
from Fill import fill_restrictive, fast_fill, FillError
from worlds.generic.Rules import exclusion_rules, add_item_rule
from ..AutoWorld import World, AutoLogicRegister, WebWorld
@@ -201,6 +201,8 @@ class OOTWorld(World):
option_value = bool(result)
elif isinstance(result, VerifyKeys):
option_value = result.value
elif isinstance(result, PlandoConnections):
option_value = result.value
else:
option_value = result.current_key
setattr(self, option_name, option_value)