Skip to content

Commit

Permalink
Make RandomEnemyPresetOption compatible with ArchipelagoMW#3280 (Ar…
Browse files Browse the repository at this point in the history
  • Loading branch information
nex3 authored Aug 6, 2024
1 parent 3776c35 commit 5374f51
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions worlds/dark_souls_3/Options.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import json
from typing import Any, Dict

from Options import Choice, DeathLink, DefaultOnToggle, ExcludeLocations, NamedRange, Option, OptionGroup, \
PerGameCommonOptions, Range, Removed, Toggle, VerifyKeys
from Options import Choice, DeathLink, DefaultOnToggle, ExcludeLocations, NamedRange, OptionDict, \
OptionGroup, PerGameCommonOptions, Range, Removed, Toggle

## Game Options

Expand Down Expand Up @@ -293,10 +293,17 @@ class ImpatientMimicsOption(Toggle):
display_name = "Impatient Mimics"


class RandomEnemyPresetOption(Option[Dict[str, Any]], VerifyKeys):
class RandomEnemyPresetOption(OptionDict):
"""The YAML preset for the static enemy randomizer.
See the static randomizer documentation in `randomizer\\presets\\README.txt` for details.
Include this as nested YAML. For example:
.. code-block:: YAML
random_enemy_preset:
RemoveSource: Ancient Wyvern; Darkeater Midir
DontRandomize: Iudex Gundyr
"""
display_name = "Random Enemy Preset"
supports_weighting = False
Expand All @@ -313,14 +320,6 @@ def __init__(self, value: Dict[str, Any]):
def get_option_name(cls, value: Dict[str, Any]) -> str:
return json.dumps(value)

@classmethod
def from_any(cls, data: Dict[str, Any]) -> "RandomEnemyPresetOption":
if isinstance(data, dict):
cls.verify_keys(data)
return cls(data)
else:
raise NotImplementedError(f"Must be a dictionary, got {type(data)}")


## Item & Location

Expand Down

0 comments on commit 5374f51

Please sign in to comment.