mirror of
https://github.com/Refactorio/RedMew.git
synced 2025-11-06 09:09:26 +02:00
updates
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
_DEBUG = true
|
||||
_DEBUG = false
|
||||
|
||||
global.scenario = {}
|
||||
global.spys = {"valansch", "air20"}
|
||||
global.spys = {'valansch', 'air20'}
|
||||
global.scenario.variables = {}
|
||||
global.scenario.variables.player_positions = {}
|
||||
global.player_walk_distances = {}
|
||||
@@ -9,5 +9,5 @@ global.scenario.variables.player_deaths = {}
|
||||
global.scenario.config = {}
|
||||
global.scenario.custom_functions = {}
|
||||
global.scenario.config.nuke_min_time_hours = 3 --how long a player must be on the server to be allowed to use the nuke
|
||||
global.newline = "\n"
|
||||
newline = "\n"
|
||||
global.newline = '\n'
|
||||
newline = '\n'
|
||||
|
||||
@@ -29,11 +29,11 @@ local Event = require 'utils.event'
|
||||
|
||||
local function player_joined(event)
|
||||
local player = game.players[event.player_index]
|
||||
player.insert {name = 'raw-fish', count = 4}
|
||||
player.insert {name = 'coin', count = 10}
|
||||
player.insert {name = 'iron-gear-wheel', count = 8}
|
||||
player.insert {name = 'iron-plate', count = 16}
|
||||
player.print('Welcome to our Server. You can join our Discord at: redmew.com/discord')
|
||||
player.print('And remember.. Keep Calm And Spaghetti!')
|
||||
player.print('And remember.. Keep Calm And Spaghetti!')
|
||||
end
|
||||
|
||||
function walkabout(player_name, distance)
|
||||
|
||||
@@ -8,42 +8,11 @@ local Random = require 'map_gen.shared.random'
|
||||
local OutpostBuilder = require 'map_gen.presets.crash_site.outpost_builder'
|
||||
|
||||
local outpost_seed = 1000
|
||||
local ore_seed = 1000
|
||||
|
||||
local outpost_blocks = 9
|
||||
local outpost_variance = 3
|
||||
local outpost_min_step = 2
|
||||
local outpost_max_level = 4
|
||||
local outpost_random = Random.new(outpost_seed, outpost_seed * 2)
|
||||
|
||||
local outpost_builder = OutpostBuilder.new(outpost_seed)
|
||||
|
||||
local walls = require 'map_gen.presets.crash_site.outpost_data.walls'
|
||||
local thin_walls = require 'map_gen.presets.crash_site.outpost_data.thin_walls'
|
||||
|
||||
local light_gun_turrets = require 'map_gen.presets.crash_site.outpost_data.light_gun_turrets'
|
||||
local medium_gun_turrets = require 'map_gen.presets.crash_site.outpost_data.medium_gun_turrets'
|
||||
local heavy_gun_turrets = require 'map_gen.presets.crash_site.outpost_data.heavy_gun_turrets'
|
||||
local light_flame_turrets = require 'map_gen.presets.crash_site.outpost_data.light_flame_turrets'
|
||||
local laser_turrets = require 'map_gen.presets.crash_site.outpost_data.light_laser_turrets'
|
||||
local small_worm_turrets = require 'map_gen.presets.crash_site.outpost_data.small_worm_turrets'
|
||||
|
||||
local medium_gun_turrets_player = OutpostBuilder.extend_walls(medium_gun_turrets, {force = 'player'})
|
||||
local laser_turrets_player =
|
||||
OutpostBuilder.extend_walls(
|
||||
laser_turrets,
|
||||
{
|
||||
force = 'player',
|
||||
turret = {callback = OutpostBuilder.power_source_callback, data = {buffer_size = 24, power_production = 4}}
|
||||
}
|
||||
)
|
||||
|
||||
local gear_factory = require 'map_gen.presets.crash_site.outpost_data.gear_factory'
|
||||
local iron_plate_factory = require 'map_gen.presets.crash_site.outpost_data.iron_plate_factory'
|
||||
local oil_refinery_factory = require 'map_gen.presets.crash_site.outpost_data.oil_refinery_factory'
|
||||
|
||||
local grid_size = (outpost_blocks + 2) * 6
|
||||
local half_grid_size = grid_size * 0.5
|
||||
|
||||
local et = OutpostBuilder.empty_template
|
||||
local outpost_builder = OutpostBuilder.new(outpost_random)
|
||||
|
||||
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'
|
||||
@@ -73,64 +42,387 @@ local small_science_factory = require 'map_gen.presets.crash_site.outpost_data.s
|
||||
local medium_science_factory = require 'map_gen.presets.crash_site.outpost_data.medium_science_factory'
|
||||
local big_science_factory = require 'map_gen.presets.crash_site.outpost_data.big_science_factory'
|
||||
|
||||
local small_oil_refinery = require 'map_gen.presets.crash_site.outpost_data.small_oil_refinery'
|
||||
local medium_oil_refinery = require 'map_gen.presets.crash_site.outpost_data.medium_oil_refinery'
|
||||
local big_oil_refinery = require 'map_gen.presets.crash_site.outpost_data.big_oil_refinery'
|
||||
|
||||
local small_chemical_factory = require 'map_gen.presets.crash_site.outpost_data.small_chemical_factory'
|
||||
local medium_chemical_factory = require 'map_gen.presets.crash_site.outpost_data.medium_chemical_factory'
|
||||
local big_chemical_factory = require 'map_gen.presets.crash_site.outpost_data.big_chemical_factory'
|
||||
|
||||
local stage1 = {
|
||||
{}
|
||||
small_iron_plate_factory,
|
||||
small_copper_plate_factory,
|
||||
small_gear_factory,
|
||||
small_circuit_factory,
|
||||
small_engine_factory,
|
||||
small_ammo_factory,
|
||||
small_science_factory,
|
||||
small_oil_refinery,
|
||||
small_chemical_factory
|
||||
}
|
||||
|
||||
local pattern = {}
|
||||
for r = 1, 100 do
|
||||
local row = {}
|
||||
pattern[r] = row
|
||||
for c = 1, 100 do
|
||||
row[c] = outpost_builder:do_outpost(medium_ammo_factory)
|
||||
local stage2 = {
|
||||
medium_iron_plate_factory,
|
||||
medium_copper_plate_factory,
|
||||
medium_gear_factory,
|
||||
medium_circuit_factory,
|
||||
medium_engine_factory,
|
||||
medium_ammo_factory,
|
||||
medium_science_factory,
|
||||
medium_oil_refinery,
|
||||
medium_chemical_factory
|
||||
}
|
||||
|
||||
local stage3 = {
|
||||
big_iron_plate_factory,
|
||||
big_copper_plate_factory,
|
||||
big_gear_factory,
|
||||
big_circuit_factory,
|
||||
big_engine_factory,
|
||||
big_ammo_factory,
|
||||
big_science_factory,
|
||||
big_oil_refinery,
|
||||
big_chemical_factory
|
||||
}
|
||||
|
||||
local function fast_remove(tbl, index)
|
||||
local count = #tbl
|
||||
if index > count then
|
||||
return
|
||||
elseif index < count then
|
||||
tbl[index] = tbl[count]
|
||||
end
|
||||
|
||||
tbl[count] = nil
|
||||
end
|
||||
|
||||
local function itertor_builder(arr, random)
|
||||
local copy = {}
|
||||
|
||||
return function()
|
||||
if #copy == 0 then
|
||||
for i = 1, #arr do
|
||||
copy[i] = arr[i]
|
||||
end
|
||||
end
|
||||
|
||||
local i = random:next_int(1, #copy)
|
||||
local res = copy[i]
|
||||
|
||||
fast_remove(copy, i)
|
||||
|
||||
return res
|
||||
end
|
||||
end
|
||||
|
||||
local outposts = b.grid_pattern(pattern, 100, 100, grid_size, grid_size)
|
||||
outposts = b.if_else(outposts, b.full_shape)
|
||||
local stage1_iter = itertor_builder(stage1, outpost_random)
|
||||
local stage2_iter = itertor_builder(stage2, outpost_random)
|
||||
local stage3_iter = itertor_builder(stage3, outpost_random)
|
||||
|
||||
local thin_walls_player = OutpostBuilder.extend_walls(thin_walls, {force = 'player'})
|
||||
local thin_walls = require 'map_gen.presets.crash_site.outpost_data.thin_walls'
|
||||
|
||||
local start_outpost = outpost_builder:do_outpost(thin_walls)
|
||||
|
||||
local function remove_water(shape)
|
||||
return function(x, y, world)
|
||||
local tile = shape(x, y, world)
|
||||
|
||||
if type(tile) == 'table' then
|
||||
local gen_tile = world.surface.get_tile(world.x, world.y)
|
||||
if gen_tile.collides_with('water-tile') then
|
||||
tile.tile = 'grass-1'
|
||||
end
|
||||
else
|
||||
local gen_tile = world.surface.get_tile(world.x, world.y)
|
||||
if gen_tile.collides_with('water-tile') then
|
||||
tile = 'grass-1'
|
||||
end
|
||||
end
|
||||
|
||||
return tile
|
||||
end
|
||||
end
|
||||
|
||||
start_outpost = remove_water(start_outpost)
|
||||
|
||||
local start_patch = b.circle(10)
|
||||
local start_iron_patch =
|
||||
b.resource(
|
||||
b.translate(start_patch, -32, -32),
|
||||
'iron-ore',
|
||||
function()
|
||||
return 1500
|
||||
end
|
||||
)
|
||||
local start_copper_patch =
|
||||
b.resource(
|
||||
b.translate(start_patch, 32, -32),
|
||||
'copper-ore',
|
||||
function()
|
||||
return 1200
|
||||
end
|
||||
)
|
||||
local start_stone_patch =
|
||||
b.resource(
|
||||
b.translate(start_patch, 32, 32),
|
||||
'stone',
|
||||
function()
|
||||
return 600
|
||||
end
|
||||
)
|
||||
local start_coal_patch =
|
||||
b.resource(
|
||||
b.translate(start_patch, -32, 32),
|
||||
'coal',
|
||||
function()
|
||||
return 1350
|
||||
end
|
||||
)
|
||||
|
||||
local start_resources = b.any({start_iron_patch, start_copper_patch, start_stone_patch, start_coal_patch})
|
||||
start_outpost = b.apply_entity(start_outpost, start_resources)
|
||||
|
||||
local water_corner =
|
||||
b.any {
|
||||
b.translate(b.rectangle(6, 16), -6, 0),
|
||||
b.translate(b.rectangle(16, 6), 0, -6)
|
||||
}
|
||||
water_corner = b.change_tile(water_corner, true, 'water')
|
||||
water_corner = b.translate(water_corner, -60, -60)
|
||||
|
||||
start_outpost =
|
||||
b.any {
|
||||
water_corner,
|
||||
b.rotate(water_corner, degrees(90)),
|
||||
b.rotate(water_corner, degrees(180)),
|
||||
b.rotate(water_corner, degrees(270)),
|
||||
start_outpost
|
||||
}
|
||||
|
||||
local pattern = {}
|
||||
|
||||
for r = 1, 10 do
|
||||
local row = {}
|
||||
pattern[r] = row
|
||||
end
|
||||
|
||||
pattern[5][5] = start_outpost
|
||||
|
||||
local outpost_offset = 64
|
||||
|
||||
for r = 4, 7 do
|
||||
local row = pattern[r]
|
||||
for c = 4, 7 do
|
||||
if not row[c] then
|
||||
local template = stage1_iter()
|
||||
local shape = outpost_builder:do_outpost(template)
|
||||
|
||||
local x = outpost_random:next_int(-outpost_offset, outpost_offset)
|
||||
local y = outpost_random:next_int(-outpost_offset, outpost_offset)
|
||||
shape = b.translate(shape, x, y)
|
||||
|
||||
row[c] = shape
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
for r = 3, 8 do
|
||||
local row = pattern[r]
|
||||
for c = 3, 8 do
|
||||
if not row[c] then
|
||||
local template = stage2_iter()
|
||||
local shape = outpost_builder:do_outpost(template)
|
||||
|
||||
local x = outpost_random:next_int(-outpost_offset, outpost_offset)
|
||||
local y = outpost_random:next_int(-outpost_offset, outpost_offset)
|
||||
shape = b.translate(shape, x, y)
|
||||
|
||||
row[c] = shape
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
for r = 1, 10 do
|
||||
local row = pattern[r]
|
||||
for c = 1, 10 do
|
||||
if not row[c] then
|
||||
local template = stage3_iter()
|
||||
local shape = outpost_builder:do_outpost(template)
|
||||
|
||||
local x = outpost_random:next_int(-outpost_offset, outpost_offset)
|
||||
local y = outpost_random:next_int(-outpost_offset, outpost_offset)
|
||||
shape = b.translate(shape, x, y)
|
||||
|
||||
row[c] = shape
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local grid_size = 200
|
||||
local half_total_size = grid_size * 0.5 * 8
|
||||
|
||||
local outposts = b.grid_pattern(pattern, 10, 10, grid_size, grid_size)
|
||||
--outposts = b.if_else(outposts, b.full_shape)
|
||||
|
||||
local spawners = {
|
||||
'biter-spawner',
|
||||
'spitter-spawner'
|
||||
}
|
||||
|
||||
local worms = {
|
||||
'small-worm-turret',
|
||||
'medium-worm-turret',
|
||||
'big-worm-turret'
|
||||
}
|
||||
|
||||
local max_chance = 1 / 64
|
||||
|
||||
local function enemy(_, _, world)
|
||||
local x, y = world.x, world.y
|
||||
local d = math.sqrt(x * x + y * y)
|
||||
|
||||
local chance = (d - 128) / 50000
|
||||
chance = math.min(chance, max_chance)
|
||||
|
||||
if math.random() < chance then
|
||||
if math.random() < 0.25 then
|
||||
local lvl = math.floor(d / 256) + 1
|
||||
lvl = math.min(lvl, 3)
|
||||
return {name = worms[lvl]}
|
||||
else
|
||||
return {name = spawners[math.random(2)]}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local enemy_shape = b.apply_entity(b.full_shape, enemy)
|
||||
|
||||
local ores_patch = b.circle(16)
|
||||
local function value(base, mult, pow)
|
||||
return function(x, y)
|
||||
local d = math.sqrt(x * x + y * y)
|
||||
return base + mult * d ^ pow
|
||||
end
|
||||
end
|
||||
|
||||
local function non_transform(shape)
|
||||
return shape
|
||||
end
|
||||
|
||||
local function uranium_transform(shape)
|
||||
return b.scale(shape, 0.5)
|
||||
end
|
||||
|
||||
local function oil_transform(shape)
|
||||
shape = b.scale(shape, 0.5)
|
||||
shape = b.throttle_world_xy(shape, 1, 5, 1, 5)
|
||||
return shape
|
||||
end
|
||||
|
||||
local ores = {
|
||||
{weight = 300},
|
||||
{transform = non_transform, resource = 'iron-ore', value = value(500, 0.75, 1.1), weight = 16},
|
||||
{transform = non_transform, resource = 'copper-ore', value = value(400, 0.75, 1.1), weight = 10},
|
||||
{transform = non_transform, resource = 'stone', value = value(250, 0.3, 1.05), weight = 5},
|
||||
{transform = non_transform, resource = 'coal', value = value(400, 0.8, 1.075), weight = 8},
|
||||
{transform = uranium_transform, resource = 'uranium-ore', value = value(200, 0.3, 1.025), weight = 3},
|
||||
{transform = oil_transform, resource = 'crude-oil', value = value(180000, 50, 1.025), weight = 6}
|
||||
}
|
||||
|
||||
local total_ore_weights = {}
|
||||
local ore_t = 0
|
||||
for _, v in ipairs(ores) do
|
||||
ore_t = ore_t + v.weight
|
||||
table.insert(total_ore_weights, ore_t)
|
||||
end
|
||||
|
||||
local random_ore = Random.new(ore_seed, ore_seed * 2)
|
||||
local ore_pattern = {}
|
||||
|
||||
for r = 1, 50 do
|
||||
local row = {}
|
||||
ore_pattern[r] = row
|
||||
for c = 1, 50 do
|
||||
local i = random_ore:next_int(1, ore_t)
|
||||
index = table.binary_search(total_ore_weights, i)
|
||||
if (index < 0) then
|
||||
index = bit32.bnot(index)
|
||||
end
|
||||
local ore_data = ores[index]
|
||||
|
||||
local transform = ore_data.transform
|
||||
if not transform then
|
||||
row[c] = b.no_entity
|
||||
else
|
||||
local ore_shape = transform(ores_patch)
|
||||
|
||||
local x = random_ore:next_int(-24, 24)
|
||||
local y = random_ore:next_int(-24, 24)
|
||||
ore_shape = b.translate(ore_shape, x, y)
|
||||
|
||||
local ore = b.resource(ore_shape, ore_data.resource, ore_data.value)
|
||||
row[c] = ore
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local ore_grid = b.grid_pattern_full_overlap(ore_pattern, 50, 50, 64, 64)
|
||||
ore_grid = b.choose(b.rectangle(196), b.no_entity, ore_grid)
|
||||
|
||||
local map = b.if_else(outposts, enemy_shape)
|
||||
--map = b.change_tile(map, true, 'grass-1')
|
||||
map = b.if_else(map, b.full_shape)
|
||||
|
||||
map = b.translate(map, -half_total_size, -half_total_size)
|
||||
|
||||
map = b.apply_entity(map, ore_grid)
|
||||
|
||||
--map = b.apply_entity(map, enemy)
|
||||
|
||||
local market = {
|
||||
callback = outpost_builder.market_set_items_callback,
|
||||
data = {
|
||||
{
|
||||
name = 'copper-cable',
|
||||
price = 50 / 200,
|
||||
distance_factor = 1 / 200 / 32,
|
||||
min_price = 5 / 200
|
||||
},
|
||||
{
|
||||
name = 'electronic-circuit',
|
||||
price = 200 / 200,
|
||||
distance_factor = 1 / 200 / 32,
|
||||
min_price = 10 / 200
|
||||
},
|
||||
{
|
||||
name = 'advanced-circuit',
|
||||
price = 2000 / 200,
|
||||
distance_factor = 1 / 200 / 32,
|
||||
min_price = 100 / 200
|
||||
}
|
||||
{name = 'raw-wood', price = 1},
|
||||
{name = 'iron-plate', price = 2},
|
||||
{name = 'stone', price = 2},
|
||||
{name = 'coal', price = 1.25},
|
||||
{name = 'raw-fish', price = 4},
|
||||
{name = 'firearm-magazine', price = 5},
|
||||
{name = 'science-pack-1', price = 50},
|
||||
{name = 'science-pack-2', price = 100},
|
||||
{name = 'military-science-pack', price = 200},
|
||||
{name = 'science-pack-3', price = 300},
|
||||
{name = 'production-science-pack', price = 600},
|
||||
{name = 'high-tech-science-pack', price = 900}
|
||||
}
|
||||
}
|
||||
|
||||
--[[ for i = 4, 1000 do
|
||||
market.data[i] = market.data[1]
|
||||
end ]]
|
||||
local outpost =
|
||||
outpost_builder.to_shape(
|
||||
{
|
||||
size = 1,
|
||||
{
|
||||
market = market,
|
||||
[15] = {entity = {name = 'market', callback = 'market'}}
|
||||
}
|
||||
local factory = {
|
||||
callback = outpost_builder.magic_item_crafting_callback,
|
||||
data = {
|
||||
output = {min_rate = 0.5 / 60, distance_factor = 0, item = 'coin'}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
local map = b.change_tile(outposts, true, 'grass-1')
|
||||
local spawn = {
|
||||
size = 2,
|
||||
[1] = {
|
||||
market = market,
|
||||
[15] = {entity = {name = 'market', callback = 'market'}}
|
||||
},
|
||||
[2] = {
|
||||
force = 'player',
|
||||
factory = factory,
|
||||
[15] = {entity = {name = 'electric-furnace', callback = 'factory'}}
|
||||
}
|
||||
}
|
||||
|
||||
local spawn_shape = outpost_builder.to_shape(spawn)
|
||||
spawn_shape = b.change_tile(spawn_shape, false, 'stone-path')
|
||||
|
||||
map = b.choose(b.rectangle(16, 16), spawn_shape, map)
|
||||
|
||||
--return b.full_shape
|
||||
return map
|
||||
--return outpost
|
||||
--return b.apply_entity(b.full_shape, ore_grid)
|
||||
|
||||
@@ -73,7 +73,7 @@ local spawn_worm =
|
||||
)
|
||||
|
||||
local function get_level()
|
||||
local ef = game.forces.player.evolution_factor
|
||||
local ef = game.forces.enemy.evolution_factor
|
||||
return math.floor(ef * 4) + 1
|
||||
end
|
||||
|
||||
|
||||
@@ -103,8 +103,8 @@ Public.__index = Public
|
||||
|
||||
Public.empty_template = {}
|
||||
|
||||
function Public.new(seed)
|
||||
local obj = {random = Random.new(seed, seed * 2)}
|
||||
function Public.new(random)
|
||||
local obj = {random = random}
|
||||
|
||||
return setmetatable(obj, Public)
|
||||
end
|
||||
@@ -629,14 +629,14 @@ local function to_shape(blocks)
|
||||
return function(x, y, world)
|
||||
x, y = math.floor(x + half_t_size), math.floor(y + half_t_size)
|
||||
if x < 0 or y < 0 or x >= t_size or y >= t_size then
|
||||
return true
|
||||
return false
|
||||
end
|
||||
|
||||
local x2, y2 = math.floor(x * inv_part_size), math.floor(y * inv_part_size)
|
||||
|
||||
local template = blocks[y2 * size + x2 + 1]
|
||||
if not template then
|
||||
return true
|
||||
return false
|
||||
end
|
||||
|
||||
local wx, wy = world.x, world.y
|
||||
@@ -657,7 +657,7 @@ local function to_shape(blocks)
|
||||
|
||||
local entry = template[i]
|
||||
if not entry then
|
||||
return true
|
||||
return false
|
||||
end
|
||||
|
||||
local entity = entry.entity
|
||||
@@ -998,7 +998,9 @@ Public.magic_item_crafting_callback =
|
||||
end
|
||||
end
|
||||
|
||||
Task.set_timeout_in_ticks(1, set_inactive_token, entity)
|
||||
if not data.keep_active then
|
||||
Task.set_timeout_in_ticks(2, set_inactive_token, entity) -- causes problems with refineries.
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
@@ -1116,6 +1118,41 @@ function Public.do_random_loot(entity, weights, loot)
|
||||
entity.insert {name = stack.name, count = count}
|
||||
end
|
||||
|
||||
function Public.do_random_fluid_loot(entity, weights, loot)
|
||||
if not entity.valid then
|
||||
return
|
||||
end
|
||||
|
||||
entity.operable = false
|
||||
entity.destructible = false
|
||||
|
||||
local i = math.random() * weights.total
|
||||
|
||||
local index = table.binary_search(weights, i)
|
||||
if (index < 0) then
|
||||
index = bit32.bnot(index)
|
||||
end
|
||||
|
||||
local stack = loot[index].stack
|
||||
if not stack then
|
||||
return
|
||||
end
|
||||
|
||||
local df = stack.distance_factor
|
||||
local count
|
||||
if df then
|
||||
local p = entity.position
|
||||
local x, y = p.x, p.y
|
||||
local d = math.sqrt(x * x + y * y)
|
||||
|
||||
count = stack.count + d * df
|
||||
else
|
||||
count = stack.count
|
||||
end
|
||||
|
||||
entity.fluidbox[1] = {name = stack.name, amount = count}
|
||||
end
|
||||
|
||||
Event.add(defines.events.on_tick, tick)
|
||||
Event.add(defines.events.on_entity_died, remove_power_source)
|
||||
|
||||
|
||||
@@ -3,20 +3,14 @@ local Token = require 'utils.global_token'
|
||||
|
||||
local loot = {
|
||||
{weight = 10},
|
||||
{stack = {name = 'coin', count = 750, distance_factor = 1 / 2}, weight = 5},
|
||||
{stack = {name = 'piercing-rounds-magazine', count = 500, distance_factor = 1 / 2}, weight = 5},
|
||||
{stack = {name = 'uranium-rounds-magazine', count = 300, distance_factor = 1 / 2}, weight = 5},
|
||||
{stack = {name = 'piercing-shotgun-shell', count = 200, distance_factor = 1 / 4}, weight = 2},
|
||||
{stack = {name = 'grenade', count = 100, distance_factor = 1 / 8}, weight = 1},
|
||||
{stack = {name = 'land-mine', count = 400, distance_factor = 1}, weight = 1},
|
||||
{stack = {name = 'rocket', count = 200, distance_factor = 1 / 32}, weight = 2},
|
||||
{stack = {name = 'explosive-rocket', count = 200, distance_factor = 1 / 32}, weight = 1},
|
||||
{stack = {name = 'cannon-shell', count = 200, distance_factor = 1 / 32}, weight = 2},
|
||||
{stack = {name = 'explosive-cannon-shell', count = 200, distance_factor = 1 / 32}, weight = 1},
|
||||
{stack = {name = 'cluster-grenade', count = 100, distance_factor = 1 / 32}, weight = 1},
|
||||
{stack = {name = 'poison-capsule', count = 100, distance_factor = 1 / 32}, weight = 1},
|
||||
{stack = {name = 'slowdown-capsule', count = 100, distance_factor = 1 / 32}, weight = 1},
|
||||
{stack = {name = 'destroyer-capsule', count = 20, distance_factor = 1 / 32}, weight = 1}
|
||||
{stack = {name = 'coin', count = 2500, distance_factor = 1 / 2}, weight = 5},
|
||||
{stack = {name = 'uranium-rounds-magazine', count = 600, distance_factor = 1 / 2}, weight = 5},
|
||||
{stack = {name = 'piercing-shotgun-shell', count = 600, distance_factor = 1 / 4}, weight = 1},
|
||||
{stack = {name = 'cluster-grenade', count = 200, distance_factor = 1 / 8}, weight = 2},
|
||||
{stack = {name = 'explosive-rocket', count = 200, distance_factor = 1 / 8}, weight = 5},
|
||||
{stack = {name = 'explosive-cannon-shell', count = 200, distance_factor = 1 / 8}, weight = 5},
|
||||
{stack = {name = 'explosive-uranium-cannon-shell', count = 200, distance_factor = 1 / 8}, weight = 2},
|
||||
{stack = {name = 'destroyer-capsule', count = 100, distance_factor = 1 / 16}, weight = 2}
|
||||
}
|
||||
|
||||
local weights = ob.prepare_weighted_loot(loot)
|
||||
@@ -31,24 +25,24 @@ local loot_callback =
|
||||
local factory = {
|
||||
callback = ob.magic_item_crafting_callback,
|
||||
data = {
|
||||
recipe = 'piercing-rounds-magazine',
|
||||
output = {min_rate = 1 / 60, distance_factor = 1 / 60 / 100, item = 'piercing-rounds-magazine'}
|
||||
recipe = 'uranium-rounds-magazine',
|
||||
output = {min_rate = 1 / 60, distance_factor = 1 / 60 / 100, item = 'uranium-rounds-magazine'}
|
||||
}
|
||||
}
|
||||
|
||||
local factory_b = {
|
||||
callback = ob.magic_item_crafting_callback,
|
||||
data = {
|
||||
recipe = 'cannon-shell',
|
||||
output = {min_rate = 1 / 3 / 60, distance_factor = 1 / 60 / 100, item = 'cannon-shell'}
|
||||
recipe = 'explosive-rocket',
|
||||
output = {min_rate = 1 / 3 / 60, distance_factor = 1 / 60 / 100, item = 'explosive-rocket'}
|
||||
}
|
||||
}
|
||||
|
||||
local factory_c = {
|
||||
callback = ob.magic_item_crafting_callback,
|
||||
data = {
|
||||
recipe = 'uranium-rounds-magazine',
|
||||
output = {min_rate = 1 / 3 / 60, distance_factor = 1 / 60 / 100, item = 'uranium-rounds-magazine'}
|
||||
recipe = 'explosive-uranium-cannon-shell',
|
||||
output = {min_rate = 1 / 3 / 60, distance_factor = 1 / 60 / 100, item = 'explosive-uranium-cannon-shell'}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,9 +111,9 @@ local market = {
|
||||
},
|
||||
{
|
||||
name = 'cluster-grenade',
|
||||
price = 60,
|
||||
price = 100,
|
||||
distance_factor = 0.005 / 32,
|
||||
min_price = 6
|
||||
min_price = 10
|
||||
},
|
||||
{
|
||||
name = 'poison-capsule',
|
||||
@@ -145,11 +139,29 @@ local market = {
|
||||
distance_factor = 0.005 / 32,
|
||||
min_price = 12
|
||||
},
|
||||
{
|
||||
name = 'explosive-uranium-cannon-shell',
|
||||
price = 160,
|
||||
distance_factor = 0.005 / 32,
|
||||
min_price = 16
|
||||
},
|
||||
{
|
||||
name = 'destroyer-capsule',
|
||||
price = 80,
|
||||
distance_factor = 0.005 / 32,
|
||||
min_price = 8
|
||||
},
|
||||
{
|
||||
name = 'vehicle-machine-gun',
|
||||
price = 1000
|
||||
},
|
||||
{
|
||||
name = 'tank-cannon',
|
||||
price = 500
|
||||
},
|
||||
{
|
||||
name = 'artillery-wagon-cannon',
|
||||
price = 2000
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -162,7 +174,26 @@ local level3 =
|
||||
base_factory[2],
|
||||
{
|
||||
factory = factory,
|
||||
fallback = level2
|
||||
fallback = level2,
|
||||
max_count = 6
|
||||
}
|
||||
)
|
||||
local level3b =
|
||||
ob.extend_1_way(
|
||||
base_factory[2],
|
||||
{
|
||||
factory = factory_b,
|
||||
fallback = level3,
|
||||
max_count = 2
|
||||
}
|
||||
)
|
||||
local level3c =
|
||||
ob.extend_1_way(
|
||||
base_factory[2],
|
||||
{
|
||||
factory = factory_c,
|
||||
fallback = level3b,
|
||||
max_count = 2
|
||||
}
|
||||
)
|
||||
local level4 =
|
||||
@@ -170,7 +201,7 @@ local level4 =
|
||||
base_factory[3],
|
||||
{
|
||||
market = market,
|
||||
fallback = level3
|
||||
fallback = level3c
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
150
map_gen/presets/crash_site/outpost_data/big_chemical_factory.lua
Normal file
150
map_gen/presets/crash_site/outpost_data/big_chemical_factory.lua
Normal file
@@ -0,0 +1,150 @@
|
||||
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 = 'solid-fuel', count = 1000, distance_factor = 1}, weight = 2},
|
||||
{stack = {name = 'sulfur', count = 1000, distance_factor = 1 / 2}, weight = 1},
|
||||
{stack = {name = 'plastic-bar', count = 1000, distance_factor = 1 / 2}, weight = 5},
|
||||
{stack = {name = 'battery', count = 1200, distance_factor = 1 / 2}, weight = 5},
|
||||
{stack = {name = 'explosives', count = 800, distance_factor = 1 / 2}, weight = 2},
|
||||
{stack = {name = 'rocket-fuel', count = 30, distance_factor = 1 / 20}, weight = 1}
|
||||
}
|
||||
|
||||
local weights = ob.prepare_weighted_loot(loot)
|
||||
|
||||
local loot_callback =
|
||||
Token.register(
|
||||
function(chest)
|
||||
ob.do_random_loot(chest, weights, loot)
|
||||
end
|
||||
)
|
||||
|
||||
local factory = {
|
||||
callback = ob.magic_item_crafting_callback,
|
||||
data = {
|
||||
recipe = 'plastic-bar',
|
||||
output = {min_rate = 1 / 60, distance_factor = 1 / 60 / 100, item = 'plastic-bar'}
|
||||
}
|
||||
}
|
||||
|
||||
local factory_b = {
|
||||
callback = ob.magic_item_crafting_callback,
|
||||
data = {
|
||||
recipe = 'sulfuric-acid',
|
||||
output = {min_rate = 20 / 60, distance_factor = 10 / 60 / 100, item = 'sulfuric-acid', fluidbox_index = 2}
|
||||
}
|
||||
}
|
||||
local factory_c = {
|
||||
callback = ob.magic_item_crafting_callback,
|
||||
data = {
|
||||
recipe = 'rocket-fuel',
|
||||
output = {min_rate = 1 / 60, distance_factor = 1 / 60 / 100, item = 'rocket-fuel'}
|
||||
}
|
||||
}
|
||||
|
||||
local market = {
|
||||
callback = ob.market_set_items_callback,
|
||||
data = {
|
||||
{
|
||||
name = 'coal',
|
||||
price = 0.25,
|
||||
distance_factor = 0.005 / 32,
|
||||
min_price = 0.025
|
||||
},
|
||||
{
|
||||
name = 'sulfur',
|
||||
price = 2,
|
||||
distance_factor = 0.005 / 32,
|
||||
min_price = 0.2
|
||||
},
|
||||
{
|
||||
name = 'plastic-bar',
|
||||
price = 2,
|
||||
distance_factor = 0.005 / 32,
|
||||
min_price = 0.2
|
||||
},
|
||||
{
|
||||
name = 'solid-fuel',
|
||||
price = 1,
|
||||
distance_factor = 0.005 / 32,
|
||||
min_price = 0.1
|
||||
},
|
||||
{
|
||||
name = 'battery',
|
||||
price = 3,
|
||||
distance_factor = 0.005 / 32,
|
||||
min_price = 0.3
|
||||
},
|
||||
{
|
||||
name = 'explosives',
|
||||
price = 3,
|
||||
distance_factor = 0.005 / 32,
|
||||
min_price = 0.3
|
||||
},
|
||||
{
|
||||
name = 'rocket-fuel',
|
||||
price = 10,
|
||||
distance_factor = 0.005 / 32,
|
||||
min_price = 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
local base_factory = require 'map_gen.presets.crash_site.outpost_data.big_chemical_plant'
|
||||
local base_factory2 = 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,
|
||||
max_count = 6
|
||||
}
|
||||
)
|
||||
|
||||
local level3b =
|
||||
ob.extend_1_way(
|
||||
base_factory[2],
|
||||
{
|
||||
factory = factory_b,
|
||||
fallback = level3,
|
||||
max_count = 3
|
||||
}
|
||||
)
|
||||
|
||||
local level3c =
|
||||
ob.extend_1_way(
|
||||
base_factory2[2],
|
||||
{
|
||||
factory = factory_c,
|
||||
fallback = level3b,
|
||||
max_count = 1
|
||||
}
|
||||
)
|
||||
local level4 =
|
||||
ob.extend_1_way(
|
||||
base_factory[3],
|
||||
{
|
||||
market = market,
|
||||
fallback = level3c
|
||||
}
|
||||
)
|
||||
return {
|
||||
settings = {
|
||||
blocks = 9,
|
||||
variance = 3,
|
||||
min_step = 2,
|
||||
max_level = 3
|
||||
},
|
||||
walls = {
|
||||
require 'map_gen.presets.crash_site.outpost_data.heavy_flame_turrets'
|
||||
},
|
||||
bases = {
|
||||
{level3b, level2},
|
||||
{level4}
|
||||
}
|
||||
}
|
||||
132
map_gen/presets/crash_site/outpost_data/big_chemical_plant.lua
Normal file
132
map_gen/presets/crash_site/outpost_data/big_chemical_plant.lua
Normal file
@@ -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 = 'chemical-plant', 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
|
||||
}
|
||||
@@ -8,7 +8,8 @@ local loot = {
|
||||
{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}
|
||||
{stack = {name = 'processing-unit', count = 200, distance_factor = 1 / 4}, weight = 5},
|
||||
{stack = {name = 'rocket-control-unit', count = 30, distance_factor = 1 / 20}, weight = 2}
|
||||
}
|
||||
|
||||
local factory = {
|
||||
@@ -31,7 +32,15 @@ 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'}
|
||||
output = {min_rate = 0.25 / 60, distance_factor = 1 / 60 / 100, item = 'processing-unit'}
|
||||
}
|
||||
}
|
||||
|
||||
local factory_d = {
|
||||
callback = ob.magic_item_crafting_callback,
|
||||
data = {
|
||||
recipe = 'rocket-control-unit',
|
||||
output = {min_rate = 1 / 60, distance_factor = 1 / 60 / 100, item = 'rocket-control-unit'}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,6 +70,12 @@ local market = {
|
||||
price = 16,
|
||||
distance_factor = 0.005 / 32,
|
||||
min_price = 0.8
|
||||
},
|
||||
{
|
||||
name = 'rocket-control-unit',
|
||||
price = 35,
|
||||
distance_factor = 0.005 / 32,
|
||||
min_price = 3.5
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -98,7 +113,17 @@ local level3_c =
|
||||
base_factory[2],
|
||||
{
|
||||
factory = factory_c,
|
||||
fallback = level3_b
|
||||
fallback = level3_b,
|
||||
max_count = 4
|
||||
}
|
||||
)
|
||||
local level3_d =
|
||||
ob.extend_1_way(
|
||||
base_factory[2],
|
||||
{
|
||||
factory = factory_d,
|
||||
fallback = level3_c,
|
||||
max_count = 1
|
||||
}
|
||||
)
|
||||
local level4 =
|
||||
@@ -106,7 +131,7 @@ local level4 =
|
||||
base_factory[3],
|
||||
{
|
||||
market = market,
|
||||
fallback = level3_c
|
||||
fallback = level3_d
|
||||
}
|
||||
)
|
||||
|
||||
@@ -115,12 +140,13 @@ return {
|
||||
blocks = 9,
|
||||
variance = 3,
|
||||
min_step = 2,
|
||||
max_level = 2
|
||||
max_level = 3
|
||||
},
|
||||
walls = {
|
||||
require 'map_gen.presets.crash_site.outpost_data.heavy_laser_turrets'
|
||||
},
|
||||
bases = {
|
||||
{level4, level2}
|
||||
{level3_c, level2},
|
||||
{level4}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,9 @@ local loot = {
|
||||
{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}
|
||||
{stack = {name = 'steel-plate', count = 1000, distance_factor = 1 / 5}, weight = 8},
|
||||
{stack = {name = 'steel-plate', count = 1000, distance_factor = 1 / 5}, weight = 8},
|
||||
{stack = {name = 'low-density-structure', count = 30, distance_factor = 1 / 20}, weight = 2}
|
||||
}
|
||||
|
||||
local weights = ob.prepare_weighted_loot(loot)
|
||||
@@ -34,6 +36,14 @@ local factory_b = {
|
||||
}
|
||||
}
|
||||
|
||||
local factory_c = {
|
||||
callback = ob.magic_item_crafting_callback,
|
||||
data = {
|
||||
recipe = 'low-density-structure',
|
||||
output = {min_rate = 1 / 60, distance_factor = 1 / 60 / 100, item = 'low-density-structure'}
|
||||
}
|
||||
}
|
||||
|
||||
local market = {
|
||||
callback = ob.market_set_items_callback,
|
||||
data = {
|
||||
@@ -48,11 +58,18 @@ local market = {
|
||||
price = 1.5,
|
||||
distance_factor = 0.005 / 32,
|
||||
min_price = 0.15
|
||||
},
|
||||
{
|
||||
name = 'low-density-structure',
|
||||
price = 25,
|
||||
distance_factor = 0.005 / 32,
|
||||
min_price = 2.5
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
local base_factory = require 'map_gen.presets.crash_site.outpost_data.medium_furance'
|
||||
local base_factory2 = 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 =
|
||||
@@ -73,12 +90,22 @@ local level3b =
|
||||
}
|
||||
)
|
||||
|
||||
local level3c =
|
||||
ob.extend_1_way(
|
||||
base_factory2[2],
|
||||
{
|
||||
factory = factory_c,
|
||||
fallback = level3b,
|
||||
max_count = 1
|
||||
}
|
||||
)
|
||||
|
||||
local level4 =
|
||||
ob.extend_1_way(
|
||||
base_factory[3],
|
||||
{
|
||||
market = market,
|
||||
fallback = level3b
|
||||
fallback = level3c
|
||||
}
|
||||
)
|
||||
return {
|
||||
|
||||
138
map_gen/presets/crash_site/outpost_data/big_oil_refinery.lua
Normal file
138
map_gen/presets/crash_site/outpost_data/big_oil_refinery.lua
Normal file
@@ -0,0 +1,138 @@
|
||||
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 = 'crude-oil-barrel', count = 200, distance_factor = 1 / 20}, weight = 2},
|
||||
{stack = {name = 'heavy-oil-barrel', count = 200, distance_factor = 1 / 20}, weight = 2},
|
||||
{stack = {name = 'light-oil-barrel', count = 200, distance_factor = 1 / 20}, weight = 2},
|
||||
{stack = {name = 'petroleum-gas-barrel', count = 200, distance_factor = 1 / 20}, weight = 2},
|
||||
{stack = {name = 'lubricant-barrel', count = 200, distance_factor = 1 / 20}, weight = 1},
|
||||
{stack = {name = 'sulfuric-acid-barrel', count = 200, distance_factor = 1 / 20}, weight = 1}
|
||||
}
|
||||
|
||||
local weights = ob.prepare_weighted_loot(loot)
|
||||
|
||||
local loot_callback =
|
||||
Token.register(
|
||||
function(chest)
|
||||
ob.do_random_loot(chest, weights, loot)
|
||||
end
|
||||
)
|
||||
|
||||
local fluid_loot = {
|
||||
{stack = {name = 'petroleum-gas', count = 25000}, weight = 1},
|
||||
{stack = {name = 'sulfuric-acid', count = 25000}, weight = 1}
|
||||
}
|
||||
|
||||
local fluid_weights = ob.prepare_weighted_loot(fluid_loot)
|
||||
|
||||
local fluid_loot_callback =
|
||||
Token.register(
|
||||
function(chest)
|
||||
ob.do_random_fluid_loot(chest, fluid_weights, fluid_loot)
|
||||
end
|
||||
)
|
||||
|
||||
local factory = {
|
||||
callback = ob.magic_item_crafting_callback,
|
||||
data = {
|
||||
recipe = 'advanced-oil-processing',
|
||||
keep_active = true,
|
||||
output = {
|
||||
{min_rate = 1 / 60, distance_factor = 1 / 60 / 100, item = 'heavy-oil', fluidbox_index = 3},
|
||||
{min_rate = 4.5 / 60, distance_factor = 4.5 / 60 / 100, item = 'light-oil', fluidbox_index = 4},
|
||||
{min_rate = 5.5 / 60, distance_factor = 5.5 / 60 / 100, item = 'petroleum-gas', fluidbox_index = 5}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
local market = {
|
||||
callback = ob.market_set_items_callback,
|
||||
data = {
|
||||
{
|
||||
name = 'crude-oil-barrel',
|
||||
price = 10,
|
||||
distance_factor = 0.005 / 32,
|
||||
min_price = 1
|
||||
},
|
||||
{
|
||||
name = 'heavy-oil-barrel',
|
||||
price = 15,
|
||||
distance_factor = 0.005 / 32,
|
||||
min_price = 1
|
||||
},
|
||||
{
|
||||
name = 'light-oil-barrel',
|
||||
price = 20,
|
||||
distance_factor = 0.005 / 32,
|
||||
min_price = 1
|
||||
},
|
||||
{
|
||||
name = 'petroleum-gas-barrel',
|
||||
price = 25,
|
||||
distance_factor = 0.005 / 32,
|
||||
min_price = 1
|
||||
},
|
||||
{
|
||||
name = 'lubricant-barrel',
|
||||
price = 15,
|
||||
distance_factor = 0.005 / 32,
|
||||
min_price = 1
|
||||
},
|
||||
{
|
||||
name = 'sulfuric-acid-barrel',
|
||||
price = 40,
|
||||
distance_factor = 0.005 / 32,
|
||||
min_price = 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
local base_factory = require 'map_gen.presets.crash_site.outpost_data.big_refinery'
|
||||
local storage_tank = require 'map_gen.presets.crash_site.outpost_data.storage_tank_block'
|
||||
|
||||
local level2 = ob.extend_1_way(base_factory[1], {loot = {callback = loot_callback}})
|
||||
|
||||
local level2b =
|
||||
ob.extend_1_way(
|
||||
storage_tank,
|
||||
{
|
||||
tank = {callback = fluid_loot_callback},
|
||||
fallback = level2,
|
||||
max_count = 3
|
||||
}
|
||||
)
|
||||
|
||||
local level3 =
|
||||
ob.extend_1_way(
|
||||
base_factory[2],
|
||||
{
|
||||
factory = factory,
|
||||
fallback = level2b,
|
||||
max_count = 6
|
||||
}
|
||||
)
|
||||
local level4 =
|
||||
ob.extend_1_way(
|
||||
base_factory[3],
|
||||
{
|
||||
market = market,
|
||||
fallback = level3
|
||||
}
|
||||
)
|
||||
return {
|
||||
settings = {
|
||||
blocks = 9,
|
||||
variance = 3,
|
||||
min_step = 2,
|
||||
max_level = 2
|
||||
},
|
||||
walls = {
|
||||
require 'map_gen.presets.crash_site.outpost_data.heavy_flame_turrets'
|
||||
},
|
||||
bases = {
|
||||
{level4, level2}
|
||||
}
|
||||
}
|
||||
132
map_gen/presets/crash_site/outpost_data/big_refinery.lua
Normal file
132
map_gen/presets/crash_site/outpost_data/big_refinery.lua
Normal file
@@ -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 = 'oil-refinery', 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
|
||||
}
|
||||
@@ -2,18 +2,19 @@ local ob = require 'map_gen.presets.crash_site.outpost_builder'
|
||||
|
||||
return {
|
||||
ob.make_4_way {
|
||||
turret = {callback = ob.refill_liquid_turret_callback, data = ob.light_oil_ammo},
|
||||
flame_turret = {callback = ob.refill_liquid_turret_callback, data = ob.light_oil_ammo},
|
||||
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'}},
|
||||
[4] = {entity = {name = 'stone-wall'}},
|
||||
[5] = {entity = {name = 'stone-wall'}},
|
||||
[6] = {entity = {name = 'stone-wall'}},
|
||||
[7] = {entity = {name = 'gun-turret', offset = 3}, tile = 'refined-hazard-concrete-left'},
|
||||
[7] = {entity = {name = 'gun-turret', callback = 'turret', offset = 3}, tile = 'refined-hazard-concrete-left'},
|
||||
[8] = {tile = 'refined-hazard-concrete-left'},
|
||||
[9] = {entity = {name = 'gun-turret', offset = 3}, tile = 'refined-hazard-concrete-left'},
|
||||
[9] = {entity = {name = 'gun-turret', callback = 'turret', offset = 3}, tile = 'refined-hazard-concrete-left'},
|
||||
[10] = {tile = 'refined-hazard-concrete-left'},
|
||||
[11] = {entity = {name = 'gun-turret', offset = 3}, tile = 'refined-hazard-concrete-left'},
|
||||
[11] = {entity = {name = 'gun-turret', callback = 'turret', offset = 3}, tile = 'refined-hazard-concrete-left'},
|
||||
[12] = {tile = 'refined-hazard-concrete-left'},
|
||||
[13] = {tile = 'refined-hazard-concrete-left'},
|
||||
[14] = {tile = 'refined-hazard-concrete-left'},
|
||||
@@ -28,17 +29,17 @@ return {
|
||||
[23] = {tile = 'refined-hazard-concrete-left'},
|
||||
[24] = {tile = 'refined-hazard-concrete-left'},
|
||||
[25] = {
|
||||
entity = {name = 'flamethrower-turret', callback = 'turret', offset = 1},
|
||||
entity = {name = 'flamethrower-turret', callback = 'flame_turret', offset = 1},
|
||||
tile = 'refined-hazard-concrete-left'
|
||||
},
|
||||
[26] = {tile = 'refined-hazard-concrete-left'},
|
||||
[27] = {
|
||||
entity = {name = 'flamethrower-turret', callback = 'turret', offset = 1},
|
||||
entity = {name = 'flamethrower-turret', callback = 'flame_turret', offset = 1},
|
||||
tile = 'refined-hazard-concrete-left'
|
||||
},
|
||||
[28] = {tile = 'refined-hazard-concrete-left'},
|
||||
[29] = {
|
||||
entity = {name = 'flamethrower-turret', callback = 'turret', offset = 1},
|
||||
entity = {name = 'flamethrower-turret', callback = 'flame_turret', offset = 1},
|
||||
tile = 'refined-hazard-concrete-left'
|
||||
},
|
||||
[30] = {tile = 'refined-hazard-concrete-left'},
|
||||
@@ -50,7 +51,8 @@ return {
|
||||
[36] = {tile = 'refined-hazard-concrete-left'}
|
||||
},
|
||||
ob.make_4_way {
|
||||
turret = {callback = ob.refill_liquid_turret_callback, data = ob.light_oil_ammo},
|
||||
flame_turret = {callback = ob.refill_liquid_turret_callback, data = ob.light_oil_ammo},
|
||||
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'}},
|
||||
@@ -66,12 +68,12 @@ return {
|
||||
[13] = {entity = {name = 'stone-wall'}},
|
||||
[14] = {entity = {name = 'stone-wall'}},
|
||||
[15] = {
|
||||
entity = {name = 'flamethrower-turret', callback = 'turret', offset = 1},
|
||||
entity = {name = 'flamethrower-turret', callback = 'flame_turret', offset = 1},
|
||||
tile = 'refined-hazard-concrete-left'
|
||||
},
|
||||
[16] = {tile = 'refined-hazard-concrete-left'},
|
||||
[17] = {
|
||||
entity = {name = 'flamethrower-turret', callback = 'turret', offset = 1},
|
||||
entity = {name = 'flamethrower-turret', callback = 'flame_turret', offset = 1},
|
||||
tile = 'refined-hazard-concrete-left'
|
||||
},
|
||||
[18] = {tile = 'refined-hazard-concrete-left'},
|
||||
@@ -84,11 +86,11 @@ return {
|
||||
[25] = {entity = {name = 'stone-wall'}},
|
||||
[26] = {tile = 'refined-hazard-concrete-left'},
|
||||
[27] = {
|
||||
entity = {name = 'flamethrower-turret', callback = 'turret', direction = 6, offset = 2},
|
||||
entity = {name = 'flamethrower-turret', callback = 'flame_turret', direction = 6, offset = 2},
|
||||
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', callback = 'turret', offset = 3}, tile = 'refined-hazard-concrete-left'},
|
||||
[30] = {tile = 'refined-hazard-concrete-left'},
|
||||
[31] = {entity = {name = 'stone-wall'}},
|
||||
[32] = {tile = 'refined-hazard-concrete-left'},
|
||||
@@ -98,7 +100,8 @@ return {
|
||||
[36] = {tile = 'refined-hazard-concrete-left'}
|
||||
},
|
||||
ob.make_4_way {
|
||||
turret = {callback = ob.refill_liquid_turret_callback, data = ob.light_oil_ammo},
|
||||
flame_turret = {callback = ob.refill_liquid_turret_callback, data = ob.light_oil_ammo},
|
||||
turret = {callback = ob.refill_turret_callback, data = ob.uranium_rounds_magazine_ammo},
|
||||
[1] = {entity = {name = 'stone-wall'}},
|
||||
[2] = {entity = {name = 'stone-wall'}},
|
||||
[3] = {tile = 'refined-hazard-concrete-left'},
|
||||
@@ -106,11 +109,11 @@ return {
|
||||
[5] = {tile = 'refined-hazard-concrete-left'},
|
||||
[6] = {tile = 'refined-hazard-concrete-left'},
|
||||
[7] = {entity = {name = 'stone-wall'}},
|
||||
[8] = {entity = {name = 'gun-turret', offset = 3}, tile = 'refined-hazard-concrete-left'},
|
||||
[8] = {entity = {name = 'gun-turret', callback = 'turret', offset = 3}, tile = 'refined-hazard-concrete-left'},
|
||||
[9] = {tile = 'refined-hazard-concrete-left'},
|
||||
[10] = {tile = 'refined-hazard-concrete-left'},
|
||||
[11] = {
|
||||
entity = {name = 'flamethrower-turret', callback = 'turret', direction = 6, offset = 2},
|
||||
entity = {name = 'flamethrower-turret', callback = 'flame_turret', direction = 6, offset = 2},
|
||||
tile = 'refined-hazard-concrete-left'
|
||||
},
|
||||
[12] = {tile = 'refined-hazard-concrete-left'},
|
||||
@@ -127,17 +130,17 @@ return {
|
||||
[23] = {tile = 'refined-hazard-concrete-left'},
|
||||
[24] = {tile = 'refined-hazard-concrete-left'},
|
||||
[25] = {
|
||||
entity = {name = 'flamethrower-turret', callback = 'turret', offset = 1},
|
||||
entity = {name = 'flamethrower-turret', callback = 'flame_turret', offset = 1},
|
||||
tile = 'refined-hazard-concrete-left'
|
||||
},
|
||||
[26] = {tile = 'refined-hazard-concrete-left'},
|
||||
[27] = {
|
||||
entity = {name = 'flamethrower-turret', callback = 'turret', offset = 1},
|
||||
entity = {name = 'flamethrower-turret', callback = 'flame_turret', offset = 1},
|
||||
tile = 'refined-hazard-concrete-left'
|
||||
},
|
||||
[28] = {tile = 'refined-hazard-concrete-left'},
|
||||
[29] = {
|
||||
entity = {name = 'flamethrower-turret', callback = 'turret', offset = 1},
|
||||
entity = {name = 'flamethrower-turret', callback = 'flame_turret', offset = 1},
|
||||
tile = 'refined-hazard-concrete-left'
|
||||
},
|
||||
[30] = {tile = 'refined-hazard-concrete-left'},
|
||||
|
||||
@@ -117,9 +117,9 @@ local market = {
|
||||
},
|
||||
{
|
||||
name = 'cluster-grenade',
|
||||
price = 60,
|
||||
price = 100,
|
||||
distance_factor = 0.005 / 32,
|
||||
min_price = 6
|
||||
min_price = 10
|
||||
},
|
||||
{
|
||||
name = 'poison-capsule',
|
||||
|
||||
@@ -0,0 +1,123 @@
|
||||
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 = 'solid-fuel', count = 500, distance_factor = 1}, weight = 2},
|
||||
{stack = {name = 'sulfur', count = 500, distance_factor = 1 / 2}, weight = 3},
|
||||
{stack = {name = 'plastic-bar', count = 500, distance_factor = 1 / 2}, weight = 3},
|
||||
{stack = {name = 'battery', count = 600, distance_factor = 1 / 2}, weight = 5},
|
||||
{stack = {name = 'explosives', count = 400, distance_factor = 1 / 2}, 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 factory = {
|
||||
callback = ob.magic_item_crafting_callback,
|
||||
data = {
|
||||
recipe = 'battery',
|
||||
output = {min_rate = 1 / 60, distance_factor = 1 / 60 / 100, item = 'battery'}
|
||||
}
|
||||
}
|
||||
|
||||
local factory_b = {
|
||||
callback = ob.magic_item_crafting_callback,
|
||||
data = {
|
||||
recipe = 'explosives',
|
||||
output = {min_rate = 1 / 60, distance_factor = 1 / 60 / 100, item = 'explosives'}
|
||||
}
|
||||
}
|
||||
|
||||
local market = {
|
||||
callback = ob.market_set_items_callback,
|
||||
data = {
|
||||
{
|
||||
name = 'coal',
|
||||
price = 0.25,
|
||||
distance_factor = 0.005 / 32,
|
||||
min_price = 0.025
|
||||
},
|
||||
{
|
||||
name = 'sulfur',
|
||||
price = 2,
|
||||
distance_factor = 0.005 / 32,
|
||||
min_price = 0.2
|
||||
},
|
||||
{
|
||||
name = 'plastic-bar',
|
||||
price = 2,
|
||||
distance_factor = 0.005 / 32,
|
||||
min_price = 0.2
|
||||
},
|
||||
{
|
||||
name = 'solid-fuel',
|
||||
price = 1,
|
||||
distance_factor = 0.005 / 32,
|
||||
min_price = 0.1
|
||||
},
|
||||
{
|
||||
name = 'battery',
|
||||
price = 3,
|
||||
distance_factor = 0.005 / 32,
|
||||
min_price = 0.3
|
||||
},
|
||||
{
|
||||
name = 'explosives',
|
||||
price = 3,
|
||||
distance_factor = 0.005 / 32,
|
||||
min_price = 0.3
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
local base_factory = require 'map_gen.presets.crash_site.outpost_data.medium_chemical_plant'
|
||||
|
||||
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,
|
||||
max_count = 3
|
||||
}
|
||||
)
|
||||
local level3b =
|
||||
ob.extend_1_way(
|
||||
base_factory[2],
|
||||
{
|
||||
factory = factory_b,
|
||||
fallback = level3,
|
||||
max_count = 3
|
||||
}
|
||||
)
|
||||
local level4 =
|
||||
ob.extend_1_way(
|
||||
base_factory[3],
|
||||
{
|
||||
market = market,
|
||||
fallback = level3b
|
||||
}
|
||||
)
|
||||
return {
|
||||
settings = {
|
||||
blocks = 7,
|
||||
variance = 3,
|
||||
min_step = 2,
|
||||
max_level = 2
|
||||
},
|
||||
walls = {
|
||||
require 'map_gen.presets.crash_site.outpost_data.medium_flame_turrets'
|
||||
},
|
||||
bases = {
|
||||
{level4, level3, level2}
|
||||
}
|
||||
}
|
||||
@@ -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 = 'chemical-plant', 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}
|
||||
@@ -2,7 +2,8 @@ local ob = require 'map_gen.presets.crash_site.outpost_builder'
|
||||
|
||||
return {
|
||||
ob.make_4_way {
|
||||
turret = {callback = ob.refill_liquid_turret_callback, data = ob.light_oil_ammo},
|
||||
flame_turret = {callback = ob.refill_liquid_turret_callback, data = ob.light_oil_ammo},
|
||||
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'}},
|
||||
@@ -23,15 +24,15 @@ return {
|
||||
[18] = {tile = 'hazard-concrete-left'},
|
||||
[19] = {tile = 'concrete'},
|
||||
[20] = {tile = 'concrete'},
|
||||
[21] = {entity = {name = 'gun-turret', offset = 3}, tile = 'concrete'},
|
||||
[21] = {entity = {name = 'gun-turret', callback = 'turret', offset = 3}, tile = 'concrete'},
|
||||
[22] = {tile = 'concrete'},
|
||||
[23] = {tile = 'concrete'},
|
||||
[24] = {tile = 'concrete'},
|
||||
[25] = {entity = {name = 'flamethrower-turret', callback = 'turret', offset = 1}, tile = 'concrete'},
|
||||
[25] = {entity = {name = 'flamethrower-turret', callback = 'flame_turret', offset = 1}, tile = 'concrete'},
|
||||
[26] = {tile = 'concrete'},
|
||||
[27] = {tile = 'concrete'},
|
||||
[28] = {tile = 'concrete'},
|
||||
[29] = {entity = {name = 'flamethrower-turret', callback = 'turret', offset = 1}, tile = 'concrete'},
|
||||
[29] = {entity = {name = 'flamethrower-turret', callback = 'flame_turret', offset = 1}, tile = 'concrete'},
|
||||
[30] = {tile = 'concrete'},
|
||||
[31] = {tile = 'concrete'},
|
||||
[32] = {tile = 'concrete'},
|
||||
@@ -41,7 +42,8 @@ return {
|
||||
[36] = {tile = 'concrete'}
|
||||
},
|
||||
ob.make_4_way {
|
||||
turret = {callback = ob.refill_liquid_turret_callback, data = ob.light_oil_ammo},
|
||||
flame_turret = {callback = ob.refill_liquid_turret_callback, data = ob.light_oil_ammo},
|
||||
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,9 +58,12 @@ return {
|
||||
[12] = {tile = 'hazard-concrete-left'},
|
||||
[13] = {entity = {name = 'stone-wall'}},
|
||||
[14] = {entity = {name = 'stone-wall'}},
|
||||
[15] = {entity = {name = 'gun-turret', offset = 3}, tile = 'hazard-concrete-left'},
|
||||
[15] = {entity = {name = 'gun-turret', callback = 'turret', offset = 3}, tile = 'hazard-concrete-left'},
|
||||
[16] = {tile = 'hazard-concrete-left'},
|
||||
[17] = {entity = {name = 'flamethrower-turret', callback = 'turret', offset = 1}, tile = 'hazard-concrete-left'},
|
||||
[17] = {
|
||||
entity = {name = 'flamethrower-turret', callback = 'flame_turret', offset = 1},
|
||||
tile = 'hazard-concrete-left'
|
||||
},
|
||||
[18] = {tile = 'hazard-concrete-left'},
|
||||
[19] = {entity = {name = 'stone-wall'}},
|
||||
[20] = {entity = {name = 'stone-wall'}},
|
||||
@@ -69,11 +74,11 @@ return {
|
||||
[25] = {entity = {name = 'stone-wall'}},
|
||||
[26] = {tile = 'hazard-concrete-left'},
|
||||
[27] = {
|
||||
entity = {name = 'flamethrower-turret', callback = 'turret', direction = 6, offset = 2},
|
||||
entity = {name = 'flamethrower-turret', callback = 'flame_turret', direction = 6, offset = 2},
|
||||
tile = 'hazard-concrete-left'
|
||||
},
|
||||
[28] = {tile = 'hazard-concrete-left'},
|
||||
[29] = {entity = {name = 'gun-turret', offset = 3}, tile = 'concrete'},
|
||||
[29] = {entity = {name = 'gun-turret', callback = 'turret', offset = 3}, tile = 'concrete'},
|
||||
[30] = {tile = 'concrete'},
|
||||
[31] = {entity = {name = 'stone-wall'}},
|
||||
[32] = {tile = 'hazard-concrete-left'},
|
||||
@@ -83,7 +88,8 @@ return {
|
||||
[36] = {tile = 'concrete'}
|
||||
},
|
||||
ob.make_4_way {
|
||||
turret = {callback = ob.refill_liquid_turret_callback, data = ob.light_oil_ammo},
|
||||
flame_turret = {callback = ob.refill_liquid_turret_callback, data = ob.light_oil_ammo},
|
||||
turret = {callback = ob.refill_turret_callback, data = ob.piercing_rounds_magazine_ammo},
|
||||
[1] = {entity = {name = 'stone-wall'}},
|
||||
[2] = {entity = {name = 'stone-wall'}},
|
||||
[3] = {tile = 'hazard-concrete-left'},
|
||||
@@ -95,7 +101,7 @@ return {
|
||||
[9] = {tile = 'hazard-concrete-left'},
|
||||
[10] = {tile = 'concrete'},
|
||||
[11] = {
|
||||
entity = {name = 'flamethrower-turret', callback = 'turret', direction = 6, offset = 2},
|
||||
entity = {name = 'flamethrower-turret', callback = 'flame_turret', direction = 6, offset = 2},
|
||||
tile = 'concrete'
|
||||
},
|
||||
[12] = {tile = 'concrete'},
|
||||
@@ -108,11 +114,11 @@ return {
|
||||
[19] = {tile = 'concrete'},
|
||||
[20] = {tile = 'concrete'},
|
||||
[21] = {tile = 'concrete'},
|
||||
[22] = {entity = {name = 'gun-turret', offset = 3}, tile = 'concrete'},
|
||||
[22] = {entity = {name = 'gun-turret', callback = 'turret', offset = 3}, tile = 'concrete'},
|
||||
[23] = {tile = 'concrete'},
|
||||
[24] = {tile = 'concrete'},
|
||||
[25] = {tile = 'concrete'},
|
||||
[26] = {entity = {name = 'flamethrower-turret', callback = 'turret', offset = 1}, tile = 'concrete'},
|
||||
[26] = {entity = {name = 'flamethrower-turret', callback = 'flame_turret', offset = 1}, tile = 'concrete'},
|
||||
[27] = {tile = 'concrete'},
|
||||
[28] = {tile = 'concrete'},
|
||||
[29] = {tile = 'concrete'},
|
||||
|
||||
@@ -74,15 +74,6 @@ local level3b =
|
||||
)
|
||||
|
||||
local level4 =
|
||||
ob.extend_1_way(
|
||||
base_factory[3],
|
||||
{
|
||||
market = market,
|
||||
fallback = level3
|
||||
}
|
||||
)
|
||||
|
||||
local level4b =
|
||||
ob.extend_1_way(
|
||||
base_factory[3],
|
||||
{
|
||||
@@ -90,6 +81,7 @@ local level4b =
|
||||
fallback = level3b
|
||||
}
|
||||
)
|
||||
|
||||
return {
|
||||
settings = {
|
||||
blocks = 7,
|
||||
@@ -101,6 +93,6 @@ return {
|
||||
require 'map_gen.presets.crash_site.outpost_data.medium_gun_turrets'
|
||||
},
|
||||
bases = {
|
||||
{level4, level4, level4b, level2}
|
||||
{level4, level3, level2}
|
||||
}
|
||||
}
|
||||
|
||||
138
map_gen/presets/crash_site/outpost_data/medium_oil_refinery.lua
Normal file
138
map_gen/presets/crash_site/outpost_data/medium_oil_refinery.lua
Normal file
@@ -0,0 +1,138 @@
|
||||
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 = 'crude-oil-barrel', count = 100, distance_factor = 1 / 20}, weight = 2},
|
||||
{stack = {name = 'heavy-oil-barrel', count = 100, distance_factor = 1 / 20}, weight = 2},
|
||||
{stack = {name = 'light-oil-barrel', count = 100, distance_factor = 1 / 20}, weight = 2},
|
||||
{stack = {name = 'petroleum-gas-barrel', count = 100, distance_factor = 1 / 20}, weight = 2},
|
||||
{stack = {name = 'lubricant-barrel', count = 100, distance_factor = 1 / 20}, weight = 1},
|
||||
{stack = {name = 'sulfuric-acid-barrel', count = 100, distance_factor = 1 / 20}, weight = 1}
|
||||
}
|
||||
|
||||
local weights = ob.prepare_weighted_loot(loot)
|
||||
|
||||
local loot_callback =
|
||||
Token.register(
|
||||
function(chest)
|
||||
ob.do_random_loot(chest, weights, loot)
|
||||
end
|
||||
)
|
||||
|
||||
local fluid_loot = {
|
||||
{stack = {name = 'light-oil', count = 17500, distance_factor = 5}, weight = 4},
|
||||
{stack = {name = 'heavy-oil', count = 17500, distance_factor = 5}, weight = 3}
|
||||
}
|
||||
|
||||
local fluid_weights = ob.prepare_weighted_loot(fluid_loot)
|
||||
|
||||
local fluid_loot_callback =
|
||||
Token.register(
|
||||
function(chest)
|
||||
ob.do_random_fluid_loot(chest, fluid_weights, fluid_loot)
|
||||
end
|
||||
)
|
||||
|
||||
local factory = {
|
||||
callback = ob.magic_item_crafting_callback,
|
||||
data = {
|
||||
recipe = 'advanced-oil-processing',
|
||||
keep_active = true,
|
||||
output = {
|
||||
{min_rate = 1 / 60, distance_factor = 1 / 60 / 100, item = 'heavy-oil', fluidbox_index = 3},
|
||||
{min_rate = 4.5 / 60, distance_factor = 4.5 / 60 / 100, item = 'light-oil', fluidbox_index = 4},
|
||||
{min_rate = 5.5 / 60, distance_factor = 5.5 / 60 / 100, item = 'petroleum-gas', fluidbox_index = 5}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
local market = {
|
||||
callback = ob.market_set_items_callback,
|
||||
data = {
|
||||
{
|
||||
name = 'crude-oil-barrel',
|
||||
price = 10,
|
||||
distance_factor = 0.005 / 32,
|
||||
min_price = 1
|
||||
},
|
||||
{
|
||||
name = 'heavy-oil-barrel',
|
||||
price = 15,
|
||||
distance_factor = 0.005 / 32,
|
||||
min_price = 1
|
||||
},
|
||||
{
|
||||
name = 'light-oil-barrel',
|
||||
price = 20,
|
||||
distance_factor = 0.005 / 32,
|
||||
min_price = 1
|
||||
},
|
||||
{
|
||||
name = 'petroleum-gas-barrel',
|
||||
price = 25,
|
||||
distance_factor = 0.005 / 32,
|
||||
min_price = 1
|
||||
},
|
||||
{
|
||||
name = 'lubricant-barrel',
|
||||
price = 15,
|
||||
distance_factor = 0.005 / 32,
|
||||
min_price = 1
|
||||
},
|
||||
{
|
||||
name = 'sulfuric-acid-barrel',
|
||||
price = 40,
|
||||
distance_factor = 0.005 / 32,
|
||||
min_price = 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
local base_factory = require 'map_gen.presets.crash_site.outpost_data.medium_refinery'
|
||||
local storage_tank = require 'map_gen.presets.crash_site.outpost_data.storage_tank_block'
|
||||
|
||||
local level2 = ob.extend_1_way(base_factory[1], {loot = {callback = loot_callback}})
|
||||
|
||||
local level2b =
|
||||
ob.extend_1_way(
|
||||
storage_tank,
|
||||
{
|
||||
tank = {callback = fluid_loot_callback},
|
||||
fallback = level2,
|
||||
max_count = 3
|
||||
}
|
||||
)
|
||||
|
||||
local level3 =
|
||||
ob.extend_1_way(
|
||||
base_factory[2],
|
||||
{
|
||||
factory = factory,
|
||||
fallback = level2b,
|
||||
max_count = 4
|
||||
}
|
||||
)
|
||||
local level4 =
|
||||
ob.extend_1_way(
|
||||
base_factory[3],
|
||||
{
|
||||
market = market,
|
||||
fallback = level3
|
||||
}
|
||||
)
|
||||
return {
|
||||
settings = {
|
||||
blocks = 7,
|
||||
variance = 3,
|
||||
min_step = 2,
|
||||
max_level = 2
|
||||
},
|
||||
walls = {
|
||||
require 'map_gen.presets.crash_site.outpost_data.medium_flame_turrets'
|
||||
},
|
||||
bases = {
|
||||
{level4, level2}
|
||||
}
|
||||
}
|
||||
128
map_gen/presets/crash_site/outpost_data/medium_refinery.lua
Normal file
128
map_gen/presets/crash_site/outpost_data/medium_refinery.lua
Normal file
@@ -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 = 'refined-concrete'},
|
||||
[2] = {tile = 'refined-concrete'},
|
||||
[3] = {tile = 'refined-concrete'},
|
||||
[4] = {tile = 'refined-concrete'},
|
||||
[5] = {tile = 'refined-concrete'},
|
||||
[6] = {tile = 'concrete'},
|
||||
[7] = {tile = 'refined-concrete'},
|
||||
[8] = {tile = 'refined-concrete'},
|
||||
[9] = {tile = 'refined-concrete'},
|
||||
[10] = {tile = 'refined-concrete'},
|
||||
[11] = {tile = 'refined-concrete'},
|
||||
[12] = {tile = 'concrete'},
|
||||
[13] = {tile = 'refined-concrete'},
|
||||
[14] = {tile = 'refined-concrete'},
|
||||
[15] = {entity = {name = 'oil-refinery', callback = 'factory'}, tile = 'refined-concrete'},
|
||||
[16] = {tile = 'refined-concrete'},
|
||||
[17] = {tile = 'refined-concrete'},
|
||||
[18] = {tile = 'concrete'},
|
||||
[19] = {tile = 'refined-concrete'},
|
||||
[20] = {tile = 'refined-concrete'},
|
||||
[21] = {tile = 'refined-concrete'},
|
||||
[22] = {tile = 'refined-concrete'},
|
||||
[23] = {tile = 'refined-concrete'},
|
||||
[24] = {tile = 'concrete'},
|
||||
[25] = {tile = 'refined-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}
|
||||
@@ -95,9 +95,9 @@ local market = {
|
||||
},
|
||||
{
|
||||
name = 'cluster-grenade',
|
||||
price = 60,
|
||||
price = 100,
|
||||
distance_factor = 0.005 / 32,
|
||||
min_price = 6
|
||||
min_price = 10
|
||||
},
|
||||
{
|
||||
name = 'poison-capsule',
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
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 = 'coal', count = 1000, distance_factor = 1}, weight = 2},
|
||||
{stack = {name = 'sulfur', count = 500, distance_factor = 1 / 2}, weight = 5},
|
||||
{stack = {name = 'plastic-bar', count = 500, distance_factor = 1 / 2}, 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 factory = {
|
||||
callback = ob.magic_item_crafting_callback,
|
||||
data = {
|
||||
recipe = 'sulfur',
|
||||
output = {min_rate = 1 / 60, distance_factor = 1 / 60 / 100, item = 'sulfur'}
|
||||
}
|
||||
}
|
||||
|
||||
local factory_b = {
|
||||
callback = ob.magic_item_crafting_callback,
|
||||
data = {
|
||||
recipe = 'plastic-bar',
|
||||
output = {min_rate = 1 / 60, distance_factor = 1 / 60 / 100, item = 'plastic-bar'}
|
||||
}
|
||||
}
|
||||
|
||||
local market = {
|
||||
callback = ob.market_set_items_callback,
|
||||
data = {
|
||||
{
|
||||
name = 'coal',
|
||||
price = 0.25,
|
||||
distance_factor = 0.005 / 32,
|
||||
min_price = 0.025
|
||||
},
|
||||
{
|
||||
name = 'sulfur',
|
||||
price = 2,
|
||||
distance_factor = 0.005 / 32,
|
||||
min_price = 0.2
|
||||
},
|
||||
{
|
||||
name = 'plastic-bar',
|
||||
price = 2,
|
||||
distance_factor = 0.005 / 32,
|
||||
min_price = 0.2
|
||||
},
|
||||
{
|
||||
name = 'solid-fuel',
|
||||
price = 1,
|
||||
distance_factor = 0.005 / 32,
|
||||
min_price = 0.1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
local base_factory = require 'map_gen.presets.crash_site.outpost_data.small_chemical_plant'
|
||||
|
||||
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,
|
||||
max_count = 2
|
||||
}
|
||||
)
|
||||
local level3b =
|
||||
ob.extend_1_way(
|
||||
base_factory[2],
|
||||
{
|
||||
factory = factory_b,
|
||||
fallback = level3,
|
||||
max_count = 2
|
||||
}
|
||||
)
|
||||
local level4 =
|
||||
ob.extend_1_way(
|
||||
base_factory[3],
|
||||
{
|
||||
market = market,
|
||||
fallback = level3b
|
||||
}
|
||||
)
|
||||
return {
|
||||
settings = {
|
||||
blocks = 6,
|
||||
variance = 3,
|
||||
min_step = 2,
|
||||
max_level = 2
|
||||
},
|
||||
walls = {
|
||||
require 'map_gen.presets.crash_site.outpost_data.light_flame_turrets'
|
||||
},
|
||||
bases = {
|
||||
{level4, level3, level2}
|
||||
}
|
||||
}
|
||||
132
map_gen/presets/crash_site/outpost_data/small_chemical_plant.lua
Normal file
132
map_gen/presets/crash_site/outpost_data/small_chemical_plant.lua
Normal file
@@ -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 = 'chemical-plant', 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
|
||||
}
|
||||
138
map_gen/presets/crash_site/outpost_data/small_oil_refinery.lua
Normal file
138
map_gen/presets/crash_site/outpost_data/small_oil_refinery.lua
Normal file
@@ -0,0 +1,138 @@
|
||||
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 = 'crude-oil-barrel', count = 100, distance_factor = 1 / 20}, weight = 2},
|
||||
{stack = {name = 'heavy-oil-barrel', count = 100, distance_factor = 1 / 20}, weight = 2},
|
||||
{stack = {name = 'light-oil-barrel', count = 100, distance_factor = 1 / 20}, weight = 2},
|
||||
{stack = {name = 'petroleum-gas-barrel', count = 100, distance_factor = 1 / 20}, weight = 2},
|
||||
{stack = {name = 'lubricant-barrel', count = 100, distance_factor = 1 / 20}, weight = 1},
|
||||
{stack = {name = 'sulfuric-acid-barrel', count = 100, distance_factor = 1 / 20}, weight = 1}
|
||||
}
|
||||
|
||||
local weights = ob.prepare_weighted_loot(loot)
|
||||
|
||||
local loot_callback =
|
||||
Token.register(
|
||||
function(chest)
|
||||
ob.do_random_loot(chest, weights, loot)
|
||||
end
|
||||
)
|
||||
|
||||
local fluid_loot = {
|
||||
{weight = 5},
|
||||
{stack = {name = 'crude-oil', count = 12500, distance_factor = 5}, weight = 10}
|
||||
}
|
||||
|
||||
local fluid_weights = ob.prepare_weighted_loot(fluid_loot)
|
||||
|
||||
local fluid_loot_callback =
|
||||
Token.register(
|
||||
function(chest)
|
||||
ob.do_random_fluid_loot(chest, fluid_weights, fluid_loot)
|
||||
end
|
||||
)
|
||||
|
||||
local factory = {
|
||||
callback = ob.magic_item_crafting_callback,
|
||||
data = {
|
||||
recipe = 'basic-oil-processing',
|
||||
keep_active = true,
|
||||
output = {
|
||||
{min_rate = 3 / 60, distance_factor = 3 / 60 / 100, item = 'heavy-oil', fluidbox_index = 2},
|
||||
{min_rate = 3 / 60, distance_factor = 3 / 60 / 100, item = 'light-oil', fluidbox_index = 3},
|
||||
{min_rate = 4 / 60, distance_factor = 4 / 60 / 100, item = 'petroleum-gas', fluidbox_index = 4}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
local market = {
|
||||
callback = ob.market_set_items_callback,
|
||||
data = {
|
||||
{
|
||||
name = 'crude-oil-barrel',
|
||||
price = 10,
|
||||
distance_factor = 0.005 / 32,
|
||||
min_price = 1
|
||||
},
|
||||
{
|
||||
name = 'heavy-oil-barrel',
|
||||
price = 15,
|
||||
distance_factor = 0.005 / 32,
|
||||
min_price = 1
|
||||
},
|
||||
{
|
||||
name = 'light-oil-barrel',
|
||||
price = 20,
|
||||
distance_factor = 0.005 / 32,
|
||||
min_price = 1
|
||||
},
|
||||
{
|
||||
name = 'petroleum-gas-barrel',
|
||||
price = 25,
|
||||
distance_factor = 0.005 / 32,
|
||||
min_price = 1
|
||||
},
|
||||
{
|
||||
name = 'lubricant-barrel',
|
||||
price = 15,
|
||||
distance_factor = 0.005 / 32,
|
||||
min_price = 1
|
||||
},
|
||||
{
|
||||
name = 'sulfuric-acid-barrel',
|
||||
price = 40,
|
||||
distance_factor = 0.005 / 32,
|
||||
min_price = 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
local base_factory = require 'map_gen.presets.crash_site.outpost_data.small_refinery'
|
||||
local storage_tank = require 'map_gen.presets.crash_site.outpost_data.storage_tank_block'
|
||||
|
||||
local level2 = ob.extend_1_way(base_factory[1], {loot = {callback = loot_callback}})
|
||||
|
||||
local level2b =
|
||||
ob.extend_1_way(
|
||||
storage_tank,
|
||||
{
|
||||
tank = {callback = fluid_loot_callback},
|
||||
fallback = level2,
|
||||
max_count = 2
|
||||
}
|
||||
)
|
||||
|
||||
local level3 =
|
||||
ob.extend_1_way(
|
||||
base_factory[2],
|
||||
{
|
||||
factory = factory,
|
||||
max_count = 2,
|
||||
fallback = level2b
|
||||
}
|
||||
)
|
||||
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_flame_turrets'
|
||||
},
|
||||
bases = {
|
||||
{level4, level2}
|
||||
}
|
||||
}
|
||||
132
map_gen/presets/crash_site/outpost_data/small_refinery.lua
Normal file
132
map_gen/presets/crash_site/outpost_data/small_refinery.lua
Normal file
@@ -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 = 'concrete'},
|
||||
[2] = {tile = 'concrete'},
|
||||
[3] = {tile = 'concrete'},
|
||||
[4] = {tile = 'concrete'},
|
||||
[5] = {tile = 'concrete'},
|
||||
[6] = {tile = 'stone-path'},
|
||||
[7] = {tile = 'concrete'},
|
||||
[8] = {tile = 'concrete'},
|
||||
[9] = {tile = 'concrete'},
|
||||
[10] = {tile = 'concrete'},
|
||||
[11] = {tile = 'concrete'},
|
||||
[12] = {tile = 'stone-path'},
|
||||
[13] = {tile = 'concrete'},
|
||||
[14] = {tile = 'concrete'},
|
||||
[15] = {entity = {name = 'oil-refinery', callback = 'factory'}, tile = 'concrete'},
|
||||
[16] = {tile = 'concrete'},
|
||||
[17] = {tile = 'concrete'},
|
||||
[18] = {tile = 'stone-path'},
|
||||
[19] = {tile = 'concrete'},
|
||||
[20] = {tile = 'concrete'},
|
||||
[21] = {tile = 'concrete'},
|
||||
[22] = {tile = 'concrete'},
|
||||
[23] = {tile = 'concrete'},
|
||||
[24] = {tile = 'stone-path'},
|
||||
[25] = {tile = 'concrete'},
|
||||
[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
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
local ob = require 'map_gen.presets.crash_site.outpost_builder'
|
||||
|
||||
return ob.make_1_way{
|
||||
[1] = {tile = 'concrete'},
|
||||
[2] = {tile = 'concrete'},
|
||||
[3] = {tile = 'concrete'},
|
||||
[4] = {tile = 'concrete'},
|
||||
[5] = {tile = 'concrete'},
|
||||
[6] = {tile = 'concrete'},
|
||||
[7] = {tile = 'concrete'},
|
||||
[8] = {entity = {name = 'storage-tank', callback ='tank'}, tile = 'concrete'},
|
||||
[9] = {tile = 'concrete'},
|
||||
[10] = {tile = 'concrete'},
|
||||
[11] = {entity = {name = 'storage-tank', callback ='tank'}, tile = 'concrete'},
|
||||
[12] = {tile = 'concrete'},
|
||||
[13] = {tile = 'concrete'},
|
||||
[14] = {tile = 'concrete'},
|
||||
[15] = {tile = 'concrete'},
|
||||
[16] = {tile = 'concrete'},
|
||||
[17] = {tile = 'concrete'},
|
||||
[18] = {tile = 'concrete'},
|
||||
[19] = {tile = 'concrete'},
|
||||
[20] = {tile = 'concrete'},
|
||||
[21] = {tile = 'concrete'},
|
||||
[22] = {tile = 'concrete'},
|
||||
[23] = {tile = 'concrete'},
|
||||
[24] = {tile = 'concrete'},
|
||||
[25] = {tile = 'concrete'},
|
||||
[26] = {entity = {name = 'storage-tank', callback ='tank'}, tile = 'concrete'},
|
||||
[27] = {tile = 'concrete'},
|
||||
[28] = {tile = 'concrete'},
|
||||
[29] = {entity = {name = 'storage-tank', callback ='tank'}, tile = 'concrete'},
|
||||
[30] = {tile = 'concrete'},
|
||||
[31] = {tile = 'concrete'},
|
||||
[32] = {tile = 'concrete'},
|
||||
[33] = {tile = 'concrete'},
|
||||
[34] = {tile = 'concrete'},
|
||||
[35] = {tile = 'concrete'},
|
||||
[36] = {tile = 'concrete'}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
local ob = require 'map_gen.presets.crash_site.outpost_builder'
|
||||
|
||||
return {
|
||||
local walls = {
|
||||
ob.make_4_way {
|
||||
force = 'player',
|
||||
[1] = {entity = {name = 'stone-wall'}},
|
||||
@@ -8,9 +8,40 @@ return {
|
||||
[3] = {entity = {name = 'stone-wall'}},
|
||||
[4] = {entity = {name = 'stone-wall'}},
|
||||
[5] = {entity = {name = 'stone-wall'}},
|
||||
[6] = {entity = {name = 'stone-wall'}}
|
||||
[6] = {entity = {name = 'stone-wall'}},
|
||||
[7] = {tile = 'stone-path'},
|
||||
[8] = {tile = 'stone-path'},
|
||||
[9] = {tile = 'stone-path'},
|
||||
[10] = {tile = 'stone-path'},
|
||||
[11] = {tile = 'stone-path'},
|
||||
[12] = {tile = 'stone-path'},
|
||||
[13] = {tile = 'stone-path'},
|
||||
[14] = {tile = 'stone-path'},
|
||||
[15] = {tile = 'stone-path'},
|
||||
[16] = {tile = 'stone-path'},
|
||||
[17] = {tile = 'stone-path'},
|
||||
[18] = {tile = 'stone-path'},
|
||||
[19] = {tile = 'stone-path'},
|
||||
[20] = {tile = 'stone-path'},
|
||||
[21] = {tile = 'stone-path'},
|
||||
[22] = {tile = 'stone-path'},
|
||||
[23] = {tile = 'stone-path'},
|
||||
[24] = {tile = 'stone-path'},
|
||||
[25] = {tile = 'stone-path'},
|
||||
[26] = {tile = 'stone-path'},
|
||||
[27] = {tile = 'stone-path'},
|
||||
[28] = {tile = 'stone-path'},
|
||||
[29] = {tile = 'stone-path'},
|
||||
[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'}
|
||||
},
|
||||
ob.make_4_way {
|
||||
force = 'player',
|
||||
[1] = {entity = {name = 'stone-wall'}},
|
||||
[2] = {entity = {name = 'stone-wall'}},
|
||||
[3] = {entity = {name = 'stone-wall'}},
|
||||
@@ -18,12 +49,125 @@ return {
|
||||
[5] = {entity = {name = 'stone-wall'}},
|
||||
[6] = {entity = {name = 'stone-wall'}},
|
||||
[7] = {entity = {name = 'stone-wall'}},
|
||||
[8] = {tile = 'stone-path'},
|
||||
[9] = {tile = 'stone-path'},
|
||||
[10] = {tile = 'stone-path'},
|
||||
[11] = {tile = 'stone-path'},
|
||||
[12] = {tile = 'stone-path'},
|
||||
[13] = {entity = {name = 'stone-wall'}},
|
||||
[14] = {tile = 'stone-path'},
|
||||
[15] = {tile = 'stone-path'},
|
||||
[16] = {tile = 'stone-path'},
|
||||
[17] = {tile = 'stone-path'},
|
||||
[18] = {tile = 'stone-path'},
|
||||
[19] = {entity = {name = 'stone-wall'}},
|
||||
[20] = {tile = 'stone-path'},
|
||||
[21] = {tile = 'stone-path'},
|
||||
[22] = {tile = 'stone-path'},
|
||||
[23] = {tile = 'stone-path'},
|
||||
[24] = {tile = 'stone-path'},
|
||||
[25] = {entity = {name = 'stone-wall'}},
|
||||
[31] = {entity = {name = 'stone-wall'}}
|
||||
[26] = {tile = 'stone-path'},
|
||||
[27] = {tile = 'stone-path'},
|
||||
[28] = {tile = 'stone-path'},
|
||||
[29] = {tile = 'stone-path'},
|
||||
[30] = {tile = 'stone-path'},
|
||||
[31] = {entity = {name = 'stone-wall'}},
|
||||
[32] = {tile = 'stone-path'},
|
||||
[33] = {tile = 'stone-path'},
|
||||
[34] = {tile = 'stone-path'},
|
||||
[35] = {tile = 'stone-path'},
|
||||
[36] = {tile = 'stone-path'}
|
||||
},
|
||||
ob.make_4_way {
|
||||
[1] = {entity = {name = 'stone-wall'}}
|
||||
force = 'player',
|
||||
[1] = {entity = {name = 'stone-wall'}},
|
||||
[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 = 'stone-path'},
|
||||
[9] = {tile = 'stone-path'},
|
||||
[10] = {tile = 'stone-path'},
|
||||
[11] = {tile = 'stone-path'},
|
||||
[12] = {tile = 'stone-path'},
|
||||
[13] = {tile = 'stone-path'},
|
||||
[14] = {tile = 'stone-path'},
|
||||
[15] = {tile = 'stone-path'},
|
||||
[16] = {tile = 'stone-path'},
|
||||
[17] = {tile = 'stone-path'},
|
||||
[18] = {tile = 'stone-path'},
|
||||
[19] = {tile = 'stone-path'},
|
||||
[20] = {tile = 'stone-path'},
|
||||
[21] = {tile = 'stone-path'},
|
||||
[22] = {tile = 'stone-path'},
|
||||
[23] = {tile = 'stone-path'},
|
||||
[24] = {tile = 'stone-path'},
|
||||
[25] = {tile = 'stone-path'},
|
||||
[26] = {tile = 'stone-path'},
|
||||
[27] = {tile = 'stone-path'},
|
||||
[28] = {tile = 'stone-path'},
|
||||
[29] = {tile = 'stone-path'},
|
||||
[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 bases = {
|
||||
ob.make_1_way {
|
||||
[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 = 'stone-path'},
|
||||
[9] = {tile = 'stone-path'},
|
||||
[10] = {tile = 'stone-path'},
|
||||
[11] = {tile = 'stone-path'},
|
||||
[12] = {tile = 'stone-path'},
|
||||
[13] = {tile = 'stone-path'},
|
||||
[14] = {tile = 'stone-path'},
|
||||
[15] = {tile = 'stone-path'},
|
||||
[16] = {tile = 'stone-path'},
|
||||
[17] = {tile = 'stone-path'},
|
||||
[18] = {tile = 'stone-path'},
|
||||
[19] = {tile = 'stone-path'},
|
||||
[20] = {tile = 'stone-path'},
|
||||
[21] = {tile = 'stone-path'},
|
||||
[22] = {tile = 'stone-path'},
|
||||
[23] = {tile = 'stone-path'},
|
||||
[24] = {tile = 'stone-path'},
|
||||
[25] = {tile = 'stone-path'},
|
||||
[26] = {tile = 'stone-path'},
|
||||
[27] = {tile = 'stone-path'},
|
||||
[28] = {tile = 'stone-path'},
|
||||
[29] = {tile = 'stone-path'},
|
||||
[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 = 20,
|
||||
variance = 3,
|
||||
min_step = 2,
|
||||
max_level = 2
|
||||
},
|
||||
walls = {walls},
|
||||
bases = {bases}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user