Rogue Legacy: Update to Options API (#3755)

* fix deprecation

* multiworld.random -> world.random

* Various small fixes

---------

Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>
Co-authored-by: Exempt-Medic <ExemptMedic@Gmail.com>
This commit is contained in:
Silvris
2024-09-08 11:50:08 -05:00
committed by GitHub
parent 05b257adf9
commit 6d6d35d598
5 changed files with 138 additions and 132 deletions

View File

@@ -1,6 +1,6 @@
from typing import Dict
from Options import Choice, Range, Toggle, DeathLink, DefaultOnToggle, OptionSet, PerGameCommonOptions
from Options import Choice, Range, Option, Toggle, DeathLink, DefaultOnToggle, OptionSet
from dataclasses import dataclass
class StartingGender(Choice):
@@ -336,42 +336,44 @@ class AvailableClasses(OptionSet):
The upgraded form of your starting class will be available regardless.
"""
display_name = "Available Classes"
default = {"Knight", "Mage", "Barbarian", "Knave", "Shinobi", "Miner", "Spellthief", "Lich", "Dragon", "Traitor"}
default = frozenset(
{"Knight", "Mage", "Barbarian", "Knave", "Shinobi", "Miner", "Spellthief", "Lich", "Dragon", "Traitor"}
)
valid_keys = {"Knight", "Mage", "Barbarian", "Knave", "Shinobi", "Miner", "Spellthief", "Lich", "Dragon", "Traitor"}
rl_options: Dict[str, type(Option)] = {
"starting_gender": StartingGender,
"starting_class": StartingClass,
"available_classes": AvailableClasses,
"new_game_plus": NewGamePlus,
"fairy_chests_per_zone": FairyChestsPerZone,
"chests_per_zone": ChestsPerZone,
"universal_fairy_chests": UniversalFairyChests,
"universal_chests": UniversalChests,
"vendors": Vendors,
"architect": Architect,
"architect_fee": ArchitectFee,
"disable_charon": DisableCharon,
"require_purchasing": RequirePurchasing,
"progressive_blueprints": ProgressiveBlueprints,
"gold_gain_multiplier": GoldGainMultiplier,
"number_of_children": NumberOfChildren,
"free_diary_on_generation": FreeDiaryOnGeneration,
"khidr": ChallengeBossKhidr,
"alexander": ChallengeBossAlexander,
"leon": ChallengeBossLeon,
"herodotus": ChallengeBossHerodotus,
"health_pool": HealthUpPool,
"mana_pool": ManaUpPool,
"attack_pool": AttackUpPool,
"magic_damage_pool": MagicDamageUpPool,
"armor_pool": ArmorUpPool,
"equip_pool": EquipUpPool,
"crit_chance_pool": CritChanceUpPool,
"crit_damage_pool": CritDamageUpPool,
"allow_default_names": AllowDefaultNames,
"additional_lady_names": AdditionalNames,
"additional_sir_names": AdditionalNames,
"death_link": DeathLink,
}
@dataclass
class RLOptions(PerGameCommonOptions):
starting_gender: StartingGender
starting_class: StartingClass
available_classes: AvailableClasses
new_game_plus: NewGamePlus
fairy_chests_per_zone: FairyChestsPerZone
chests_per_zone: ChestsPerZone
universal_fairy_chests: UniversalFairyChests
universal_chests: UniversalChests
vendors: Vendors
architect: Architect
architect_fee: ArchitectFee
disable_charon: DisableCharon
require_purchasing: RequirePurchasing
progressive_blueprints: ProgressiveBlueprints
gold_gain_multiplier: GoldGainMultiplier
number_of_children: NumberOfChildren
free_diary_on_generation: FreeDiaryOnGeneration
khidr: ChallengeBossKhidr
alexander: ChallengeBossAlexander
leon: ChallengeBossLeon
herodotus: ChallengeBossHerodotus
health_pool: HealthUpPool
mana_pool: ManaUpPool
attack_pool: AttackUpPool
magic_damage_pool: MagicDamageUpPool
armor_pool: ArmorUpPool
equip_pool: EquipUpPool
crit_chance_pool: CritChanceUpPool
crit_damage_pool: CritDamageUpPool
allow_default_names: AllowDefaultNames
additional_lady_names: AdditionalNames
additional_sir_names: AdditionalNames
death_link: DeathLink