Skip to content

Commit

Permalink
TUNIC: Add setting to disable local spoiler to host yaml (Archipelago…
Browse files Browse the repository at this point in the history
…MW#3661)

* Add TunicSettings class for host yaml options

* Update __init__.py

* Update worlds/tunic/__init__.py

Co-authored-by: Scipio Wright <[email protected]>

* Use self.settings

* Remove unused import

---------

Co-authored-by: Scipio Wright <[email protected]>
  • Loading branch information
silent-destroyer and ScipioWright authored Jul 23, 2024
1 parent 5188375 commit ed4ad38
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions worlds/tunic/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Dict, List, Any, Tuple, TypedDict
from typing import Dict, List, Any, Tuple, TypedDict, ClassVar, Union
from logging import warning
from BaseClasses import Region, Location, Item, Tutorial, ItemClassification, MultiWorld
from .items import item_name_to_id, item_table, item_name_groups, fool_tiers, filler_items, slot_data_item_names
Expand All @@ -12,6 +12,14 @@
from worlds.AutoWorld import WebWorld, World
from Options import PlandoConnection
from decimal import Decimal, ROUND_HALF_UP
from settings import Group, Bool


class TunicSettings(Group):
class DisableLocalSpoiler(Bool):
"""Disallows the TUNIC client from creating a local spoiler log."""

disable_local_spoiler: Union[DisableLocalSpoiler, bool] = False


class TunicWeb(WebWorld):
Expand Down Expand Up @@ -57,6 +65,7 @@ class TunicWorld(World):

options: TunicOptions
options_dataclass = TunicOptions
settings: ClassVar[TunicSettings]
item_name_groups = item_name_groups
location_name_groups = location_name_groups

Expand Down Expand Up @@ -373,7 +382,8 @@ def fill_slot_data(self) -> Dict[str, Any]:
"Hexagon Quest Holy Cross": self.ability_unlocks["Pages 42-43 (Holy Cross)"],
"Hexagon Quest Icebolt": self.ability_unlocks["Pages 52-53 (Icebolt)"],
"Hexagon Quest Goal": self.options.hexagon_goal.value,
"Entrance Rando": self.tunic_portal_pairs
"Entrance Rando": self.tunic_portal_pairs,
"disable_local_spoiler": int(self.settings.disable_local_spoiler or self.multiworld.is_race),
}

for tunic_item in filter(lambda item: item.location is not None and item.code is not None, self.slot_data_items):
Expand Down

0 comments on commit ed4ad38

Please sign in to comment.