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
This commit is contained in:
threeandthreee
2025-10-23 16:11:41 -04:00
committed by GitHub
parent 4847be98d2
commit 19839399e5
5 changed files with 29 additions and 11 deletions

View File

@@ -57,6 +57,7 @@ from .patches import bingo as _
from .patches import multiworld as _ from .patches import multiworld as _
from .patches import tradeSequence as _ from .patches import tradeSequence as _
from . import hints from . import hints
from . import utils
from .patches import bank34 from .patches import bank34
from .roomEditor import RoomEditor, Object from .roomEditor import RoomEditor, Object
@@ -231,10 +232,10 @@ def generateRom(base_rom: bytes, args, patch_data: Dict):
rom.patch(0, 0x0003, "00", "01") rom.patch(0, 0x0003, "00", "01")
# Patch the sword check on the shopkeeper turning around. # Patch the sword check on the shopkeeper turning around.
#if ladxr_settings["steal"] == 'never': if options["stealing"] == Options.Stealing.option_disabled:
# rom.patch(4, 0x36F9, "FA4EDB", "3E0000") rom.patch(4, 0x36F9, "FA4EDB", "3E0000")
#elif ladxr_settings["steal"] == 'always': rom.texts[0x2E] = utils.formatText("Hey! Welcome! Did you know that I have eyes on the back of my head?")
# rom.patch(4, 0x36F9, "FA4EDB", "3E0100") rom.texts[0x2F] = utils.formatText("Nothing escapes my gaze! Your thieving ways shall never prosper!")
#if ladxr_settings["hpmode"] == 'inverted': #if ladxr_settings["hpmode"] == 'inverted':
# patches.health.setStartHealth(rom, 9) # patches.health.setStartHealth(rom, 9)
@@ -325,7 +326,7 @@ def generateRom(base_rom: bytes, args, patch_data: Dict):
0x1A9, 0x1AA, 0x1AB, 0x1AC, 0x1AD, 0x1A9, 0x1AA, 0x1AB, 0x1AC, 0x1AD,
# Prices # Prices
0x02C, 0x02D, 0x030, 0x031, 0x032, 0x033, # Shop items 0x02C, 0x02D, 0x02E, 0x02F, 0x030, 0x031, 0x032, 0x033, # Shop items
0x03B, # Trendy Game 0x03B, # Trendy Game
0x045, # Fisherman 0x045, # Fisherman
0x018, 0x019, # Crazy Tracy 0x018, 0x019, # Crazy Tracy

View File

@@ -43,8 +43,12 @@ class World:
self._addEntrance("start_house", mabe_village, start_house, None) self._addEntrance("start_house", mabe_village, start_house, None)
shop = Location("Shop") shop = Location("Shop")
Location().add(ShopItem(0)).connect(shop, OR(AND(r.can_farm, COUNT("RUPEES", 500)), SWORD)) if options.steal == "inlogic":
Location().add(ShopItem(1)).connect(shop, OR(AND(r.can_farm, COUNT("RUPEES", 1480)), SWORD)) 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) self._addEntrance("shop", mabe_village, shop, None)
dream_hut = Location("Dream Hut") dream_hut = Location("Dream Hut")

View File

@@ -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. [Hero] Switch version hero mode, double damage, no heart/fairy drops.
[One hit KO] You die on a single hit, always."""), [One hit KO] You die on a single hit, always."""),
Setting('steal', 'Gameplay', 't', 'Stealing from the shop', Setting('steal', 'Gameplay', 't', 'Stealing from the shop',
options=[('always', 'a', 'Always'), ('never', 'n', 'Never'), ('default', '', 'Normal')], default='default', options=[('inlogic', 'a', 'In logic'), ('disabled', 'n', 'Disabled'), ('outoflogic', '', 'Out of logic')], default='outoflogic',
description="""Effects when you can steal from the shop. Stealing is bad and never in logic. description="""Effects when you can steal from the shop and if it is in logic.
[Normal] requires the sword before you can steal. [Normal] requires the sword before you can steal.
[Always] you can always steal from the shop [Always] you can always steal from the shop
[Never] you can never 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"): if self.goal in ("bingo", "bingo-full"):
req("overworld", "normal", "Bingo goal does not work with dungeondive") req("overworld", "normal", "Bingo goal does not work with dungeondive")
req("accessibility", "all", "Bingo goal needs 'all' accessibility") 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("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") dis("miniboss", "random", "shuffle", "With bingo goal, minibosses need to be on normal or shuffle")
if self.overworld == "dungeondive": if self.overworld == "dungeondive":

View File

@@ -325,6 +325,18 @@ class HardMode(Choice, LADXROption):
default = option_none 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): class Overworld(Choice, LADXROption):
""" """
**Open Mabe:** Replaces rock on the east side of Mabe Village with bushes, **Open Mabe:** Replaces rock on the east side of Mabe Village with bushes,
@@ -656,6 +668,7 @@ class LinksAwakeningOptions(PerGameCommonOptions):
nag_messages: NagMessages nag_messages: NagMessages
ap_title_screen: APTitleScreen ap_title_screen: APTitleScreen
boots_controls: BootsControls boots_controls: BootsControls
stealing: Stealing
quickswap: Quickswap quickswap: Quickswap
hard_mode: HardMode hard_mode: HardMode
low_hp_beep: LowHpBeep low_hp_beep: LowHpBeep

View File

@@ -97,7 +97,7 @@ def write_patch_data(world: "LinksAwakeningWorld", patch: LADXProcedurePatch):
"nag_messages", "nag_messages",
"ap_title_screen", "ap_title_screen",
"boots_controls", "boots_controls",
# "stealing", "stealing",
"quickswap", "quickswap",
"hard_mode", "hard_mode",
"low_hp_beep", "low_hp_beep",