mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21:32 -06:00
Timespinner: migrate to new options api and correct random (#2485)
* Implemented new options system into Timespinner * Fixed typo * Fixed typo * Fixed slotdata maybe * Fixes * more fixes * Fixed failing unit tests * Implemented options backwards comnpatibility * Fixed option fallbacks * Implemented review results * Fixed logic bug * Fixed python 3.8/3.9 compatibility * Replaced one more multiworld option usage * Update worlds/timespinner/Options.py Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com> * Updated logging of options replacement to include player name and also write it to spoiler Fixed generation bug Implemented review results --------- Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
from typing import Union
|
||||
from BaseClasses import MultiWorld, CollectionState
|
||||
from .Options import is_option_enabled
|
||||
from typing import Union, Optional
|
||||
from BaseClasses import CollectionState
|
||||
from .Options import TimespinnerOptions
|
||||
from .PreCalculatedWeights import PreCalculatedWeights
|
||||
|
||||
|
||||
@@ -10,17 +10,18 @@ class TimespinnerLogic:
|
||||
flag_unchained_keys: bool
|
||||
flag_eye_spy: bool
|
||||
flag_specific_keycards: bool
|
||||
pyramid_keys_unlock: Union[str, None]
|
||||
present_keys_unlock: Union[str, None]
|
||||
past_keys_unlock: Union[str, None]
|
||||
time_keys_unlock: Union[str, None]
|
||||
pyramid_keys_unlock: Optional[str]
|
||||
present_keys_unlock: Optional[str]
|
||||
past_keys_unlock: Optional[str]
|
||||
time_keys_unlock: Optional[str]
|
||||
|
||||
def __init__(self, world: MultiWorld, player: int, precalculated_weights: PreCalculatedWeights):
|
||||
def __init__(self, player: int, options: Optional[TimespinnerOptions],
|
||||
precalculated_weights: Optional[PreCalculatedWeights]):
|
||||
self.player = player
|
||||
|
||||
self.flag_specific_keycards = is_option_enabled(world, player, "SpecificKeycards")
|
||||
self.flag_eye_spy = is_option_enabled(world, player, "EyeSpy")
|
||||
self.flag_unchained_keys = is_option_enabled(world, player, "UnchainedKeys")
|
||||
self.flag_specific_keycards = bool(options and options.specific_keycards)
|
||||
self.flag_eye_spy = bool(options and options.eye_spy)
|
||||
self.flag_unchained_keys = bool(options and options.unchained_keys)
|
||||
|
||||
if precalculated_weights:
|
||||
if self.flag_unchained_keys:
|
||||
|
||||
Reference in New Issue
Block a user