From a2c4be4c4cc547d86d469182907143c9cb64daf2 Mon Sep 17 00:00:00 2001 From: Cody Bailey Date: Sun, 19 Nov 2023 17:32:45 -0500 Subject: [PATCH] Add aga_randomness to exposed settings --- BaseClasses.py | 2 +- CLI.py | 3 ++- Main.py | 1 + Rom.py | 2 +- resources/app/cli/args.json | 4 ++++ source/classes/CustomSettings.py | 2 ++ source/tools/MysteryUtils.py | 1 + 7 files changed, 12 insertions(+), 3 deletions(-) diff --git a/BaseClasses.py b/BaseClasses.py index 7a463a38..231cf89b 100644 --- a/BaseClasses.py +++ b/BaseClasses.py @@ -54,7 +54,6 @@ class World(object): self.shuffle_bonk_prizes = False self.clock_mode = 'none' self.rupoor_cost = 10 - self.aga_randomness = True self.lock_aga_door_in_escape = False self.save_and_quit_from_boss = True self.accessibility = accessibility.copy() @@ -150,6 +149,7 @@ class World(object): set_player_attr('door_type_mode', 'original') set_player_attr('trap_door_mode', 'optional') set_player_attr('key_logic_algorithm', 'default') + set_player_attr('aga_randomness', True) set_player_attr('shopsanity', False) set_player_attr('mixed_travel', 'prevent') diff --git a/CLI.py b/CLI.py index 4c9d4fc0..38af7c52 100644 --- a/CLI.py +++ b/CLI.py @@ -141,7 +141,7 @@ def parse_cli(argv, no_defaults=False): 'heartbeep', 'remote_items', 'shopsanity', 'dropshuffle', 'pottery', 'keydropshuffle', 'mixed_travel', 'standardize_palettes', 'code', 'reduce_flashing', 'shuffle_sfx', 'msu_resume', 'collection_rate', 'colorizepots', 'decoupledoors', 'door_type_mode', - 'trap_door_mode', 'key_logic_algorithm', 'door_self_loops', 'any_enemy_logic']: + 'trap_door_mode', 'key_logic_algorithm', 'door_self_loops', 'any_enemy_logic', 'aga_randomness']: value = getattr(defaults, name) if getattr(playerargs, name) is None else getattr(playerargs, name) if player == 1: setattr(ret, name, {1: value}) @@ -223,6 +223,7 @@ def parse_settings(): 'dungeon_counters': 'default', 'mixed_travel': 'prevent', 'standardize_palettes': 'standardize', + 'aga_randomness': True, "triforce_pool": 0, "triforce_goal": 0, diff --git a/Main.py b/Main.py index b5d5c61e..3ffda1f9 100644 --- a/Main.py +++ b/Main.py @@ -137,6 +137,7 @@ def main(args, seed=None, fish=None): world.restrict_boss_items = args.restrict_boss_items.copy() world.collection_rate = args.collection_rate.copy() world.colorizepots = args.colorizepots.copy() + world.aga_randomness = args.aga_randomness.copy() world.treasure_hunt_count = {} world.treasure_hunt_total = {} diff --git a/Rom.py b/Rom.py index afe69a0e..7b018e13 100644 --- a/Rom.py +++ b/Rom.py @@ -1118,7 +1118,7 @@ def patch_rom(world, rom, player, team, is_mystery=False): rom.initial_sram.pre_open_ganons_tower() rom.write_byte(0xF5D73, 0xF0) # bees are catchable rom.write_byte(0xF5F10, 0xF0) # bees are catchable - rom.write_byte(0x180086, 0x00 if world.aga_randomness else 0x01) # set blue ball and ganon warp randomness + rom.write_byte(0x180086, 0x00 if world.aga_randomness[player] else 0x01) # set blue ball and ganon warp randomness rom.write_byte(0x1800A0, 0x01) # return to light world on s+q without mirror rom.write_byte(0x1800A1, 0x01) # enable overworld screen transition draining for water level inside swamp rom.write_byte(0x180174, 0x01 if world.fix_fake_world[player] else 0x00) diff --git a/resources/app/cli/args.json b/resources/app/cli/args.json index 354a5618..42934aba 100644 --- a/resources/app/cli/args.json +++ b/resources/app/cli/args.json @@ -514,6 +514,10 @@ "action": "store_true", "type": "bool" }, + "aga_randomness": { + "action": "store_false", + "type": "bool" + }, "saveonexit": { "choices": [ "ask", diff --git a/source/classes/CustomSettings.py b/source/classes/CustomSettings.py index 631ca260..c72a111c 100644 --- a/source/classes/CustomSettings.py +++ b/source/classes/CustomSettings.py @@ -155,6 +155,7 @@ class CustomSettings(object): args.triforce_min_difference[p] = get_setting(settings['triforce_min_difference'], args.triforce_min_difference[p]) args.triforce_max_difference[p] = get_setting(settings['triforce_max_difference'], args.triforce_max_difference[p]) args.beemizer[p] = get_setting(settings['beemizer'], args.beemizer[p]) + args.aga_randomness[p] = get_setting(settings['aga_randomness'], args.aga_randomness[p]) # mystery usage args.usestartinventory[p] = get_setting(settings['usestartinventory'], args.usestartinventory[p]) @@ -283,6 +284,7 @@ class CustomSettings(object): settings_dict[p]['triforce_goal'] = world.treasure_hunt_count[p] settings_dict[p]['triforce_pool'] = world.treasure_hunt_total[p] settings_dict[p]['beemizer'] = world.beemizer[p] + settings_dict[p]['aga_randomness'] = world.aga_randomness[p] # rom adjust stuff # settings_dict[p]['sprite'] = world.sprite[p] diff --git a/source/tools/MysteryUtils.py b/source/tools/MysteryUtils.py index 00df02ef..017144eb 100644 --- a/source/tools/MysteryUtils.py +++ b/source/tools/MysteryUtils.py @@ -122,6 +122,7 @@ def roll_settings(weights): ret.pottery = 'keys' if ret.pottery == 'none' and keydropshuffle else ret.pottery ret.colorizepots = get_choice_bool_default('colorizepots', default=True) ret.shufflepots = get_choice_bool('pot_shuffle') + ret.aga_randomness = get_choice_bool('aga_randomness') ret.mixed_travel = get_choice('mixed_travel') if 'mixed_travel' in weights else 'prevent' ret.standardize_palettes = (get_choice('standardize_palettes') if 'standardize_palettes' in weights else 'standardize')