From 6ef621fe66a1252011e5bed2178a64881d9eeacb Mon Sep 17 00:00:00 2001 From: LLCoolDave Date: Thu, 25 May 2017 17:52:31 +0200 Subject: [PATCH] Shuffle the bottles you receive from a fairy exchange. --- Main.py | 2 +- Rom.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Main.py b/Main.py index 01a63ff6..1ff21b15 100644 --- a/Main.py +++ b/Main.py @@ -11,7 +11,7 @@ import logging import argparse import os -__version__ = '0.1-dev' +__version__ = '0.2-dev' def main(args, seed=None): diff --git a/Rom.py b/Rom.py index 5f35398a..cfa95dd8 100644 --- a/Rom.py +++ b/Rom.py @@ -184,6 +184,10 @@ def patch_rom(world, rom, quickswap=False, beep='normal'): for prize, address in zip(bonk_prizes, bonk_addresses): write_byte(rom, address, prize) + # set Fountain bottle exchange items + write_byte(rom, 0x348FF, [0x16, 0x2B, 0x2C, 0x2D, 0x3C, 0x3D, 0x48][random.randint(0, 6)]) + write_byte(rom, 0x3493B, [0x16, 0x2B, 0x2C, 0x2D, 0x3C, 0x3D, 0x48][random.randint(0, 6)]) + if world.swamp_patch_required: # patch swamp: Need to enable permanent drain of water as dam or swamp were moved rom = rom.replace(bytearray([0xAF, 0xBB, 0xF2, 0x7E, 0x29, 0xDF, 0x8F, 0xBB, 0xF2, 0x7E]), bytearray([0xEA, 0xEA, 0xEA, 0xEA, 0xEA, 0xEA, 0xEA, 0xEA, 0xEA, 0xEA]))