Repository: randovania/randovania
Pull request #8139: create_generated_pickup: get PickupDatabase as argument
Author: login: henriquegemignani
Created: 2025-03-17T19:03:49Z | Merged: 2025-03-17T19:37:57Z

Bite sized refactors being pulled out from a monster PR. Enjoy :)


Diff:
diff --git a/randovania/game_description/game_description.py b/randovania/game_description/game_description.py
index 66960ac9c4..c46c1c4f06 100644
--- a/randovania/game_description/game_description.py
+++ b/randovania/game_description/game_description.py
@@ -24,6 +24,7 @@
     from randovania.game_description.db.dock import DockWeaknessDatabase
     from randovania.game_description.db.node_identifier import NodeIdentifier
     from randovania.game_description.hint_features import HintFeature
+    from randovania.game_description.pickup.pickup_database import PickupDatabase
     from randovania.game_description.requirements.base import Requirement
     from randovania.game_description.requirements.requirement_list import RequirementList, SatisfiableRequirements
     from randovania.game_description.requirements.requirement_set import RequirementSet
@@ -247,6 +248,11 @@ def has_specific_location_hints(self) -> bool:
     def has_specific_pickup_hints(self) -> bool:
         return bool(self.game.hints.specific_pickup_hints) or self._has_hint_with_kind(HintNodeKind.SPECIFIC_PICKUP)
 
