Skip to content

Commit

Permalink
(Aegis) pass the new test
Browse files Browse the repository at this point in the history
  • Loading branch information
ahyangyi committed Nov 1, 2023
1 parent 01e1fc4 commit c455752
Show file tree
Hide file tree
Showing 7 changed files with 93 additions and 34 deletions.
11 changes: 11 additions & 0 deletions industry/cargos/tired_workers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import grf
from industry.lib.cargo import ACargo, CargoUnit

the_cargo = ACargo(
0x40,
b"TRWK",
grf.CargoClass.PASSENGERS,
capacity_multiplier=0x400,
weight=1,
units_text=CargoUnit.PASSENGER,
)
11 changes: 10 additions & 1 deletion industry/economies/firs_arctic.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
pyrite_ore,
sulphur,
timber,
tired_workers,
water,
wood,
workers,
Expand Down Expand Up @@ -139,7 +140,15 @@ def get_economy(self, parameters):
ret.graph[chemical_plant].produces += (farm_supplies,)

if parameters["WORKFORCE"].startswith("YETI"):
ret.graph[worker_yard] = WorkerYard(workers, boosters=(paper, zinc))
if parameters["WORKFORCE"] == "YETI":
ret.graph[worker_yard] = WorkerYard(workers, boosters=(paper, zinc))
elif parameters["WORKFORCE"] == "YETI_PASSENGERS":
ret.graph[worker_yard] = WorkerYard(workers, boosters=(paper, zinc, passengers))
elif parameters["WORKFORCE"] == "YETI_MAIL":
ret.graph[worker_yard] = WorkerYard(workers, boosters=(paper, zinc, mail))
elif parameters["WORKFORCE"] == "YETI_TIRED":
ret.graph[worker_yard] = WorkerYard(workers, boosters=(paper, zinc, tired_workers))
ret.graph[peatlands].produces += (tired_workers,)

# FIXME
ret.graph[peatlands].boosters = workers
Expand Down
11 changes: 10 additions & 1 deletion industry/economies/firs_temperate.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
sand,
scrap_metal,
steel,
tired_workers,
water,
workers,
)
Expand Down Expand Up @@ -104,7 +105,15 @@ def get_economy(self, parameters):
ret.graph[cider_mill].produces += (engineering_supplies, farm_supplies)

if parameters["WORKFORCE"].startswith("YETI"):
ret.graph[worker_yard] = WorkerYard(workers, boosters=(goods, alcohol))
if parameters["WORKFORCE"] == "YETI":
ret.graph[worker_yard] = WorkerYard(workers, boosters=(goods, alcohol))
elif parameters["WORKFORCE"] == "YETI_PASSENGERS":
ret.graph[worker_yard] = WorkerYard(workers, boosters=(goods, alcohol, passengers))
elif parameters["WORKFORCE"] == "YETI_MAIL":
ret.graph[worker_yard] = WorkerYard(workers, boosters=(goods, alcohol, mail))
elif parameters["WORKFORCE"] == "YETI_TIRED":
ret.graph[worker_yard] = WorkerYard(workers, boosters=(goods, alcohol, tired_workers))
ret.graph[orchard_and_piggery].produces += (tired_workers,)

