5656from randomizer .Enums .SwitchTypes import SwitchType
5757from randomizer .Enums .Switches import Switches
5858from randomizer .Lists .Switches import SwitchInfo
59- from archipelago .Options import Goal , SwitchSanity , SelectStartingKong
59+ from archipelago .Options import Goal , SwitchSanity , SelectStartingKong , GalleonWaterLevel
6060from archipelago .Goals import GOAL_MAPPING , QUANTITY_GOALS , calculate_quantity
6161from archipelago .Logic import logic_item_name_to_id
6262
@@ -128,7 +128,6 @@ def get_default_settings() -> dict:
128128 "filler_items_selected" : [ItemRandoFiller .junkitem ],
129129 "free_trade_setting" : True ,
130130 "fungi_time" : FungiTimeSetting .dusk ,
131- "galleon_water" : GalleonWaterSetting .raised ,
132131 "generate_spoilerlog" : True ,
133132 "hard_bosses_selected" : [],
134133 "hard_mode_selected" : [],
@@ -194,7 +193,6 @@ def get_default_settings() -> dict:
194193 "krool_phase_order_rando" : True ,
195194 "krool_random" : False ,
196195 "less_fragile_boulders" : True ,
197- "level_randomization" : LevelRandomization .level_order_complex ,
198196 "logic_type" : LogicType .glitchless ,
199197 "maximize_helm_blocker" : True ,
200198 "medal_cb_req" : 40 ,
@@ -317,6 +315,7 @@ def apply_archipelago_settings(settings_dict: dict, options, multiworld) -> None
317315 settings_dict ["krool_in_boss_pool" ] = options .krool_in_boss_pool .value
318316 settings_dict ["helm_phase_count" ] = options .helm_phase_count .value
319317 settings_dict ["krool_phase_count" ] = options .krool_phase_count .value
318+ settings_dict ["level_randomization" ] = LevelRandomization .loadingzone if options .loading_zone_rando .value else LevelRandomization .level_order_complex
320319
321320 # Medal distribution settings
322321 if options .medal_distribution .value == 0 : # pre_selected
@@ -337,6 +336,12 @@ def apply_archipelago_settings(settings_dict: dict, options, multiworld) -> None
337336 if options .enable_cutscenes .value :
338337 settings_dict ["more_cutscene_skips" ] = ExtraCutsceneSkips .press
339338 settings_dict ["alt_minecart_mayhem" ] = options .alternate_minecart_mayhem .value
339+ if options .galleon_water_level == GalleonWaterLevel .option_lowered :
340+ settings_dict ["galleon_water" ] = GalleonWaterSetting .lowered
341+ elif options .galleon_water_level == GalleonWaterLevel .option_raised :
342+ settings_dict ["galleon_water" ] = GalleonWaterSetting .raised
343+ else :
344+ settings_dict ["galleon_water" ] = GalleonWaterSetting .vanilla
340345
341346
342347def apply_blocker_settings (settings_dict : dict , options ) -> None :
@@ -741,6 +746,66 @@ def apply_minigame_settings(settings_dict: dict, options, multiworld) -> None:
741746 settings_dict ["bonus_barrel_auto_complete" ] = options .auto_complete_bonus_barrels .value and options .goal .value != Goal .option_bonuses
742747 settings_dict ["helm_room_bonus_count" ] = HelmBonuses (options .helm_room_bonus_count .value )
743748
749+ # Map crown door and coin door settings
750+ crown_door_mapping = {
751+ 0 : HelmDoorItem .vanilla ,
752+ 1 : HelmDoorItem .opened ,
753+ 2 : HelmDoorItem .medium_random ,
754+ 3 : HelmDoorItem .req_gb ,
755+ 4 : HelmDoorItem .req_bp ,
756+ 5 : HelmDoorItem .req_companycoins ,
757+ 6 : HelmDoorItem .req_key ,
758+ 7 : HelmDoorItem .req_medal ,
759+ 8 : HelmDoorItem .req_crown ,
760+ 9 : HelmDoorItem .req_fairy ,
761+ 10 : HelmDoorItem .req_rainbowcoin ,
762+ 11 : HelmDoorItem .req_bean ,
763+ 12 : HelmDoorItem .req_pearl ,
764+ 13 : HelmDoorItem .easy_random ,
765+ 14 : HelmDoorItem .hard_random ,
766+ }
767+
768+ coin_door_mapping = {
769+ 0 : HelmDoorItem .vanilla ,
770+ 1 : HelmDoorItem .opened ,
771+ 2 : HelmDoorItem .medium_random ,
772+ 3 : HelmDoorItem .req_gb ,
773+ 4 : HelmDoorItem .req_bp ,
774+ 6 : HelmDoorItem .req_key ,
775+ 7 : HelmDoorItem .req_medal ,
776+ 8 : HelmDoorItem .req_crown ,
777+ 9 : HelmDoorItem .req_fairy ,
778+ 10 : HelmDoorItem .req_rainbowcoin ,
779+ 11 : HelmDoorItem .req_bean ,
780+ 12 : HelmDoorItem .req_pearl ,
781+ 13 : HelmDoorItem .easy_random ,
782+ 14 : HelmDoorItem .hard_random ,
783+ }
784+
785+ # Map door item type to the key name in helm_door_item_count dict
786+ door_item_to_key = {
787+ 3 : "golden_bananas" , # req_gb
788+ 4 : "blueprints" , # req_bp
789+ 5 : "company_coins" , # req_companycoins
790+ 6 : "keys" , # req_key
791+ 7 : "medals" , # req_medal
792+ 8 : "crowns" , # req_crown
793+ 9 : "fairies" , # req_fairy
794+ 10 : "rainbow_coins" , # req_rainbowcoin
795+ 11 : "bean" , # req_bean
796+ 12 : "pearls" , # req_pearl
797+ }
798+
799+ settings_dict ["crown_door_item" ] = crown_door_mapping .get (options .crown_door_item .value , HelmDoorItem .opened )
800+ # Get count from dict based on selected item, default to 1 if not found
801+ crown_item_key = door_item_to_key .get (options .crown_door_item .value )
802+ settings_dict ["crown_door_item_count" ] = options .helm_door_item_count .value .get (crown_item_key , 1 ) if crown_item_key else 1
803+
804+ settings_dict ["coin_door_item" ] = coin_door_mapping .get (options .coin_door_item .value , HelmDoorItem .opened )
805+ # Get count from dict based on selected item, default to 1 if not found
806+ coin_item_key = door_item_to_key .get (options .coin_door_item .value )
807+ settings_dict ["coin_door_item_count" ] = options .helm_door_item_count .value .get (coin_item_key , 1 ) if coin_item_key else 1
808+
744809 if hasattr (multiworld , "generation_is_fake" ):
745810 if hasattr (multiworld , "re_gen_passthrough" ):
746811 if "Donkey Kong 64" in multiworld .re_gen_passthrough :
@@ -759,10 +824,8 @@ def handle_fake_generation_settings(settings: Settings, multiworld) -> None:
759824
760825 # Switch logic lifted out of level shuffle due to static levels for UT
761826 if settings .alter_switch_allocation :
762- allocation = [1 , 1 , 1 , 1 , 2 , 2 , 3 , 3 ]
763827 for x in range (8 ):
764- level = settings .level_order [x + 1 ]
765- settings .switch_allocation [level ] = allocation [x ]
828+ settings .switch_allocation [x ] = passthrough ["SlamLevels" ][x ]
766829
767830 settings .starting_kong_list = passthrough ["StartingKongs" ]
768831 settings .starting_kong = settings .starting_kong_list [0 ] # fake a starting kong so that we don't force a different kong
0 commit comments