magnifying lens changes

https://github.com/daid/LADXR/pull/156
This commit is contained in:
Alex Nordstrom
2024-08-20 10:44:25 -04:00
parent e95bb5ea56
commit 6f3e7b711e
5 changed files with 39 additions and 14 deletions

View File

@@ -177,10 +177,11 @@ def generateRom(args, world: "LinksAwakeningWorld"):
patches.songs.upgradeManbo(rom)
patches.songs.upgradeMamu(rom)
if world.ladxr_settings.tradequest:
patches.tradeSequence.patchTradeSequence(rom, world.ladxr_settings.boomerang)
patches.tradeSequence.patchTradeSequence(rom, world.ladxr_settings)
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.tradeSequence.unrequiredTradeSequence(rom)
patches.bowwow.fixBowwow(rom, everywhere=world.ladxr_settings.bowwow != 'normal')
if world.ladxr_settings.bowwow != 'normal':
patches.bowwow.bowwowMapPatches(rom)

View File

@@ -24,11 +24,6 @@ class BoomerangGuy(ItemInfo):
# But SHIELD, BOMB and MAGIC_POWDER would most likely break things.
# SWORD and POWER_BRACELET would most likely introduce the lv0 shield/bracelet issue
def patch(self, rom, option, *, multiworld=None):
# Always have the boomerang trade guy enabled (normally you need the magnifier)
rom.patch(0x19, 0x05EC, ASM("ld a, [wTradeSequenceItem]\ncp $0E"), ASM("ld a, $0E\ncp $0E"), fill_nop=True) # show the guy
rom.patch(0x00, 0x3199, ASM("ld a, [wTradeSequenceItem]\ncp $0E"), ASM("ld a, $0E\ncp $0E"), fill_nop=True) # load the proper room layout
rom.patch(0x19, 0x05F4, ASM("ld a, [wTradeSequenceItem2]\nand a"), ASM("xor a"), fill_nop=True)
if self.setting == 'trade':
inv = INVENTORY_MAP[option]
# Patch the check if you traded back the boomerang (so traded twice)

View File

@@ -61,9 +61,9 @@ class World:
self._addEntrance("banana_seller", sword_beach, banana_seller, r.bush)
boomerang_cave = Location("Boomerang Cave")
if options.boomerang == 'trade':
Location().add(BoomerangGuy()).connect(boomerang_cave, OR(BOOMERANG, HOOKSHOT, MAGIC_ROD, PEGASUS_BOOTS, FEATHER, SHOVEL))
Location().add(BoomerangGuy()).connect(boomerang_cave, AND(r.shuffled_magnifier), OR(BOOMERANG, HOOKSHOT, MAGIC_ROD, PEGASUS_BOOTS, FEATHER, SHOVEL))
elif options.boomerang == 'gift':
Location().add(BoomerangGuy()).connect(boomerang_cave, None)
Location().add(BoomerangGuy()).connect(boomerang_cave, r.shuffled_magnifier)
self._addEntrance("boomerang_cave", sword_beach, boomerang_cave, BOMB)
self._addEntranceRequirementExit("boomerang_cave", None) # if exiting, you do not need bombs

View File

@@ -265,6 +265,7 @@ class RequirementsSettings:
self.rear_attack_range = OR(MAGIC_ROD, BOW) # mimic
self.fire = OR(MAGIC_POWDER, MAGIC_ROD) # torches
self.push_hardhat = OR(SHIELD, SWORD, HOOKSHOT, BOOMERANG)
self.shuffled_magnifier = TRADING_ITEM_MAGNIFYING_GLASS
self.boss_requirements = [
SWORD, # D1 boss
@@ -293,6 +294,8 @@ class RequirementsSettings:
}
# Adjust for options
if not options.tradequest:
self.shuffled_magnifier = True
if options.bowwow != 'normal':
# We cheat in bowwow mode, we pretend we have the sword, as bowwow can pretty much do all what the sword ca$ # Except for taking out bushes (and crystal pillars are removed)
self.bush.remove(SWORD)

View File