+    def get_pickup_database(self) -> PickupDatabase:
+        from randovania.game_description import default_database
+
+        return default_database.pickup_database_for_game(self.game)
+
 
 def _resources_for_damage(
     resource: SimpleResourceInfo, database: ResourceDatabase, collection: ResourceCollection
diff --git a/randovania/game_description/resources/resource_database.py b/randovania/game_description/resources/resource_database.py
index 30c3cfa09e..e73a128a39 100644
--- a/randovania/game_description/resources/resource_database.py
+++ b/randovania/game_description/resources/resource_database.py
@@ -3,6 +3,7 @@
 import dataclasses
 import typing
 
+from randovania.game_description.pickup.pickup_entry import PickupModel
 from randovania.game_description.resources import search
 from randovania.game_description.resources.resource_info import ResourceInfo
 from randovania.game_description.resources.resource_type import ResourceType
@@ -108,6 +109,12 @@ def get_damage(self, short_name: str) -> SimpleResourceInfo:
     def get_item_by_name(self, name: str) -> ItemResourceInfo:
         return search.find_resource_info_with_long_name(self.item, name)
 
+    def get_pickup_model(self, name: str) -> PickupModel:
+        return PickupModel(
+            game=self.game_enum,
+            name=name,
+        )
+
     @property
     def energy_tank(self) -> ItemResourceInfo:
         return self.energy_tank_item
diff --git a/randovania/games/am2r/generator/pool_creator.py b/randovania/games/am2r/generator/pool_creator.py
index 2a65d31931..f63a27dda7 100644
--- a/randovania/games/am2r/generator/pool_creator.py
+++ b/randovania/games/am2r/generator/pool_creator.py
@@ -32,7 +32,8 @@ def artifact_pool(game: GameDescription, config: AM2RArtifactConfig) -> PoolResu
         raise InvalidConfiguration("More Metroid DNA than allowed!")
 
     keys: list[PickupEntry] = [
-        create_generated_pickup("Metroid DNA", game.resource_database, i=i + 1) for i in range(46)
+        create_generated_pickup("Metroid DNA", game.resource_database, game.get_pickup_database(), i=i + 1)
+        for i in range(46)
     ]
     keys_to_shuffle = keys[: config.placed_artifacts]
     starting_keys = keys[config.placed_artifacts :]
diff --git a/randovania/games/blank/generator/pool_creator.py b/randovania/games/blank/generator/pool_creator.py
index f950a1a577..b7ae033cf8 100644
--- a/randovania/games/blank/generator/pool_creator.py
+++ b/randovania/games/blank/generator/pool_creator.py
@@ -14,4 +14,4 @@
 def pool_creator(results: PoolResults, configuration: BaseConfiguration, game: GameDescription) -> None:
     assert isinstance(configuration, BlankConfiguration)
 
-    results.to_place.append(create_generated_pickup("Victory Key", game.resource_database))
+    results.to_place.append(create_generated_pickup("Victory Key", game.resource_database, game.get_pickup_database()))
diff --git a/randovania/games/dread/generator/pool_creator.py b/randovania/games/dread/generator/pool_creator.py
index 079006908c..8ea561c9f3 100644
--- a/randovania/games/dread/generator/pool_creator.py
+++ b/randovania/games/dread/generator/pool_creator.py
@@ -18,7 +18,10 @@ def pool_creator(results: PoolResults, configuration: BaseConfiguration, game: G
 
 
 def artifact_pool(game: GameDescription, config: DreadArtifactConfig) -> PoolResults:
-    keys = [create_generated_pickup("Metroid DNA", game.resource_database, i=i + 1) for i in range(12)]
+    keys = [
+        create_generated_pickup("Metroid DNA", game.resource_database, game.get_pickup_database(), i=i + 1)
+        for i in range(12)
+    ]
     keys_to_shuffle = keys[: config.required_artifacts]
     starting_keys = keys[config.required_artifacts :]
 
diff --git a/randovania/games/fusion/generator/pool_creator.py b/randovania/games/fusion/generator/pool_creator.py
index 132c1272d4..419adc5a57 100644
--- a/randovania/games/fusion/generator/pool_creator.py
+++ b/randovania/games/fusion/generator/pool_creator.py
@@ -30,7 +30,8 @@ def artifact_pool(game: GameDescription, config: FusionArtifactConfig) -> PoolRe
         raise InvalidConfiguration("More Infant Metroids than allowed!")
 
     keys: list[PickupEntry] = [
-        create_generated_pickup("Infant Metroid", game.resource_database, i=i + 1) for i in range(20)
+        create_generated_pickup("Infant Metroid", game.resource_database, game.get_pickup_database(), i=i + 1)
+        for i in range(20)
     ]
     keys_to_shuffle = keys[: config.placed_artifacts]
     starting_keys = keys[config.placed_artifacts :]
diff --git a/randovania/games/planets_zebeth/generator/pool_creator.py b/randovania/games/planets_zebeth/generator/pool_creator.py
index 8e6433145f..7afc2c1b26 100644
--- a/randovania/games/planets_zebeth/generator/pool_creator.py
+++ b/randovania/games/planets_zebeth/generator/pool_creator.py
@@ -25,7 +25,8 @@ def pool_creator(results: PoolResults, configuration: BaseConfiguration, game: G
 
 def artifact_pool(game: GameDescription, config: PlanetsZebethArtifactConfig) -> PoolResults:
     keys: list[PickupEntry] = [
-        create_generated_pickup("Tourian Key", game.resource_database, i=i + 1) for i in range(9)
+        create_generated_pickup("Tourian Key", game.resource_database, game.get_pickup_database(), i=i + 1)
+        for i in range(9)
     ]
 
     # Check if we have vanilla tourian keys checked
diff --git a/randovania/games/prime1/generator/pickup_pool/artifacts.py b/randovania/games/prime1/generator/pickup_pool/artifacts.py
index c7dc4bdaf7..496f343166 100644
--- a/randovania/games/prime1/generator/pickup_pool/artifacts.py
+++ b/randovania/games/prime1/generator/pickup_pool/artifacts.py
@@ -7,6 +7,7 @@
 from randovania.generator.pickup_pool.pickup_creator import create_generated_pickup
 
 if TYPE_CHECKING:
+    from randovania.game_description.pickup.pickup_database import PickupDatabase
     from randovania.game_description.pickup.pickup_entry import PickupEntry
     from randovania.game_description.resources.resource_database import ResourceDatabase
     from randovania.games.prime1.layout.artifact_mode import LayoutArtifactMode
@@ -14,11 +15,13 @@
 
 def add_artifacts(
     resource_database: ResourceDatabase,
+    pickup_database: PickupDatabase,
     total: LayoutArtifactMode,
     artifact_minimum_progression: int,
 ) -> PoolResults:
     """
     :param resource_database:
+    :param pickup_database:
     :param total
     :param artifact_minimum_progression
     :return:
@@ -32,6 +35,7 @@ def add_artifacts(
             create_generated_pickup(
                 "Chozo Artifact",
                 resource_database,
+                pickup_database,
                 name=prime_items.ARTIFACT_ITEMS[i],
                 minimum_progression=artifact_minimum_progression,
             )
@@ -43,6 +47,7 @@ def add_artifacts(
         create_generated_pickup(
             "Chozo Artifact",
             resource_database,
+            pickup_database,
             name=prime_items.ARTIFACT_ITEMS[automatic_artifact],
             minimum_progression=artifact_minimum_progression,
         )
diff --git a/randovania/games/prime1/generator/pickup_pool/pool_creator.py b/randovania/games/prime1/generator/pickup_pool/pool_creator.py
index 20f6f3b5d3..386195695c 100644
--- a/randovania/games/prime1/generator/pickup_pool/pool_creator.py
+++ b/randovania/games/prime1/generator/pickup_pool/pool_creator.py
@@ -16,6 +16,7 @@ def prime1_specific_pool(results: PoolResults, configuration: BaseConfiguration,
     results.extend_with(
         add_artifacts(
             game.resource_database,
+            game.get_pickup_database(),
             configuration.artifact_target,
             configuration.artifact_minimum_progression,
         )
diff --git a/randovania/games/prime2/generator/pickup_pool/dark_temple_keys.py b/randovania/games/prime2/generator/pickup_pool/dark_temple_keys.py
index 5cc5262a69..a7bd27fe6d 100644
--- a/randovania/games/prime2/generator/pickup_pool/dark_temple_keys.py
+++ b/randovania/games/prime2/generator/pickup_pool/dark_temple_keys.py
@@ -6,21 +6,24 @@
 from randovania.generator.pickup_pool.pickup_creator import create_generated_pickup
 
 if TYPE_CHECKING:
+    from randovania.game_description.pickup.pickup_database import PickupDatabase
     from randovania.game_description.pickup.pickup_entry import PickupEntry
     from randovania.game_description.resources.resource_database import ResourceDatabase
 
 
 def add_dark_temple_keys(
     resource_database: ResourceDatabase,
+    pickup_database: PickupDatabase,
 ) -> PoolResults:
     """
     :param resource_database:
+    :param pickup_database:
     :return:
     """
     item_pool: list[PickupEntry] = []
 
     for temple_key in ("Dark Agon Key", "Dark Torvus Key", "Ing Hive Key"):
         for i in range(3):
-            item_pool.append(create_generated_pickup(temple_key, resource_database, i=i + 1))
+            item_pool.append(create_generated_pickup(temple_key, resource_database, pickup_database, i=i + 1))
 
     return PoolResults(item_pool, {}, [])
diff --git a/randovania/games/prime2/generator/pickup_pool/pool_creator.py b/randovania/games/prime2/generator/pickup_pool/pool_creator.py
index 63771e46be..3427cff2fe 100644
--- a/randovania/games/prime2/generator/pickup_pool/pool_creator.py
+++ b/randovania/games/prime2/generator/pickup_pool/pool_creator.py
@@ -15,7 +15,7 @@
 def echoes_specific_pool(results: PoolResults, configuration: BaseConfiguration, game: GameDescription):
     assert isinstance(configuration, EchoesConfiguration)
     # Adding Dark Temple Keys to pool
-    results.extend_with(add_dark_temple_keys(game.resource_database))
+    results.extend_with(add_dark_temple_keys(game.resource_database, game.get_pickup_database()))
 
     # Adding Sky Temple Keys to pool
     results.extend_with(add_sky_temple_key_distribution_logic(game, configuration.sky_temple_keys))
diff --git a/randovania/games/prime2/generator/pickup_pool/sky_temple_keys.py b/randovania/games/prime2/generator/pickup_pool/sky_temple_keys.py
index 26eccaaeb4..78bc2944c1 100644
--- a/randovania/games/prime2/generator/pickup_pool/sky_temple_keys.py
+++ b/randovania/games/prime2/generator/pickup_pool/sky_temple_keys.py
@@ -35,6 +35,7 @@ def add_sky_temple_key_distribution_logic(
     :return:
     """
     resource_database = game.resource_database
+    pickup_db = game.get_pickup_database()
     item_pool: list[PickupEntry] = []
     keys_to_place: int
 
@@ -47,11 +48,11 @@ def add_sky_temple_key_distribution_logic(
             raise InvalidConfiguration(f"Unknown Sky Temple Key mode: {mode}")
 
     for key_number in range(keys_to_place):
-        item_pool.append(create_generated_pickup("Sky Temple Key", resource_database, i=key_number + 1))
+        item_pool.append(create_generated_pickup("Sky Temple Key", resource_database, pickup_db, i=key_number + 1))
     first_automatic_key = keys_to_place
 
     starting = [
-        create_generated_pickup("Sky Temple Key", resource_database, i=automatic_key_number + 1)
+        create_generated_pickup("Sky Temple Key", resource_database, pickup_db, i=automatic_key_number + 1)
         for automatic_key_number in range(first_automatic_key, 9)
     ]
 
diff --git a/randovania/games/samus_returns/generator/pool_creator.py b/randovania/games/samus_returns/generator/pool_creator.py
index 2395b4615e..89905a8e3e 100644
--- a/randovania/games/samus_returns/generator/pool_creator.py
+++ b/randovania/games/samus_returns/generator/pool_creator.py
@@ -34,7 +34,8 @@ def artifact_pool(game: GameDescription, config: MSRArtifactConfig) -> PoolResul
         raise InvalidConfiguration("More Metroid DNA than allowed!")
 
     keys: list[PickupEntry] = [
-        create_generated_pickup("Metroid DNA", game.resource_database, i=i + 1) for i in range(39)
+        create_generated_pickup("Metroid DNA", game.resource_database, game.get_pickup_database(), i=i + 1)
+        for i in range(39)
     ]
     keys_to_shuffle = keys[: config.placed_artifacts]
     starting_keys = keys[config.placed_artifacts :]
diff --git a/randovania/generator/pickup_pool/pickup_creator.py b/randovania/generator/pickup_pool/pickup_creator.py
index 79214cbe55..ca2960ff09 100644
--- a/randovania/generator/pickup_pool/pickup_creator.py
+++ b/randovania/generator/pickup_pool/pickup_creator.py
@@ -4,7 +4,7 @@
 
 from frozendict import frozendict
 
-from randovania.game_description import default_database, hint_features
+from randovania.game_description import hint_features
 from randovania.game_description.pickup.pickup_entry import PickupEntry, PickupGeneratorParams, PickupModel
 from randovania.game_description.resources.location_category import LocationCategory
 
@@ -13,6 +13,7 @@
     from typing import Any
 
     from randovania.game.game_enum import RandovaniaGame
+    from randovania.game_description.pickup.pickup_database import PickupDatabase
     from randovania.game_description.pickup.pickup_definition.ammo_pickup import AmmoPickupDefinition
     from randovania.game_description.pickup.pickup_definition.standard_pickup import StandardPickupDefinition
     from randovania.game_description.resources.item_resource_info import ItemResourceInfo
@@ -53,10 +54,7 @@ def _create_resources(base_resource: str) -> tuple[ItemResourceInfo, int]:
         progression=tuple(_create_resources(progression) for progression in pickup.progression),
         start_case=pickup.starting_condition,
         extra_resources=tuple(extra_resources),
-        model=PickupModel(
-            game=resource_database.game_enum,
-            name=pickup.model_name,
-        ),
+        model=resource_database.get_pickup_model(pickup.model_name),
         offworld_models=pickup.offworld_models,
         gui_category=pickup.gui_category,
         hint_features=pickup.hint_features,
@@ -94,10 +92,7 @@ def create_ammo_pickup(
         name=ammo.name,
         progression=(),
         extra_resources=tuple(resources),
-        model=PickupModel(
-            game=resource_database.game_enum,
-            name=ammo.model_name,
-        ),
+        model=resource_database.get_pickup_model(ammo.model_name),
         offworld_models=ammo.offworld_models,
         gui_category=ammo.gui_category,
         hint_features=ammo.hint_features,
@@ -117,6 +112,7 @@ def create_ammo_pickup(
 def create_generated_pickup(
     pickup_group: str,
     resource_database: ResourceDatabase,
+    pickup_database: PickupDatabase,
     *,
     minimum_progression: int = 0,
     **format_kwargs: Any,
@@ -125,13 +121,12 @@ def create_generated_pickup(
     Creates a concrete PickupEntry given a generated pickup group and an identifier
     :param pickup_group:
     :param resource_database:
+    :param pickup_database:
     :param minimum_progression:
     :return:
     """
 
-    pickup_database = default_database.pickup_database_for_game(resource_database.game_enum)
     pickup = pickup_database.generated_pickups[pickup_group]
-
     assert not pickup.ammo
     assert not pickup.unlocks_ammo
 
@@ -142,10 +137,7 @@ def _create_resources(base_resource: str, count: int = 1) -> tuple[ItemResourceI
         name=pickup.name.format(**format_kwargs),
         progression=tuple(_create_resources(progression) for progression in pickup.progression),
         extra_resources=tuple(_create_resources(item, count) for item, count in pickup.additional_resources.items()),
-        model=PickupModel(
-            game=resource_database.game_enum,
-            name=pickup.model_name.format(**format_kwargs),
-        ),
+        model=resource_database.get_pickup_model(pickup.model_name.format(**format_kwargs)),
         offworld_models=frozendict(
             {game: model_name.format(**format_kwargs) for game, model_name in pickup.offworld_models.items()}
         ),
@@ -178,10 +170,7 @@ def create_nothing_pickup(resource_database: ResourceDatabase, model_name: str =
     return PickupEntry(
         name="Nothing",
         progression=(),
-        model=PickupModel(
-            game=resource_database.game_enum,
-            name=model_name,
-        ),
+        model=resource_database.get_pickup_model(model_name),
         gui_category=USELESS_PICKUP_CATEGORY,
         hint_features=frozenset((USELESS_PICKUP_CATEGORY,)),
         generator_params=PickupGeneratorParams(
diff --git a/test/games/am2r/generator/test_am2r_pool_creator.py b/test/games/am2r/generator/test_am2r_pool_creator.py
index 916f2a19bb..c4f71f5ccf 100644
--- a/test/games/am2r/generator/test_am2r_pool_creator.py
+++ b/test/games/am2r/generator/test_am2r_pool_creator.py
@@ -17,9 +17,15 @@ def test_am2r_pool_creator(am2r_game_description, required_dna, placed_dna):
 
     # Assert
     assert results == PoolResults(
-        [create_generated_pickup("Metroid DNA", db, i=i + 1) for i in range(required_dna)],
+        [
+            create_generated_pickup("Metroid DNA", db, am2r_game_description.get_pickup_database(), i=i + 1)
+            for i in range(required_dna)
+        ],
         {},
-        [create_generated_pickup("Metroid DNA", db, i=i + 1) for i in range(required_dna, 46)],
+        [
+            create_generated_pickup("Metroid DNA", db, am2r_game_description.get_pickup_database(), i=i + 1)
+            for i in range(required_dna, 46)
+        ],
     )
 
 
diff --git a/test/games/dread/generator/test_dread_pool_creator.py b/test/games/dread/generator/test_dread_pool_creator.py
index 43c87cc46c..e9bf8a910f 100644
--- a/test/games/dread/generator/test_dread_pool_creator.py
+++ b/test/games/dread/generator/test_dread_pool_creator.py
@@ -17,7 +17,13 @@ def test_artifact_pool(dread_game_description, dread_configuration, count: int):
 
     # Assert
     assert results == PoolResults(
-        to_place=[create_generated_pickup("Metroid DNA", db, i=i + 1) for i in range(count)],
+        to_place=[
+            create_generated_pickup("Metroid DNA", db, dread_game_description.get_pickup_database(), i=i + 1)
+            for i in range(count)
+        ],
         assignment={},
-        starting=[create_generated_pickup("Metroid DNA", db, i=i + 1) for i in range(count, 12)],
+        starting=[
+            create_generated_pickup("Metroid DNA", db, dread_game_description.get_pickup_database(), i=i + 1)
+            for i in range(count, 12)
+        ],
     )
diff --git a/test/games/fusion/generator/test_fusion_pool_creator.py b/test/games/fusion/generator/test_fusion_pool_creator.py
index 037c7c8b93..d3b973d769 100644
--- a/test/games/fusion/generator/test_fusion_pool_creator.py
+++ b/test/games/fusion/generator/test_fusion_pool_creator.py
@@ -27,9 +27,15 @@ def test_fusion_pool_creator(fusion_game_description, required_metroids, placed_
 
     # Assert
     assert results == PoolResults(
-        [create_generated_pickup("Infant Metroid", db, i=i + 1) for i in range(required_metroids)],
+        [
+            create_generated_pickup("Infant Metroid", db, fusion_game_description.get_pickup_database(), i=i + 1)
+            for i in range(required_metroids)
+        ],
         {},
-        [create_generated_pickup("Infant Metroid", db, i=i + 1) for i in range(required_metroids, 20)],
+        [
+            create_generated_pickup("Infant Metroid", db, fusion_game_description.get_pickup_database(), i=i + 1)
+            for i in range(required_metroids, 20)
+        ],
     )
 
 
diff --git a/test/games/planets_zebeth/generator/test_planets_zebeth_pool_creator.py b/test/games/planets_zebeth/generator/test_planets_zebeth_pool_creator.py
index 5c603c6ed5..948ca35e72 100644
--- a/test/games/planets_zebeth/generator/test_planets_zebeth_pool_creator.py
+++ b/test/games/planets_zebeth/generator/test_planets_zebeth_pool_creator.py
@@ -17,9 +17,15 @@ def test_planets_zebeth_pool_creator(planets_zebeth_game_description, keys_count
 
     # Assert
     assert results == PoolResults(
-        [create_generated_pickup("Tourian Key", db, i=i + 1) for i in range(keys_count)],
+        [
+            create_generated_pickup("Tourian Key", db, planets_zebeth_game_description.get_pickup_database(), i=i + 1)
+            for i in range(keys_count)
+        ],
         {},
-        [create_generated_pickup("Tourian Key", db, i=i + 1) for i in range(keys_count, 9)],
+        [
+            create_generated_pickup("Tourian Key", db, planets_zebeth_game_description.get_pickup_database(), i=i + 1)
+            for i in range(keys_count, 9)
+        ],
     )
 
 
diff --git a/test/games/prime/patcher_file_lib/test_sky_temple_key_hint.py b/test/games/prime/patcher_file_lib/test_sky_temple_key_hint.py
index 404b5332f5..44b2cc1a1c 100644
--- a/test/games/prime/patcher_file_lib/test_sky_temple_key_hint.py
+++ b/test/games/prime/patcher_file_lib/test_sky_temple_key_hint.py
@@ -5,8 +5,6 @@
 import pytest
 
 import randovania.games.prime2.exporter.hints
-from randovania.game.game_enum import RandovaniaGame
-from randovania.game_description import default_database
 from randovania.game_description.assignment import PickupTarget
 from randovania.game_description.resources.pickup_index import PickupIndex
 from randovania.games.prime2.exporter.hint_namer import EchoesHintNamer
@@ -51,19 +49,25 @@ def test_create_hints_all_placed(
     hide_area: bool,
     multiworld: bool,
     echoes_game_patches,
+    echoes_game_description,
     prime_game_patches,
     default_echoes_configuration,
     default_prime_configuration,
 ):
     # Setup
-    echoes_game = default_database.game_description_for(RandovaniaGame.METROID_PRIME_ECHOES)
+    echoes_game = echoes_game_description
     players_config = PlayersConfiguration(0, {0: "you", 1: "them"} if multiworld else {0: "you"})
 
     patches = echoes_game_patches.assign_new_pickups(
         [
             (
                 PickupIndex(17 + key),
-                PickupTarget(create_generated_pickup("Sky Temple Key", echoes_game.resource_database, i=key + 1), 0),
+                PickupTarget(
+                    create_generated_pickup(
+                        "Sky Temple Key", echoes_game.resource_database, echoes_game.get_pickup_database(), i=key + 1
+                    ),
+                    0,
+                ),
             )
             for key in range(5 if multiworld else 9)
         ]
@@ -74,7 +78,12 @@ def test_create_hints_all_placed(
         [
             (
                 PickupIndex(17 + key),
-                PickupTarget(create_generated_pickup("Sky Temple Key", echoes_game.resource_database, i=key + 1), 0),
+                PickupTarget(
+                    create_generated_pickup(
+                        "Sky Temple Key", echoes_game.resource_database, echoes_game.get_pickup_database(), i=key + 1
+                    ),
+                    0,
+                ),
             )
             for key in range(5, 9)
         ]
@@ -142,7 +151,14 @@ def test_create_hints_all_starting(
 
     patches = echoes_game_patches.assign_extra_starting_pickups(
         [
-            (create_generated_pickup("Sky Temple Key", echoes_game_description.resource_database, i=key + 1))
+            (
+                create_generated_pickup(
+                    "Sky Temple Key",
+                    echoes_game_description.resource_database,
+                    echoes_game_description.get_pickup_database(),
+                    i=key + 1,
+                )
+            )
             for key in range(9)
         ]
     )
diff --git a/test/games/prime2/generator/test_sky_temple_key.py b/test/games/prime2/generator/test_sky_temple_key.py
index 362a469dc8..90973eaf43 100644
--- a/test/games/prime2/generator/test_sky_temple_key.py
+++ b/test/games/prime2/generator/test_sky_temple_key.py
@@ -10,23 +10,29 @@
 from randovania.generator.pickup_pool.pickup_creator import create_generated_pickup
 
 if TYPE_CHECKING:
+    from randovania.game_description.pickup.pickup_database import PickupDatabase
     from randovania.game_description.resources.resource_database import ResourceDatabase
 
 
-def _create_pool_with(shuffled_count: int, db: ResourceDatabase):
+def _create_pool_with(shuffled_count: int, db: ResourceDatabase, pdb: PickupDatabase):
     return PoolResults(
-        to_place=[create_generated_pickup("Sky Temple Key", db, i=i + 1) for i in range(shuffled_count)],
+        to_place=[create_generated_pickup("Sky Temple Key", db, pdb, i=i + 1) for i in range(shuffled_count)],
         assignment={},
-        starting=[create_generated_pickup("Sky Temple Key", db, i=i + 1) for i in range(shuffled_count, 9)],
+        starting=[create_generated_pickup("Sky Temple Key", db, pdb, i=i + 1) for i in range(shuffled_count, 9)],
     )
 
 
 @pytest.mark.parametrize("index", range(9))
-def test_create_key_id(index: int, echoes_resource_database):
-    key = create_generated_pickup("Sky Temple Key", echoes_resource_database, i=index + 1)
+def test_create_key_id(index: int, echoes_game_description):
+    key = create_generated_pickup(
+        "Sky Temple Key",
+        echoes_game_description.resource_database,
+        echoes_game_description.get_pickup_database(),
+        i=index + 1,
+    )
 
     assert key.gui_category.name == "sky_temple_key"
-    assert key.progression == ((echoes_resource_database.get_item(f"TempleKey{index + 1}"), 1),)
+    assert key.progression == ((echoes_game_description.resource_database.get_item(f"TempleKey{index + 1}"), 1),)
 
 
 def test_sky_temple_key_distribution_logic_all_bosses_valid(echoes_game_description):
@@ -36,7 +42,9 @@ def test_sky_temple_key_distribution_logic_all_bosses_valid(echoes_game_descript
     )
 
     # Assert
-    assert results == _create_pool_with(9, echoes_game_description.resource_database)
+    assert results == _create_pool_with(
+        9, echoes_game_description.resource_database, echoes_game_description.get_pickup_database()
+    )
 
 
 def test_sky_temple_key_distribution_logic_all_guardians_valid(echoes_game_description):
@@ -46,7 +54,9 @@ def test_sky_temple_key_distribution_logic_all_guardians_valid(echoes_game_descr
     )
 
     # Assert
-    assert results == _create_pool_with(3, echoes_game_description.resource_database)
+    assert results == _create_pool_with(
+        3, echoes_game_description.resource_database, echoes_game_description.get_pickup_database()
+    )
 
 
 @pytest.mark.parametrize("quantity", list(range(10)))
@@ -57,4 +67,6 @@ def test_sky_temple_key_distribution_logic_with_quantity(echoes_game_description
     )
 
     # Assert
-    assert results == _create_pool_with(quantity, echoes_game_description.resource_database)
+    assert results == _create_pool_with(
+        quantity, echoes_game_description.resource_database, echoes_game_description.get_pickup_database()
+    )
diff --git a/test/games/samus_returns/generator/test_msr_pool_creator.py b/test/games/samus_returns/generator/test_msr_pool_creator.py
index 08f7fe5a33..5587007f7a 100644
--- a/test/games/samus_returns/generator/test_msr_pool_creator.py
+++ b/test/games/samus_returns/generator/test_msr_pool_creator.py
@@ -17,9 +17,15 @@ def test_msr_pool_creator(msr_game_description, required_dna, placed_dna):
 
     # Assert
     assert results == PoolResults(
-        [create_generated_pickup("Metroid DNA", db, i=i + 1) for i in range(required_dna)],
+        [
+            create_generated_pickup("Metroid DNA", db, msr_game_description.get_pickup_database(), i=i + 1)
+            for i in range(required_dna)
+        ],
         {},
-        [create_generated_pickup("Metroid DNA", db, i=i + 1) for i in range(placed_dna, 39)],
+        [
+            create_generated_pickup("Metroid DNA", db, msr_game_description.get_pickup_database(), i=i + 1)
+            for i in range(placed_dna, 39)
+        ],
     )
 
 


Reviews:
user: login: duncathan
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-17T19:08:10Z
user: login: henriquegemignani
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-17T19:11:04Z
user: login: duncathan
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-03-17T19:11:46Z

Review comments:
diff_hunk: @@ -117,6 +112,7 @@ def create_ammo_pickup(
 def create_generated_pickup(
     pickup_group: str,
     resource_database: ResourceDatabase,
+    pickup_database: PickupDatabase,
path: randovania/generator/pickup_pool/pickup_creator.py
user: login: duncathan
body: maybe this should just accept a GameDescription?
created_at: 2025-03-17T19:06:46Z
author_association: CONTRIBUTOR
diff_hunk: @@ -7,18 +7,21 @@
 from randovania.generator.pickup_pool.pickup_creator import create_generated_pickup
 
 if TYPE_CHECKING:
+    from randovania.game_description.pickup.pickup_database import PickupDatabase
     from randovania.game_description.pickup.pickup_entry import PickupEntry
     from randovania.game_description.resources.resource_database import ResourceDatabase
     from randovania.games.prime1.layout.artifact_mode import LayoutArtifactMode
 
 
 def add_artifacts(
     resource_database: ResourceDatabase,
+    pickup_database: PickupDatabase,
path: randovania/games/prime1/generator/pickup_pool/artifacts.py
user: login: duncathan
body: this one too?
created_at: 2025-03-17T19:08:04Z
author_association: CONTRIBUTOR
diff_hunk: @@ -117,6 +112,7 @@ def create_ammo_pickup(
 def create_generated_pickup(
     pickup_group: str,
     resource_database: ResourceDatabase,
+    pickup_database: PickupDatabase,
path: randovania/generator/pickup_pool/pickup_creator.py
user: login: henriquegemignani
body: Maybe, though I do like having it use the separate pieces. I'm working on changing a bunch around these classes at the moment so I'd rather leave as is for now.
created_at: 2025-03-17T19:11:04Z
author_association: MEMBER

PR comments:
user: login: duncathan
created_at: 2025-03-17T19:05:11Z
body: this diff is clearly much larger than one byte!
author_association: CONTRIBUTOR
user: login: codecov[bot]
created_at: 2025-03-17T19:12:51Z
body: ## [Codecov](https://app.codecov.io/gh/randovania/randovania/pull/8139?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=randovania) Report
All modified and coverable lines are covered by tests :white_check_mark:
> Project coverage is 85.70%. Comparing base [(`1148737`)](https://app.codecov.io/gh/randovania/randovania/commit/11487372ac217b938b4cd6a2f21041fef6ca3ba9?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=randovania) to head [(`c7ae6d1`)](https://app.codecov.io/gh/randovania/randovania/commit/c7ae6d1472510734365c55f4ce2b8cdbeebabba5?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=randovania).
> Report is 3 commits behind head on main.

<details><summary>Additional details and impacted files</summary>


```diff
@@           Coverage Diff           @@
##             main    #8139   +/-   ##
=======================================
  Coverage   85.70%   85.70%           
=======================================
  Files         699      699           
  Lines       45366    45372    +6     
  Branches     5602     5602           
=======================================
+ Hits        38882    38888    +6     
  Misses       5233     5233           
  Partials     1251     1251           
```

</details>

[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/randovania/randovania/pull/8139?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=randovania).   
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=randovania).

<details><summary>🚀 New features to boost your workflow: </summary>

- ❄ [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
</details>
author_association: NONE