Files
dockipelago/worlds/voltorb_flip/options.py
Jonathan Tinney 7971961166
Some checks failed
Analyze modified files / flake8 (push) Failing after 2m28s
Build / build-win (push) Has been cancelled
Build / build-ubuntu2204 (push) Has been cancelled
ctest / Test C++ ubuntu-latest (push) Has been cancelled
ctest / Test C++ windows-latest (push) Has been cancelled
Analyze modified files / mypy (push) Has been cancelled
Build and Publish Docker Images / Push Docker image to Docker Hub (push) Successful in 5m4s
Native Code Static Analysis / scan-build (push) Failing after 5m2s
type check / pyright (push) Successful in 1m7s
unittests / Test Python 3.11.2 ubuntu-latest (push) Failing after 16m23s
unittests / Test Python 3.12 ubuntu-latest (push) Failing after 28m19s
unittests / Test Python 3.13 ubuntu-latest (push) Failing after 14m49s
unittests / Test hosting with 3.13 on ubuntu-latest (push) Successful in 5m0s
unittests / Test Python 3.13 macos-latest (push) Has been cancelled
unittests / Test Python 3.11 windows-latest (push) Has been cancelled
unittests / Test Python 3.13 windows-latest (push) Has been cancelled
add schedule I, sonic 1/frontiers/heroes, spirit island
2026-04-02 23:46:36 -07:00

103 lines
3.4 KiB
Python

import dataclasses
from BaseClasses import PlandoOptions
from Options import PerGameCommonOptions, Choice, OptionCounter, OptionError
from worlds.AutoWorld import World
class Goal(Choice):
"""
Select your goal.
- **Levels** - Win all levels you have checks for.
- **Coins** - Collect enough coins to check all coin locations.
"""
display_name = "Goal"
option_levels = 0
option_coins = 1
default = 0
class LevelLocationsAdjustments(OptionCounter):
"""
Adjust various things about the **Win level x** locations.
- **Maximum** - The maximum level that has a location. Allowed values are in range 1 to 8.
"""
display_name = "Level Locations Adjustments"
valid_keys = [
"Maximum",
]
default = {
"Maximum": 7,
}
def verify(self, world: type[World], player_name: str, plando_options: PlandoOptions) -> None:
super().verify(world, player_name, plando_options)
errors = []
if not 1 <= self.value["Maximum"] <= 8:
errors.append(f"Maximum: {self.value['Maximum']} not in range 10 to 50000")
if len(errors) != 0:
errors = [f"For option {getattr(self, 'display_name', self)} of player {player_name}:"] + errors
raise OptionError("\n".join(errors))
class CoinLocationsAdjustments(OptionCounter):
"""
Adjust various things about the **Collect x coins** locations.
- **Maximum** - The maximum amount of coins that locations have. Allowed values are in range 10 to 50000.
- **Steps** - The amount of coins needed for each next location. Allowed values are in range 10 to 50000. Cannot be higher than **Maximum**.
"""
display_name = "Coin Locations Adjustments"
valid_keys = [
"Maximum",
"Steps",
]
default = {
"Maximum": 10000,
"Steps": 1000,
}
def verify(self, world: type[World], player_name: str, plando_options: PlandoOptions) -> None:
super().verify(world, player_name, plando_options)
errors = []
if not 10 <= self.value["Maximum"] <= 50000:
errors.append(f"Maximum: {self.value['Maximum']} not in range 10 to 50000")
if not 10 <= self.value["Steps"] <= 50000:
errors.append(f"Steps: {self.value['Steps']} not in range 10 to 50000")
if self.value["Steps"] > self.value["Maximum"]:
errors.append(f"Steps: {self.value['Steps']} is higher than Maximum: {self.value['Maximum']}")
if len(errors) != 0:
errors = [f"For option {getattr(self, 'display_name', self)} of player {player_name}:"] + errors
raise OptionError("\n".join(errors))
class ArtificialLogic(Choice):
"""
If enabled, progression is logically blocked by having to receive certain amounts of the "Luck" item
(without actually requiring them).
If set to **experimental**, random progression items from the multiworld pool will be used for this game's logic instead
(without actually requiring them as well). However, be aware of frequent generation failures
"""
display_name = "Artificial Logic"
option_off = 0
option_on = 1
option_experimental = 2
default = True
@dataclasses.dataclass
class VoltorbFlipOptions(PerGameCommonOptions):
goal: Goal
level_locations_adjustments: LevelLocationsAdjustments
coin_locations_adjustments: CoinLocationsAdjustments
artificial_logic: ArtificialLogic