From 377abec5df6c3b72a06cdafeeff1183a4fa6b1c4 Mon Sep 17 00:00:00 2001 From: "Yi Yang @ Anteros" Date: Fri, 6 Oct 2023 00:25:57 +0800 Subject: [PATCH] (Aegis) turn more industries into custom layouts --- industry/industries/farm.py | 31 +++++++++++++++++++++-- industry/industries/oil_wells.py | 42 ++++++++++++++++++++++++++++++-- 2 files changed, 69 insertions(+), 4 deletions(-) diff --git a/industry/industries/farm.py b/industry/industries/farm.py index 724f0d6b..b86e4646 100644 --- a/industry/industries/farm.py +++ b/industry/industries/farm.py @@ -1,9 +1,36 @@ import grf -from industry.lib.industry import AIndustry +from industry.lib.industry import AIndustry, transcribe, symmetrize +medium_set = [ + ( + "eed", + "abd", + "cff", + ), + ( + "cddc", + "eabf", + "eeff", + ), + ( + "ddee", + "cffe", + "abec", + ), +] + +tile_map = { + "a": grf.OldIndustryTileID(0x21), # house (left) + "b": grf.OldIndustryTileID(0x22), # house (right) + "c": grf.OldIndustryTileID(0x23), # warehouse with straws + "d": grf.OldIndustryTileID(0x24), # warehouse + "e": grf.OldIndustryTileID(0x25), # silo + "f": grf.OldIndustryTileID(0x26), # piggery +} the_industry = AIndustry( name="Farm", substitute_type=0x09, - layouts=[[{"xofs": i, "yofs": j, "gfx": grf.NewIndustryTileID(0x23)} for i in range(4) for j in range(4)]], + # layouts=[[{"xofs": i, "yofs": j, "gfx": grf.NewIndustryTileID(0x23)} for i in range(4) for j in range(4)]], + layouts=transcribe(symmetrize(medium_set), tile_map), ) diff --git a/industry/industries/oil_wells.py b/industry/industries/oil_wells.py index 76ec6f08..5e58881d 100644 --- a/industry/industries/oil_wells.py +++ b/industry/industries/oil_wells.py @@ -1,4 +1,42 @@ -from industry.lib.industry import AIndustry +import grf +from industry.lib.industry import AIndustry, transcribe, symmetrize -the_industry = AIndustry(name="Oil Wells", substitute_type=0x0B) +medium_set = [ + ( + "x ", + "x ", + "xxx", + ), + ( + "x ", + "xx ", + " xx", + ), + ( + "x ", + "xx ", + " xx", + ), + ( + " x ", + "xxx ", + " x", + ), + ( + " x ", + "x x ", + "x x", + ), + ( + "x ", + "x ", + "x xx", + ), +] + +the_industry = AIndustry( + name="Oil Wells", + substitute_type=0x0B, + layouts=transcribe(symmetrize(medium_set), {"x": grf.OldIndustryTileID(0x1D)}), +)