From 7dbcaa89bef751cbdd9ddb954e52d1f878335b63 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Sun, 16 Jun 2024 10:12:40 -0400 Subject: [PATCH] Rename ladxr_options -> ladxr_settings --- worlds/ladx/LADXR/generator.py | 70 +++++++++++++++++----------------- worlds/ladx/__init__.py | 14 +++---- 2 files changed, 42 insertions(+), 42 deletions(-) diff --git a/worlds/ladx/LADXR/generator.py b/worlds/ladx/LADXR/generator.py index 1d41c7a9f6ad..9142fe54cb4e 100644 --- a/worlds/ladx/LADXR/generator.py +++ b/worlds/ladx/LADXR/generator.py @@ -89,8 +89,8 @@ def generateRom(args, world: "LinksAwakeningWorld"): for pymod in pymods: pymod.prePatch(rom) - if world.ladxr_options.gfxmod: - patches.aesthetics.gfxMod(rom, os.path.join("data", "sprites", "ladx", world.ladxr_options.gfxmod)) + if world.ladxr_settings.gfxmod: + patches.aesthetics.gfxMod(rom, os.path.join("data", "sprites", "ladx", world.ladxr_settings.gfxmod)) item_list = [item for item in world.ladxr_logic.iteminfo_list if not isinstance(item, KeyLocation)] @@ -121,7 +121,7 @@ def generateRom(args, world: "LinksAwakeningWorld"): assembler.const("wLinkSpawnDelay", 0xDE13) #assembler.const("HARDWARE_LINK", 1) - assembler.const("HARD_MODE", 1 if world.ladxr_options.hardmode != "none" else 0) + assembler.const("HARD_MODE", 1 if world.ladxr_settings.hardmode != "none" else 0) patches.core.cleanup(rom) patches.save.singleSaveSlot(rom) @@ -150,7 +150,7 @@ def generateRom(args, world: "LinksAwakeningWorld"): world.options.shuffle_nightmare_keys != ShuffleNightmareKeys.option_original_dungeon: patches.inventory.advancedInventorySubscreen(rom) patches.inventory.moreSlots(rom) - if world.ladxr_options.witch: + if world.ladxr_settings.witch: patches.witch.updateWitch(rom) patches.softlock.fixAll(rom) patches.maptweaks.tweakMap(rom) @@ -164,9 +164,9 @@ def generateRom(args, world: "LinksAwakeningWorld"): patches.tarin.updateTarin(rom) patches.fishingMinigame.updateFinishingMinigame(rom) patches.health.upgradeHealthContainers(rom) - if world.ladxr_options.owlstatues in ("dungeon", "both"): + if world.ladxr_settings.owlstatues in ("dungeon", "both"): patches.owl.upgradeDungeonOwlStatues(rom) - if world.ladxr_options.owlstatues in ("overworld", "both"): + if world.ladxr_settings.owlstatues in ("overworld", "both"): patches.owl.upgradeOverworldOwlStatues(rom) patches.goldenLeaf.fixGoldenLeaf(rom) patches.heartPiece.fixHeartPiece(rom) @@ -176,21 +176,21 @@ def generateRom(args, world: "LinksAwakeningWorld"): patches.songs.upgradeMarin(rom) patches.songs.upgradeManbo(rom) patches.songs.upgradeMamu(rom) - if world.ladxr_options.tradequest: - patches.tradeSequence.patchTradeSequence(rom, world.ladxr_options.boomerang) + if world.ladxr_settings.tradequest: + patches.tradeSequence.patchTradeSequence(rom, world.ladxr_settings.boomerang) else: # Monkey bridge patch, always have the bridge there. rom.patch(0x00, 0x333D, assembler.ASM("bit 4, e\njr Z, $05"), b"", fill_nop=True) - patches.bowwow.fixBowwow(rom, everywhere=world.ladxr_options.bowwow != 'normal') - if world.ladxr_options.bowwow != 'normal': + patches.bowwow.fixBowwow(rom, everywhere=world.ladxr_settings.bowwow != 'normal') + if world.ladxr_settings.bowwow != 'normal': patches.bowwow.bowwowMapPatches(rom) patches.desert.desertAccess(rom) - if world.ladxr_options.overworld == 'dungeondive': + if world.ladxr_settings.overworld == 'dungeondive': patches.overworld.patchOverworldTilesets(rom) patches.overworld.createDungeonOnlyOverworld(rom) - elif world.ladxr_options.overworld == 'nodungeons': + elif world.ladxr_settings.overworld == 'nodungeons': patches.dungeon.patchNoDungeons(rom) - elif world.ladxr_options.overworld == 'random': + elif world.ladxr_settings.overworld == 'random': patches.overworld.patchOverworldTilesets(rom) mapgen.store_map(rom, world.ladxr_logic.world.map) #if settings.dungeon_items == 'keysy': @@ -202,52 +202,52 @@ def generateRom(args, world: "LinksAwakeningWorld"): patches.aesthetics.noSwordMusic(rom) patches.aesthetics.reduceMessageLengths(rom, world.random) patches.aesthetics.allowColorDungeonSpritesEverywhere(rom) - if world.ladxr_options.music == 'random': + if world.ladxr_settings.music == 'random': patches.music.randomizeMusic(rom, world.random) - elif world.ladxr_options.music == 'off': + elif world.ladxr_settings.music == 'off': patches.music.noMusic(rom) - if world.ladxr_options.noflash: + if world.ladxr_settings.noflash: patches.aesthetics.removeFlashingLights(rom) - if world.ladxr_options.hardmode == "oracle": + if world.ladxr_settings.hardmode == "oracle": patches.hardMode.oracleMode(rom) - elif world.ladxr_options.hardmode == "hero": + elif world.ladxr_settings.hardmode == "hero": patches.hardMode.heroMode(rom) - elif world.ladxr_options.hardmode == "ohko": + elif world.ladxr_settings.hardmode == "ohko": patches.hardMode.oneHitKO(rom) - if world.ladxr_options.superweapons: + if world.ladxr_settings.superweapons: patches.weapons.patchSuperWeapons(rom) - if world.ladxr_options.textmode == 'fast': + if world.ladxr_settings.textmode == 'fast': patches.aesthetics.fastText(rom) - if world.ladxr_options.textmode == 'none': + if world.ladxr_settings.textmode == 'none': patches.aesthetics.fastText(rom) patches.aesthetics.noText(rom) - if not world.ladxr_options.nagmessages: + if not world.ladxr_settings.nagmessages: patches.aesthetics.removeNagMessages(rom) - if world.ladxr_options.lowhpbeep == 'slow': + if world.ladxr_settings.lowhpbeep == 'slow': patches.aesthetics.slowLowHPBeep(rom) - if world.ladxr_options.lowhpbeep == 'none': + if world.ladxr_settings.lowhpbeep == 'none': patches.aesthetics.removeLowHPBeep(rom) - if 0 <= int(world.ladxr_options.linkspalette): - patches.aesthetics.forceLinksPalette(rom, int(world.ladxr_options.linkspalette)) + if 0 <= int(world.ladxr_settings.linkspalette): + patches.aesthetics.forceLinksPalette(rom, int(world.ladxr_settings.linkspalette)) if args.romdebugmode: # The default rom has this build in, just need to set a flag and we get this save. rom.patch(0, 0x0003, "00", "01") # Patch the sword check on the shopkeeper turning around. - if world.ladxr_options.steal == 'never': + if world.ladxr_settings.steal == 'never': rom.patch(4, 0x36F9, "FA4EDB", "3E0000") - elif world.ladxr_options.steal == 'always': + elif world.ladxr_settings.steal == 'always': rom.patch(4, 0x36F9, "FA4EDB", "3E0100") - if world.ladxr_options.hpmode == 'inverted': + if world.ladxr_settings.hpmode == 'inverted': patches.health.setStartHealth(rom, 9) - elif world.ladxr_options.hpmode == '1': + elif world.ladxr_settings.hpmode == '1': patches.health.setStartHealth(rom, 1) patches.inventory.songSelectAfterOcarinaSelect(rom) - if world.ladxr_options.quickswap == 'a': + if world.ladxr_settings.quickswap == 'a': patches.core.quickswap(rom, 1) - elif world.ladxr_options.quickswap == 'b': + elif world.ladxr_settings.quickswap == 'b': patches.core.quickswap(rom, 0) patches.core.addBootsControls(rom, world.options.boots_controls) @@ -309,7 +309,7 @@ def gen_hint(): # Patch the generated logic into the rom patches.chest.setMultiChest(rom, world_setup.multichest) - if world.ladxr_options.overworld not in {"dungeondive", "random"}: + if world.ladxr_settings.overworld not in {"dungeondive", "random"}: patches.entrances.changeEntrances(rom, world_setup.entrance_mapping) for spot in item_list: if spot.item and spot.item.startswith("*"): @@ -328,7 +328,7 @@ def gen_hint(): patches.core.addFrameCounter(rom, len(item_list)) patches.core.warpHome(rom) # Needs to be done after setting the start location. - patches.titleScreen.setRomInfo(rom, world.multi_key, world.multiworld.seed_name, world.ladxr_options, + patches.titleScreen.setRomInfo(rom, world.multi_key, world.multiworld.seed_name, world.ladxr_settings, world.player_name, world.player) if world.options.ap_title_screen: patches.titleScreen.setTitleGraphics(rom) diff --git a/worlds/ladx/__init__.py b/worlds/ladx/__init__.py index 201310eeaf4b..e52bd9a14f3b 100644 --- a/worlds/ladx/__init__.py +++ b/worlds/ladx/__init__.py @@ -104,7 +104,7 @@ class LinksAwakeningWorld(World): prefill_dungeon_items = None - ladxr_options: LADXRSettings + ladxr_settings: LADXRSettings ladxr_logic: LADXRLogic ladxr_itempool: LADXRItemPool @@ -119,13 +119,13 @@ class LinksAwakeningWorld(World): } def convert_ap_options_to_ladxr_logic(self): - self.ladxr_options = LADXRSettings(dataclasses.asdict(self.options)) - - self.ladxr_options.validate() + self.ladxr_settings = LADXRSettings(dataclasses.asdict(self.options)) + + self.ladxr_settings.validate() world_setup = LADXRWorldSetup() - world_setup.randomize(self.ladxr_options, self.random) - self.ladxr_logic = LADXRLogic(configuration_options=self.ladxr_options, world_setup=world_setup) - self.ladxr_itempool = LADXRItemPool(self.ladxr_logic, self.ladxr_options, self.random).toDict() + world_setup.randomize(self.ladxr_settings, self.random) + self.ladxr_logic = LADXRLogic(configuration_options=self.ladxr_settings, world_setup=world_setup) + self.ladxr_itempool = LADXRItemPool(self.ladxr_logic, self.ladxr_settings, self.random).toDict() def create_regions(self) -> None: # Initialize