From 19839399e507038ebf967dd3b6f838ad00f37ccb Mon Sep 17 00:00:00 2001 From: threeandthreee Date: Thu, 23 Oct 2025 16:11:41 -0400 Subject: [PATCH] LADX: stealing logic option (#3965) * implement StealingInLogic option * fix ladxr setting * adjust docs * option to disable stealing * indicate disabled stealing with shopkeeper dialog * merge upstream/main * Revert "merge upstream/main" This reverts commit c91d2d6b292d95cf93b091121f56c94b55ac8fd0. * fix * stealing in patch * logic reorder and fix sword to front for readability, but also can_farm condition was missing --- worlds/ladx/LADXR/generator.py | 11 ++++++----- worlds/ladx/LADXR/logic/overworld.py | 8 ++++++-- worlds/ladx/LADXR/settings.py | 6 +++--- worlds/ladx/Options.py | 13 +++++++++++++ worlds/ladx/Rom.py | 2 +- 5 files changed, 29 insertions(+), 11 deletions(-) diff --git a/worlds/ladx/LADXR/generator.py b/worlds/ladx/LADXR/generator.py index f4023469..ed5e6cf1 100644 --- a/worlds/ladx/LADXR/generator.py +++ b/worlds/ladx/LADXR/generator.py @@ -57,6 +57,7 @@ from .patches import bingo as _ from .patches import multiworld as _ from .patches import tradeSequence as _ from . import hints +from . import utils from .patches import bank34 from .roomEditor import RoomEditor, Object @@ -231,10 +232,10 @@ def generateRom(base_rom: bytes, args, patch_data: Dict): rom.patch(0, 0x0003, "00", "01") # Patch the sword check on the shopkeeper turning around. - #if ladxr_settings["steal"] == 'never': - # rom.patch(4, 0x36F9, "FA4EDB", "3E0000") - #elif ladxr_settings["steal"] == 'always': - # rom.patch(4, 0x36F9, "FA4EDB", "3E0100") + if options["stealing"] == Options.Stealing.option_disabled: + rom.patch(4, 0x36F9, "FA4EDB", "3E0000") + rom.texts[0x2E] = utils.formatText("Hey! Welcome! Did you know that I have eyes on the back of my head?") + rom.texts[0x2F] = utils.formatText("Nothing escapes my gaze! Your thieving ways shall never prosper!") #if ladxr_settings["hpmode"] == 'inverted': # patches.health.setStartHealth(rom, 9) @@ -325,7 +326,7 @@ def generateRom(base_rom: bytes, args, patch_data: Dict): 0x1A9, 0x1AA, 0x1AB, 0x1AC, 0x1AD, # Prices - 0x02C, 0x02D, 0x030, 0x031, 0x032, 0x033, # Shop items + 0x02C, 0x02D, 0x02E, 0x02F, 0x030, 0x031, 0x032, 0x033, # Shop items 0x03B, # Trendy Game 0x045, # Fisherman 0x018, 0x019, # Crazy Tracy diff --git a/worlds/ladx/LADXR/logic/overworld.py b/worlds/ladx/LADXR/logic/overworld.py index b63aad2b..30236ab4 100644 --- a/worlds/ladx/LADXR/logic/overworld.py +++ b/worlds/ladx/LADXR/logic/overworld.py @@ -43,8 +43,12 @@ class World: self._addEntrance("start_house", mabe_village, start_house, None) shop = Location("Shop") - Location().add(ShopItem(0)).connect(shop, OR(AND(r.can_farm, COUNT("RUPEES", 500)), SWORD)) - Location().add(ShopItem(1)).connect(shop, OR(AND(r.can_farm, COUNT("RUPEES", 1480)), SWORD)) + if options.steal == "inlogic": + Location().add(ShopItem(0)).connect(shop, OR(SWORD, AND(r.can_farm, COUNT("RUPEES", 500)))) + Location().add(ShopItem(1)).connect(shop, OR(SWORD, AND(r.can_farm, COUNT("RUPEES", 1480)))) + else: + Location().add(ShopItem(0)).connect(shop, AND(r.can_farm, COUNT("RUPEES", 500))) + Location().add(ShopItem(1)).connect(shop, AND(r.can_farm, COUNT("RUPEES", 1480))) self._addEntrance("shop", mabe_village, shop, None) dream_hut = Location("Dream Hut") diff --git a/worlds/ladx/LADXR/settings.py b/worlds/ladx/LADXR/settings.py index 3b8407c1..c0949f26 100644 --- a/worlds/ladx/LADXR/settings.py +++ b/worlds/ladx/LADXR/settings.py @@ -162,8 +162,8 @@ Note, some entrances can lead into water, use the warp-to-home from the save&qui [Hero] Switch version hero mode, double damage, no heart/fairy drops. [One hit KO] You die on a single hit, always."""), Setting('steal', 'Gameplay', 't', 'Stealing from the shop', - options=[('always', 'a', 'Always'), ('never', 'n', 'Never'), ('default', '', 'Normal')], default='default', - description="""Effects when you can steal from the shop. Stealing is bad and never in logic. + options=[('inlogic', 'a', 'In logic'), ('disabled', 'n', 'Disabled'), ('outoflogic', '', 'Out of logic')], default='outoflogic', + description="""Effects when you can steal from the shop and if it is in logic. [Normal] requires the sword before you can steal. [Always] you can always steal from the shop [Never] you can never steal from the shop."""), @@ -286,7 +286,7 @@ Note, some entrances can lead into water, use the warp-to-home from the save&qui if self.goal in ("bingo", "bingo-full"): req("overworld", "normal", "Bingo goal does not work with dungeondive") req("accessibility", "all", "Bingo goal needs 'all' accessibility") - dis("steal", "never", "default", "With bingo goal, stealing should be allowed") + dis("steal", "disabled", "default", "With bingo goal, stealing should be allowed") dis("boss", "random", "shuffle", "With bingo goal, bosses need to be on normal or shuffle") dis("miniboss", "random", "shuffle", "With bingo goal, minibosses need to be on normal or shuffle") if self.overworld == "dungeondive": diff --git a/worlds/ladx/Options.py b/worlds/ladx/Options.py index 9c532c98..47328036 100644 --- a/worlds/ladx/Options.py +++ b/worlds/ladx/Options.py @@ -325,6 +325,18 @@ class HardMode(Choice, LADXROption): default = option_none +class Stealing(Choice, LADXROption): + """ + Puts stealing from the shop in logic if the player has a sword. + """ + display_name = "Stealing" + ladxr_name = "steal" + option_in_logic = 1 + option_out_of_logic = 2 + option_disabled = 3 + default = option_out_of_logic + + class Overworld(Choice, LADXROption): """ **Open Mabe:** Replaces rock on the east side of Mabe Village with bushes, @@ -656,6 +668,7 @@ class LinksAwakeningOptions(PerGameCommonOptions): nag_messages: NagMessages ap_title_screen: APTitleScreen boots_controls: BootsControls + stealing: Stealing quickswap: Quickswap hard_mode: HardMode low_hp_beep: LowHpBeep diff --git a/worlds/ladx/Rom.py b/worlds/ladx/Rom.py index 969215a5..c58403c7 100644 --- a/worlds/ladx/Rom.py +++ b/worlds/ladx/Rom.py @@ -97,7 +97,7 @@ def write_patch_data(world: "LinksAwakeningWorld", patch: LADXProcedurePatch): "nag_messages", "ap_title_screen", "boots_controls", - # "stealing", + "stealing", "quickswap", "hard_mode", "low_hp_beep",