From 795918394749b320f096300ff0a4d65e6ca35265 Mon Sep 17 00:00:00 2001 From: GSKirox <65768236+GSKirox@users.noreply.github.com> Date: Sat, 29 Jul 2023 08:15:53 +0200 Subject: [PATCH] Fix misc hint merchants with long item names --- Patches.py | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/Patches.py b/Patches.py index 7d2fdb26c..20cd7e13d 100644 --- a/Patches.py +++ b/Patches.py @@ -2133,7 +2133,11 @@ def update_scrub_text(message: bytearray, text_replacement: list[str], default_p else: location = world.get_location("ZR Magic Bean Salesman") item_text = get_hint(get_item_generic_name(location.item), True).text - update_message_by_id(messages, 0x405E, "\x1AChomp chomp chomp...We have...\x01\x05\x41" + item_text + "\x05\x40! \x01Do you want it...huh? Huh?\x04\x05\x41\x0860 Rupees\x05\x40 and it's yours!\x01Keyahahah!\x01\x1B\x05\x42Yes\x01No\x05\x40\x02") + wrapped_item_text = line_wrap(item_text, False, False, False) + if wrapped_item_text != item_text: + update_message_by_id(messages, 0x405E, "\x1AChomp chomp chomp...We have...\x01\x05\x41" + wrapped_item_text + "\x05\x40!\x04\x05\x41\x0860 Rupees\x05\x40 and it's yours!\x01Keyahahah!\x01\x1B\x05\x42Yes\x01No\x05\x40\x02") + else: + update_message_by_id(messages, 0x405E, "\x1AChomp chomp chomp...We have...\x01\x05\x41" + item_text + "\x05\x40! \x01Do you want it...huh? Huh?\x04\x05\x41\x0860 Rupees\x05\x40 and it's yours!\x01Keyahahah!\x01\x1B\x05\x42Yes\x01No\x05\x40\x02") update_message_by_id(messages, 0x4069, "You don't have enough money.\x01I can't sell it to you.\x01Chomp chomp...\x02") update_message_by_id(messages, 0x406C, "We hope you like it!\x01Chomp chomp chomp.\x02") # Change first magic bean to cost 60 (is used as the price for the one time item when beans are shuffled) @@ -2147,7 +2151,11 @@ def update_scrub_text(message: bytearray, text_replacement: list[str], default_p else: location = world.get_location("Wasteland Bombchu Salesman") item_text = get_hint(get_item_generic_name(location.item), True).text - update_message_by_id(messages, 0x6077, "\x06\x41Well Come!\x04I am selling stuff, strange and \x01rare, from all over the world to \x01everybody. Today's special is...\x01\x05\x41"+ item_text + "\x05\x40! \x01\x04How about \x05\x41200 Rupees\x05\x40?\x01\x01\x1B\x05\x42Buy\x01Don't buy\x05\x40\x02") + wrapped_item_text = line_wrap(item_text, False, False, False) + if wrapped_item_text != item_text: + update_message_by_id(messages, 0x6077, "\x06\x41Well Come!\x04I am selling stuff, strange and \x01rare. Today's special is...\x01\x05\x41"+ wrapped_item_text + "\x05\x40!\x04How about \x05\x41200 Rupees\x05\x40?\x01\x01\x1B\x05\x42Buy\x01Don't buy\x05\x40\x02") + else: + update_message_by_id(messages, 0x6077, "\x06\x41Well Come!\x04I am selling stuff, strange and \x01rare, from all over the world to \x01everybody. Today's special is...\x01\x05\x41"+ wrapped_item_text + "\x05\x40! \x01\x04How about \x05\x41200 Rupees\x05\x40?\x01\x01\x1B\x05\x42Buy\x01Don't buy\x05\x40\x02") update_message_by_id(messages, 0x6078, "Thank you very much!\x04The mark that will lead you to\x01the Spirit Temple is the \x05\x41flag on\x01the left \x05\x40outside the shop.\x01Be seeing you!\x02") rom.write_byte(rom.sym('SHUFFLE_MEDIGORON'), 0x01) @@ -2159,7 +2167,11 @@ def update_scrub_text(message: bytearray, text_replacement: list[str], default_p else: location = world.get_location("GC Medigoron") item_text = get_hint(get_item_generic_name(location.item), True).text - update_message_by_id(messages, 0x304F, "For 200 Rupees, how about buying \x01\x05\x41" + item_text + "\x05\x40?\x01\x1B\x05\x42Buy\x01Don't buy\x05\x40\x02") + wrapped_item_text = line_wrap(item_text, False, False, False) + if wrapped_item_text != item_text: + update_message_by_id(messages, 0x304F, "For 200 Rupees, how about buying...\x04\x05\x41" + wrapped_item_text + "\x05\x40?\x01\x1B\x05\x42Buy\x01Don't buy\x05\x40\x02") + else: + update_message_by_id(messages, 0x304F, "For 200 Rupees, how about buying \x01\x05\x41" + item_text + "\x05\x40?\x01\x1B\x05\x42Buy\x01Don't buy\x05\x40\x02") rom.write_byte(rom.sym('SHUFFLE_GRANNYS_POTION_SHOP'), 0x01) if 'unique_merchants' not in world.settings.misc_hints: @@ -2167,7 +2179,11 @@ def update_scrub_text(message: bytearray, text_replacement: list[str], default_p else: location = world.get_location("Kak Granny Buy Blue Potion") item_text = get_hint(get_item_generic_name(location.item), True).text - update_message_by_id(messages, 0x500C, "How about \x05\x41100 Rupees\x05\x40 for\x01\x05\x41"+ item_text +"\x05\x40?\x01\x1B\x05\x42Buy\x01Don't buy\x05\x40\x02") + wrapped_item_text = line_wrap(item_text, False, False, False) + if wrapped_item_text != item_text: + update_message_by_id(messages, 0x500C, "How about \x05\x41100 Rupees\x05\x40 for...\x04\x05\x41"+ wrapped_item_text +"\x05\x40?\x01\x1B\x05\x42Buy\x01Don't buy\x05\x40\x02") + else: + update_message_by_id(messages, 0x500C, "How about \x05\x41100 Rupees\x05\x40 for\x01\x05\x41"+ item_text +"\x05\x40?\x01\x1B\x05\x42Buy\x01Don't buy\x05\x40\x02") new_message = "All right. You don't have to play\x01if you don't want to.\x0B\x02" update_message_by_id(messages, 0x908B, new_message, 0x00) @@ -2182,7 +2198,11 @@ def update_scrub_text(message: bytearray, text_replacement: list[str], default_p else: location = world.get_location("Market Treasure Chest Game Salesman") item_text = get_hint(get_item_generic_name(location.item), True).text - update_message_by_id(messages, 0x6D, "I seem to have misplaced my\x01keys, but I have a fun item to\x01sell instead.\x04How about \x05\x4110 Rupees\x05\x40 for\x01\x05\x41" + item_text + "\x05\x40?\x01\x1B\x05\x42Buy\x01Don't Buy\x05\x40\x02") + wrapped_item_text = line_wrap(item_text, False, False, False) + if wrapped_item_text != item_text: + update_message_by_id(messages, 0x6D, "I seem to have misplaced my\x01keys, but I have a fun item to\x01sell instead.\x01How about \x05\x4110 Rupees\x05\x40 for...\x04\x05\x41" + wrapped_item_text + "\x05\x40?\x01\x1B\x05\x42Buy\x01Don't Buy\x05\x40\x02") + else: + update_message_by_id(messages, 0x6D, "I seem to have misplaced my\x01keys, but I have a fun item to\x01sell instead.\x04How about \x05\x4110 Rupees\x05\x40 for\x01\x05\x41" + item_text + "\x05\x40?\x01\x1B\x05\x42Buy\x01Don't Buy\x05\x40\x02") update_message_by_id(messages, 0x908B, "That's OK!\x01More fun for me.\x0B\x02", 0x00) update_message_by_id(messages, 0x6E, "Wait, that room was off limits!\x02") update_message_by_id(messages, 0x704C, "I hope you like it!\x02")