diff --git a/map_gen/presets/crash_site.lua b/map_gen/presets/crash_site.lua index caeb4d28..aec82108 100644 --- a/map_gen/presets/crash_site.lua +++ b/map_gen/presets/crash_site.lua @@ -62,13 +62,28 @@ local templates = { --{base_templates.test[1]} } +local small_gear_factory = require 'map_gen.presets.crash_site.outpost_data.small_gear_factory' +local medium_gear_factory = require 'map_gen.presets.crash_site.outpost_data.medium_gear_factory' +local big_gear_factory = require 'map_gen.presets.crash_site.outpost_data.big_gear_factory' + +local small_iron_plate_factory = require 'map_gen.presets.crash_site.outpost_data.small_iron_plate_factory' +local medium_iron_plate_factory = require 'map_gen.presets.crash_site.outpost_data.medium_iron_plate_factory' +local big_iron_plate_factory = require 'map_gen.presets.crash_site.outpost_data.big_iron_plate_factory' + +local small_circuit_factory = require 'map_gen.presets.crash_site.outpost_data.small_circuit_factory' +local medium_circuit_factory = require 'map_gen.presets.crash_site.outpost_data.medium_circuit_factory' +local big_circuit_factory = require 'map_gen.presets.crash_site.outpost_data.big_circuit_factory' + +local stage1 = { + {} +} + local pattern = {} for r = 1, 100 do local row = {} pattern[r] = row for c = 1, 100 do - row[c] = - outpost_builder:do_outpost(outpost_blocks, outpost_variance, outpost_min_step, outpost_max_level, templates) + row[c] = outpost_builder:do_outpost(big_circuit_factory) end end diff --git a/map_gen/presets/crash_site/outpost_builder.lua b/map_gen/presets/crash_site/outpost_builder.lua index d82d90f8..3b86a6b8 100644 --- a/map_gen/presets/crash_site/outpost_builder.lua +++ b/map_gen/presets/crash_site/outpost_builder.lua @@ -478,15 +478,10 @@ local function fill(blocks) end local function do_levels(blocks, max_level) - if max_level < 3 then - return - end - local size = blocks.size - local level = 2 - repeat + while level < max_level do local next_level = level + 1 for y = 1, size do @@ -518,7 +513,7 @@ local function do_levels(blocks, max_level) end level = level + 1 - until level == max_level + end local levels = {} blocks.levels = levels @@ -572,36 +567,37 @@ local function get_template(random, templates, templates_count, counts) return template end -local function make_blocks(self, blocks, templates) +local function make_blocks(self, blocks, template) local random = self.random local levels = blocks.levels local wall_level = levels[1] - local walls = templates[1] + local walls = template.walls local wall_template_count = #walls for _, i in ipairs(wall_level) do local ti = random:next_int(1, wall_template_count) - local template = walls[ti] + local block = walls[ti] - if template == Public.empty_template then + if block == Public.empty_template then blocks[i] = nil else - local block = blocks[i] + local block_data = blocks[i] - local section = get_section(block) - local dir = get_4_way_direction(block) + local section = get_section(block_data) + local dir = get_4_way_direction(block_data) - local new_block = template[section + 1][dir + 1] + local new_block = block[section + 1][dir + 1] blocks[i] = new_block end end local counts = {} + local bases = template.bases for l = 2, #levels do local level = levels[l] - local base_templates = templates[l] + local base_templates = bases[l - 1] if base_templates then local base_template_count = #base_templates @@ -612,8 +608,7 @@ local function make_blocks(self, blocks, templates) fast_remove(level, index) - local template = get_template(random, base_templates, base_template_count, counts) - blocks[i] = template + blocks[i] = get_template(random, base_templates, base_template_count, counts) end else for _, i in ipairs(level) do @@ -693,13 +688,14 @@ local function to_shape(blocks) end end -function Public:do_outpost(outpost_blocks, outpost_variance, outpost_min_step, max_level, templates) - local blocks = {size = outpost_blocks} +function Public:do_outpost(template) + local settings = template.settings + local blocks = {size = settings.blocks} - do_walls(self, blocks, outpost_variance, outpost_min_step) + do_walls(self, blocks, settings.variance, settings.min_step) fill(blocks) - do_levels(blocks, max_level) - make_blocks(self, blocks, templates) + do_levels(blocks, settings.max_level) + make_blocks(self, blocks, template) return to_shape(blocks) end @@ -977,8 +973,8 @@ Public.magic_item_crafting_callback = Token.register( function(entity, data) entity.minable = false - entity.operable = false entity.destructible = false + entity.operable = false local recipe = data.recipe if recipe then @@ -1121,4 +1117,10 @@ end Event.add(defines.events.on_tick, tick) Event.add(defines.events.on_entity_died, remove_power_source) +Event.on_init( + function() + game.forces.neutral.recipes['steel-plate'].enabled = true + end +) + return Public diff --git a/map_gen/presets/crash_site/outpost_data/big_circuit_factory.lua b/map_gen/presets/crash_site/outpost_data/big_circuit_factory.lua new file mode 100644 index 00000000..70bcfaf0 --- /dev/null +++ b/map_gen/presets/crash_site/outpost_data/big_circuit_factory.lua @@ -0,0 +1,130 @@ +local ob = require 'map_gen.presets.crash_site.outpost_builder' + +local Token = require 'utils.global_token' + +local loot = { + {weight = 10}, + {stack = {name = 'coin', count = 2500, distance_factor = 1 / 2}, weight = 5}, + {stack = {name = 'copper-cable', count = 300, distance_factor = 3 / 4}, weight = 5}, + {stack = {name = 'electronic-circuit', count = 800, distance_factor = 1}, weight = 5}, + {stack = {name = 'advanced-circuit', count = 400, distance_factor = 1 / 2}, weight = 5}, + {stack = {name = 'processing-unit', count = 200, distance_factor = 1 / 4}, weight = 5} +} + +local factory = { + callback = ob.magic_item_crafting_callback, + data = { + recipe = 'electronic-circuit', + output = {min_rate = 1 / 60, distance_factor = 1 / 60 / 100, item = 'electronic-circuit'} + } +} + +local factory_b = { + callback = ob.magic_item_crafting_callback, + data = { + recipe = 'advanced-circuit', + output = {min_rate = 1 / 60, distance_factor = 1 / 60 / 100, item = 'advanced-circuit'} + } +} + +local factory_c = { + callback = ob.magic_item_crafting_callback, + data = { + recipe = 'processing-unit', + output = {min_rate = 1 / 600, distance_factor = 1 / 600 / 100, item = 'processing-unit'} + } +} + +local market = { + callback = ob.market_set_items_callback, + data = { + { + offer = {type = 'give-item', item = 'copper-cable', count = 200}, + name = 'coin', + price = 50, + distance_factor = 1 / 32, + min_price = 5 + }, + { + offer = {type = 'give-item', item = 'electronic-circuit', count = 200}, + name = 'coin', + price = 200, + distance_factor = 1 / 32, + min_price = 10 + }, + { + offer = {type = 'give-item', item = 'advanced-circuit', count = 200}, + name = 'coin', + price = 800, + distance_factor = 1 / 32, + min_price = 40 + }, + { + offer = {type = 'give-item', item = 'processing-unit', count = 200}, + name = 'coin', + price = 2000, + distance_factor = 1 / 32, + min_price = 80 + } + } +} + +local weights = ob.prepare_weighted_loot(loot) + +local loot_callback = + Token.register( + function(chest) + ob.do_random_loot(chest, weights, loot) + end +) + +local base_factory = require 'map_gen.presets.crash_site.outpost_data.big_factory' + +local level2 = ob.extend_1_way(base_factory[1], {loot = {callback = loot_callback}}) +local level3 = + ob.extend_1_way( + base_factory[2], + { + factory = factory, + fallback = level2 + } +) +local level3_b = + ob.extend_1_way( + base_factory[2], + { + factory = factory_b, + fallback = level3 + } +) +local level3_c = + ob.extend_1_way( + base_factory[2], + { + factory = factory_c, + fallback = level3_b + } +) +local level4 = + ob.extend_1_way( + base_factory[3], + { + market = market, + fallback = level3_c + } +) + +return { + settings = { + blocks = 9, + variance = 3, + min_step = 2, + max_level = 2 + }, + walls = { + require 'map_gen.presets.crash_site.outpost_data.heavy_laser_turrets' + }, + bases = { + {level4, level2} + } +} diff --git a/map_gen/presets/crash_site/outpost_data/big_factory.lua b/map_gen/presets/crash_site/outpost_data/big_factory.lua new file mode 100644 index 00000000..ea94ce82 --- /dev/null +++ b/map_gen/presets/crash_site/outpost_data/big_factory.lua @@ -0,0 +1,132 @@ +local ob = require 'map_gen.presets.crash_site.outpost_builder' + +local level2 = + ob.make_1_way { + force = 'neutral', + [1] = {tile = 'refined-concrete'}, + [2] = {tile = 'refined-concrete'}, + [3] = {tile = 'refined-concrete'}, + [4] = {tile = 'refined-concrete'}, + [5] = {tile = 'refined-concrete'}, + [6] = {tile = 'refined-concrete'}, + [7] = {tile = 'refined-concrete'}, + [8] = {entity = {name = 'steel-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [9] = {entity = {name = 'steel-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [10] = {entity = {name = 'steel-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [11] = {entity = {name = 'steel-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [12] = {tile = 'refined-concrete'}, + [13] = {tile = 'refined-concrete'}, + [14] = {entity = {name = 'steel-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [15] = {entity = {name = 'steel-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [16] = {entity = {name = 'steel-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [17] = {entity = {name = 'steel-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [18] = {tile = 'refined-concrete'}, + [19] = {tile = 'refined-concrete'}, + [20] = {entity = {name = 'steel-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [21] = {entity = {name = 'steel-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [22] = {entity = {name = 'steel-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [23] = {entity = {name = 'steel-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [24] = {tile = 'refined-concrete'}, + [25] = {tile = 'refined-concrete'}, + [26] = {entity = {name = 'steel-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [27] = {entity = {name = 'steel-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [28] = {entity = {name = 'steel-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [29] = {entity = {name = 'steel-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [30] = {tile = 'refined-concrete'}, + [31] = {tile = 'refined-concrete'}, + [32] = {tile = 'refined-concrete'}, + [33] = {tile = 'refined-concrete'}, + [34] = {tile = 'refined-concrete'}, + [35] = {tile = 'refined-concrete'}, + [36] = {tile = 'refined-concrete'} +} + +local level3 = + ob.make_1_way { + force = 'neutral', + max_count = 8, + [1] = {tile = 'refined-concrete'}, + [2] = {tile = 'refined-concrete'}, + [3] = {tile = 'refined-concrete'}, + [4] = {tile = 'refined-concrete'}, + [5] = {tile = 'refined-concrete'}, + [6] = {tile = 'refined-concrete'}, + [7] = {tile = 'refined-concrete'}, + [8] = {tile = 'refined-concrete'}, + [9] = {tile = 'refined-concrete'}, + [10] = {tile = 'refined-concrete'}, + [11] = {tile = 'refined-concrete'}, + [12] = {tile = 'refined-concrete'}, + [13] = {tile = 'refined-concrete'}, + [14] = {tile = 'refined-concrete'}, + [15] = {entity = {name = 'assembling-machine-2', callback = 'factory'}, tile = 'refined-concrete'}, + [16] = {tile = 'refined-concrete'}, + [17] = {tile = 'refined-concrete'}, + [18] = {tile = 'refined-concrete'}, + [19] = {tile = 'refined-concrete'}, + [20] = {tile = 'refined-concrete'}, + [21] = {tile = 'refined-concrete'}, + [22] = {tile = 'refined-concrete'}, + [23] = {tile = 'refined-concrete'}, + [24] = {tile = 'refined-concrete'}, + [25] = {tile = 'refined-concrete'}, + [26] = {tile = 'refined-concrete'}, + [27] = {tile = 'refined-concrete'}, + [28] = {tile = 'refined-concrete'}, + [29] = {tile = 'refined-concrete'}, + [30] = {tile = 'refined-concrete'}, + [31] = {tile = 'refined-concrete'}, + [32] = {tile = 'refined-concrete'}, + [33] = {tile = 'refined-concrete'}, + [34] = {tile = 'refined-concrete'}, + [35] = {tile = 'refined-concrete'}, + [36] = {tile = 'refined-concrete'} +} + +local level4 = + ob.make_1_way { + force = 'neutral', + max_count = 1, + [1] = {tile = 'refined-concrete'}, + [2] = {tile = 'refined-concrete'}, + [3] = {tile = 'refined-concrete'}, + [4] = {tile = 'refined-concrete'}, + [5] = {tile = 'refined-concrete'}, + [6] = {tile = 'refined-concrete'}, + [7] = {tile = 'refined-concrete'}, + [8] = {tile = 'refined-concrete'}, + [9] = {tile = 'refined-concrete'}, + [10] = {tile = 'refined-concrete'}, + [11] = {tile = 'refined-concrete'}, + [12] = {tile = 'refined-concrete'}, + [13] = {tile = 'refined-concrete'}, + [14] = {tile = 'refined-concrete'}, + [15] = {entity = {name = 'market', callback = 'market'}}, + [16] = {tile = 'refined-concrete'}, + [17] = {tile = 'refined-concrete'}, + [18] = {tile = 'refined-concrete'}, + [19] = {tile = 'refined-concrete'}, + [20] = {tile = 'refined-concrete'}, + [21] = {tile = 'refined-concrete'}, + [22] = {tile = 'refined-concrete'}, + [23] = {tile = 'refined-concrete'}, + [24] = {tile = 'refined-concrete'}, + [25] = {tile = 'refined-concrete'}, + [26] = {tile = 'refined-concrete'}, + [27] = {tile = 'refined-concrete'}, + [28] = {tile = 'refined-concrete'}, + [29] = {tile = 'refined-concrete'}, + [30] = {tile = 'refined-concrete'}, + [31] = {tile = 'refined-concrete'}, + [32] = {tile = 'refined-concrete'}, + [33] = {tile = 'refined-concrete'}, + [34] = {tile = 'refined-concrete'}, + [35] = {tile = 'refined-concrete'}, + [36] = {tile = 'refined-concrete'} +} + +return { + level2, + level3, + level4 +} diff --git a/map_gen/presets/crash_site/outpost_data/big_gear_factory.lua b/map_gen/presets/crash_site/outpost_data/big_gear_factory.lua new file mode 100644 index 00000000..440675f0 --- /dev/null +++ b/map_gen/presets/crash_site/outpost_data/big_gear_factory.lua @@ -0,0 +1,195 @@ +local ob = require 'map_gen.presets.crash_site.outpost_builder' +local Token = require 'utils.global_token' + +local loot = { + {weight = 10}, + {stack = {name = 'coin', count = 5000, distance_factor = 1 / 2}, weight = 5}, + {stack = {name = 'iron-plate', count = 2500, distance_factor = 1 / 2}, weight = 5}, + {stack = {name = 'steel-plate', count = 1000, distance_factor = 1 / 5}, weight = 1}, + {stack = {name = 'iron-gear-wheel', count = 4000, distance_factor = 1}, weight = 5} +} + +local weights = ob.prepare_weighted_loot(loot) + +local loot_callback = + Token.register( + function(chest) + ob.do_random_loot(chest, weights, loot) + end +) + +local level2 = + ob.make_1_way { + force = 'neutral', + loot = {callback = loot_callback}, + [1] = {tile = 'refined-concrete'}, + [2] = {tile = 'refined-concrete'}, + [3] = {tile = 'refined-concrete'}, + [4] = {tile = 'refined-concrete'}, + [5] = {tile = 'refined-concrete'}, + [6] = {tile = 'refined-concrete'}, + [7] = {tile = 'refined-concrete'}, + [8] = {entity = {name = 'steel-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [9] = {entity = {name = 'steel-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [10] = {entity = {name = 'steel-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [11] = {entity = {name = 'steel-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [12] = {tile = 'refined-concrete'}, + [13] = {tile = 'refined-concrete'}, + [14] = {entity = {name = 'steel-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [15] = {entity = {name = 'steel-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [16] = {entity = {name = 'steel-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [17] = {entity = {name = 'steel-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [18] = {tile = 'refined-concrete'}, + [19] = {tile = 'refined-concrete'}, + [20] = {entity = {name = 'steel-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [21] = {entity = {name = 'steel-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [22] = {entity = {name = 'steel-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [23] = {entity = {name = 'steel-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [24] = {tile = 'refined-concrete'}, + [25] = {tile = 'refined-concrete'}, + [26] = {entity = {name = 'steel-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [27] = {entity = {name = 'steel-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [28] = {entity = {name = 'steel-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [29] = {entity = {name = 'steel-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [30] = {tile = 'refined-concrete'}, + [31] = {tile = 'refined-concrete'}, + [32] = {tile = 'refined-concrete'}, + [33] = {tile = 'refined-concrete'}, + [34] = {tile = 'refined-concrete'}, + [35] = {tile = 'refined-concrete'}, + [36] = {tile = 'refined-concrete'} +} + +local level3 = + ob.make_1_way { + force = 'neutral', + factory = { + callback = ob.magic_item_crafting_callback, + data = { + recipe = 'iron-gear-wheel', + output = {min_rate = 1 / 60, distance_factor = 1 / 60 / 100, item = 'iron-gear-wheel'} + } + }, + max_count = 8, + fallback = level2, + [1] = {tile = 'refined-concrete'}, + [2] = {tile = 'refined-concrete'}, + [3] = {tile = 'refined-concrete'}, + [4] = {tile = 'refined-concrete'}, + [5] = {tile = 'refined-concrete'}, + [6] = {tile = 'refined-concrete'}, + [7] = {tile = 'refined-concrete'}, + [8] = {tile = 'refined-concrete'}, + [9] = {tile = 'refined-concrete'}, + [10] = {tile = 'refined-concrete'}, + [11] = {tile = 'refined-concrete'}, + [12] = {tile = 'refined-concrete'}, + [13] = {tile = 'refined-concrete'}, + [14] = {tile = 'refined-concrete'}, + [15] = {entity = {name = 'assembling-machine-2', callback = 'factory'}, tile = 'refined-concrete'}, + [16] = {tile = 'refined-concrete'}, + [17] = {tile = 'refined-concrete'}, + [18] = {tile = 'refined-concrete'}, + [19] = {tile = 'refined-concrete'}, + [20] = {tile = 'refined-concrete'}, + [21] = {tile = 'refined-concrete'}, + [22] = {tile = 'refined-concrete'}, + [23] = {tile = 'refined-concrete'}, + [24] = {tile = 'refined-concrete'}, + [25] = {tile = 'refined-concrete'}, + [26] = {tile = 'refined-concrete'}, + [27] = {tile = 'refined-concrete'}, + [28] = {tile = 'refined-concrete'}, + [29] = {tile = 'refined-concrete'}, + [30] = {tile = 'refined-concrete'}, + [31] = {tile = 'refined-concrete'}, + [32] = {tile = 'refined-concrete'}, + [33] = {tile = 'refined-concrete'}, + [34] = {tile = 'refined-concrete'}, + [35] = {tile = 'refined-concrete'}, + [36] = {tile = 'refined-concrete'} +} + +local level4 = + ob.make_1_way { + force = 'neutral', + market = { + callback = ob.market_set_items_callback, + data = { + { + offer = {type = 'give-item', item = 'iron-gear-wheel', count = 100}, + name = 'coin', + price = 100, + distance_factor = 1 / 32, + min_price = 5 + }, + { + offer = {type = 'give-item', item = 'iron-plate', count = 100}, + name = 'coin', + price = 80, + distance_factor = 1 / 32, + min_price = 4 + }, + { + offer = {type = 'give-item', item = 'steel-plate', count = 100}, + name = 'coin', + price = 400, + distance_factor = 1 / 32, + min_price = 25 + } + } + }, + max_count = 1, + fallback = level3, + [1] = {tile = 'refined-concrete'}, + [2] = {tile = 'refined-concrete'}, + [3] = {tile = 'refined-concrete'}, + [4] = {tile = 'refined-concrete'}, + [5] = {tile = 'refined-concrete'}, + [6] = {tile = 'refined-concrete'}, + [7] = {tile = 'refined-concrete'}, + [8] = {tile = 'refined-concrete'}, + [9] = {tile = 'refined-concrete'}, + [10] = {tile = 'refined-concrete'}, + [11] = {tile = 'refined-concrete'}, + [12] = {tile = 'refined-concrete'}, + [13] = {tile = 'refined-concrete'}, + [14] = {tile = 'refined-concrete'}, + [15] = {entity = {name = 'market', callback = 'market'}}, + [16] = {tile = 'refined-concrete'}, + [17] = {tile = 'refined-concrete'}, + [18] = {tile = 'refined-concrete'}, + [19] = {tile = 'refined-concrete'}, + [20] = {tile = 'refined-concrete'}, + [21] = {tile = 'refined-concrete'}, + [22] = {tile = 'refined-concrete'}, + [23] = {tile = 'refined-concrete'}, + [24] = {tile = 'refined-concrete'}, + [25] = {tile = 'refined-concrete'}, + [26] = {tile = 'refined-concrete'}, + [27] = {tile = 'refined-concrete'}, + [28] = {tile = 'refined-concrete'}, + [29] = {tile = 'refined-concrete'}, + [30] = {tile = 'refined-concrete'}, + [31] = {tile = 'refined-concrete'}, + [32] = {tile = 'refined-concrete'}, + [33] = {tile = 'refined-concrete'}, + [34] = {tile = 'refined-concrete'}, + [35] = {tile = 'refined-concrete'}, + [36] = {tile = 'refined-concrete'} +} + +return { + settings = { + blocks = 9, + variance = 3, + min_step = 2, + max_level = 2 + }, + walls = { + require 'map_gen.presets.crash_site.outpost_data.heavy_gun_turrets' + }, + bases = { + {level4, level2} + } +} diff --git a/map_gen/presets/crash_site/outpost_data/big_iron_plate_factory.lua b/map_gen/presets/crash_site/outpost_data/big_iron_plate_factory.lua new file mode 100644 index 00000000..f8a43490 --- /dev/null +++ b/map_gen/presets/crash_site/outpost_data/big_iron_plate_factory.lua @@ -0,0 +1,210 @@ +local ob = require 'map_gen.presets.crash_site.outpost_builder' +local Token = require 'utils.global_token' + +local loot = { + {weight = 5}, + {stack = {name = 'coin', count = 2500, distance_factor = 1 / 2}, weight = 5}, + {stack = {name = 'iron-ore', count = 2400}, weight = 2}, + {stack = {name = 'iron-plate', count = 1500, distance_factor = 1 / 2}, weight = 10}, + {stack = {name = 'steel-plate', count = 1000, distance_factor = 1 / 5}, weight = 8} +} + +local weights = ob.prepare_weighted_loot(loot) + +local loot_callback = + Token.register( + function(chest) + ob.do_random_loot(chest, weights, loot) + end +) + +local level2 = + ob.make_1_way { + force = 'neutral', + loot = {callback = loot_callback}, + [1] = {tile = 'refined-concrete'}, + [2] = {tile = 'refined-concrete'}, + [3] = {tile = 'refined-concrete'}, + [4] = {tile = 'refined-concrete'}, + [5] = {tile = 'refined-concrete'}, + [6] = {tile = 'refined-concrete'}, + [7] = {tile = 'refined-concrete'}, + [8] = {entity = {name = 'steel-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [9] = {entity = {name = 'steel-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [10] = {entity = {name = 'steel-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [11] = {entity = {name = 'steel-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [12] = {tile = 'refined-concrete'}, + [13] = {tile = 'refined-concrete'}, + [14] = {entity = {name = 'steel-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [15] = {entity = {name = 'steel-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [16] = {entity = {name = 'steel-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [17] = {entity = {name = 'steel-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [18] = {tile = 'refined-concrete'}, + [19] = {tile = 'refined-concrete'}, + [20] = {entity = {name = 'steel-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [21] = {entity = {name = 'steel-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [22] = {entity = {name = 'steel-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [23] = {entity = {name = 'steel-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [24] = {tile = 'refined-concrete'}, + [25] = {tile = 'refined-concrete'}, + [26] = {entity = {name = 'steel-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [27] = {entity = {name = 'steel-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [28] = {entity = {name = 'steel-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [29] = {entity = {name = 'steel-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [30] = {tile = 'refined-concrete'}, + [31] = {tile = 'refined-concrete'}, + [32] = {tile = 'refined-concrete'}, + [33] = {tile = 'refined-concrete'}, + [34] = {tile = 'refined-concrete'}, + [35] = {tile = 'refined-concrete'}, + [36] = {tile = 'refined-concrete'} +} + +local level3 = + ob.make_1_way { + force = 'neutral', + factory = { + callback = ob.magic_item_crafting_callback, + data = { + furance_item = 'iron-ore', + output = {min_rate = 1.5 / 60, distance_factor = 1.5 / 60 / 100, item = 'iron-plate'} + } + }, + max_count = 9, + fallback = level2, + [1] = {tile = 'refined-concrete'}, + [2] = {tile = 'refined-concrete'}, + [3] = {tile = 'refined-concrete'}, + [4] = {tile = 'refined-concrete'}, + [5] = {tile = 'refined-concrete'}, + [6] = {tile = 'refined-concrete'}, + [7] = {tile = 'refined-concrete'}, + [8] = {tile = 'refined-concrete'}, + [9] = {tile = 'refined-concrete'}, + [10] = {tile = 'refined-concrete'}, + [11] = {tile = 'refined-concrete'}, + [12] = {tile = 'refined-concrete'}, + [13] = {tile = 'refined-concrete'}, + [14] = {tile = 'refined-concrete'}, + [15] = {entity = {name = 'electric-furnace', callback = 'factory'}, tile = 'refined-concrete'}, + [16] = {tile = 'refined-concrete'}, + [17] = {tile = 'refined-concrete'}, + [18] = {tile = 'refined-concrete'}, + [19] = {tile = 'refined-concrete'}, + [20] = {tile = 'refined-concrete'}, + [21] = {tile = 'refined-concrete'}, + [22] = {tile = 'refined-concrete'}, + [23] = {tile = 'refined-concrete'}, + [24] = {tile = 'refined-concrete'}, + [25] = {tile = 'refined-concrete'}, + [26] = {tile = 'refined-concrete'}, + [27] = {tile = 'refined-concrete'}, + [28] = {tile = 'refined-concrete'}, + [29] = {tile = 'refined-concrete'}, + [30] = {tile = 'refined-concrete'}, + [31] = {tile = 'refined-concrete'}, + [32] = {tile = 'refined-concrete'}, + [33] = {tile = 'refined-concrete'}, + [34] = {tile = 'refined-concrete'}, + [35] = {tile = 'refined-concrete'}, + [36] = {tile = 'refined-concrete'} +} + +local level3b = + ob.extend_1_way( + level3, + { + factory = { + callback = ob.magic_item_crafting_callback, + data = { + furance_item = {name = 'iron-plate', count = 100}, + output = {min_rate = 1.5 / 60, distance_factor = 1.5 / 60 / 100, item = 'steel-plate'} + } + } + } +) + +local level4 = + ob.make_1_way { + force = 'neutral', + market = { + callback = ob.market_set_items_callback, + data = { + { + offer = {type = 'give-item', item = 'iron-plate', count = 100}, + name = 'coin', + price = 60, + distance_factor = 1 / 32, + min_price = 6 + }, + { + offer = {type = 'give-item', item = 'steel-plate', count = 100}, + name = 'coin', + price = 300, + distance_factor = 1 / 32, + min_price = 30 + } + } + }, + max_count = 1, + fallback = level3, + [1] = {tile = 'refined-concrete'}, + [2] = {tile = 'refined-concrete'}, + [3] = {tile = 'refined-concrete'}, + [4] = {tile = 'refined-concrete'}, + [5] = {tile = 'refined-concrete'}, + [6] = {tile = 'refined-concrete'}, + [7] = {tile = 'refined-concrete'}, + [8] = {tile = 'refined-concrete'}, + [9] = {tile = 'refined-concrete'}, + [10] = {tile = 'refined-concrete'}, + [11] = {tile = 'refined-concrete'}, + [12] = {tile = 'refined-concrete'}, + [13] = {tile = 'refined-concrete'}, + [14] = {tile = 'refined-concrete'}, + [15] = {entity = {name = 'market', callback = 'market'}}, + [16] = {tile = 'refined-concrete'}, + [17] = {tile = 'refined-concrete'}, + [18] = {tile = 'refined-concrete'}, + [19] = {tile = 'refined-concrete'}, + [20] = {tile = 'refined-concrete'}, + [21] = {tile = 'refined-concrete'}, + [22] = {tile = 'refined-concrete'}, + [23] = {tile = 'refined-concrete'}, + [24] = {tile = 'refined-concrete'}, + [25] = {tile = 'refined-concrete'}, + [26] = {tile = 'refined-concrete'}, + [27] = {tile = 'refined-concrete'}, + [28] = {tile = 'refined-concrete'}, + [29] = {tile = 'refined-concrete'}, + [30] = {tile = 'refined-concrete'}, + [31] = {tile = 'refined-concrete'}, + [32] = {tile = 'refined-concrete'}, + [33] = {tile = 'refined-concrete'}, + [34] = {tile = 'refined-concrete'}, + [35] = {tile = 'refined-concrete'}, + [36] = {tile = 'refined-concrete'} +} + +local level4b = + ob.extend_1_way( + level4, + { + fallback = level3b + } +) + +return { + settings = { + blocks = 9, + variance = 3, + min_step = 2, + max_level = 2 + }, + walls = { + require 'map_gen.presets.crash_site.outpost_data.heavy_gun_turrets' + }, + bases = { + {level4, level4b, level2} + } +} diff --git a/map_gen/presets/crash_site/outpost_data/gear_factory.lua b/map_gen/presets/crash_site/outpost_data/gear_factory.lua index 128e74b4..d815a429 100644 --- a/map_gen/presets/crash_site/outpost_data/gear_factory.lua +++ b/map_gen/presets/crash_site/outpost_data/gear_factory.lua @@ -18,7 +18,7 @@ local loot_callback = end ) -level2 = +local level2 = ob.make_1_way { force = 'neutral', loot = {callback = loot_callback}, @@ -107,7 +107,7 @@ return { } }, max_count = 1, - fallback = level2, + fallback = level3, [15] = {entity = {name = 'market', callback = 'market'}} } } diff --git a/map_gen/presets/crash_site/outpost_data/heavy_gun_turrets.lua b/map_gen/presets/crash_site/outpost_data/heavy_gun_turrets.lua index 261ab402..59df5127 100644 --- a/map_gen/presets/crash_site/outpost_data/heavy_gun_turrets.lua +++ b/map_gen/presets/crash_site/outpost_data/heavy_gun_turrets.lua @@ -2,6 +2,7 @@ local ob = require 'map_gen.presets.crash_site.outpost_builder' return { ob.make_4_way { + turret = {callback = ob.refill_turret_callback, data = ob.uranium_rounds_magazine_ammo}, [1] = {entity = {name = 'stone-wall'}}, [2] = {entity = {name = 'stone-wall'}}, [3] = {entity = {name = 'stone-wall'}}, @@ -14,11 +15,11 @@ return { [10] = {entity = {name = 'stone-wall'}}, [11] = {entity = {name = 'stone-wall'}}, [12] = {entity = {name = 'stone-wall'}}, - [13] = {entity = {name = 'gun-turret', offset = 3}, tile = 'refined-hazard-concrete-left'}, + [13] = {entity = {name = 'gun-turret', offset = 3, callback = 'turret'}, tile = 'refined-hazard-concrete-left'}, [14] = {tile = 'refined-hazard-concrete-left'}, - [15] = {entity = {name = 'gun-turret', offset = 3}, tile = 'refined-hazard-concrete-left'}, + [15] = {entity = {name = 'gun-turret', offset = 3, callback = 'turret'}, tile = 'refined-hazard-concrete-left'}, [16] = {tile = 'refined-hazard-concrete-left'}, - [17] = {entity = {name = 'gun-turret', offset = 3}, tile = 'refined-hazard-concrete-left'}, + [17] = {entity = {name = 'gun-turret', offset = 3, callback = 'turret'}, tile = 'refined-hazard-concrete-left'}, [18] = {tile = 'refined-hazard-concrete-left'}, [19] = {tile = 'refined-hazard-concrete-left'}, [20] = {tile = 'refined-hazard-concrete-left'}, @@ -26,11 +27,11 @@ return { [22] = {tile = 'refined-hazard-concrete-left'}, [23] = {tile = 'refined-hazard-concrete-left'}, [24] = {tile = 'refined-hazard-concrete-left'}, - [25] = {entity = {name = 'gun-turret', offset = 3}, tile = 'refined-hazard-concrete-left'}, + [25] = {entity = {name = 'gun-turret', offset = 3, callback = 'turret'}, tile = 'refined-hazard-concrete-left'}, [26] = {tile = 'refined-hazard-concrete-left'}, - [27] = {entity = {name = 'gun-turret', offset = 3}, tile = 'refined-hazard-concrete-left'}, + [27] = {entity = {name = 'gun-turret', offset = 3, callback = 'turret'}, tile = 'refined-hazard-concrete-left'}, [28] = {tile = 'refined-hazard-concrete-left'}, - [29] = {entity = {name = 'gun-turret', offset = 3}, tile = 'refined-hazard-concrete-left'}, + [29] = {entity = {name = 'gun-turret', offset = 3, callback = 'turret'}, tile = 'refined-hazard-concrete-left'}, [30] = {tile = 'refined-hazard-concrete-left'}, [31] = {tile = 'refined-hazard-concrete-left'}, [32] = {tile = 'refined-hazard-concrete-left'}, @@ -40,6 +41,7 @@ return { [36] = {tile = 'refined-hazard-concrete-left'} }, ob.make_4_way { + turret = {callback = ob.refill_turret_callback, data = ob.uranium_rounds_magazine_ammo}, [1] = {entity = {name = 'stone-wall'}}, [2] = {entity = {name = 'stone-wall'}}, [3] = {entity = {name = 'stone-wall'}}, @@ -54,9 +56,9 @@ return { [12] = {entity = {name = 'stone-wall'}}, [13] = {entity = {name = 'stone-wall'}}, [14] = {entity = {name = 'stone-wall'}}, - [15] = {entity = {name = 'gun-turret', offset = 3}, tile = 'refined-hazard-concrete-left'}, + [15] = {entity = {name = 'gun-turret', offset = 3, callback = 'turret'}, tile = 'refined-hazard-concrete-left'}, [16] = {tile = 'refined-hazard-concrete-left'}, - [17] = {entity = {name = 'gun-turret', offset = 3}, tile = 'refined-hazard-concrete-left'}, + [17] = {entity = {name = 'gun-turret', offset = 3, callback = 'turret'}, tile = 'refined-hazard-concrete-left'}, [18] = {tile = 'refined-hazard-concrete-left'}, [19] = {entity = {name = 'stone-wall'}}, [20] = {entity = {name = 'stone-wall'}}, @@ -66,9 +68,9 @@ return { [24] = {tile = 'refined-hazard-concrete-left'}, [25] = {entity = {name = 'stone-wall'}}, [26] = {entity = {name = 'stone-wall'}}, - [27] = {entity = {name = 'gun-turret', offset = 3}, tile = 'refined-hazard-concrete-left'}, + [27] = {entity = {name = 'gun-turret', offset = 3, callback = 'turret'}, tile = 'refined-hazard-concrete-left'}, [28] = {tile = 'refined-hazard-concrete-left'}, - [29] = {entity = {name = 'gun-turret', offset = 3}, tile = 'refined-hazard-concrete-left'}, + [29] = {entity = {name = 'gun-turret', offset = 3, callback = 'turret'}, tile = 'refined-hazard-concrete-left'}, [30] = {tile = 'refined-hazard-concrete-left'}, [31] = {entity = {name = 'stone-wall'}}, [32] = {entity = {name = 'stone-wall'}}, @@ -78,11 +80,12 @@ return { [36] = {tile = 'refined-hazard-concrete-left'} }, ob.make_4_way { + turret = {callback = ob.refill_turret_callback, data = ob.uranium_rounds_magazine_ammo}, [1] = {entity = {name = 'stone-wall'}}, [2] = {entity = {name = 'stone-wall'}}, - [3] = {entity = {name = 'gun-turret', offset = 3}, tile = 'refined-hazard-concrete-left'}, + [3] = {entity = {name = 'gun-turret', offset = 3, callback = 'turret'}, tile = 'refined-hazard-concrete-left'}, [4] = {tile = 'refined-hazard-concrete-left'}, - [5] = {entity = {name = 'gun-turret', offset = 3}, tile = 'refined-hazard-concrete-left'}, + [5] = {entity = {name = 'gun-turret', offset = 3, callback = 'turret'}, tile = 'refined-hazard-concrete-left'}, [6] = {tile = 'refined-hazard-concrete-left'}, [7] = {entity = {name = 'stone-wall'}}, [8] = {entity = {name = 'stone-wall'}}, @@ -90,11 +93,11 @@ return { [10] = {tile = 'refined-hazard-concrete-left'}, [11] = {tile = 'refined-hazard-concrete-left'}, [12] = {tile = 'refined-hazard-concrete-left'}, - [13] = {entity = {name = 'gun-turret', offset = 3}, tile = 'refined-hazard-concrete-left'}, + [13] = {entity = {name = 'gun-turret', offset = 3, callback = 'turret'}, tile = 'refined-hazard-concrete-left'}, [14] = {tile = 'refined-hazard-concrete-left'}, - [15] = {entity = {name = 'gun-turret', offset = 3}, tile = 'refined-hazard-concrete-left'}, + [15] = {entity = {name = 'gun-turret', offset = 3, callback = 'turret'}, tile = 'refined-hazard-concrete-left'}, [16] = {tile = 'refined-hazard-concrete-left'}, - [17] = {entity = {name = 'gun-turret', offset = 3}, tile = 'refined-hazard-concrete-left'}, + [17] = {entity = {name = 'gun-turret', offset = 3, callback = 'turret'}, tile = 'refined-hazard-concrete-left'}, [18] = {tile = 'refined-hazard-concrete-left'}, [19] = {tile = 'refined-hazard-concrete-left'}, [20] = {tile = 'refined-hazard-concrete-left'}, @@ -102,11 +105,11 @@ return { [22] = {tile = 'refined-hazard-concrete-left'}, [23] = {tile = 'refined-hazard-concrete-left'}, [24] = {tile = 'refined-hazard-concrete-left'}, - [25] = {entity = {name = 'gun-turret', offset = 3}, tile = 'refined-hazard-concrete-left'}, + [25] = {entity = {name = 'gun-turret', offset = 3, callback = 'turret'}, tile = 'refined-hazard-concrete-left'}, [26] = {tile = 'refined-hazard-concrete-left'}, - [27] = {entity = {name = 'gun-turret', offset = 3}, tile = 'refined-hazard-concrete-left'}, + [27] = {entity = {name = 'gun-turret', offset = 3, callback = 'turret'}, tile = 'refined-hazard-concrete-left'}, [28] = {tile = 'refined-hazard-concrete-left'}, - [29] = {entity = {name = 'gun-turret', offset = 3}, tile = 'refined-hazard-concrete-left'}, + [29] = {entity = {name = 'gun-turret', offset = 3, callback = 'turret'}, tile = 'refined-hazard-concrete-left'}, [30] = {tile = 'refined-hazard-concrete-left'}, [31] = {tile = 'refined-hazard-concrete-left'}, [32] = {tile = 'refined-hazard-concrete-left'}, diff --git a/map_gen/presets/crash_site/outpost_data/iron_plate_factory.lua b/map_gen/presets/crash_site/outpost_data/iron_plate_factory.lua index 70d4a185..6a73d5eb 100644 --- a/map_gen/presets/crash_site/outpost_data/iron_plate_factory.lua +++ b/map_gen/presets/crash_site/outpost_data/iron_plate_factory.lua @@ -6,8 +6,7 @@ return { factory = { callback = ob.magic_item_crafting_callback, data = { - --furance_item = 'coin', - output = {min_rate = 1 / 60, distance_factor = 1 / 60 / 100, item = 'coin'} + output = {min_rate = 1 / 60, distance_factor = 1 / 60 / 100, item = 'iron-plate'} } }, [15] = {entity = {name = 'electric-furnace', callback = 'factory'}} diff --git a/map_gen/presets/crash_site/outpost_data/light_gun_turrets.lua b/map_gen/presets/crash_site/outpost_data/light_gun_turrets.lua index 7906e1b5..92130fa9 100644 --- a/map_gen/presets/crash_site/outpost_data/light_gun_turrets.lua +++ b/map_gen/presets/crash_site/outpost_data/light_gun_turrets.lua @@ -2,6 +2,7 @@ local ob = require 'map_gen.presets.crash_site.outpost_builder' return { ob.make_4_way { + turret = {callback = ob.refill_turret_callback, data = ob.firearm_magazine_ammo}, [1] = {entity = {name = 'stone-wall'}}, [2] = {entity = {name = 'stone-wall'}}, [3] = {entity = {name = 'stone-wall'}}, @@ -22,7 +23,7 @@ return { [18] = {tile = 'stone-path'}, [19] = {tile = 'concrete'}, [20] = {tile = 'concrete'}, - [21] = {entity = {name = 'gun-turret', offset = 3}, tile = 'concrete'}, + [21] = {entity = {name = 'gun-turret', offset = 3, callback = 'turret'}, tile = 'concrete'}, [22] = {tile = 'concrete'}, [23] = {tile = 'concrete'}, [24] = {tile = 'concrete'}, @@ -40,6 +41,7 @@ return { [36] = {tile = 'stone-path'} }, ob.make_4_way { + turret = {callback = ob.refill_turret_callback, data = ob.firearm_magazine_ammo}, [1] = {entity = {name = 'stone-wall'}}, [2] = {entity = {name = 'stone-wall'}}, [3] = {entity = {name = 'stone-wall'}}, @@ -61,7 +63,7 @@ return { [19] = {entity = {name = 'stone-wall'}}, [20] = {entity = {name = 'stone-wall'}}, [21] = {tile = 'stone-path'}, - [22] = {entity = {name = 'gun-turret', offset = 3}, tile = 'concrete'}, + [22] = {entity = {name = 'gun-turret', offset = 3, callback = 'turret'}, tile = 'concrete'}, [23] = {tile = 'concrete'}, [24] = {tile = 'concrete'}, [25] = {entity = {name = 'stone-wall'}}, @@ -78,6 +80,7 @@ return { [36] = {tile = 'stone-path'} }, ob.make_4_way { + turret = {callback = ob.refill_turret_callback, data = ob.firearm_magazine_ammo}, [1] = {entity = {name = 'stone-wall'}}, [2] = {entity = {name = 'stone-wall'}}, [3] = {tile = 'stone-path'}, @@ -99,7 +102,7 @@ return { [19] = {tile = 'concrete'}, [20] = {tile = 'concrete'}, [21] = {tile = 'concrete'}, - [22] = {entity = {name = 'gun-turret', offset = 3}, tile = 'concrete'}, + [22] = {entity = {name = 'gun-turret', offset = 3, callback = 'turret'}, tile = 'concrete'}, [23] = {tile = 'concrete'}, [24] = {tile = 'stone-path'}, [25] = {tile = 'concrete'}, diff --git a/map_gen/presets/crash_site/outpost_data/medium_circuit_factory.lua b/map_gen/presets/crash_site/outpost_data/medium_circuit_factory.lua new file mode 100644 index 00000000..6533d968 --- /dev/null +++ b/map_gen/presets/crash_site/outpost_data/medium_circuit_factory.lua @@ -0,0 +1,114 @@ +local ob = require 'map_gen.presets.crash_site.outpost_builder' + +local Token = require 'utils.global_token' + +local loot = { + {weight = 10}, + {stack = {name = 'coin', count = 750, distance_factor = 1 / 2}, weight = 5}, + {stack = {name = 'copper-cable', count = 300, distance_factor = 3 / 4}, weight = 5}, + {stack = {name = 'electronic-circuit', count = 400, distance_factor = 1}, weight = 5}, + {stack = {name = 'advanced-circuit', count = 200, distance_factor = 1}, weight = 5}, + {stack = {name = 'processing-unit', count = 200, distance_factor = 1 / 10}, weight = 1} +} + +local factory = { + callback = ob.magic_item_crafting_callback, + data = { + recipe = 'electronic-circuit', + output = {min_rate = 1 / 60, distance_factor = 1 / 60 / 100, item = 'electronic-circuit'} + } +} + +local factory_b = { + callback = ob.magic_item_crafting_callback, + data = { + recipe = 'advanced-circuit', + output = {min_rate = 1 / 600, distance_factor = 1 / 600 / 100, item = 'advanced-circuit'} + } +} + +local market = { + callback = ob.market_set_items_callback, + data = { + { + offer = {type = 'give-item', item = 'copper-cable', count = 200}, + name = 'coin', + price = 50, + distance_factor = 1 / 32, + min_price = 5 + }, + { + offer = {type = 'give-item', item = 'electronic-circuit', count = 200}, + name = 'coin', + price = 200, + distance_factor = 1 / 32, + min_price = 10 + }, + { + offer = {type = 'give-item', item = 'advanced-circuit', count = 200}, + name = 'coin', + price = 800, + distance_factor = 1 / 32, + min_price = 40 + }, + { + offer = {type = 'give-item', item = 'processing-unit', count = 200}, + name = 'coin', + price = 8000, + distance_factor = 1 / 32, + min_price = 80 + } + } +} + +local weights = ob.prepare_weighted_loot(loot) + +local loot_callback = + Token.register( + function(chest) + ob.do_random_loot(chest, weights, loot) + end +) + +local base_factory = require 'map_gen.presets.crash_site.outpost_data.medium_factory' + +local level2 = ob.extend_1_way(base_factory[1], {loot = {callback = loot_callback}}) +local level3 = + ob.extend_1_way( + base_factory[2], + { + factory = factory, + fallback = level2 + } +) +local level3_b = + ob.extend_1_way( + base_factory[2], + { + factory = factory_b, + fallback = level3 + } +) +local level4 = + ob.extend_1_way( + base_factory[3], + { + market = market, + fallback = level3_b + } +) + +return { + settings = { + blocks = 7, + variance = 3, + min_step = 2, + max_level = 2 + }, + walls = { + require 'map_gen.presets.crash_site.outpost_data.medium_laser_turrets' + }, + bases = { + {level4, level3, level2} + } +} diff --git a/map_gen/presets/crash_site/outpost_data/medium_factory.lua b/map_gen/presets/crash_site/outpost_data/medium_factory.lua new file mode 100644 index 00000000..75fb1870 --- /dev/null +++ b/map_gen/presets/crash_site/outpost_data/medium_factory.lua @@ -0,0 +1,128 @@ +local ob = require 'map_gen.presets.crash_site.outpost_builder' + +local level2 = + ob.make_1_way { + force = 'neutral', + [1] = {tile = 'concrete'}, + [2] = {tile = 'concrete'}, + [3] = {tile = 'concrete'}, + [4] = {tile = 'concrete'}, + [5] = {tile = 'concrete'}, + [6] = {tile = 'concrete'}, + [7] = {tile = 'concrete'}, + [8] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [9] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [10] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [11] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [12] = {tile = 'concrete'}, + [13] = {tile = 'concrete'}, + [14] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [15] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [16] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [17] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [18] = {tile = 'concrete'}, + [19] = {tile = 'concrete'}, + [20] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [21] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [22] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [23] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [24] = {tile = 'concrete'}, + [25] = {tile = 'concrete'}, + [26] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [27] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [28] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [29] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [30] = {tile = 'concrete'}, + [31] = {tile = 'concrete'}, + [32] = {tile = 'concrete'}, + [33] = {tile = 'concrete'}, + [34] = {tile = 'concrete'}, + [35] = {tile = 'concrete'}, + [36] = {tile = 'concrete'} +} + +local level3 = + ob.make_1_way { + force = 'neutral', + max_count = 6, + [1] = {tile = 'concrete'}, + [2] = {tile = 'concrete'}, + [3] = {tile = 'concrete'}, + [4] = {tile = 'concrete'}, + [5] = {tile = 'concrete'}, + [6] = {tile = 'concrete'}, + [7] = {tile = 'concrete'}, + [8] = {tile = 'refined-concrete'}, + [9] = {tile = 'refined-concrete'}, + [10] = {tile = 'refined-concrete'}, + [11] = {tile = 'refined-concrete'}, + [12] = {tile = 'concrete'}, + [13] = {tile = 'concrete'}, + [14] = {tile = 'refined-concrete'}, + [15] = {entity = {name = 'assembling-machine-2', callback = 'factory'}, tile = 'refined-concrete'}, + [16] = {tile = 'refined-concrete'}, + [17] = {tile = 'refined-concrete'}, + [18] = {tile = 'concrete'}, + [19] = {tile = 'concrete'}, + [20] = {tile = 'refined-concrete'}, + [21] = {tile = 'refined-concrete'}, + [22] = {tile = 'refined-concrete'}, + [23] = {tile = 'refined-concrete'}, + [24] = {tile = 'concrete'}, + [25] = {tile = 'concrete'}, + [26] = {tile = 'refined-concrete'}, + [27] = {tile = 'refined-concrete'}, + [28] = {tile = 'refined-concrete'}, + [29] = {tile = 'refined-concrete'}, + [30] = {tile = 'concrete'}, + [31] = {tile = 'concrete'}, + [32] = {tile = 'concrete'}, + [33] = {tile = 'concrete'}, + [34] = {tile = 'concrete'}, + [35] = {tile = 'concrete'}, + [36] = {tile = 'concrete'} +} + +local level4 = + ob.make_1_way { + force = 'neutral', + max_count = 1, + [1] = {tile = 'concrete'}, + [2] = {tile = 'concrete'}, + [3] = {tile = 'concrete'}, + [4] = {tile = 'concrete'}, + [5] = {tile = 'concrete'}, + [6] = {tile = 'concrete'}, + [7] = {tile = 'concrete'}, + [8] = {tile = 'refined-concrete'}, + [9] = {tile = 'refined-concrete'}, + [10] = {tile = 'refined-concrete'}, + [11] = {tile = 'refined-concrete'}, + [12] = {tile = 'concrete'}, + [13] = {tile = 'concrete'}, + [14] = {tile = 'refined-concrete'}, + [15] = {entity = {name = 'market', callback = 'market'}}, + [16] = {tile = 'refined-concrete'}, + [17] = {tile = 'refined-concrete'}, + [18] = {tile = 'concrete'}, + [19] = {tile = 'concrete'}, + [20] = {tile = 'refined-concrete'}, + [21] = {tile = 'refined-concrete'}, + [22] = {tile = 'refined-concrete'}, + [23] = {tile = 'refined-concrete'}, + [24] = {tile = 'concrete'}, + [25] = {tile = 'concrete'}, + [26] = {tile = 'refined-concrete'}, + [27] = {tile = 'refined-concrete'}, + [28] = {tile = 'refined-concrete'}, + [29] = {tile = 'refined-concrete'}, + [30] = {tile = 'concrete'}, + [31] = {tile = 'concrete'}, + [32] = {tile = 'concrete'}, + [33] = {tile = 'concrete'}, + [34] = {tile = 'concrete'}, + [35] = {tile = 'concrete'}, + [36] = {tile = 'concrete'} +} + +return {level2, level3, level4} diff --git a/map_gen/presets/crash_site/outpost_data/medium_gear_factory.lua b/map_gen/presets/crash_site/outpost_data/medium_gear_factory.lua new file mode 100644 index 00000000..a1fafe7b --- /dev/null +++ b/map_gen/presets/crash_site/outpost_data/medium_gear_factory.lua @@ -0,0 +1,195 @@ +local ob = require 'map_gen.presets.crash_site.outpost_builder' +local Token = require 'utils.global_token' + +local loot = { + {weight = 10}, + {stack = {name = 'coin', count = 1000, distance_factor = 1 / 2}, weight = 5}, + {stack = {name = 'iron-plate', count = 750, distance_factor = 1 / 2}, weight = 5}, + {stack = {name = 'steel-plate', count = 200, distance_factor = 1 / 5}, weight = 1}, + {stack = {name = 'iron-gear-wheel', count = 1500, distance_factor = 1}, weight = 5} +} + +local weights = ob.prepare_weighted_loot(loot) + +local loot_callback = + Token.register( + function(chest) + ob.do_random_loot(chest, weights, loot) + end +) + +local level2 = + ob.make_1_way { + force = 'neutral', + loot = {callback = loot_callback}, + [1] = {tile = 'concrete'}, + [2] = {tile = 'concrete'}, + [3] = {tile = 'concrete'}, + [4] = {tile = 'concrete'}, + [5] = {tile = 'concrete'}, + [6] = {tile = 'concrete'}, + [7] = {tile = 'concrete'}, + [8] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [9] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [10] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [11] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [12] = {tile = 'concrete'}, + [13] = {tile = 'concrete'}, + [14] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [15] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [16] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [17] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [18] = {tile = 'concrete'}, + [19] = {tile = 'concrete'}, + [20] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [21] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [22] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [23] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [24] = {tile = 'concrete'}, + [25] = {tile = 'concrete'}, + [26] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [27] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [28] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [29] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [30] = {tile = 'concrete'}, + [31] = {tile = 'concrete'}, + [32] = {tile = 'concrete'}, + [33] = {tile = 'concrete'}, + [34] = {tile = 'concrete'}, + [35] = {tile = 'concrete'}, + [36] = {tile = 'concrete'} +} + +local level3 = + ob.make_1_way { + force = 'neutral', + factory = { + callback = ob.magic_item_crafting_callback, + data = { + recipe = 'iron-gear-wheel', + output = {min_rate = 1 / 60, distance_factor = 1 / 60 / 100, item = 'iron-gear-wheel'} + } + }, + max_count = 6, + fallback = level2, + [1] = {tile = 'concrete'}, + [2] = {tile = 'concrete'}, + [3] = {tile = 'concrete'}, + [4] = {tile = 'concrete'}, + [5] = {tile = 'concrete'}, + [6] = {tile = 'concrete'}, + [7] = {tile = 'concrete'}, + [8] = {tile = 'refined-concrete'}, + [9] = {tile = 'refined-concrete'}, + [10] = {tile = 'refined-concrete'}, + [11] = {tile = 'refined-concrete'}, + [12] = {tile = 'concrete'}, + [13] = {tile = 'concrete'}, + [14] = {tile = 'refined-concrete'}, + [15] = {entity = {name = 'assembling-machine-2', callback = 'factory'}, tile = 'refined-concrete'}, + [16] = {tile = 'refined-concrete'}, + [17] = {tile = 'refined-concrete'}, + [18] = {tile = 'concrete'}, + [19] = {tile = 'concrete'}, + [20] = {tile = 'refined-concrete'}, + [21] = {tile = 'refined-concrete'}, + [22] = {tile = 'refined-concrete'}, + [23] = {tile = 'refined-concrete'}, + [24] = {tile = 'concrete'}, + [25] = {tile = 'concrete'}, + [26] = {tile = 'refined-concrete'}, + [27] = {tile = 'refined-concrete'}, + [28] = {tile = 'refined-concrete'}, + [29] = {tile = 'refined-concrete'}, + [30] = {tile = 'concrete'}, + [31] = {tile = 'concrete'}, + [32] = {tile = 'concrete'}, + [33] = {tile = 'concrete'}, + [34] = {tile = 'concrete'}, + [35] = {tile = 'concrete'}, + [36] = {tile = 'concrete'} +} + +local level4 = + ob.make_1_way { + force = 'neutral', + market = { + callback = ob.market_set_items_callback, + data = { + { + offer = {type = 'give-item', item = 'iron-gear-wheel', count = 100}, + name = 'coin', + price = 100, + distance_factor = 1 / 32, + min_price = 10 + }, + { + offer = {type = 'give-item', item = 'iron-plate', count = 100}, + name = 'coin', + price = 80, + distance_factor = 1 / 32, + min_price = 8 + }, + { + offer = {type = 'give-item', item = 'steel-plate', count = 100}, + name = 'coin', + price = 400, + distance_factor = 1 / 32, + min_price = 40 + } + } + }, + max_count = 1, + fallback = level3, + [1] = {tile = 'concrete'}, + [2] = {tile = 'concrete'}, + [3] = {tile = 'concrete'}, + [4] = {tile = 'concrete'}, + [5] = {tile = 'concrete'}, + [6] = {tile = 'concrete'}, + [7] = {tile = 'concrete'}, + [8] = {tile = 'refined-concrete'}, + [9] = {tile = 'refined-concrete'}, + [10] = {tile = 'refined-concrete'}, + [11] = {tile = 'refined-concrete'}, + [12] = {tile = 'concrete'}, + [13] = {tile = 'concrete'}, + [14] = {tile = 'refined-concrete'}, + [15] = {entity = {name = 'market', callback = 'market'}}, + [16] = {tile = 'refined-concrete'}, + [17] = {tile = 'refined-concrete'}, + [18] = {tile = 'concrete'}, + [19] = {tile = 'concrete'}, + [20] = {tile = 'refined-concrete'}, + [21] = {tile = 'refined-concrete'}, + [22] = {tile = 'refined-concrete'}, + [23] = {tile = 'refined-concrete'}, + [24] = {tile = 'concrete'}, + [25] = {tile = 'concrete'}, + [26] = {tile = 'refined-concrete'}, + [27] = {tile = 'refined-concrete'}, + [28] = {tile = 'refined-concrete'}, + [29] = {tile = 'refined-concrete'}, + [30] = {tile = 'concrete'}, + [31] = {tile = 'concrete'}, + [32] = {tile = 'concrete'}, + [33] = {tile = 'concrete'}, + [34] = {tile = 'concrete'}, + [35] = {tile = 'concrete'}, + [36] = {tile = 'concrete'} +} + +return { + settings = { + blocks = 7, + variance = 3, + min_step = 2, + max_level = 2 + }, + walls = { + require 'map_gen.presets.crash_site.outpost_data.medium_gun_turrets' + }, + bases = { + {level4, level2} + } +} diff --git a/map_gen/presets/crash_site/outpost_data/medium_gun_turrets.lua b/map_gen/presets/crash_site/outpost_data/medium_gun_turrets.lua index 3ac53fab..67975ca5 100644 --- a/map_gen/presets/crash_site/outpost_data/medium_gun_turrets.lua +++ b/map_gen/presets/crash_site/outpost_data/medium_gun_turrets.lua @@ -2,6 +2,7 @@ local ob = require 'map_gen.presets.crash_site.outpost_builder' return { ob.make_4_way { + turret = {callback = ob.refill_turret_callback, data = ob.piercing_rounds_magazine_ammo}, [1] = {entity = {name = 'stone-wall'}}, [2] = {entity = {name = 'stone-wall'}}, [3] = {entity = {name = 'stone-wall'}}, @@ -21,9 +22,9 @@ return { [17] = {tile = 'stone-path'}, [18] = {tile = 'stone-path'}, [19] = {tile = 'concrete'}, - [20] = {entity = {name = 'gun-turret', offset = 3}, tile = 'concrete'}, + [20] = {entity = {name = 'gun-turret', offset = 3, callback = 'turret'}, tile = 'concrete'}, [21] = {tile = 'concrete'}, - [22] = {entity = {name = 'gun-turret', offset = 3}, tile = 'concrete'}, + [22] = {entity = {name = 'gun-turret', offset = 3, callback = 'turret'}, tile = 'concrete'}, [23] = {tile = 'concrete'}, [24] = {tile = 'concrete'}, [25] = {tile = 'concrete'}, @@ -40,6 +41,7 @@ return { [36] = {tile = 'stone-path'} }, ob.make_4_way { + turret = {callback = ob.refill_turret_callback, data = ob.piercing_rounds_magazine_ammo}, [1] = {entity = {name = 'stone-wall'}}, [2] = {entity = {name = 'stone-wall'}}, [3] = {entity = {name = 'stone-wall'}}, @@ -56,7 +58,7 @@ return { [14] = {entity = {name = 'stone-wall'}}, [15] = {tile = 'stone-path'}, [16] = {tile = 'stone-path'}, - [17] = {entity = {name = 'gun-turret', offset = 3}, tile = 'stone-path'}, + [17] = {entity = {name = 'gun-turret', offset = 3, callback = 'turret'}, tile = 'stone-path'}, [18] = {tile = 'stone-path'}, [19] = {entity = {name = 'stone-wall'}}, [20] = {entity = {name = 'stone-wall'}}, @@ -66,7 +68,7 @@ return { [24] = {tile = 'concrete'}, [25] = {entity = {name = 'stone-wall'}}, [26] = {entity = {name = 'stone-wall'}}, - [27] = {entity = {name = 'gun-turret', offset = 3}, tile = 'stone-path'}, + [27] = {entity = {name = 'gun-turret', offset = 3, callback = 'turret'}, tile = 'stone-path'}, [28] = {tile = 'concrete'}, [29] = {tile = 'concrete'}, [30] = {tile = 'concrete'}, @@ -78,6 +80,7 @@ return { [36] = {tile = 'stone-path'} }, ob.make_4_way { + turret = {callback = ob.refill_turret_callback, data = ob.piercing_rounds_magazine_ammo}, [1] = {entity = {name = 'stone-wall'}}, [2] = {entity = {name = 'stone-wall'}}, [3] = {tile = 'stone-path'}, @@ -87,7 +90,7 @@ return { [7] = {entity = {name = 'stone-wall'}}, [8] = {entity = {name = 'stone-wall'}}, [9] = {tile = 'stone-path'}, - [10] = {entity = {name = 'gun-turret', offset = 3}, tile = 'concrete'}, + [10] = {entity = {name = 'gun-turret', offset = 3, callback = 'turret'}, tile = 'concrete'}, [11] = {tile = 'concrete'}, [12] = {tile = 'stone-path'}, [13] = {tile = 'stone-path'}, @@ -97,7 +100,7 @@ return { [17] = {tile = 'concrete'}, [18] = {tile = 'stone-path'}, [19] = {tile = 'concrete'}, - [20] = {entity = {name = 'gun-turret', offset = 3}, tile = 'concrete'}, + [20] = {entity = {name = 'gun-turret', offset = 3, callback = 'turret'}, tile = 'concrete'}, [21] = {tile = 'concrete'}, [22] = {tile = 'concrete'}, [23] = {tile = 'concrete'}, diff --git a/map_gen/presets/crash_site/outpost_data/medium_iron_plate_factory.lua b/map_gen/presets/crash_site/outpost_data/medium_iron_plate_factory.lua new file mode 100644 index 00000000..39662702 --- /dev/null +++ b/map_gen/presets/crash_site/outpost_data/medium_iron_plate_factory.lua @@ -0,0 +1,210 @@ +local ob = require 'map_gen.presets.crash_site.outpost_builder' +local Token = require 'utils.global_token' + +local loot = { + {weight = 5}, + {stack = {name = 'coin', count = 750, distance_factor = 1 / 2}, weight = 5}, + {stack = {name = 'iron-ore', count = 2400}, weight = 8}, + {stack = {name = 'iron-plate', count = 750, distance_factor = 1 / 2}, weight = 10}, + {stack = {name = 'steel-plate', count = 500, distance_factor = 1 / 5}, weight = 4} +} + +local weights = ob.prepare_weighted_loot(loot) + +local loot_callback = + Token.register( + function(chest) + ob.do_random_loot(chest, weights, loot) + end +) + +local level2 = + ob.make_1_way { + force = 'neutral', + loot = {callback = loot_callback}, + [1] = {tile = 'concrete'}, + [2] = {tile = 'concrete'}, + [3] = {tile = 'concrete'}, + [4] = {tile = 'concrete'}, + [5] = {tile = 'concrete'}, + [6] = {tile = 'concrete'}, + [7] = {tile = 'concrete'}, + [8] = {entity = {name = 'steel-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [9] = {entity = {name = 'steel-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [10] = {entity = {name = 'steel-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [11] = {entity = {name = 'steel-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [12] = {tile = 'concrete'}, + [13] = {tile = 'concrete'}, + [14] = {entity = {name = 'steel-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [15] = {entity = {name = 'steel-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [16] = {entity = {name = 'steel-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [17] = {entity = {name = 'steel-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [18] = {tile = 'concrete'}, + [19] = {tile = 'concrete'}, + [20] = {entity = {name = 'steel-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [21] = {entity = {name = 'steel-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [22] = {entity = {name = 'steel-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [23] = {entity = {name = 'steel-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [24] = {tile = 'concrete'}, + [25] = {tile = 'concrete'}, + [26] = {entity = {name = 'steel-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [27] = {entity = {name = 'steel-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [28] = {entity = {name = 'steel-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [29] = {entity = {name = 'steel-chest', callback = 'loot'}, tile = 'refined-concrete'}, + [30] = {tile = 'concrete'}, + [31] = {tile = 'concrete'}, + [32] = {tile = 'concrete'}, + [33] = {tile = 'concrete'}, + [34] = {tile = 'concrete'}, + [35] = {tile = 'concrete'}, + [36] = {tile = 'concrete'} +} + +local level3 = + ob.make_1_way { + force = 'neutral', + factory = { + callback = ob.magic_item_crafting_callback, + data = { + furance_item = 'iron-ore', + output = {min_rate = 1.5 / 60, distance_factor = 1.5 / 60 / 100, item = 'iron-plate'} + } + }, + max_count = 6, + fallback = level2, + [1] = {tile = 'concrete'}, + [2] = {tile = 'concrete'}, + [3] = {tile = 'concrete'}, + [4] = {tile = 'concrete'}, + [5] = {tile = 'concrete'}, + [6] = {tile = 'concrete'}, + [7] = {tile = 'concrete'}, + [8] = {tile = 'refined-concrete'}, + [9] = {tile = 'refined-concrete'}, + [10] = {tile = 'refined-concrete'}, + [11] = {tile = 'refined-concrete'}, + [12] = {tile = 'concrete'}, + [13] = {tile = 'concrete'}, + [14] = {tile = 'refined-concrete'}, + [15] = {entity = {name = 'electric-furnace', callback = 'factory'}, tile = 'refined-concrete'}, + [16] = {tile = 'refined-concrete'}, + [17] = {tile = 'refined-concrete'}, + [18] = {tile = 'concrete'}, + [19] = {tile = 'concrete'}, + [20] = {tile = 'refined-concrete'}, + [21] = {tile = 'refined-concrete'}, + [22] = {tile = 'refined-concrete'}, + [23] = {tile = 'refined-concrete'}, + [24] = {tile = 'concrete'}, + [25] = {tile = 'concrete'}, + [26] = {tile = 'refined-concrete'}, + [27] = {tile = 'refined-concrete'}, + [28] = {tile = 'refined-concrete'}, + [29] = {tile = 'refined-concrete'}, + [30] = {tile = 'concrete'}, + [31] = {tile = 'concrete'}, + [32] = {tile = 'concrete'}, + [33] = {tile = 'concrete'}, + [34] = {tile = 'concrete'}, + [35] = {tile = 'concrete'}, + [36] = {tile = 'concrete'} +} + +local level3b = + ob.extend_1_way( + level3, + { + factory = { + callback = ob.magic_item_crafting_callback, + data = { + furance_item = {name = 'iron-plate', count = 100}, + output = {min_rate = 1.5 / 60, distance_factor = 1.5 / 60 / 100, item = 'steel-plate'} + } + } + } +) + +local level4 = + ob.make_1_way { + force = 'neutral', + market = { + callback = ob.market_set_items_callback, + data = { + { + offer = {type = 'give-item', item = 'iron-plate', count = 100}, + name = 'coin', + price = 60, + distance_factor = 1 / 32, + min_price = 6 + }, + { + offer = {type = 'give-item', item = 'steel-plate', count = 100}, + name = 'coin', + price = 300, + distance_factor = 1 / 32, + min_price = 30 + } + } + }, + max_count = 1, + fallback = level3, + [1] = {tile = 'concrete'}, + [2] = {tile = 'concrete'}, + [3] = {tile = 'concrete'}, + [4] = {tile = 'concrete'}, + [5] = {tile = 'concrete'}, + [6] = {tile = 'concrete'}, + [7] = {tile = 'concrete'}, + [8] = {tile = 'refined-concrete'}, + [9] = {tile = 'refined-concrete'}, + [10] = {tile = 'refined-concrete'}, + [11] = {tile = 'refined-concrete'}, + [12] = {tile = 'concrete'}, + [13] = {tile = 'concrete'}, + [14] = {tile = 'refined-concrete'}, + [15] = {entity = {name = 'market', callback = 'market'}}, + [16] = {tile = 'refined-concrete'}, + [17] = {tile = 'refined-concrete'}, + [18] = {tile = 'concrete'}, + [19] = {tile = 'concrete'}, + [20] = {tile = 'refined-concrete'}, + [21] = {tile = 'refined-concrete'}, + [22] = {tile = 'refined-concrete'}, + [23] = {tile = 'refined-concrete'}, + [24] = {tile = 'concrete'}, + [25] = {tile = 'concrete'}, + [26] = {tile = 'refined-concrete'}, + [27] = {tile = 'refined-concrete'}, + [28] = {tile = 'refined-concrete'}, + [29] = {tile = 'refined-concrete'}, + [30] = {tile = 'concrete'}, + [31] = {tile = 'concrete'}, + [32] = {tile = 'concrete'}, + [33] = {tile = 'concrete'}, + [34] = {tile = 'concrete'}, + [35] = {tile = 'concrete'}, + [36] = {tile = 'concrete'} +} + +local level4b = + ob.extend_1_way( + level4, + { + fallback = level3b + } +) + +return { + settings = { + blocks = 7, + variance = 3, + min_step = 2, + max_level = 2 + }, + walls = { + require 'map_gen.presets.crash_site.outpost_data.medium_gun_turrets' + }, + bases = { + {level4, level4, level4b, level2} + } +} diff --git a/map_gen/presets/crash_site/outpost_data/small_circuit_factory.lua b/map_gen/presets/crash_site/outpost_data/small_circuit_factory.lua new file mode 100644 index 00000000..28c30f72 --- /dev/null +++ b/map_gen/presets/crash_site/outpost_data/small_circuit_factory.lua @@ -0,0 +1,90 @@ +local ob = require 'map_gen.presets.crash_site.outpost_builder' + +local Token = require 'utils.global_token' + +local loot = { + {weight = 10}, + {stack = {name = 'coin', count = 500, distance_factor = 1 / 2}, weight = 5}, + {stack = {name = 'iron-plate', count = 200, distance_factor = 1 / 2}, weight = 5}, + {stack = {name = 'copper-cable', count = 300, distance_factor = 3 / 4}, weight = 5}, + {stack = {name = 'electronic-circuit', count = 400, distance_factor = 1}, weight = 5}, + {stack = {name = 'advanced-circuit', count = 200, distance_factor = 1 / 10}, weight = 1} +} + +local factory = { + callback = ob.magic_item_crafting_callback, + data = { + recipe = 'electronic-circuit', + output = {min_rate = 1 / 60, distance_factor = 1 / 60 / 100, item = 'electronic-circuit'} + } +} + +local market = { + callback = ob.market_set_items_callback, + data = { + { + offer = {type = 'give-item', item = 'copper-cable', count = 200}, + name = 'coin', + price = 50, + distance_factor = 1 / 32, + min_price = 5 + }, + { + offer = {type = 'give-item', item = 'electronic-circuit', count = 200}, + name = 'coin', + price = 200, + distance_factor = 1 / 32, + min_price = 10 + }, + { + offer = {type = 'give-item', item = 'advanced-circuit', count = 200}, + name = 'coin', + price = 2000, + distance_factor = 1 / 32, + min_price = 100 + } + } +} + +local weights = ob.prepare_weighted_loot(loot) + +local loot_callback = + Token.register( + function(chest) + ob.do_random_loot(chest, weights, loot) + end +) + +local base_factory = require 'map_gen.presets.crash_site.outpost_data.small_factory' + +local level2 = ob.extend_1_way(base_factory[1], {loot = {callback = loot_callback}}) +local level3 = + ob.extend_1_way( + base_factory[2], + { + factory = factory, + fallback = level2 + } +) +local level4 = + ob.extend_1_way( + base_factory[3], + { + market = market, + fallback = level3 + } +) +return { + settings = { + blocks = 6, + variance = 3, + min_step = 2, + max_level = 2 + }, + walls = { + require 'map_gen.presets.crash_site.outpost_data.light_laser_turrets' + }, + bases = { + {level4, level2} + } +} diff --git a/map_gen/presets/crash_site/outpost_data/small_factory.lua b/map_gen/presets/crash_site/outpost_data/small_factory.lua new file mode 100644 index 00000000..435d3684 --- /dev/null +++ b/map_gen/presets/crash_site/outpost_data/small_factory.lua @@ -0,0 +1,132 @@ +local ob = require 'map_gen.presets.crash_site.outpost_builder' + +local level2 = + ob.make_1_way { + force = 'neutral', + [1] = {tile = 'stone-path'}, + [2] = {tile = 'stone-path'}, + [3] = {tile = 'stone-path'}, + [4] = {tile = 'stone-path'}, + [5] = {tile = 'stone-path'}, + [6] = {tile = 'stone-path'}, + [7] = {tile = 'stone-path'}, + [8] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'concrete'}, + [9] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'concrete'}, + [10] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'concrete'}, + [11] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'concrete'}, + [12] = {tile = 'stone-path'}, + [13] = {tile = 'stone-path'}, + [14] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'concrete'}, + [15] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'concrete'}, + [16] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'concrete'}, + [17] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'concrete'}, + [18] = {tile = 'stone-path'}, + [19] = {tile = 'stone-path'}, + [20] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'concrete'}, + [21] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'concrete'}, + [22] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'concrete'}, + [23] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'concrete'}, + [24] = {tile = 'stone-path'}, + [25] = {tile = 'stone-path'}, + [26] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'concrete'}, + [27] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'concrete'}, + [28] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'concrete'}, + [29] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'concrete'}, + [30] = {tile = 'stone-path'}, + [31] = {tile = 'stone-path'}, + [32] = {tile = 'stone-path'}, + [33] = {tile = 'stone-path'}, + [34] = {tile = 'stone-path'}, + [35] = {tile = 'stone-path'}, + [36] = {tile = 'stone-path'} +} + +local level3 = + ob.make_1_way { + force = 'neutral', + max_count = 4, + [1] = {tile = 'stone-path'}, + [2] = {tile = 'stone-path'}, + [3] = {tile = 'stone-path'}, + [4] = {tile = 'stone-path'}, + [5] = {tile = 'stone-path'}, + [6] = {tile = 'stone-path'}, + [7] = {tile = 'stone-path'}, + [8] = {tile = 'concrete'}, + [9] = {tile = 'concrete'}, + [10] = {tile = 'concrete'}, + [11] = {tile = 'concrete'}, + [12] = {tile = 'stone-path'}, + [13] = {tile = 'stone-path'}, + [14] = {tile = 'concrete'}, + [15] = {entity = {name = 'assembling-machine-2', callback = 'factory'}, tile = 'concrete'}, + [16] = {tile = 'concrete'}, + [17] = {tile = 'concrete'}, + [18] = {tile = 'stone-path'}, + [19] = {tile = 'stone-path'}, + [20] = {tile = 'concrete'}, + [21] = {tile = 'concrete'}, + [22] = {tile = 'concrete'}, + [23] = {tile = 'concrete'}, + [24] = {tile = 'stone-path'}, + [25] = {tile = 'stone-path'}, + [26] = {tile = 'concrete'}, + [27] = {tile = 'concrete'}, + [28] = {tile = 'concrete'}, + [29] = {tile = 'concrete'}, + [30] = {tile = 'stone-path'}, + [31] = {tile = 'stone-path'}, + [32] = {tile = 'stone-path'}, + [33] = {tile = 'stone-path'}, + [34] = {tile = 'stone-path'}, + [35] = {tile = 'stone-path'}, + [36] = {tile = 'stone-path'} +} + +local level4 = + ob.make_1_way { + force = 'neutral', + max_count = 1, + [1] = {tile = 'stone-path'}, + [2] = {tile = 'stone-path'}, + [3] = {tile = 'stone-path'}, + [4] = {tile = 'stone-path'}, + [5] = {tile = 'stone-path'}, + [6] = {tile = 'stone-path'}, + [7] = {tile = 'stone-path'}, + [8] = {tile = 'concrete'}, + [9] = {tile = 'concrete'}, + [10] = {tile = 'concrete'}, + [11] = {tile = 'concrete'}, + [12] = {tile = 'stone-path'}, + [13] = {tile = 'stone-path'}, + [14] = {tile = 'concrete'}, + [15] = {entity = {name = 'market', callback = 'market'}}, + [16] = {tile = 'concrete'}, + [17] = {tile = 'concrete'}, + [18] = {tile = 'stone-path'}, + [19] = {tile = 'stone-path'}, + [20] = {tile = 'concrete'}, + [21] = {tile = 'concrete'}, + [22] = {tile = 'concrete'}, + [23] = {tile = 'concrete'}, + [24] = {tile = 'stone-path'}, + [25] = {tile = 'stone-path'}, + [26] = {tile = 'concrete'}, + [27] = {tile = 'concrete'}, + [28] = {tile = 'concrete'}, + [29] = {tile = 'concrete'}, + [30] = {tile = 'stone-path'}, + [31] = {tile = 'stone-path'}, + [32] = {tile = 'stone-path'}, + [33] = {tile = 'stone-path'}, + [34] = {tile = 'stone-path'}, + [35] = {tile = 'stone-path'}, + [36] = {tile = 'stone-path'} +} + +return { + level2, + level3, + level4 +} diff --git a/map_gen/presets/crash_site/outpost_data/small_gear_factory.lua b/map_gen/presets/crash_site/outpost_data/small_gear_factory.lua new file mode 100644 index 00000000..dc6cc95e --- /dev/null +++ b/map_gen/presets/crash_site/outpost_data/small_gear_factory.lua @@ -0,0 +1,195 @@ +local ob = require 'map_gen.presets.crash_site.outpost_builder' +local Token = require 'utils.global_token' + +local loot = { + {weight = 10}, + {stack = {name = 'coin', count = 500, distance_factor = 1 / 2}, weight = 5}, + {stack = {name = 'iron-plate', count = 500, distance_factor = 1 / 2}, weight = 5}, + {stack = {name = 'steel-plate', count = 100, distance_factor = 1 / 5}, weight = 1}, + {stack = {name = 'iron-gear-wheel', count = 1000, distance_factor = 1}, weight = 5} +} + +local weights = ob.prepare_weighted_loot(loot) + +local loot_callback = + Token.register( + function(chest) + ob.do_random_loot(chest, weights, loot) + end +) + +local level2 = + ob.make_1_way { + force = 'neutral', + loot = {callback = loot_callback}, + [1] = {tile = 'stone-path'}, + [2] = {tile = 'stone-path'}, + [3] = {tile = 'stone-path'}, + [4] = {tile = 'stone-path'}, + [5] = {tile = 'stone-path'}, + [6] = {tile = 'stone-path'}, + [7] = {tile = 'stone-path'}, + [8] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'concrete'}, + [9] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'concrete'}, + [10] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'concrete'}, + [11] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'concrete'}, + [12] = {tile = 'stone-path'}, + [13] = {tile = 'stone-path'}, + [14] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'concrete'}, + [15] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'concrete'}, + [16] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'concrete'}, + [17] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'concrete'}, + [18] = {tile = 'stone-path'}, + [19] = {tile = 'stone-path'}, + [20] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'concrete'}, + [21] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'concrete'}, + [22] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'concrete'}, + [23] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'concrete'}, + [24] = {tile = 'stone-path'}, + [25] = {tile = 'stone-path'}, + [26] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'concrete'}, + [27] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'concrete'}, + [28] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'concrete'}, + [29] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'concrete'}, + [30] = {tile = 'stone-path'}, + [31] = {tile = 'stone-path'}, + [32] = {tile = 'stone-path'}, + [33] = {tile = 'stone-path'}, + [34] = {tile = 'stone-path'}, + [35] = {tile = 'stone-path'}, + [36] = {tile = 'stone-path'} +} + +local level3 = + ob.make_1_way { + force = 'neutral', + factory = { + callback = ob.magic_item_crafting_callback, + data = { + recipe = 'iron-gear-wheel', + output = {min_rate = 1 / 60, distance_factor = 1 / 60 / 100, item = 'iron-gear-wheel'} + } + }, + max_count = 4, + fallback = level2, + [1] = {tile = 'stone-path'}, + [2] = {tile = 'stone-path'}, + [3] = {tile = 'stone-path'}, + [4] = {tile = 'stone-path'}, + [5] = {tile = 'stone-path'}, + [6] = {tile = 'stone-path'}, + [7] = {tile = 'stone-path'}, + [8] = {tile = 'concrete'}, + [9] = {tile = 'concrete'}, + [10] = {tile = 'concrete'}, + [11] = {tile = 'concrete'}, + [12] = {tile = 'stone-path'}, + [13] = {tile = 'stone-path'}, + [14] = {tile = 'concrete'}, + [15] = {entity = {name = 'assembling-machine-2', callback = 'factory'}, tile = 'concrete'}, + [16] = {tile = 'concrete'}, + [17] = {tile = 'concrete'}, + [18] = {tile = 'stone-path'}, + [19] = {tile = 'stone-path'}, + [20] = {tile = 'concrete'}, + [21] = {tile = 'concrete'}, + [22] = {tile = 'concrete'}, + [23] = {tile = 'concrete'}, + [24] = {tile = 'stone-path'}, + [25] = {tile = 'stone-path'}, + [26] = {tile = 'concrete'}, + [27] = {tile = 'concrete'}, + [28] = {tile = 'concrete'}, + [29] = {tile = 'concrete'}, + [30] = {tile = 'stone-path'}, + [31] = {tile = 'stone-path'}, + [32] = {tile = 'stone-path'}, + [33] = {tile = 'stone-path'}, + [34] = {tile = 'stone-path'}, + [35] = {tile = 'stone-path'}, + [36] = {tile = 'stone-path'} +} + +local level4 = + ob.make_1_way { + force = 'neutral', + market = { + callback = ob.market_set_items_callback, + data = { + { + offer = {type = 'give-item', item = 'iron-gear-wheel', count = 100}, + name = 'coin', + price = 100, + distance_factor = 1 / 32, + min_price = 10 + }, + { + offer = {type = 'give-item', item = 'iron-plate', count = 100}, + name = 'coin', + price = 80, + distance_factor = 1 / 32, + min_price = 8 + }, + { + offer = {type = 'give-item', item = 'steel-plate', count = 100}, + name = 'coin', + price = 400, + distance_factor = 1 / 32, + min_price = 40 + } + } + }, + max_count = 1, + fallback = level3, + [1] = {tile = 'stone-path'}, + [2] = {tile = 'stone-path'}, + [3] = {tile = 'stone-path'}, + [4] = {tile = 'stone-path'}, + [5] = {tile = 'stone-path'}, + [6] = {tile = 'stone-path'}, + [7] = {tile = 'stone-path'}, + [8] = {tile = 'concrete'}, + [9] = {tile = 'concrete'}, + [10] = {tile = 'concrete'}, + [11] = {tile = 'concrete'}, + [12] = {tile = 'stone-path'}, + [13] = {tile = 'stone-path'}, + [14] = {tile = 'concrete'}, + [15] = {entity = {name = 'market', callback = 'market'}}, + [16] = {tile = 'concrete'}, + [17] = {tile = 'concrete'}, + [18] = {tile = 'stone-path'}, + [19] = {tile = 'stone-path'}, + [20] = {tile = 'concrete'}, + [21] = {tile = 'concrete'}, + [22] = {tile = 'concrete'}, + [23] = {tile = 'concrete'}, + [24] = {tile = 'stone-path'}, + [25] = {tile = 'stone-path'}, + [26] = {tile = 'concrete'}, + [27] = {tile = 'concrete'}, + [28] = {tile = 'concrete'}, + [29] = {tile = 'concrete'}, + [30] = {tile = 'stone-path'}, + [31] = {tile = 'stone-path'}, + [32] = {tile = 'stone-path'}, + [33] = {tile = 'stone-path'}, + [34] = {tile = 'stone-path'}, + [35] = {tile = 'stone-path'}, + [36] = {tile = 'stone-path'} +} + +return { + settings = { + blocks = 6, + variance = 3, + min_step = 2, + max_level = 2 + }, + walls = { + require 'map_gen.presets.crash_site.outpost_data.light_gun_turrets' + }, + bases = { + {level4, level2} + } +} diff --git a/map_gen/presets/crash_site/outpost_data/small_iron_plate_factory.lua b/map_gen/presets/crash_site/outpost_data/small_iron_plate_factory.lua new file mode 100644 index 00000000..e3ced7cf --- /dev/null +++ b/map_gen/presets/crash_site/outpost_data/small_iron_plate_factory.lua @@ -0,0 +1,188 @@ +local ob = require 'map_gen.presets.crash_site.outpost_builder' +local Token = require 'utils.global_token' + +local loot = { + {weight = 5}, + {stack = {name = 'coin', count = 500, distance_factor = 1 / 2}, weight = 5}, + {stack = {name = 'iron-ore', count = 1600}, weight = 8}, + {stack = {name = 'iron-plate', count = 500, distance_factor = 1 / 2}, weight = 10}, + {stack = {name = 'steel-plate', count = 250, distance_factor = 1 / 5}, weight = 2} +} + +local weights = ob.prepare_weighted_loot(loot) + +local loot_callback = + Token.register( + function(chest) + ob.do_random_loot(chest, weights, loot) + end +) + +local level2 = + ob.make_1_way { + force = 'neutral', + loot = {callback = loot_callback}, + [1] = {tile = 'stone-path'}, + [2] = {tile = 'stone-path'}, + [3] = {tile = 'stone-path'}, + [4] = {tile = 'stone-path'}, + [5] = {tile = 'stone-path'}, + [6] = {tile = 'stone-path'}, + [7] = {tile = 'stone-path'}, + [8] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'concrete'}, + [9] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'concrete'}, + [10] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'concrete'}, + [11] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'concrete'}, + [12] = {tile = 'stone-path'}, + [13] = {tile = 'stone-path'}, + [14] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'concrete'}, + [15] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'concrete'}, + [16] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'concrete'}, + [17] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'concrete'}, + [18] = {tile = 'stone-path'}, + [19] = {tile = 'stone-path'}, + [20] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'concrete'}, + [21] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'concrete'}, + [22] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'concrete'}, + [23] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'concrete'}, + [24] = {tile = 'stone-path'}, + [25] = {tile = 'stone-path'}, + [26] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'concrete'}, + [27] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'concrete'}, + [28] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'concrete'}, + [29] = {entity = {name = 'iron-chest', callback = 'loot'}, tile = 'concrete'}, + [30] = {tile = 'stone-path'}, + [31] = {tile = 'stone-path'}, + [32] = {tile = 'stone-path'}, + [33] = {tile = 'stone-path'}, + [34] = {tile = 'stone-path'}, + [35] = {tile = 'stone-path'}, + [36] = {tile = 'stone-path'} +} + +local level3 = + ob.make_1_way { + force = 'neutral', + factory = { + callback = ob.magic_item_crafting_callback, + data = { + furance_item = 'iron-ore', + output = {min_rate = 1.5 / 60, distance_factor = 1.5 / 60 / 100, item = 'iron-plate'} + } + }, + max_count = 4, + fallback = level2, + [1] = {tile = 'stone-path'}, + [2] = {tile = 'stone-path'}, + [3] = {tile = 'stone-path'}, + [4] = {tile = 'stone-path'}, + [5] = {tile = 'stone-path'}, + [6] = {tile = 'stone-path'}, + [7] = {tile = 'stone-path'}, + [8] = {tile = 'concrete'}, + [9] = {tile = 'concrete'}, + [10] = {tile = 'concrete'}, + [11] = {tile = 'concrete'}, + [12] = {tile = 'stone-path'}, + [13] = {tile = 'stone-path'}, + [14] = {tile = 'concrete'}, + [15] = {entity = {name = 'electric-furnace', callback = 'factory'}, tile = 'concrete'}, + [16] = {tile = 'concrete'}, + [17] = {tile = 'concrete'}, + [18] = {tile = 'stone-path'}, + [19] = {tile = 'stone-path'}, + [20] = {tile = 'concrete'}, + [21] = {tile = 'concrete'}, + [22] = {tile = 'concrete'}, + [23] = {tile = 'concrete'}, + [24] = {tile = 'stone-path'}, + [25] = {tile = 'stone-path'}, + [26] = {tile = 'concrete'}, + [27] = {tile = 'concrete'}, + [28] = {tile = 'concrete'}, + [29] = {tile = 'concrete'}, + [30] = {tile = 'stone-path'}, + [31] = {tile = 'stone-path'}, + [32] = {tile = 'stone-path'}, + [33] = {tile = 'stone-path'}, + [34] = {tile = 'stone-path'}, + [35] = {tile = 'stone-path'}, + [36] = {tile = 'stone-path'} +} + +local level4 = + ob.make_1_way { + force = 'neutral', + market = { + callback = ob.market_set_items_callback, + data = { + { + offer = {type = 'give-item', item = 'iron-plate', count = 100}, + name = 'coin', + price = 60, + distance_factor = 1 / 32, + min_price = 6 + }, + { + offer = {type = 'give-item', item = 'steel-plate', count = 100}, + name = 'coin', + price = 300, + distance_factor = 1 / 32, + min_price = 30 + } + } + }, + max_count = 1, + fallback = level3, + [1] = {tile = 'stone-path'}, + [2] = {tile = 'stone-path'}, + [3] = {tile = 'stone-path'}, + [4] = {tile = 'stone-path'}, + [5] = {tile = 'stone-path'}, + [6] = {tile = 'stone-path'}, + [7] = {tile = 'stone-path'}, + [8] = {tile = 'concrete'}, + [9] = {tile = 'concrete'}, + [10] = {tile = 'concrete'}, + [11] = {tile = 'concrete'}, + [12] = {tile = 'stone-path'}, + [13] = {tile = 'stone-path'}, + [14] = {tile = 'concrete'}, + [15] = {entity = {name = 'market', callback = 'market'}}, + [16] = {tile = 'concrete'}, + [17] = {tile = 'concrete'}, + [18] = {tile = 'stone-path'}, + [19] = {tile = 'stone-path'}, + [20] = {tile = 'concrete'}, + [21] = {tile = 'concrete'}, + [22] = {tile = 'concrete'}, + [23] = {tile = 'concrete'}, + [24] = {tile = 'stone-path'}, + [25] = {tile = 'stone-path'}, + [26] = {tile = 'concrete'}, + [27] = {tile = 'concrete'}, + [28] = {tile = 'concrete'}, + [29] = {tile = 'concrete'}, + [30] = {tile = 'stone-path'}, + [31] = {tile = 'stone-path'}, + [32] = {tile = 'stone-path'}, + [33] = {tile = 'stone-path'}, + [34] = {tile = 'stone-path'}, + [35] = {tile = 'stone-path'}, + [36] = {tile = 'stone-path'} +} + +return { + settings = { + blocks = 6, + variance = 3, + min_step = 2, + max_level = 2 + }, + walls = { + require 'map_gen.presets.crash_site.outpost_data.light_gun_turrets' + }, + bases = { + {level4, level2} + } +}