From fc18d0c9cab015dc242450821bcc70d99d48c669 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Sat, 4 May 2024 01:40:17 -0500 Subject: Lingo: Started using OptionError (#3251) --- __init__.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to '__init__.py') diff --git a/__init__.py b/__init__.py index 537b149..113c392 100644 --- a/__init__.py +++ b/__init__.py @@ -4,6 +4,7 @@ Archipelago init file for Lingo from logging import warning from BaseClasses import Item, ItemClassification, Tutorial +from Options import OptionError from worlds.AutoWorld import WebWorld, World from .datatypes import Room, RoomEntrance from .items import ALL_ITEM_TABLE, ITEMS_BY_GROUP, TRAP_ITEMS, LingoItem @@ -52,13 +53,14 @@ class LingoWorld(World): player_logic: LingoPlayerLogic def generate_early(self): - if not (self.options.shuffle_doors or self.options.shuffle_colors): + if not (self.options.shuffle_doors or self.options.shuffle_colors or self.options.shuffle_sunwarps): if self.multiworld.players == 1: warning(f"{self.multiworld.get_player_name(self.player)}'s Lingo world doesn't have any progression" - f" items. Please turn on Door Shuffle or Color Shuffle if that doesn't seem right.") + f" items. Please turn on Door Shuffle, Color Shuffle, or Sunwarp Shuffle if that doesn't seem" + f" right.") else: - raise Exception(f"{self.multiworld.get_player_name(self.player)}'s Lingo world doesn't have any" - f" progression items. Please turn on Door Shuffle or Color Shuffle.") + raise OptionError(f"{self.multiworld.get_player_name(self.player)}'s Lingo world doesn't have any" + f" progression items. Please turn on Door Shuffle, Color Shuffle or Sunwarp Shuffle.") self.player_logic = LingoPlayerLogic(self) @@ -94,7 +96,7 @@ class LingoWorld(World): total_weight = sum(self.options.trap_weights.values()) if total_weight == 0: - raise Exception("Sum of trap weights must be at least one.") + raise OptionError("Sum of trap weights must be at least one.") trap_counts = {name: int(weight * traps / total_weight) for name, weight in self.options.trap_weights.items()} -- cgit 1.4.1