Skip to content

Commit 25fe394

Browse files
authored
Merge pull request #1239 from grilledham/one_direction_beltbox
Add dangore_ore_one_direction_beltboxes preset.
2 parents 3d4e67a + 2c57995 commit 25fe394

File tree

4 files changed

+258
-1
lines changed

4 files changed

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

map_gen/maps/danger_ores/presets/danger_ore_one_direction.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ local rocket_launched = require 'map_gen.maps.danger_ores.modules.rocket_launche
122122
rocket_launched({win_satellite_count = 250})
123123

124124
local restart_command = require 'map_gen.maps.danger_ores.modules.restart_command'
125-
restart_command({scenario_name = 'terraforming-danger-ore'})
125+
restart_command({scenario_name = 'danger-ore-one-direction'})
126126

127127
local container_dump = require 'map_gen.maps.danger_ores.modules.container_dump'
128128
container_dump({entity_name = 'coal'})
Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
local RS = require 'map_gen.shared.redmew_surface'
2+
local MGSP = require 'resources.map_gen_settings'
3+
local Event = require 'utils.event'
4+
local b = require 'map_gen.shared.builders'
5+
local Config = require 'config'
6+
7+
local ScenarioInfo = require 'features.gui.info'
8+
ScenarioInfo.set_map_name('Danger Ore One Direction Beltboxes')
9+
ScenarioInfo.set_map_description([[
10+
Clear the ore to expand the base,
11+
focus mining efforts on specific sectors to ensure
12+
proper material ratios, expand the map with pollution!
13+
]])
14+
ScenarioInfo.add_map_extra_info([[
15+
This map is split in three sectors [item=iron-ore] [item=copper-ore] [item=coal].
16+
Each sector has a main resource and the other resources at a lower ratio.
17+
18+
You may not build the factory on ore patches. Exceptions:
19+
[item=burner-mining-drill] [item=electric-mining-drill] [item=pumpjack] [item=small-electric-pole] [item=medium-electric-pole] [item=big-electric-pole] [item=substation] [item=car] [item=tank] [item=spidertron] [item=locomotive] [item=cargo-wagon] [item=fluid-wagon] [item=artillery-wagon]
20+
[item=transport-belt] [item=fast-transport-belt] [item=express-transport-belt] [item=underground-belt] [item=fast-underground-belt] [item=express-underground-belt] [item=rail] [item=rail-signal] [item=rail-chain-signal] [item=train-stop]
21+
22+
The map size is restricted to the pollution generated. A significant amount of
23+
pollution must affect a section of the map before it is revealed. Pollution
24+
does not affect biter evolution.]])
25+
26+
ScenarioInfo.set_new_info([[
27+
2019-04-24:
28+
- Stone ore density reduced by 1/2
29+
- Ore quadrants randomized
30+
- Increased time factor of biter evolution from 5 to 7
31+
- Added win conditions (+5% evolution every 5 rockets until 100%, +100 rockets until biters are wiped)
32+
33+
2019-03-30:
34+
- Uranium ore patch threshold increased slightly
35+
- Bug fix: Cars and tanks can now be placed onto ore!
36+
- Starting minimum pollution to expand map set to 650
37+
View current pollution via Debug Settings [F4] show-pollution-values,
38+
then open map and turn on pollution via the red box.
39+
- Starting water at spawn increased from radius 8 to radius 16 circle.
40+
41+
2019-03-27:
42+
- Ore arranged into quadrants to allow for more controlled resource gathering.
43+
44+
2020-09-02:
45+
- Destroyed chests dump their content as coal ore.
46+
47+
2020-12-28:
48+
- Changed win condition. First satellite kills all biters, launch 500 to win the map.
49+
50+
2021-04-06:
51+
- Rail signals and train stations now allowed on ore.
52+
]])
53+
54+
local map = require 'map_gen.maps.danger_ores.modules.map'
55+
local main_ores_config = require 'map_gen.maps.danger_ores.config.one_direction_beltboxes_ores'
56+
local resource_patches = require 'map_gen.maps.danger_ores.modules.resource_patches'
57+
local resource_patches_config = require 'map_gen.maps.danger_ores.config.deadlock_beltboxes_resource_patches'
58+
-- local water = require 'map_gen.maps.danger_ores.modules.water'
59+
local trees = require 'map_gen.maps.danger_ores.modules.trees'
60+
local enemy = require 'map_gen.maps.danger_ores.modules.enemy'
61+
-- local dense_patches = require 'map_gen.maps.danger_ores.modules.dense_patches'
62+
63+
local banned_entities = require 'map_gen.maps.danger_ores.modules.banned_entities'
64+
local allowed_entities = require 'map_gen.maps.danger_ores.config.deadlock_betlboxes_allowed_entities'
65+
banned_entities(allowed_entities)
66+
67+
RS.set_map_gen_settings({
68+
MGSP.grass_only,
69+
MGSP.enable_water,
70+
{terrain_segmentation = 'normal', water = 'normal'},
71+
MGSP.starting_area_very_low,
72+
MGSP.ore_oil_none,
73+
MGSP.enemy_none,
74+
MGSP.cliff_none,
75+
MGSP.tree_none,
76+
{height = 32 * 3}
77+
})
78+
79+
Config.market.enabled = false
80+
Config.player_rewards.enabled = false
81+
Config.player_create.starting_items = {}
82+
Config.dump_offline_inventories = {
83+
enabled = true,
84+
offline_timout_mins = 30 -- time after which a player logs off that their inventory is provided to the team
85+
}
86+
Config.paint.enabled = false
87+
88+
Event.on_init(function()
89+
game.draw_resource_selection = false
90+
game.forces.player.technologies['mining-productivity-1'].enabled = false
91+
game.forces.player.technologies['mining-productivity-2'].enabled = false
92+
game.forces.player.technologies['mining-productivity-3'].enabled = false
93+
game.forces.player.technologies['mining-productivity-4'].enabled = false
94+
95+
game.difficulty_settings.technology_price_multiplier = 35
96+
game.forces.player.technologies.logistics.researched = true
97+
game.forces.player.technologies.automation.researched = true
98+
99+
game.map_settings.enemy_evolution.time_factor = 0.000007 -- default 0.000004
100+
game.map_settings.enemy_evolution.destroy_factor = 0.000010 -- default 0.002
101+
game.map_settings.enemy_evolution.pollution_factor = 0.000000 -- Pollution has no affect on evolution default 0.0000009
102+
103+
game.forces.player.manual_mining_speed_modifier = 1
104+
105+
RS.get_surface().always_day = true
106+
end)
107+
108+
local function terraforming_bounds(x, y)
109+
return x > -64 and y > -64 and y < 64
110+
end
111+
112+
local terraforming = require 'map_gen.maps.danger_ores.modules.terraforming'
113+
terraforming({
114+
start_size = 12 * 32,
115+
min_pollution = 300,
116+
max_pollution = 16000,
117+
pollution_increment = 6,
118+
bounds = terraforming_bounds
119+
})
120+
121+
local rocket_launched = require 'map_gen.maps.danger_ores.modules.rocket_launched_simple'
122+
rocket_launched({win_satellite_count = 1000})
123+
124+
local restart_command = require 'map_gen.maps.danger_ores.modules.restart_command'
125+
restart_command({scenario_name = 'danger-ore-one-direction-beltboxes'})
126+
127+
local container_dump = require 'map_gen.maps.danger_ores.modules.container_dump'
128+
container_dump({entity_name = 'coal'})
129+
130+
local concrete_on_landfill = require 'map_gen.maps.danger_ores.modules.concrete_on_landfill'
131+
concrete_on_landfill({tile = 'blue-refined-concrete'})
132+
133+
local main_ores_builder = require 'map_gen.maps.danger_ores.modules.main_ores_one_direction'
134+
135+
local function post_map_func(map_shape)
136+
local function map_bounds(x, y)
137+
return x > -44 and y > -48 and y < 48
138+
end
139+
140+
local function water_bounds(x, y)
141+
return x > -46 and y > -50 and y < 50
142+
end
143+
144+
local water_border = b.tile('water')
145+
water_border = b.choose(water_bounds, water_border, b.empty_shape)
146+
147+
return b.choose(map_bounds, map_shape, water_border)
148+
end
149+
150+
local config = {
151+
spawn_shape = b.rectangle(72),
152+
start_ore_shape = b.rectangle(88),
153+
post_map_func = post_map_func,
154+
main_ores_builder = main_ores_builder,
155+
no_resource_patch_shape = b.rectangle(160),
156+
main_ores = main_ores_config,
157+
main_ores_shuffle_order = true,
158+
-- main_ores_rotate = 30,
159+
resource_patches = resource_patches,
160+
resource_patches_config = resource_patches_config,
161+
-- water = water,
162+
water_scale = 1 / 96,
163+
water_threshold = 0.4,
164+
deepwater_threshold = 0.45,
165+
trees = trees,
166+
trees_scale = 1 / 64,
167+
trees_threshold = 0.3,
168+
trees_chance = 0.875,
169+
enemy = enemy,
170+
enemy_factor = 10 / (768 * 32),
171+
enemy_max_chance = 1 / 6,
172+
enemy_scale_factor = 32,
173+
fish_spawn_rate = 0.025,
174+
-- dense_patches = dense_patches,
175+
dense_patches_scale = 1 / 48,
176+
dense_patches_threshold = 0.55,
177+
dense_patches_multiplier = 25
178+
}
179+
180+
return map(config)
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_one_direction_beltboxes'

0 commit comments

Comments
 (0)