From b56c820411de1de7d031c34e54a1d0c27c733d13 Mon Sep 17 00:00:00 2001 From: Jarno Westhof Date: Tue, 29 Apr 2025 21:27:58 +0200 Subject: [PATCH] Implemented exploration cost in slot_data --- worlds/satisfactory/Options.py | 9 ++++++++- worlds/satisfactory/__init__.py | 19 +++++++++++++++---- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/worlds/satisfactory/Options.py b/worlds/satisfactory/Options.py index 3b135ca7cb..420ddaf566 100644 --- a/worlds/satisfactory/Options.py +++ b/worlds/satisfactory/Options.py @@ -372,7 +372,14 @@ class ExplorationCollectableCount(Range): """ Does nothing if *Exploration Collectables* goal is not enabled. - Collect this amount of Mercer Spheres and Summer Sloops each to finish. + Collect this amount of Mercer Spheres, Somersloops, Harddrives, Paleberry, Beryl Nut and Bacon Agaric each to finish. + + The amount for Mercer Spheres is 2x the selected amount + The amount for Somersloops is the selected amount + The amount for Harddrives is 1/5th the selected amount + The amount for Paleberry is 10x the selected amount + The amount for Beryl Nut is 20x the selected amount + The amount for Bacon Agaric is the selected amount """ display_name = "Exploration Collectables" default = 20 diff --git a/worlds/satisfactory/__init__.py b/worlds/satisfactory/__init__.py index 7e8cf1f05e..88792d2f57 100644 --- a/worlds/satisfactory/__init__.py +++ b/worlds/satisfactory/__init__.py @@ -109,10 +109,8 @@ class SatisfactoryWorld(World): for milestone, parts in enumerate(milestones, 1): slot_hub_layout[tier - 1].append({}) for part, amount in parts.items(): - # ItemIDs of bundles are shared with their component item - bundled_name = f"Bundle: {part}" - multiplied_amount = max(amount * (self.options.milestone_cost_multiplier / 100), 1) - slot_hub_layout[tier - 1][milestone - 1][self.item_name_to_id[bundled_name]] = multiplied_amount + multiplied_amount = int(max(amount * (self.options.milestone_cost_multiplier / 100), 1)) + slot_hub_layout[tier-1][milestone-1][self.item_id_str(part)] = multiplied_amount starting_recipes: tuple[int] = tuple( self.item_name_to_id[recipe_name] @@ -123,6 +121,14 @@ class SatisfactoryWorld(World): "Data": { "HubLayout": slot_hub_layout, "SlotsPerMilestone": self.game_logic.slots_per_milestone, + "ExplorationCosts": { + self.item_id_str("Mercer Sphere"): int(self.options.goal_exploration_collectables_amount * 2), + self.item_id_str("Somersloop"): self.options.goal_exploration_collectables_amount, + self.item_id_str("Hard Drive"): int(self.options.goal_exploration_collectables_amount / 5), + self.item_id_str("Paleberry"): self.options.goal_exploration_collectables_amount * 10, + self.item_id_str("Beryl Nut"): self.options.goal_exploration_collectables_amount * 20, + self.item_id_str("Bacon Agaric"): self.options.goal_exploration_collectables_amount, + }, "Options": { "GoalSelection": self.options.goal_selection.value, "GoalRequirement": self.options.goal_requirement.value, @@ -171,3 +177,8 @@ class SatisfactoryWorld(World): def push_precollected(self, item_name: str) -> None: item = self.create_item(item_name) self.multiworld.push_precollected(item) + + def item_id_str(self, item_name: str) -> str: + # ItemIDs of bundles are shared with their component item + bundled_name = f"Bundle: {item_name}" + return str(self.item_name_to_id[bundled_name])