@@ -1,7 +1,7 @@
from ..assembler import ASM
def patchTradeSequence(rom, boomerang_option):
def patchTradeSequence(rom, settings):
patchTrendy(rom)
patchPapahlsWife(rom)
patchYipYip(rom)
@@ -16,7 +16,7 @@ def patchTradeSequence(rom, boomerang_option):
patchMermaid(rom)
patchMermaidStatue(rom)
patchSharedCode(rom)
patchVarious(rom, boomerang_option)
patchVarious(rom, settings)
patchInventoryMenu(rom)
@@ -317,7 +317,7 @@ notSideScroll:
rom.patch(0x07, 0x3F7F, "00" * 7, ASM("ldh a, [$F8]\nor $20\nldh [$F8], a\nret"))
def patchVarious(rom, boomerang_option):
def patchVarious(rom, settings):
# Make the zora photo work with the magnifier
rom.patch(0x18, 0x09F3, 0x0A02, ASM("""
ld a, [wTradeSequenceItem2]
@@ -336,16 +336,42 @@ def patchVarious(rom, boomerang_option):
# Shift the magnifier 8 pixels
rom.patch(0x03, 0x0F68, 0x0F6F, ASM("""
ldh a, [$F6] ; map room
cp $97 ; check if we are in the maginfier room
cp $97 ; check if we are in the magnifier room
jp z, $4F83
"""), fill_nop=True)
# Something with the photographer
rom.patch(0x36, 0x0948, 0x0950, "", fill_nop=True)
if boomerang_option not in {'trade', 'gift'}: # Boomerang cave is not patched, so adjust it
# Boomerang trade guy
if settings.boomerang not in {'trade', 'gift'} or settings.overworld in {'normal', 'nodungeons'}:
# Update magnifier checks
rom.patch(0x19, 0x05EC, ASM("ld a, [wTradeSequenceItem]\ncp $0E\njp nz, $7E61"), ASM("ld a, [wTradeSequenceItem2]\nand $20\njp z, $7E61")) # show the guy
rom.patch(0x00, 0x3199, ASM("ld a, [wTradeSequenceItem]\ncp $0E\njr nz, $06"), ASM("ld a, [wTradeSequenceItem2]\nand $20\njr z, $06")) # load the proper room layout
rom.patch(0x19, 0x05F4, 0x05FB, "", fill_nop=True)
else:
# Always have the boomerang trade guy enabled (magnifier not needed)
rom.patch(0x19, 0x05EC, ASM("ld a, [wTradeSequenceItem]\ncp $0E"), ASM("ld a, $0E\ncp $0E"), fill_nop=True) # show the guy
rom.patch(0x00, 0x3199, ASM("ld a, [wTradeSequenceItem]\ncp $0E"), ASM("ld a, $0E\ncp $0E"), fill_nop=True) # load the proper room layout
rom.patch(0x19, 0x05F4, ASM("ld a, [wTradeSequenceItem2]\nand a"), ASM("xor a"), fill_nop=True)
def unrequiredTradeSequence(rom):
# Monkey bridge patch, always have the bridge there.
rom.patch(0x00, 0x333D, ASM("bit 4, e\njr Z, $05"), b"", fill_nop=True)
# Make the zora photo work without the magnifier
rom.patch(0x18, 0x09F3, ASM("""
ld a, [$DB40]
cp $0E
jp nz, $7F08 ; ClearEntityStatusBank18
"""), "", fill_nop=True)
rom.patch(0x03, 0x0B6D, ASM("""
ld a, [$DB40]
cp $0E
jp nz, $3F8D ; UnloadEntity
"""), "", fill_nop=True)
# Always have the boomerang trade guy enabled (magnifier not needed)
rom.patch(0x19, 0x05EC, ASM("ld a, [wTradeSequenceItem]\ncp $0E"), ASM("ld a, $0E\ncp $0E"), fill_nop=True) # show the guy
rom.patch(0x00, 0x3199, ASM("ld a, [wTradeSequenceItem]\ncp $0E"), ASM("ld a, $0E\ncp $0E"), fill_nop=True) # load the proper room layout
rom.patch(0x19, 0x05F4, ASM("ld a, [wTradeSequenceItem2]\nand a"), ASM("xor a"), fill_nop=True)
def patchInventoryMenu(rom):