Skip to content

Commit 42dc38f

Browse files
committed
Add DO:Gridlocked
1 parent 593f57d commit 42dc38f

File tree

7 files changed

+116
-13
lines changed

7 files changed

+116
-13
lines changed
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
local b = require 'map_gen.shared.builders'
2+
local start_value = b.euclidean_value(50, 0.75)
3+
local value = b.exponential_value(50, 0.003, 2.25)
4+
5+
return {
6+
{
7+
name = 'iron-ore',
8+
tiles = {
9+
[1] = 'landfill',
10+
},
11+
start = start_value,
12+
weight = 10,
13+
ratios = {
14+
{ resource = b.resource(b.full_shape, 'iron-ore', value), weight = 75 },
15+
{ resource = b.resource(b.full_shape, 'copper-ore', value), weight = 13 },
16+
{ resource = b.resource(b.full_shape, 'stone', value), weight = 7 },
17+
{ resource = b.resource(b.full_shape, 'coal', value), weight = 5 },
18+
},
19+
},
20+
{
21+
name = 'coal',
22+
tiles = {
23+
[1] = 'landfill',
24+
},
25+
start = start_value,
26+
weight = 8,
27+
ratios = {
28+
{ resource = b.resource(b.full_shape, 'iron-ore', value), weight = 18 },
29+
{ resource = b.resource(b.full_shape, 'copper-ore', value), weight = 9 },
30+
{ resource = b.resource(b.full_shape, 'stone', value), weight = 8 },
31+
{ resource = b.resource(b.full_shape, 'coal', value), weight = 65 },
32+
},
33+
},
34+
{
35+
name = 'copper-ore',
36+
tiles = {
37+
[1] = 'landfill',
38+
},
39+
start = start_value,
40+
weight = 7,
41+
ratios = {
42+
{ resource = b.resource(b.full_shape, 'iron-ore', value), weight = 15 },
43+
{ resource = b.resource(b.full_shape, 'copper-ore', value), weight = 70 },
44+
{ resource = b.resource(b.full_shape, 'stone', value), weight = 10 },
45+
{ resource = b.resource(b.full_shape, 'coal', value), weight = 5 },
46+
},
47+
},
48+
{
49+
name = 'stone',
50+
tiles = {
51+
[1] = 'landfill',
52+
},
53+
start = start_value,
54+
weight = 2,
55+
ratios = {
56+
{ resource = b.resource(b.full_shape, 'iron-ore', value), weight = 25 },
57+
{ resource = b.resource(b.full_shape, 'copper-ore', value), weight = 10 },
58+
{ resource = b.resource(b.full_shape, 'stone', value), weight = 60 },
59+
{ resource = b.resource(b.full_shape, 'coal', value), weight = 5 },
60+
},
61+
},
62+
}

map_gen/maps/danger_ores/modules/main_ores_grid_factory.lua

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
local b = require 'map_gen.shared.builders'
22
local gear_pic = b.decompress(require 'map_gen.data.presets.gear_64by64')
3+
34
return function(config)
45
local main_ores = config.main_ores
56
local shuffle_order = config.main_ores_shuffle_order
@@ -11,7 +12,7 @@ return function(config)
1112
for _, ore_data in pairs(main_ores) do
1213
local ore_name = ore_data.name
1314
local tiles = {
14-
[1] = 'concrete'
15+
[1] = 'concrete',
1516
}
1617
local land = tile_builder(tiles)
1718

@@ -22,7 +23,9 @@ return function(config)
2223
local ore = ore_builder(ore_name, amount, ratios, weighted)
2324

