Skip to content

Commit

Permalink
Factorio: inflate location pool (#2422)
Browse files Browse the repository at this point in the history
  • Loading branch information
Berserker66 authored Nov 7, 2023
1 parent 5a7d69c commit 72cb8b7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
9 changes: 2 additions & 7 deletions worlds/factorio/Locations.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,13 @@
from .Technologies import factorio_base_id
from .Options import MaxSciencePack

boundary: int = 0xff
total_locations: int = 0xff

assert total_locations <= boundary


def make_pools() -> Dict[str, List[str]]:
pools: Dict[str, List[str]] = {}
for i, pack in enumerate(MaxSciencePack.get_ordered_science_packs(), start=1):
max_needed: int = 0xff
max_needed: int = 999
prefix: str = f"AP-{i}-"
pools[pack] = [prefix + hex(x)[2:].upper().zfill(2) for x in range(1, max_needed + 1)]
pools[pack] = [prefix + str(x).upper().zfill(3) for x in range(1, max_needed + 1)]
return pools


Expand Down
2 changes: 1 addition & 1 deletion worlds/factorio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ def __init__(self, player: int, name: str, address: int, parent: Region):
super(FactorioScienceLocation, self).__init__(player, name, address, parent)
# "AP-{Complexity}-{Cost}"
self.complexity = int(self.name[3]) - 1
self.rel_cost = int(self.name[5:], 16)
self.rel_cost = int(self.name[5:])

self.ingredients = {Factorio.ordered_science_packs[self.complexity]: 1}
for complexity in range(self.complexity):
Expand Down

0 comments on commit 72cb8b7

Please sign in to comment.