Skip to content

Commit

Permalink
(Aegis) More variants for industries
Browse files Browse the repository at this point in the history
  • Loading branch information
ahyangyi committed Oct 18, 2023
1 parent bc01f94 commit 7648936
Show file tree
Hide file tree
Showing 14 changed files with 293 additions and 173 deletions.
19 changes: 10 additions & 9 deletions industry/aegis_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,16 +198,17 @@ def gen():
g.add_int_parameter(
name=s["STR_PARAM_INDUSTRY_SIZE"],
description=s["STR_PARAM_INDUSTRY_SIZE_DESC"],
default=2,
limits=(0, 6),
default=3,
limits=(0, 7),
enum={
0: s["STR_PARAM_INDUSTRY_SIZE_EXTRA_LARGE"],
1: s["STR_PARAM_INDUSTRY_SIZE_LARGE"],
2: s["STR_PARAM_INDUSTRY_SIZE_REGULAR"],
3: s["STR_PARAM_INDUSTRY_SIZE_SMALL"],
4: s["STR_PARAM_INDUSTRY_SIZE_TINY"],
5: s["STR_PARAM_INDUSTRY_SIZE_ONE_TILE"],
6: s["STR_PARAM_INDUSTRY_SIZE_ONE_TILE_FLAT"],
0: s["STR_PARAM_INDUSTRY_SIZE_ENORMOUS"],
1: s["STR_PARAM_INDUSTRY_SIZE_HUGE"],
2: s["STR_PARAM_INDUSTRY_SIZE_LARGE"],
3: s["STR_PARAM_INDUSTRY_SIZE_REGULAR"],
4: s["STR_PARAM_INDUSTRY_SIZE_SMALL"],
5: s["STR_PARAM_INDUSTRY_SIZE_TINY"],
6: s["STR_PARAM_INDUSTRY_SIZE_ONE_TILE"],
7: s["STR_PARAM_INDUSTRY_SIZE_ONE_TILE_FLAT"],
},
)

Expand Down
8 changes: 6 additions & 2 deletions industry/industries/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@
p = p.split("/")[-1][:-3]
if p == "__init__":
continue
_imported_industry = importlib.import_module(f"industry.industries.{p}")

__all__.append(p)
for p in glob.glob("industry/industries/*/__init__.py"):
p = p.split("/")[-2]
__all__.append(p)

for p in __all__:
_imported_industry = importlib.import_module(f"industry.industries.{p}")
setattr(module, p, _imported_industry.the_industry)
del _imported_industry
11 changes: 6 additions & 5 deletions industry/industries/farm.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,12 @@
{
0: transcribe(large_set, tile_map),
1: transcribe(large_set, tile_map),
2: transcribe(medium_set, tile_map),
3: transcribe(small_set, tile_map),
4: transcribe(tiny_set, tile_map),
5: transcribe(one_tile_set, tile_map),
6: [[{"xofs": 0, "yofs": 0, "gfx": grf.NewIndustryTileID(0x23)}]],
2: transcribe(large_set, tile_map),
3: transcribe(medium_set, tile_map),
4: transcribe(small_set, tile_map),
5: transcribe(tiny_set, tile_map),
6: transcribe(one_tile_set, tile_map),
7: [[{"xofs": 0, "yofs": 0, "gfx": grf.NewIndustryTileID(0x23)}]],
},
),
mapgen_probability=15,
Expand Down
147 changes: 0 additions & 147 deletions industry/industries/forest.py

This file was deleted.

35 changes: 35 additions & 0 deletions industry/industries/forest/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import grf
from industry.lib.industry import AIndustry, SplitDefinition, transcribe, symmetrize
from .enormous import enormous_set
from .huge import huge_set
from .large import large_set
from .medium import medium_set
from .small import small_set
from .tiny import tiny_set


one_grid_set = [
("x",),
]

tile_map = {"x": grf.OldIndustryTileID(0x10)}