# FIXME
ret.graph[orchard_and_piggery].boosters = workers
Expand Down
28 changes: 19 additions & 9 deletions industry/economies/vanilla_subarctic.py
Original file line number Diff line number Diff line change
@@ -1,35 +1,36 @@
from industry.lib.economy import Economy, PrimaryIndustry, WorkerYard, SecondaryIndustry, TertiaryIndustry, Town
from industry.cargos import (
coal,
engineering_supplies,
farm_supplies,
food,
goods,
gold,
goods,
livestock,
mail,
oil,
paper,
passengers,
tired_workers,
water,
wheat,
wood,
farm_supplies,
engineering_supplies,
water,
workers,
)
from industry.industries import (
bank,
coal_mine,
food_processing_plant,
farm,
food_processing_plant,
forest,
paper_mill,
gold_mine,
oil_refinery,
printing_works,
oil_wells,
paper_mill,
port,
power_station,
gold_mine,
printing_works,
towns,
port,
trading_centre,
water_supply,
water_tower,
Expand Down Expand Up @@ -100,6 +101,15 @@ def get_economy(self, parameters):

if parameters["WORKFORCE"].startswith("YETI"):
ret.graph[worker_yard] = WorkerYard(workers, boosters=(goods, gold))
if parameters["WORKFORCE"] == "YETI":
ret.graph[worker_yard] = WorkerYard(workers, boosters=(goods, gold))
elif parameters["WORKFORCE"] == "YETI_PASSENGERS":
ret.graph[worker_yard] = WorkerYard(workers, boosters=(goods, gold, passengers))
elif parameters["WORKFORCE"] == "YETI_MAIL":
ret.graph[worker_yard] = WorkerYard(workers, boosters=(goods, gold, mail))
elif parameters["WORKFORCE"] == "YETI_TIRED":
ret.graph[worker_yard] = WorkerYard(workers, boosters=(goods, gold, tired_workers))
ret.graph[coal_mine].produces += (tired_workers,)

# FIXME
ret.graph[coal_mine].boosters = workers
Expand Down
33 changes: 21 additions & 12 deletions industry/economies/vanilla_subtropical.py
Original file line number Diff line number Diff line change
@@ -1,33 +1,34 @@
from industry.lib.economy import Economy, PrimaryIndustry, WorkerYard, SecondaryIndustry, TertiaryIndustry, Town
from industry.cargos import (
copper_ore,
diamonds,
engineering_supplies,
farm_supplies,
food,
fruit,
goods,
diamonds,
mail,
maize,
oil,
passengers,
maize,
wood,
fruit,
rubber,
tired_workers,
water,
farm_supplies,
engineering_supplies,
wood,
workers,
)
from industry.industries import (
bank,
copper_ore_mine,
food_processing_plant,
diamond_mine,
factory,
farm,
lumber_mill,
food_processing_plant,
fruit_plantation,
rubber_plantation,
lumber_mill,
oil_refinery,
factory,
oil_wells,
diamond_mine,
rubber_plantation,
towns,
water_supply,
water_tower,
Expand Down Expand Up @@ -76,7 +77,15 @@ def get_economy(self, parameters):
ret.graph[oil_refinery].produces += (farm_supplies,)

if parameters["WORKFORCE"].startswith("YETI"):
ret.graph[worker_yard] = WorkerYard(workers, boosters=(goods, diamonds))
if parameters["WORKFORCE"] == "YETI":
ret.graph[worker_yard] = WorkerYard(workers, boosters=(goods, diamonds))
elif parameters["WORKFORCE"] == "YETI_PASSENGERS":
ret.graph[worker_yard] = WorkerYard(workers, boosters=(goods, diamonds, passengers))
elif parameters["WORKFORCE"] == "YETI_MAIL":
ret.graph[worker_yard] = WorkerYard(workers, boosters=(goods, diamonds, mail))
elif parameters["WORKFORCE"] == "YETI_TIRED":
ret.graph[worker_yard] = WorkerYard(workers, boosters=(goods, diamonds, tired_workers))
ret.graph[diamond_mine].produces += (tired_workers,)
# FIXME
ret.graph[diamond_mine].boosters = workers

Expand Down
31 changes: 20 additions & 11 deletions industry/economies/vanilla_temperate.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
from industry.lib.economy import Economy, PrimaryIndustry, WorkerYard, SecondaryIndustry, TertiaryIndustry, Town
from industry.cargos import (
valuables,
coal,
grain,
livestock,
steel,
engineering_supplies,
farm_supplies,
food,
goods,
wood,
grain,
iron_ore,
livestock,
mail,
oil,
passengers,
mail,
farm_supplies,
engineering_supplies,
food,
steel,
tired_workers,
valuables,
water,
wood,
workers,
)
from industry.industries import (
bank,
coal_mine,
factory,
farm,
food_processing_plant,
forest,
iron_ore_mine,
oil_refinery,
Expand All @@ -31,7 +33,6 @@
sawmill,
steel_mill,
towns,
food_processing_plant,
water_supply,
water_tower,
worker_yard,
Expand Down Expand Up @@ -82,7 +83,15 @@ def get_economy(self, parameters):
ret.graph[oil_refinery].produces += (farm_supplies,)

if parameters["WORKFORCE"].startswith("YETI"):
ret.graph[worker_yard] = WorkerYard(workers, boosters=(goods, valuables))
if parameters["WORKFORCE"] == "YETI":
ret.graph[worker_yard] = WorkerYard(workers, boosters=(goods, valuables))
elif parameters["WORKFORCE"] == "YETI_PASSENGERS":
ret.graph[worker_yard] = WorkerYard(workers, boosters=(goods, valuables, passengers))
elif parameters["WORKFORCE"] == "YETI_MAIL":
ret.graph[worker_yard] = WorkerYard(workers, boosters=(goods, valuables, mail))
elif parameters["WORKFORCE"] == "YETI_TIRED":
ret.graph[worker_yard] = WorkerYard(workers, boosters=(goods, valuables, tired_workers))
ret.graph[coal_mine].produces += (tired_workers,)
# FIXME
ret.graph[coal_mine].boosters = workers

Expand Down
2 changes: 2 additions & 0 deletions industry/lang/english-uk.lng
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ STR_CARGO_NAME_SAND :Sand
STR_CARGO_NAME_SCMT :Scrap Metal
STR_CARGO_NAME_STEL :Steel
STR_CARGO_NAME_SULP :Sulphur
STR_CARGO_NAME_TRWK :Tired Workers
STR_CARGO_NAME_VALU :Valuables
STR_CARGO_NAME_WATR :Water
STR_CARGO_NAME_WDPR :Timber
Expand Down Expand Up @@ -188,6 +189,7 @@ STR_CARGO_UNIT_SAND :{WEIGHT} of sand
STR_CARGO_UNIT_SCMT :{WEIGHT} of scrap metal
STR_CARGO_UNIT_STEL :{WEIGHT} of steel
STR_CARGO_UNIT_SULP :{WEIGHT} of sulphur
STR_CARGO_UNIT_TRWK :{SIGNED_WORD} tired worker{P 0 "" s}
STR_CARGO_UNIT_VALU :{WEIGHT} of valuables
STR_CARGO_UNIT_WATR :{VOLUME} of water
STR_CARGO_UNIT_WDPR :{WEIGHT} of timber
Expand Down

0 comments on commit c455752

Please sign in to comment.