コード例 #1
0
    def patch(self, rom, option, *, multiworld=None):
        super().patch(rom, option, multiworld=multiworld)

        re = RoomEditor(rom, self.room)

        # Make the bird key accessible without the rooster
        re.removeObject(1, 6)
        re.removeObject(2, 6)
        re.removeObject(3, 5)
        re.removeObject(3, 6)
        re.moveObject(1, 5, 2, 6)
        re.moveObject(2, 5, 3, 6)
        re.addEntity(3, 5, 0x9D)
        re.store(rom)

        # Do not give the rooster
        rom.patch(0x19, 0x0E9D, ASM("ld [$DB7B], a"), "", fill_nop=True)
コード例 #2
0
    def patch(self, rom, option, *, multiworld=None):
        super().patch(rom, option, multiworld=multiworld)

        re = RoomEditor(rom, self.room)

        # Make the bird key accessible without the rooster
        re.removeObject(1, 6)
        re.removeObject(2, 6)
        re.removeObject(3, 5)
        re.removeObject(3, 6)
        re.moveObject(1, 5, 2, 6)
        re.moveObject(2, 5, 3, 6)
        re.addEntity(3, 5, 0x9D)
        re.store(rom)
        rom.patch(0x19, 0x0010, "F0007806F008782600007A0600087A26",
                  "F000640FF008642F0000660F0008662F")
        rom.patch(0x19, 0x004F, ASM("cp $01"), ASM("cp $0A"))

        # Do not give the rooster
        rom.patch(0x19, 0x0E9D, ASM("ld [$DB7B], a"), "", fill_nop=True)
コード例 #3
0
    def patch(self, rom, option, *, multiworld=None):
        if option != SWORD or multiworld is not None:
            # Set the heart piece data
            super().patch(rom, option, multiworld=multiworld)

            # Patch the room to contain a heart piece instead of the sword on the beach
            re = RoomEditor(rom, 0x0F2)
            re.removeEntities(0x31)  # remove sword
            re.addEntity(5, 5, 0x35)  # add heart piece
            re.store(rom)

            # Prevent shield drops from the like-like from turning into swords.
            rom.patch(0x03,
                      0x1B9C,
                      ASM("ld a, [$DB4E]"),
                      ASM("ld a, $01"),
                      fill_nop=True)
            rom.patch(0x03,
                      0x244D,
                      ASM("ld a, [$DB4E]"),
                      ASM("ld a, $01"),
                      fill_nop=True)
コード例 #4
0
ファイル: witch.py プロジェクト: dragonc0/LADXR
def updateWitch(rom):
    # Add a heartpiece at the toadstool, the item patches turn this into a 1 time toadstool item
    # Or depending on flags, in something else.
    re = RoomEditor(rom, 0x050)
    re.addEntity(2, 3, 0x35)
    re.store(rom)

    # Change what happens when you trade the toadstool with the witch
    #  Note that the 2nd byte of this code gets patched with the item to give from the witch.
    rom.patch(0x05,
              0x08D4,
              0x08F0,
              ASM("""
        ld  e, $09 ; load the item to give the first time

        ; Get the room flags and mark the witch as done.
        ld  hl, $DAA2
        ld  a, [hl]
        and $30
        set 4, [hl]
        set 5, [hl]
        jr  z, skip
        ld  e, $09 ; give powder every time after the first time.
skip:
        ld  a, e
        ldh [$F1], a
        ld  a, $02
        rst 8
        ld  a, $03
        rst 8
    """),
              fill_nop=True)

    # Patch the toadstool to unload when you haven't delivered something to the witch yet.
    rom.patch(0x03,
              0x1D4B,
              ASM("""
        ld   hl, $DB4B
        ld   a, [$DB4C]
        or   [hl]
        jp   nz, $3F8D
    """),
              ASM("""
        ld   a, [$DAA2]
        and  $20
        jp   z, $3F8D
    """),
              fill_nop=True)

    # Patch what happens when we pickup the toadstool, call our chest code to give a toadstool.
    rom.patch(0x03,
              0x1D6F,
              0x1D7D,
              ASM("""
        ld   a, $50
        ldh  [$F1], a
        ld  a, $02 ; give item
        rst 8

        ld   hl, $DAA2
        res  5, [hl]
    """),
              fill_nop=True)