Skip to content

Commit

Permalink
(aegis) vanilla economies use ports to buy supplies when available
Browse files Browse the repository at this point in the history
  • Loading branch information
ahyangyi committed Dec 22, 2023
1 parent 6518868 commit 213a68b
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 12 deletions.
2 changes: 1 addition & 1 deletion industry/economies/firs_temperate.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def get_economy(self, parameters):
fishing_grounds: PrimaryIndustry(fish),
dairy_farm: PrimaryIndustry((milk, livestock)),
orchard_and_piggery: PrimaryIndustry((fruit, livestock)),
chemical_plant: PrimaryIndustry(chemicals), # FIXME
chemical_plant: PrimaryIndustry(chemicals),
steel_mill: SecondaryIndustry((coal, iron_ore, scrap_metal), steel),
dairy: SecondaryIndustry(milk, food),
glass_works: SecondaryIndustry((sand, chemicals), goods),
Expand Down
25 changes: 20 additions & 5 deletions industry/economies/vanilla_subarctic.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,25 +82,40 @@ def get_economy(self, parameters):
ret.graph[farm].boosters = engineering_supplies
ret.graph[forest].boosters = engineering_supplies

ret.graph[printing_works].produces += (engineering_supplies,)
if parameters["POLICY"] in ("SELF_SUFFICIENT", "FREE_TRADE", "EXPORT"):
ret.graph[port].produces += (engineering_supplies,)
else:
ret.graph[printing_works].produces += (engineering_supplies,)
elif parameters["PRIMARY_INDUSTRY_GROWTH"] == "GENERIC_SUPPLIES":
ret.graph[coal_mine].boosters = engineering_supplies
ret.graph[oil_wells].boosters = engineering_supplies
ret.graph[gold_mine].boosters = engineering_supplies
ret.graph[farm].boosters = farm_supplies
ret.graph[forest].boosters = farm_supplies

ret.graph[printing_works].produces += (engineering_supplies,)
ret.graph[oil_refinery].produces += (farm_supplies,)
if parameters["POLICY"] in ("SELF_SUFFICIENT", "FREE_TRADE", "EXPORT"):
ret.graph[port].produces += (
engineering_supplies,
farm_supplies,
)
else:
ret.graph[printing_works].produces += (engineering_supplies,)
ret.graph[oil_refinery].produces += (farm_supplies,)
elif parameters["PRIMARY_INDUSTRY_GROWTH"] == "GENERIC_SUPPLIES_PASSENGERS":
ret.graph[coal_mine].boosters = engineering_supplies
ret.graph[oil_wells].boosters = passengers
ret.graph[gold_mine].boosters = engineering_supplies
ret.graph[farm].boosters = farm_supplies
ret.graph[forest].boosters = farm_supplies

ret.graph[printing_works].produces += (engineering_supplies,)
ret.graph[oil_refinery].produces += (farm_supplies,)
if parameters["POLICY"] in ("SELF_SUFFICIENT", "FREE_TRADE", "EXPORT"):
ret.graph[port].produces += (
engineering_supplies,
farm_supplies,
)
else:
ret.graph[printing_works].produces += (engineering_supplies,)
ret.graph[oil_refinery].produces += (farm_supplies,)

self.default_worker_support(
ret,
Expand Down
12 changes: 9 additions & 3 deletions industry/economies/vanilla_subtropical.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,22 @@ def get_economy(self, parameters):
ret.graph[farm].boosters = engineering_supplies
ret.graph[lumber_mill].boosters = engineering_supplies

ret.graph[factory].produces += (engineering_supplies,)
if parameters["POLICY"] in ("SELF_SUFFICIENT", "FREE_TRADE", "EXPORT"):
ret.graph[port].produces += (engineering_supplies,)
else:
ret.graph[factory].produces += (engineering_supplies,)
elif parameters["PRIMARY_INDUSTRY_GROWTH"] == "GENERIC_SUPPLIES":
ret.graph[diamond_mine].boosters = engineering_supplies
ret.graph[oil_wells].boosters = engineering_supplies
ret.graph[copper_ore_mine].boosters = engineering_supplies
ret.graph[farm].boosters = farm_supplies
ret.graph[lumber_mill].boosters = farm_supplies

ret.graph[factory].produces += (engineering_supplies,)
ret.graph[oil_refinery].produces += (farm_supplies,)
if parameters["POLICY"] in ("SELF_SUFFICIENT", "FREE_TRADE", "EXPORT"):
ret.graph[port].produces += (engineering_supplies, farm_supplies)
else:
ret.graph[factory].produces += (engineering_supplies,)
ret.graph[oil_refinery].produces += (farm_supplies,)

self.default_worker_support(
ret,
Expand Down
12 changes: 9 additions & 3 deletions industry/economies/vanilla_temperate.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ def get_economy(self, parameters):
ret.graph[farm].boosters = engineering_supplies
ret.graph[forest].boosters = engineering_supplies

ret.graph[factory].produces += (engineering_supplies,)
if parameters["POLICY"] in ("SELF_SUFFICIENT", "FREE_TRADE", "EXPORT"):
ret.graph[port].produces += (engineering_supplies,)
else:
ret.graph[factory].produces += (engineering_supplies,)
elif parameters["PRIMARY_INDUSTRY_GROWTH"] == "GENERIC_SUPPLIES":
ret.graph[coal_mine].boosters = engineering_supplies
ret.graph[oil_wells].boosters = engineering_supplies
Expand All @@ -95,8 +98,11 @@ def get_economy(self, parameters):
ret.graph[farm].boosters = farm_supplies
ret.graph[forest].boosters = farm_supplies

ret.graph[factory].produces += (engineering_supplies,)
ret.graph[oil_refinery].produces += (farm_supplies,)
if parameters["POLICY"] in ("SELF_SUFFICIENT", "FREE_TRADE", "EXPORT"):
ret.graph[port].produces += (engineering_supplies, farm_supplies)
else:
ret.graph[factory].produces += (engineering_supplies,)
ret.graph[oil_refinery].produces += (farm_supplies,)

self.default_worker_support(
ret,
Expand Down

0 comments on commit 213a68b

Please sign in to comment.