Skip to content

Commit

Permalink
(Aegis) Add worker secondary support for FIRS economies
Browse files Browse the repository at this point in the history
  • Loading branch information
ahyangyi committed Nov 21, 2023
1 parent dadbb4d commit 07e4466
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 4 deletions.
12 changes: 11 additions & 1 deletion industry/economies/firs_arctic.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def get_economy(self, parameters):
ret.graph[fishing_grounds].boosters = workers
if parameters["WORKFORCE"] == "YETI_TIRED":
ret.graph[fishing_grounds].produces += (tired_workers,)
if parameters["WORKER_PARTICIPATION"] in ("PRIMARY_INDUSTRY", "SECONDARY_INDUSTRY", "BOTH"):
if parameters["WORKER_PARTICIPATION"] in ("PRIMARY_INDUSTRY", "BOTH"):
for i in [
ammonia_plant,
clay_pit,
Expand All @@ -177,6 +177,16 @@ def get_economy(self, parameters):
ret.graph[i] = ret.graph[i].to_secondary(workers)
if parameters["WORKFORCE"] == "YETI_TIRED":
ret.graph[i].produces += (tired_workers,)
if parameters["WORKER_PARTICIPATION"] in ("SECONDARY_INDUSTRY", "BOTH"):
for i in [
chemical_plant,
fishing_harbor,
paper_mill,
sawmill,
]:
ret.graph[i].boosters += (workers,)
if parameters["WORKFORCE"] == "YETI_TIRED":
ret.graph[i].produces += (tired_workers,)

if port in ret.graph:
if parameters["SEA_INDUSTRY"] == "LAND_ONLY":
Expand Down
18 changes: 16 additions & 2 deletions industry/economies/firs_temperate.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,26 @@ def get_economy(self, parameters):
ret.graph[fishing_grounds].boosters = workers
if parameters["WORKFORCE"] == "YETI_TIRED":
ret.graph[fishing_grounds].produces += (tired_workers,)
if parameters["WORKER_PARTICIPATION"] in ("PRIMARY_INDUSTRY", "SECONDARY_INDUSTRY", "BOTH"):
for i in [clay_pit, coal_mine, dredging_site, iron_ore_mine, dairy_farm, orchard_and_piggery]:
if parameters["WORKER_PARTICIPATION"] in ("SECONDARY_INDUSTRY", "BOTH"):
for i in [
chemical_plant,
clay_pit,
coal_mine,
dredging_site,
iron_ore_mine,
dairy_farm,
orchard_and_piggery,
]:
if i in ret.graph:
ret.graph[i] = ret.graph[i].to_secondary(workers)
if parameters["WORKFORCE"] == "YETI_TIRED":
ret.graph[i].produces += (tired_workers,)
if parameters["WORKER_PARTICIPATION"] in ("PRIMARY_INDUSTRY", "BOTH"):
for i in [metal_workshop, steel_mill, glass_works, cider_mill, stockyard, fishing_harbor, dairy]:
if i in ret.graph:
ret.graph[i].boosters += (workers,)
if parameters["WORKFORCE"] == "YETI_TIRED":
ret.graph[i].produces += (tired_workers,)

if port in ret.graph:
if parameters["SEA_INDUSTRY"] == "LAND_ONLY":
Expand Down
14 changes: 13 additions & 1 deletion industry/economies/firs_tropical.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
water,
wool,
workers,
zinc,
)
from industry.industries import (
arable_farm,
Expand Down Expand Up @@ -155,6 +154,19 @@ def get_economy(self, parameters):
ret.graph[i] = ret.graph[i].to_secondary(workers)
if parameters["WORKFORCE"] == "YETI_TIRED":
ret.graph[i].produces += (tired_workers,)
if parameters["WORKER_PARTICIPATION"] in ("PRIMARY_INDUSTRY", "SECONDARY_INDUSTRY", "BOTH"):
for i in [
chemical_plant,
copper_smelter,
fishing_harbor,
flour_mill,
stockyard,
food_processing_plant,
]:
if i in ret.graph:
ret.graph[i].boosters += (workers,)
if parameters["WORKFORCE"] == "YETI_TIRED":
ret.graph[i].produces += (tired_workers,)

if port in ret.graph:
if parameters["SEA_INDUSTRY"] == "LAND_ONLY":
Expand Down

0 comments on commit 07e4466

Please sign in to comment.