the_industry = AIndustry(
name="Forest",
substitute_type=0x03,
layouts=SplitDefinition(
9,
{
0: transcribe(enormous_set, tile_map),
1: transcribe(huge_set, tile_map),
2: transcribe(large_set, tile_map),
3: transcribe(medium_set, tile_map),
4: transcribe(small_set, tile_map),
5: transcribe(tiny_set, tile_map),
6: transcribe(one_grid_set, tile_map),
7: transcribe(one_grid_set, tile_map),
},
),
mapgen_probability=10,
ingame_probability=4,
)
60 changes: 60 additions & 0 deletions industry/industries/forest/enormous.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
from industry.lib.industry import symmetrize

enormous_set = symmetrize(
[
(
" xxxxxxxx ",
" xxxxxxxxxxxx ",
" xxxxxxxxxxxxxx ",
" xxxxxxxxxxxxxx ",
"xxxxxxxxxxxxxxxx",
"xxxxxxxxxxxxxxxx",
"xxxxxxxxxxxxxxxx",
"xxxxxxxxxxxxxxxx",
"xxxxxxxxxxxxxxxx",
"xxxxxxxxxxxxxxxx",
"xxxxxxxxxxxxxxxx",
"xxxxxxxxxxxxxxxx",
" xxxxxxxxxxxxxx ",
" xxxxxxxxxxxxxx ",
" xxxxxxxxxxxx ",
" xxxxxxxx ",
),
(
" xxxxxxxx ",
" xxxxxxxxxxxx ",
" xxxxxxxxxxxxx ",
" xxxxxxxxxxxxxx ",
" xxxxxxxxxxxxxxx",
"xxxxxxxxxxxxxxxx",
"xxxxxxxxxxxxxxxx",
"xxxxxxxxxxxxxxxx",
"xxxxxxxxxxxxxxxx",
"xxxxxxxxxxxxxxxx",
"xxxxxxxxxxxxxxxx",
"xxxxxxxxxxxxxxx ",
" xxxxxxxxxxxxxx ",
" xxxxxxxxxxxxx ",
" xxxxxxxxxxxx ",
" xxxxxxxx ",
),
(
" xxxxxxx ",
" xxxxxxxxxxx ",
" xxxxxxxxxxxxx ",
" xxxxxxxxxxxxxx ",
" xxxxxxxxxxxxxxx",
"xxxxxxxxxxxxxxxx",
"xxxxxxxxxxxxxxxx",
"xxxxxxxxxxxxxxxx",
"xxxxxxxxxxxxxxxx",
"xxxxxxxxxxxxxxxx",
"xxxxxxxxxxxxxxxx",
"xxxxxxxxxxxxxxx ",
" xxxxxxxxxxxxxx ",
" xxxxxxxxxxxxx ",
" xxxxxxxxxxx ",
" xxxxxxx ",
),
]
)
17 changes: 17 additions & 0 deletions industry/industries/forest/huge.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from industry.lib.industry import symmetrize

huge_set = symmetrize(
[
(
" xxxxxx ",
"xxxxxxxx",
"xxxxxxxx",
"xxxxxxxx",
"xxxxxxxx",
"xxxxxxxx",
"xxxxxxxx",
"xxxxxxxx",
" xxxxxx ",
),
]
)
42 changes: 42 additions & 0 deletions industry/industries/forest/large.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
from industry.lib.industry import symmetrize

large_set = symmetrize(
[
(
" xxxx ",
"xxxxxx",
"xxxxxx",
"xxxxxx",
"xxxxxx",
"xxxxxx",
" xxxx ",
),
(
" xxxx ",
"xxxxxx ",
"xxxxxxx",
"xxxxxxx",
"xxxxxxx",
"xxxxxxx",
" xxxxx ",
),
(
" xxxx ",
"xxxxxx ",
"xxxxxxx",
"xxxxxxx",
"xxxxxxx",
" xxxxxx",
" xxxx ",
),
(
" xxxxx ",
"xxxxxxx",
"xxxxxxx",
"xxxxxxx",
"xxxxxxx",
"xxxxxxx",
" xxxxx ",
),
]
)
Loading

0 comments on commit 7648936

Please sign in to comment.