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:
parent
1e251dcdc0
commit
ab4324c901
|
@ -69,6 +69,14 @@ class TechCostMix(Range):
|
||||||
default = 70
|
default = 70
|
||||||
|
|
||||||
|
|
||||||
|
class RampingTechCosts(Toggle):
|
||||||
|
"""Forces the amount of Science Packs required to ramp up with the highest involved Pack. Average is preserved.
|
||||||
|
For example:
|
||||||
|
off: Automation (red)/Logistics (green) sciences can range from 1 to 1000 Science Packs,
|
||||||
|
on: Automation (red) ranges to ~500 packs and Logistics (green) from ~500 to 1000 Science Packs"""
|
||||||
|
display_name = "Ramping Tech Costs"
|
||||||
|
|
||||||
|
|
||||||
class Silo(Choice):
|
class Silo(Choice):
|
||||||
"""Ingredients to craft rocket silo or auto-place if set to spawn."""
|
"""Ingredients to craft rocket silo or auto-place if set to spawn."""
|
||||||
display_name = "Rocket Silo"
|
display_name = "Rocket Silo"
|
||||||
|
@ -372,6 +380,7 @@ factorio_options: typing.Dict[str, type(Option)] = {
|
||||||
"min_tech_cost": MinTechCost,
|
"min_tech_cost": MinTechCost,
|
||||||
"max_tech_cost": MaxTechCost,
|
"max_tech_cost": MaxTechCost,
|
||||||
"tech_cost_mix": TechCostMix,
|
"tech_cost_mix": TechCostMix,
|
||||||
|
"ramping_tech_costs": RampingTechCosts,
|
||||||
"silo": Silo,
|
"silo": Silo,
|
||||||
"satellite": Satellite,
|
"satellite": Satellite,
|
||||||
"free_samples": FreeSamples,
|
"free_samples": FreeSamples,
|
||||||
|
|
|
@ -99,7 +99,13 @@ class Factorio(World):
|
||||||
for loc_name in location_names]
|
for loc_name in location_names]
|
||||||
rand_values = sorted(random.randint(self.multiworld.min_tech_cost[self.player],
|
rand_values = sorted(random.randint(self.multiworld.min_tech_cost[self.player],
|
||||||
self.multiworld.max_tech_cost[self.player]) for _ in self.locations)
|
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]
|
location.count = rand_values[i]
|
||||||
del rand_values
|
del rand_values
|
||||||
nauvis.locations.extend(self.locations)
|
nauvis.locations.extend(self.locations)
|
||||||
|
|
Loading…
Reference in New Issue