2425
local shape = b.apply_entity(land, ore)
25-
shapes[#shapes + 1] = shape
26+
for i = 1, (ore_data.weight or 1) do
27+
shapes[#shapes + 1] = shape
28+
end
2629
end
2730

2831
local count = #shapes
@@ -72,7 +75,7 @@ return function(config)
7275

7376
local cc_gear_shadow = b.choose(b.circle((grid_tile_size / 2) - 1), b.tile('concrete'), b.empty_shape)
7477
local spawn_cc_rect = b.choose(b.rectangle(grid_tile_size), concrete_ores, ores) --overlay ores
75-
spawn_cc_rect = b.any({spawn_shape, gear_shape, cc_gear_shadow, spawn_cc_rect})
78+
spawn_cc_rect = b.any({ spawn_shape, gear_shape, cc_gear_shadow, spawn_cc_rect })
7679

7780
-- walkways::
7881
local left_tile = b.tile('refined-hazard-concrete-left')
@@ -81,7 +84,7 @@ return function(config)
8184
[1] = b.tile('water'),
8285
[2] = b.tile('deepwater'),
8386
[3] = b.tile('water-shallow'),
84-
[4] = b.tile('water-wube')
87+
[4] = b.tile('water-wube'),
8588
}
8689
local water_tile = water_tiles[random_gen(#water_tiles)]
8790
local walk_pattern = {}
@@ -96,26 +99,26 @@ return function(config)
9699
walk_pattern[i][j] = water_tile
97100
end
98101
end
99-
end
102+
end
100103
-- middle x
101104
-- top
102-
walk_pattern[ 1][32] = right_tile -- b.tile('red-refined-concrete')
103-
walk_pattern[ 1][33] = left_tile -- b.tile('green-refined-concrete')
105+
walk_pattern[1][32] = right_tile -- b.tile('red-refined-concrete')
106+
walk_pattern[1][33] = left_tile -- b.tile('green-refined-concrete')
104107
-- bottom
105-
walk_pattern[64][32] = left_tile -- b.tile('blue-refined-concrete')
108+
walk_pattern[64][32] = left_tile -- b.tile('blue-refined-concrete')
106109
walk_pattern[64][33] = right_tile -- b.tile('yellow-refined-concrete')
107110
-- middle y
108111
-- left
109-
walk_pattern[32][ 1] = right_tile -- b.tile('orange-refined-concrete')
110-
walk_pattern[33][ 1] = left_tile -- b.tile('pink-refined-concrete')
112+
walk_pattern[32][1] = right_tile -- b.tile('orange-refined-concrete')
113+
walk_pattern[33][1] = left_tile -- b.tile('pink-refined-concrete')
111114
-- right
112-
walk_pattern[32][64] = left_tile -- b.tile('purple-refined-concrete')
115+
walk_pattern[32][64] = left_tile -- b.tile('purple-refined-concrete')
113116
walk_pattern[33][64] = right_tile -- b.tile('cyan-refined-concrete')
114117

115-
local hazard_grid = b.grid_pattern_no_offset(walk_pattern, 64, 64, 1, 1)
118+
local hazard_grid = b.grid_pattern_no_offset(walk_pattern, 64, 64, 1, 1)
116119
hazard_grid = b.translate(hazard_grid, 33, 33)
117120

118-
local map = b.any {hazard_grid, spawn_cc_rect, ores}
121+
local map = b.any { hazard_grid, spawn_cc_rect, ores }
119122
return b.set_hidden_tile(map, 'sand-1') -- tile below concrete
120123
end
121124
end

map_gen/maps/danger_ores/modules/map_poll.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ local mod_packs = {
2929
danger_ore_scrap = 'danger_ore_scrap',
3030
danger_ore_space_age = 'danger_ore_space_age',
3131
danger_ore_collapse = 'danger_ore_collapse',
32+
danger_ore_gridlocked = 'danger_ore_gridlocked',
3233
}
3334

3435
local maps = {
@@ -47,6 +48,7 @@ local maps = {
4748
{ name = 'danger-ore-for-the-swarm', display_name = 'Honeycomb-gradient (smooth ore ratios)', mod_pack = mod_packs.danger_ore_normal },
4849
{ name = 'danger-ore-gradient', display_name = 'Gradient (smooth ore ratios)', mod_pack = mod_packs.danger_ore_normal },
4950
{ name = 'danger-ore-grid-factory', display_name = 'Grid Factory (squares)', mod_pack = mod_packs.danger_ore_normal },
51+
{ name = 'danger-ore-gridlocked', display_name = 'Gridlocked (buy chunks)', mod_pack = mod_packs.danger_ore_gridlocked },
5052
{ name = 'danger-ore-hub-spiral', display_name = 'Hub-spiral (with void)', mod_pack = mod_packs.danger_ore_normal },
5153
--{ name = 'danger-ore-industrial-revolution-3', display_name = 'Industrial Revolution 3 (default)', mod_pack = mod_packs.danger_ore_ir3 },
5254
--{ name = 'danger-ore-industrial-revolution-3-grid-factory', display_name = 'Industrial Revolution 3 Grid Factory (squares)', mod_pack = mod_packs.danger_ore_ir3 },

map_gen/maps/danger_ores/presets/danger_ore_grid_factory.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
local B = require 'map_gen.shared.builders'
12
local DOC = require 'map_gen.maps.danger_ores.configuration'
23
local Scenario = require 'map_gen.maps.danger_ores.scenario'
34
local ScenarioInfo = require 'features.gui.info'
@@ -12,5 +13,8 @@ DOC.scenario_name = 'danger-ore-grid-factory'
1213
DOC.map_config.main_ores_builder = require 'map_gen.maps.danger_ores.modules.main_ores_grid_factory'
1314
DOC.map_config.main_ores = require 'map_gen.maps.danger_ores.config.vanilla_ores_landfill'
1415
DOC.map_config.spawn_tile = 'orange-refined-concrete'
16+
DOC.map_config.spawn_shape = B.circle(20)
17+
DOC.map_config.start_ore_shape = B.circle(40)
18+
DOC.map_config.no_resource_patch_shape = B.circle(80)
1519

1620
return Scenario.register(DOC)
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
local B = require 'map_gen.shared.builders'
2+
local DOC = require 'map_gen.maps.danger_ores.configuration'
3+
local Scenario = require 'map_gen.maps.danger_ores.scenario'
4+
local ScenarioInfo = require 'features.gui.info'
5+
6+
ScenarioInfo.set_map_name('Danger Ores - Gridlocked')
7+
ScenarioInfo.add_map_extra_info([[
8+
This map is divided in quadrants of [item=iron-ore] [item=copper-ore] [item=coal] [item=stone].
9+
Each sector has a main resource and the other resources at a lower ratio.
10+
11+
Unlock new chunks via [font=default-bold]Chunk claim tool (Alt + K)[/font].
12+
Chunk purchases can be reverted within 30s from purchase.
13+
Chunk points are awarded by completing [technology=gl-additional-chunk-space-science-pack] Technology: Additional chunks.
14+
Chunk cost is computed based on adjacient chunks.
15+
]])
16+
17+
DOC.scenario_name = 'danger-ore-gridlocked'
18+
DOC.map_config.main_ores_builder = require 'map_gen.maps.danger_ores.modules.main_ores_grid_factory'
19+
DOC.map_config.main_ores = require 'map_gen.maps.danger_ores.config.vanilla_ores_gridlocked'
20+
DOC.map_config.spawn_tile = 'orange-refined-concrete'
21+
DOC.map_config.spawn_shape = B.circle(20)
22+
DOC.map_config.start_ore_shape = B.circle(40)
23+
DOC.map_config.no_resource_patch_shape = B.circle(80)
24+
DOC.terraforming.enabled = false
25+
DOC.game.technology_price_multiplier = 10
26+
27+
return Scenario.register(DOC)

map_gen/maps/danger_ores/presets/danger_ore_industrial_revolution_3_grid_factory.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
local B = require 'map_gen.shared.builders'
12
local H = require 'map_gen.maps.danger_ores.modules.helper'
23
local DOC = require 'map_gen.maps.danger_ores.configuration'
34
local Config = require 'config'
@@ -32,6 +33,9 @@ DOC.map_config.main_ores_builder = require 'map_gen.maps.danger_ores.modules.mai
3233
DOC.map_config.main_ores = require 'map_gen.maps.danger_ores.compatibility.industrial_revolution_3.ores_grid_factory'
3334
DOC.map_config.resource_patches_config = require 'map_gen.maps.danger_ores.compatibility.industrial_revolution_3.resource_patches'
3435
DOC.map_config.spawn_tile = 'tarmac'
36+
DOC.map_config.spawn_shape = B.circle(20)
37+
DOC.map_config.start_ore_shape = B.circle(40)
38+
DOC.map_config.no_resource_patch_shape = B.circle(80)
3539
DOC.map_gen_settings.settings = H.empty_map_settings{
3640
-- point patches
3741
'crude-oil',
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
return require 'map_gen.maps.danger_ores.presets.danger_ore_gridlocked'

0 commit comments

Comments
 (0)