Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LADX: text shuffle exclusions #3919

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 43 additions & 1 deletion worlds/ladx/LADXR/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,11 +342,53 @@ def gen_hint():
patches.enemies.doubleTrouble(rom)

if world.options.text_shuffle:
excluded_ids = [
# Overworld owl statues
0x1B6, 0x1B7, 0x1B8, 0x1B9, 0x1BA, 0x1BB, 0x1BC, 0x1BD, 0x1BE, 0x22D,

# Dungeon owls
0x288, 0x280, # D1
0x28A, 0x289, 0x281, # D2
0x282, 0x28C, 0x28B, # D3
0x283, # D4
0x28D, 0x284, # D5
0x285, 0x28F, 0x28E, # D6
0x291, 0x290, 0x286, # D7
0x293, 0x287, 0x292, # D8
0x263, # D0

# Hint books
0x267, # color dungeon
0x200, 0x201,
0x202, 0x203,
0x204, 0x205,
0x206, 0x207,
0x208, 0x209,
0x20A, 0x20B,
0x20C,
0x20D, 0x20E,
0x217, 0x218, 0x219, 0x21A,

# Goal sign
0x1A3,

# Signpost maze
0x1A9, 0x1AA, 0x1AB, 0x1AC, 0x1AD,

# Prices
0x02C, 0x02D, 0x030, 0x031, 0x032, 0x033, # Shop items
0x03B, # Trendy Game
0x045, # Fisherman
0x018, 0x019, # Crazy Tracy
0x0DC, # Mamu
0x0F0, # Raft ride
]
excluded_texts = [ rom.texts[b_id] for b_id in excluded_ids]
buckets = defaultdict(list)
# For each ROM bank, shuffle text within the bank
for n, data in enumerate(rom.texts._PointerTable__data):
# Don't muck up which text boxes are questions and which are statements
if type(data) != int and data and data != b'\xFF':
if type(data) != int and data and data != b'\xFF' and data not in excluded_texts:
buckets[(rom.texts._PointerTable__banks[n], data[len(data) - 1] == 0xfe)].append((n, data))
for bucket in buckets.values():
# For each bucket, make a copy and shuffle
Expand Down
Loading