From 39839434c23696905a02c6946eeb1a4299cd4504 Mon Sep 17 00:00:00 2001 From: Karlcloudy Date: Sun, 25 Feb 2024 17:31:12 +1000 Subject: [PATCH 1/2] Fix fourkeys for Frue derived ROMs. --- randomizer.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/randomizer.py b/randomizer.py index 87ef49e..e9fa669 100644 --- a/randomizer.py +++ b/randomizer.py @@ -6423,6 +6423,8 @@ def make_four_keys(): assert 1 <= opcode <= 6 or opcode == 0x40 key_index = script.script[0][2][0] key = ItemObject.get(key_index) + if key.name in ['Door Key', 'VIP Card']: + continue key.set_name('Useless key') locations = [loc for loc in keydict if key in keydict[loc]] if not locations: @@ -6874,9 +6876,14 @@ class VanillaObject(TableObject): def get_keydict(): - tower = {'sky', 'wind', 'cloud', 'light', 'trial', 'truth', 'narcysus'} + frue = bool(re.search(r'FRUE|KUREJI|SPEKKIO', get_global_label())) + narcysus_name = 'sacral' if frue else 'narcysus' + gratze_name = 'jail' if frue else 'basement' + dankirk_name = 'angel' if frue else 'dankirk' + + tower = {'sky', 'wind', 'cloud', 'light', 'trial', 'truth', narcysus_name} shrine = {'sword', 'heart', 'ghost'} - dungeon = {'lake', 'ruby', 'dankirk', 'basement', 'ancient'} + dungeon = {'lake', 'ruby', 'ancient', dankirk_name, gratze_name} mountain = {'magma', 'flower', 'tree'} keys = lange(0x1af, 0x1c0) + [0x1c2] From 892fbd9c8d4da9bdaae0dd194aa894d20ab61c90 Mon Sep 17 00:00:00 2001 From: Karlcloudy Date: Mon, 26 Feb 2024 23:20:04 +1000 Subject: [PATCH 2/2] Stock ROM does not use title case for key names. --- randomizer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/randomizer.py b/randomizer.py index e9fa669..1a73ef1 100644 --- a/randomizer.py +++ b/randomizer.py @@ -6423,7 +6423,7 @@ def make_four_keys(): assert 1 <= opcode <= 6 or opcode == 0x40 key_index = script.script[0][2][0] key = ItemObject.get(key_index) - if key.name in ['Door Key', 'VIP Card']: + if key.name.upper() in ['DOOR KEY', 'VIP CARD']: continue key.set_name('Useless key') locations = [loc for loc in keydict if key in keydict[loc]]