Factorio: add option "ramping tech cost" (#1403)

* Factorio: add option "ramping tech cost"

* Factorio: fix missing s

* Factorio: add display_name to ranmping tech costs
This commit is contained in:
Fabian Dill
2023-01-28 00:30:05 +01:00
committed by GitHub
parent 1e251dcdc0
commit ab4324c901
2 changed files with 16 additions and 1 deletions

View File

@@ -99,7 +99,13 @@ class Factorio(World):
for loc_name in location_names]
rand_values = sorted(random.randint(self.multiworld.min_tech_cost[self.player],
self.multiworld.max_tech_cost[self.player]) for _ in self.locations)
for i, location in enumerate(sorted(self.locations, key=lambda loc: loc.rel_cost)):
if self.multiworld.ramping_tech_costs[self.player]:
def sorter(loc: FactorioScienceLocation):
return loc.complexity, loc.rel_cost
else:
def sorter(loc: FactorioScienceLocation):
return loc.rel_cost
for i, location in enumerate(sorted(self.locations, key=sorter)):
location.count = rand_values[i]
del rand_values
nauvis.locations.extend(self.locations)