Custom Goal framework fixes

This commit is contained in:
codemann8
2025-10-29 20:17:45 -05:00
parent a5ce59c7e8
commit 6edfbda0bf
6 changed files with 26 additions and 8 deletions

11
Main.py
View File

@@ -552,10 +552,12 @@ def resolve_random_settings(world, args):
req_table = {
'Invulnerable': 0x00,
'Disabled': 0x00,
'Pendants': 0x01,
'Crystals': 0x02,
'PendantBosses': 0x03,
'CrystalBosses': 0x04,
'PrizeBosses': 0x05,
'Bosses': 0x05,
'Agahnim1Defeated': 0x06,
'Agahnim1': 0x06,
@@ -577,7 +579,10 @@ def resolve_random_settings(world, args):
for r in list(goal_input['requirements']):
req = {}
try:
req['condition'] = req_table[list(r.keys())[0]]
if isinstance(r, str):
req['condition'] = req_table[r]
else:
req['condition'] = req_table[list(r.keys())[0]]
if req['condition'] == req_table['Invulnerable']:
goal['requirements']= [req]
goal['logic'] = False
@@ -647,7 +652,7 @@ def resolve_random_settings(world, args):
goal['logic']['pendant_bosses'] = req['target'] or 3
elif req['condition'] & 0x7F == req_table['CrystalBosses']:
goal['logic']['crystal_bosses'] = req['target'] or 7
elif req['condition'] & 0x7F == req_table['Bosses']:
elif req['condition'] & 0x7F == req_table['PrizeBosses']:
goal['logic']['bosses'] = req['target'] or 10
elif req['condition'] & 0x7F == req_table['Aga1']:
goal['logic']['aga1'] = True
@@ -662,7 +667,7 @@ def resolve_random_settings(world, args):
raise KeyError(f'Invalid {goal_type} requirement: {r}')
else:
raise KeyError(f'Invalid {goal_type} requirement definition')
if 'logic' in goal_input and goal['logic'] is not None:
if 'logic' in goal_input and goal['logic'] and goal['logic'] is not None:
goal['logic'].update(goal_input['logic'])
return