mirror of
https://github.com/Refactorio/RedMew.git
synced 2025-03-05 15:05:57 +02:00
crashsite 0.3.0
This commit is contained in:
parent
c980b30787
commit
9fed3f725b
@ -8,8 +8,8 @@ local Random = require 'map_gen.shared.random'
|
|||||||
local OutpostBuilder = require 'map_gen.presets.crash_site.outpost_builder'
|
local OutpostBuilder = require 'map_gen.presets.crash_site.outpost_builder'
|
||||||
local Perlin = require 'map_gen.shared.perlin_noise'
|
local Perlin = require 'map_gen.shared.perlin_noise'
|
||||||
|
|
||||||
local outpost_seed = 7000
|
local outpost_seed = 20000
|
||||||
local ore_seed = 9000
|
local ore_seed = 14000
|
||||||
local enemy_seed = 420420
|
local enemy_seed = 420420
|
||||||
|
|
||||||
local outpost_random = Random.new(outpost_seed, outpost_seed * 2)
|
local outpost_random = Random.new(outpost_seed, outpost_seed * 2)
|
||||||
@ -24,6 +24,10 @@ local small_copper_plate_factory = require 'map_gen.presets.crash_site.outpost_d
|
|||||||
local medium_copper_plate_factory = require 'map_gen.presets.crash_site.outpost_data.medium_copper_plate_factory'
|
local medium_copper_plate_factory = require 'map_gen.presets.crash_site.outpost_data.medium_copper_plate_factory'
|
||||||
local big_copper_plate_factory = require 'map_gen.presets.crash_site.outpost_data.big_copper_plate_factory'
|
local big_copper_plate_factory = require 'map_gen.presets.crash_site.outpost_data.big_copper_plate_factory'
|
||||||
|
|
||||||
|
local small_stone_factory = require 'map_gen.presets.crash_site.outpost_data.small_stone_factory'
|
||||||
|
local medium_stone_factory = require 'map_gen.presets.crash_site.outpost_data.medium_stone_factory'
|
||||||
|
local big_stone_factory = require 'map_gen.presets.crash_site.outpost_data.big_stone_factory'
|
||||||
|
|
||||||
local small_gear_factory = require 'map_gen.presets.crash_site.outpost_data.small_gear_factory'
|
local small_gear_factory = require 'map_gen.presets.crash_site.outpost_data.small_gear_factory'
|
||||||
local medium_gear_factory = require 'map_gen.presets.crash_site.outpost_data.medium_gear_factory'
|
local medium_gear_factory = require 'map_gen.presets.crash_site.outpost_data.medium_gear_factory'
|
||||||
local big_gear_factory = require 'map_gen.presets.crash_site.outpost_data.big_gear_factory'
|
local big_gear_factory = require 'map_gen.presets.crash_site.outpost_data.big_gear_factory'
|
||||||
@ -32,14 +36,14 @@ local small_circuit_factory = require 'map_gen.presets.crash_site.outpost_data.s
|
|||||||
local medium_circuit_factory = require 'map_gen.presets.crash_site.outpost_data.medium_circuit_factory'
|
local medium_circuit_factory = require 'map_gen.presets.crash_site.outpost_data.medium_circuit_factory'
|
||||||
local big_circuit_factory = require 'map_gen.presets.crash_site.outpost_data.big_circuit_factory'
|
local big_circuit_factory = require 'map_gen.presets.crash_site.outpost_data.big_circuit_factory'
|
||||||
|
|
||||||
local small_engine_factory = require 'map_gen.presets.crash_site.outpost_data.small_engine_factory'
|
|
||||||
local medium_engine_factory = require 'map_gen.presets.crash_site.outpost_data.medium_engine_factory'
|
|
||||||
local big_engine_factory = require 'map_gen.presets.crash_site.outpost_data.big_engine_factory'
|
|
||||||
|
|
||||||
local small_ammo_factory = require 'map_gen.presets.crash_site.outpost_data.small_ammo_factory'
|
local small_ammo_factory = require 'map_gen.presets.crash_site.outpost_data.small_ammo_factory'
|
||||||
local medium_ammo_factory = require 'map_gen.presets.crash_site.outpost_data.medium_ammo_factory'
|
local medium_ammo_factory = require 'map_gen.presets.crash_site.outpost_data.medium_ammo_factory'
|
||||||
local big_ammo_factory = require 'map_gen.presets.crash_site.outpost_data.big_ammo_factory'
|
local big_ammo_factory = require 'map_gen.presets.crash_site.outpost_data.big_ammo_factory'
|
||||||
|
|
||||||
|
local small_weapon_factory = require 'map_gen.presets.crash_site.outpost_data.small_weapon_factory'
|
||||||
|
local medium_weapon_factory = require 'map_gen.presets.crash_site.outpost_data.medium_weapon_factory'
|
||||||
|
local big_weapon_factory = require 'map_gen.presets.crash_site.outpost_data.big_weapon_factory'
|
||||||
|
|
||||||
local small_science_factory = require 'map_gen.presets.crash_site.outpost_data.small_science_factory'
|
local small_science_factory = require 'map_gen.presets.crash_site.outpost_data.small_science_factory'
|
||||||
local medium_science_factory = require 'map_gen.presets.crash_site.outpost_data.medium_science_factory'
|
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 big_science_factory = require 'map_gen.presets.crash_site.outpost_data.big_science_factory'
|
||||||
@ -52,14 +56,18 @@ local small_chemical_factory = require 'map_gen.presets.crash_site.outpost_data.
|
|||||||
local medium_chemical_factory = require 'map_gen.presets.crash_site.outpost_data.medium_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 big_chemical_factory = require 'map_gen.presets.crash_site.outpost_data.big_chemical_factory'
|
||||||
|
|
||||||
|
--[[ local small_power_factory = require 'map_gen.presets.crash_site.outpost_data.small_power_factory'
|
||||||
|
local medium_power_factory = require 'map_gen.presets.crash_site.outpost_data.medium_power_factory'
|
||||||
|
local big_power_factory = require 'map_gen.presets.crash_site.outpost_data.big_power_factory' ]]
|
||||||
local stage1 = {
|
local stage1 = {
|
||||||
small_iron_plate_factory,
|
small_iron_plate_factory,
|
||||||
small_iron_plate_factory,
|
small_iron_plate_factory,
|
||||||
small_copper_plate_factory,
|
small_copper_plate_factory,
|
||||||
|
small_stone_factory,
|
||||||
small_gear_factory,
|
small_gear_factory,
|
||||||
small_circuit_factory,
|
small_circuit_factory,
|
||||||
small_engine_factory,
|
|
||||||
small_ammo_factory,
|
small_ammo_factory,
|
||||||
|
small_weapon_factory,
|
||||||
small_science_factory,
|
small_science_factory,
|
||||||
small_oil_refinery,
|
small_oil_refinery,
|
||||||
small_chemical_factory
|
small_chemical_factory
|
||||||
@ -68,10 +76,11 @@ local stage1 = {
|
|||||||
local stage2 = {
|
local stage2 = {
|
||||||
medium_iron_plate_factory,
|
medium_iron_plate_factory,
|
||||||
medium_copper_plate_factory,
|
medium_copper_plate_factory,
|
||||||
|
medium_stone_factory,
|
||||||
medium_gear_factory,
|
medium_gear_factory,
|
||||||
medium_circuit_factory,
|
medium_circuit_factory,
|
||||||
medium_engine_factory,
|
|
||||||
medium_ammo_factory,
|
medium_ammo_factory,
|
||||||
|
medium_weapon_factory,
|
||||||
medium_science_factory,
|
medium_science_factory,
|
||||||
medium_oil_refinery,
|
medium_oil_refinery,
|
||||||
medium_chemical_factory
|
medium_chemical_factory
|
||||||
@ -80,10 +89,11 @@ local stage2 = {
|
|||||||
local stage3 = {
|
local stage3 = {
|
||||||
big_iron_plate_factory,
|
big_iron_plate_factory,
|
||||||
big_copper_plate_factory,
|
big_copper_plate_factory,
|
||||||
|
big_stone_factory,
|
||||||
big_gear_factory,
|
big_gear_factory,
|
||||||
big_circuit_factory,
|
big_circuit_factory,
|
||||||
big_engine_factory,
|
|
||||||
big_ammo_factory,
|
big_ammo_factory,
|
||||||
|
big_weapon_factory,
|
||||||
big_science_factory,
|
big_science_factory,
|
||||||
big_oil_refinery,
|
big_oil_refinery,
|
||||||
big_chemical_factory
|
big_chemical_factory
|
||||||
@ -171,7 +181,7 @@ local start_stone_patch =
|
|||||||
b.translate(start_patch, 32, 32),
|
b.translate(start_patch, 32, 32),
|
||||||
'stone',
|
'stone',
|
||||||
function()
|
function()
|
||||||
return 600
|
return 900
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
local start_coal_patch =
|
local start_coal_patch =
|
||||||
@ -212,9 +222,11 @@ end
|
|||||||
|
|
||||||
pattern[5][5] = start_outpost
|
pattern[5][5] = start_outpost
|
||||||
|
|
||||||
local outpost_offset = 64
|
local outpost_offset = 59
|
||||||
local grid_size = 200
|
local grid_block_size = 190
|
||||||
local half_total_size = grid_size * 0.5 * 8
|
local grid_number_of_blocks = 10
|
||||||
|
|
||||||
|
local half_total_size = grid_block_size * 0.5 * 8
|
||||||
|
|
||||||
for r = 4, 7 do
|
for r = 4, 7 do
|
||||||
local row = pattern[r]
|
local row = pattern[r]
|
||||||
@ -248,9 +260,9 @@ for r = 3, 8 do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
for r = 1, 10 do
|
for r = 1, grid_number_of_blocks do
|
||||||
local row = pattern[r]
|
local row = pattern[r]
|
||||||
for c = 1, 10 do
|
for c = 1, grid_number_of_blocks do
|
||||||
if not row[c] then
|
if not row[c] then
|
||||||
local template = stage3_iter()
|
local template = stage3_iter()
|
||||||
local shape = outpost_builder:do_outpost(template)
|
local shape = outpost_builder:do_outpost(template)
|
||||||
@ -264,9 +276,7 @@ for r = 1, 10 do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local outposts = b.grid_pattern(pattern, 10, 10, grid_block_size, grid_block_size)
|
||||||
|
|
||||||
local outposts = b.grid_pattern(pattern, 10, 10, grid_size, grid_size)
|
|
||||||
--outposts = b.if_else(outposts, b.full_shape)
|
--outposts = b.if_else(outposts, b.full_shape)
|
||||||
|
|
||||||
local spawners = {
|
local spawners = {
|
||||||
@ -280,8 +290,8 @@ local worms = {
|
|||||||
'big-worm-turret'
|
'big-worm-turret'
|
||||||
}
|
}
|
||||||
|
|
||||||
local max_spawner_chance = 1 / 160
|
local max_spawner_chance = 1 / 256
|
||||||
local spawner_chance_factor = 1 / (160 * 512)
|
local spawner_chance_factor = 1 / (256 * 512)
|
||||||
local max_worm_chance = 1 / 32
|
local max_worm_chance = 1 / 32
|
||||||
local worm_chance_factor = 1 / (32 * 512)
|
local worm_chance_factor = 1 / (32 * 512)
|
||||||
|
|
||||||
@ -294,7 +304,7 @@ local function enemy(x, y, world)
|
|||||||
--[[ if Perlin.noise(x * scale_factor, y * scale_factor, enemy_seed) < 0 then
|
--[[ if Perlin.noise(x * scale_factor, y * scale_factor, enemy_seed) < 0 then
|
||||||
return nil
|
return nil
|
||||||
end ]]
|
end ]]
|
||||||
local spawner_chance = d - 144
|
local spawner_chance = d - 128
|
||||||
|
|
||||||
if spawner_chance > 0 then
|
if spawner_chance > 0 then
|
||||||
spawner_chance = spawner_chance * spawner_chance_factor
|
spawner_chance = spawner_chance * spawner_chance_factor
|
||||||
@ -305,7 +315,7 @@ local function enemy(x, y, world)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local worm_chance = d - 144
|
local worm_chance = d - 128
|
||||||
|
|
||||||
if worm_chance > 0 then
|
if worm_chance > 0 then
|
||||||
worm_chance = worm_chance * worm_chance_factor
|
worm_chance = worm_chance * worm_chance_factor
|
||||||
@ -461,9 +471,14 @@ spawn_shape = b.change_tile(spawn_shape, false, 'stone-path')
|
|||||||
|
|
||||||
map = b.choose(b.rectangle(16, 16), spawn_shape, map)
|
map = b.choose(b.rectangle(16, 16), spawn_shape, map)
|
||||||
|
|
||||||
--return outpost_builder:do_outpost(big_engine_factory)
|
local bounds = b.rectangle(grid_block_size * (grid_number_of_blocks - 1))
|
||||||
|
map = b.choose(bounds, map, b.empty_shape)
|
||||||
|
|
||||||
|
--return outpost_builder:do_outpost(small_power_factory)
|
||||||
|
|
||||||
--return b.full_shape
|
--return b.full_shape
|
||||||
|
|
||||||
return map
|
return map
|
||||||
|
--return spawn_shape
|
||||||
--return b.apply_entity(b.full_shape, ore_grid)
|
--return b.apply_entity(b.full_shape, ore_grid)
|
||||||
|
--/c game.player.character = nil
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
local Gui = require 'utils.gui'
|
local Gui = require 'utils.gui'
|
||||||
local Event = require 'utils.event'
|
local Event = require 'utils.event'
|
||||||
local Global = require 'utils.global'
|
local Global = require 'utils.global'
|
||||||
|
local PlayerStats = require 'player_stats'
|
||||||
|
|
||||||
local Public = {}
|
local Public = {}
|
||||||
|
|
||||||
@ -243,6 +244,7 @@ Gui.on_click(
|
|||||||
else
|
else
|
||||||
player.remove_item {name = 'coin', count = cost}
|
player.remove_item {name = 'coin', count = cost}
|
||||||
do_coin_label(player, data.coin_label)
|
do_coin_label(player, data.coin_label)
|
||||||
|
PlayerStats.change_coin_spent(player.index, cost)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -4,6 +4,7 @@ local Global = require 'utils.global'
|
|||||||
local Event = require 'utils.event'
|
local Event = require 'utils.event'
|
||||||
local Task = require 'utils.Task'
|
local Task = require 'utils.Task'
|
||||||
local Market = require 'map_gen.presets.crash_site.market'
|
local Market = require 'map_gen.presets.crash_site.market'
|
||||||
|
local PlayerStats = require 'player_stats'
|
||||||
|
|
||||||
local b = require 'map_gen.shared.builders'
|
local b = require 'map_gen.shared.builders'
|
||||||
|
|
||||||
@ -945,6 +946,22 @@ Public.power_source_callback =
|
|||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Public.power_source_player_callback =
|
||||||
|
Token.register(
|
||||||
|
function(entity, data)
|
||||||
|
local power_source =
|
||||||
|
entity.surface.create_entity {name = 'hidden-electric-energy-interface', position = entity.position}
|
||||||
|
power_source.electric_buffer_size = data.buffer_size
|
||||||
|
power_source.power_production = data.power_production
|
||||||
|
|
||||||
|
power_sources[entity.unit_number] = power_source
|
||||||
|
|
||||||
|
entity.minable = false
|
||||||
|
entity.operable = false
|
||||||
|
entity.destructible = false
|
||||||
|
end
|
||||||
|
)
|
||||||
|
|
||||||
local function add_magic_crafter_output(entity, output, distance)
|
local function add_magic_crafter_output(entity, output, distance)
|
||||||
local rate = output.min_rate + output.distance_factor * distance
|
local rate = output.min_rate + output.distance_factor * distance
|
||||||
table.insert(
|
table.insert(
|
||||||
@ -1049,13 +1066,16 @@ Public.market_set_items_callback =
|
|||||||
local market_data = {}
|
local market_data = {}
|
||||||
for i, item in ipairs(data) do
|
for i, item in ipairs(data) do
|
||||||
local price = item.price
|
local price = item.price
|
||||||
local df = item.distance_factor or 0
|
|
||||||
local min_price = item.min_price or 1
|
|
||||||
|
|
||||||
local count = price - d * df
|
local df = item.distance_factor
|
||||||
count = math.max(count, min_price)
|
if df then
|
||||||
|
local min_price = item.min_price or 1
|
||||||
|
|
||||||
market_data[i] = {name = item.name, price = count}
|
price = item.price - d * df
|
||||||
|
price = math.max(price, min_price)
|
||||||
|
end
|
||||||
|
|
||||||
|
market_data[i] = {name = item.name, price = price}
|
||||||
end
|
end
|
||||||
|
|
||||||
Market.add_market(entity.position, market_data)
|
Market.add_market(entity.position, market_data)
|
||||||
@ -1154,6 +1174,13 @@ function Public.do_random_fluid_loot(entity, weights, loot)
|
|||||||
entity.fluidbox[1] = {name = stack.name, amount = count}
|
entity.fluidbox[1] = {name = stack.name, amount = count}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function coin_mined(event)
|
||||||
|
local stack = event.item_stack
|
||||||
|
if stack.name == 'coin' then
|
||||||
|
PlayerStats.change_coin_earned(event.player_index, stack.count)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
Event.add(defines.events.on_tick, tick)
|
Event.add(defines.events.on_tick, tick)
|
||||||
Event.add(defines.events.on_entity_died, remove_power_source)
|
Event.add(defines.events.on_entity_died, remove_power_source)
|
||||||
|
|
||||||
@ -1163,4 +1190,6 @@ Event.on_init(
|
|||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Event.add(defines.events.on_player_mined_item, coin_mined)
|
||||||
|
|
||||||
return Public
|
return Public
|
||||||
|
@ -3,14 +3,11 @@ local Token = require 'utils.global_token'
|
|||||||
|
|
||||||
local loot = {
|
local loot = {
|
||||||
{weight = 10},
|
{weight = 10},
|
||||||
{stack = {name = 'coin', count = 250, distance_factor = 1 / 20}, weight = 5},
|
{stack = {name = 'coin', count = 500, distance_factor = 1 / 8}, weight = 5},
|
||||||
{stack = {name = 'uranium-rounds-magazine', count = 600, distance_factor = 1 / 2}, weight = 5},
|
{stack = {name = 'uranium-rounds-magazine', count = 2000, distance_factor = 1}, 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 = '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-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 = '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)
|
local weights = ob.prepare_weighted_loot(loot)
|
||||||
@ -26,23 +23,15 @@ local factory = {
|
|||||||
callback = ob.magic_item_crafting_callback,
|
callback = ob.magic_item_crafting_callback,
|
||||||
data = {
|
data = {
|
||||||
recipe = 'uranium-rounds-magazine',
|
recipe = 'uranium-rounds-magazine',
|
||||||
output = {min_rate = 1 / 60, distance_factor = 1 / 60 / 512, item = 'uranium-rounds-magazine'}
|
output = {min_rate = 2 / 60, distance_factor = 2 / 60 / 512, item = 'uranium-rounds-magazine'}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
local factory_b = {
|
local factory_b = {
|
||||||
callback = ob.magic_item_crafting_callback,
|
|
||||||
data = {
|
|
||||||
recipe = 'explosive-rocket',
|
|
||||||
output = {min_rate = 1 / 3 / 60, distance_factor = 1 / 3 / 60 / 512, item = 'explosive-rocket'}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
local factory_c = {
|
|
||||||
callback = ob.magic_item_crafting_callback,
|
callback = ob.magic_item_crafting_callback,
|
||||||
data = {
|
data = {
|
||||||
recipe = 'explosive-uranium-cannon-shell',
|
recipe = 'explosive-uranium-cannon-shell',
|
||||||
output = {min_rate = 1 / 3 / 60, distance_factor = 1 / 3 / 60 / 512, item = 'explosive-uranium-cannon-shell'}
|
output = {min_rate = 1 / 2 / 60, distance_factor = 1 / 2 / 60 / 512, item = 'explosive-uranium-cannon-shell'}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -51,39 +40,27 @@ local market = {
|
|||||||
data = {
|
data = {
|
||||||
{
|
{
|
||||||
name = 'firearm-magazine',
|
name = 'firearm-magazine',
|
||||||
price = 1,
|
price = 0.5,
|
||||||
distance_factor = 0.5 / 512,
|
distance_factor = 0.25 / 512,
|
||||||
min_price = 0.1
|
min_price = 0.1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name = 'piercing-rounds-magazine',
|
name = 'piercing-rounds-magazine',
|
||||||
price = 3,
|
price = 1.5,
|
||||||
distance_factor = 1.5 / 512,
|
distance_factor = 0.75 / 512,
|
||||||
min_price = 0.3
|
min_price = 0.15
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name = 'uranium-rounds-magazine',
|
name = 'uranium-rounds-magazine',
|
||||||
price = 9,
|
price = 4.5,
|
||||||
distance_factor = 4.5 / 512,
|
distance_factor = 2.25 / 512,
|
||||||
min_price = 0.9
|
min_price = 0.45
|
||||||
},
|
|
||||||
{
|
|
||||||
name = 'shotgun-shell',
|
|
||||||
price = 2,
|
|
||||||
distance_factor = 1 / 512,
|
|
||||||
min_price = 0.2
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name = 'piercing-shotgun-shell',
|
|
||||||
price = 6,
|
|
||||||
distance_factor = 3 / 512,
|
|
||||||
min_price = 0.6
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name = 'grenade',
|
name = 'grenade',
|
||||||
price = 10,
|
price = 5,
|
||||||
distance_factor = 5 / 512,
|
distance_factor = 2.5 / 512,
|
||||||
min_price = 1
|
min_price = 0.5
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name = 'land-mine',
|
name = 'land-mine',
|
||||||
@ -91,65 +68,29 @@ local market = {
|
|||||||
distance_factor = 0.5 / 512,
|
distance_factor = 0.5 / 512,
|
||||||
min_price = 0.1
|
min_price = 0.1
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name = 'rocket',
|
|
||||||
price = 20,
|
|
||||||
distance_factor = 10 / 512,
|
|
||||||
min_price = 2
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name = 'explosive-rocket',
|
|
||||||
price = 40,
|
|
||||||
distance_factor = 20 / 512,
|
|
||||||
min_price = 4
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name = 'rocket-launcher',
|
|
||||||
price = 250,
|
|
||||||
distance_factor = 125 / 512,
|
|
||||||
min_price = 125
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name = 'cluster-grenade',
|
name = 'cluster-grenade',
|
||||||
price = 100,
|
price = 50,
|
||||||
distance_factor = 50 / 512,
|
distance_factor = 25 / 512,
|
||||||
min_price = 10
|
min_price = 5
|
||||||
},
|
|
||||||
{
|
|
||||||
name = 'poison-capsule',
|
|
||||||
price = 60,
|
|
||||||
distance_factor = 30 / 512,
|
|
||||||
min_price = 6
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name = 'slowdown-capsule',
|
|
||||||
price = 60,
|
|
||||||
distance_factor = 60 / 512,
|
|
||||||
min_price = 6
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name = 'cannon-shell',
|
name = 'cannon-shell',
|
||||||
price = 60,
|
price = 15,
|
||||||
distance_factor = 60 / 512,
|
distance_factor = 7.5 / 512,
|
||||||
min_price = 6
|
min_price = 1.5
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name = 'explosive-cannon-shell',
|
name = 'explosive-cannon-shell',
|
||||||
price = 120,
|
price = 30,
|
||||||
distance_factor = 120 / 512,
|
distance_factor = 15 / 512,
|
||||||
min_price = 12
|
min_price = 3
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name = 'explosive-uranium-cannon-shell',
|
name = 'explosive-uranium-cannon-shell',
|
||||||
price = 160,
|
price = 60,
|
||||||
distance_factor = 80 / 512,
|
distance_factor = 30 / 512,
|
||||||
min_price = 16
|
min_price = 6
|
||||||
},
|
|
||||||
{
|
|
||||||
name = 'destroyer-capsule',
|
|
||||||
price = 80,
|
|
||||||
distance_factor = 40 / 512,
|
|
||||||
min_price = 8
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name = 'vehicle-machine-gun',
|
name = 'vehicle-machine-gun',
|
||||||
@ -187,21 +128,13 @@ local level3b =
|
|||||||
max_count = 2
|
max_count = 2
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
local level3c =
|
|
||||||
ob.extend_1_way(
|
|
||||||
base_factory[2],
|
|
||||||
{
|
|
||||||
factory = factory_c,
|
|
||||||
fallback = level3b,
|
|
||||||
max_count = 2
|
|
||||||
}
|
|
||||||
)
|
|
||||||
local level4 =
|
local level4 =
|
||||||
ob.extend_1_way(
|
ob.extend_1_way(
|
||||||
base_factory[3],
|
base_factory[3],
|
||||||
{
|
{
|
||||||
market = market,
|
market = market,
|
||||||
fallback = level3c
|
fallback = level3b
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -9,7 +9,9 @@ local loot = {
|
|||||||
{stack = {name = 'plastic-bar', count = 1000, distance_factor = 1 / 2}, weight = 5},
|
{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 = 'battery', count = 1200, distance_factor = 1 / 2}, weight = 5},
|
||||||
{stack = {name = 'explosives', count = 800, distance_factor = 1 / 2}, weight = 2},
|
{stack = {name = 'explosives', count = 800, distance_factor = 1 / 2}, weight = 2},
|
||||||
{stack = {name = 'rocket-fuel', count = 30, distance_factor = 1 / 20}, weight = 1}
|
{stack = {name = 'rocket-fuel', count = 30, distance_factor = 1 / 20}, weight = 1},
|
||||||
|
{stack = {name = 'poison-capsule', count = 500, distance_factor = 1 / 4}, weight = 2},
|
||||||
|
{stack = {name = 'slowdown-capsule', count = 500, distance_factor = 1 / 4}, weight = 1}
|
||||||
}
|
}
|
||||||
|
|
||||||
local weights = ob.prepare_weighted_loot(loot)
|
local weights = ob.prepare_weighted_loot(loot)
|
||||||
@ -88,6 +90,18 @@ local market = {
|
|||||||
price = 10,
|
price = 10,
|
||||||
distance_factor = 5 / 512,
|
distance_factor = 5 / 512,
|
||||||
min_price = 1
|
min_price = 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'poison-capsule',
|
||||||
|
price = 15,
|
||||||
|
distance_factor = 7.5 / 512,
|
||||||
|
min_price = 1.5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'slowdown-capsule',
|
||||||
|
price = 15,
|
||||||
|
distance_factor = 7.5 / 512,
|
||||||
|
min_price = 1.5
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,11 +2,18 @@ local ob = require 'map_gen.presets.crash_site.outpost_builder'
|
|||||||
local Token = require 'utils.global_token'
|
local Token = require 'utils.global_token'
|
||||||
|
|
||||||
local loot = {
|
local loot = {
|
||||||
{weight = 10},
|
{weight = 5},
|
||||||
{stack = {name = 'coin', count = 250, distance_factor = 1 / 20}, weight = 5},
|
{stack = {name = 'coin', count = 250, distance_factor = 1 / 20}, weight = 5},
|
||||||
{stack = {name = 'iron-plate', count = 2500, distance_factor = 1 / 2}, weight = 5},
|
{stack = {name = 'iron-plate', count = 2500, distance_factor = 1}, weight = 5},
|
||||||
{stack = {name = 'steel-plate', count = 1000, distance_factor = 1 / 5}, weight = 1},
|
{stack = {name = 'steel-plate', count = 1000, distance_factor = 1}, weight = 1},
|
||||||
{stack = {name = 'iron-gear-wheel', count = 4000, distance_factor = 1}, weight = 5}
|
{stack = {name = 'iron-gear-wheel', count = 4000, distance_factor = 2}, weight = 10},
|
||||||
|
{stack = {name = 'engine-unit', count = 800, distance_factor = 1 / 2}, weight = 5},
|
||||||
|
{stack = {name = 'electric-engine-unit', count = 400, distance_factor = 1 / 2}, weight = 5},
|
||||||
|
{stack = {name = 'rail', count = 2500, distance_factor = 1}, weight = 1},
|
||||||
|
{stack = {name = 'tank', count = 5, distance_factor = 1 / 128}, weight = 1},
|
||||||
|
{stack = {name = 'locomotive', count = 5, distance_factor = 1 / 128}, weight = 1},
|
||||||
|
{stack = {name = 'cargo-wagon', count = 5, distance_factor = 1 / 128}, weight = 1},
|
||||||
|
{stack = {name = 'fluid-wagon', count = 5, distance_factor = 1 / 128}, weight = 1}
|
||||||
}
|
}
|
||||||
|
|
||||||
local weights = ob.prepare_weighted_loot(loot)
|
local weights = ob.prepare_weighted_loot(loot)
|
||||||
@ -22,7 +29,23 @@ local factory = {
|
|||||||
callback = ob.magic_item_crafting_callback,
|
callback = ob.magic_item_crafting_callback,
|
||||||
data = {
|
data = {
|
||||||
recipe = 'iron-gear-wheel',
|
recipe = 'iron-gear-wheel',
|
||||||
output = {min_rate = 1 / 60, distance_factor = 1 / 60 / 512, item = 'iron-gear-wheel'}
|
output = {min_rate = 4 / 60, distance_factor = 4 / 60 / 512, item = 'iron-gear-wheel'}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
local factory_b = {
|
||||||
|
callback = ob.magic_item_crafting_callback,
|
||||||
|
data = {
|
||||||
|
recipe = 'engine-unit',
|
||||||
|
output = {min_rate = 2 / 60, distance_factor = 2 / 60 / 512, item = 'engine-unit'}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
local factory_c = {
|
||||||
|
callback = ob.magic_item_crafting_callback,
|
||||||
|
data = {
|
||||||
|
recipe = 'electric-engine-unit',
|
||||||
|
output = {min_rate = 2 / 60, distance_factor = 2 / 60 / 512, item = 'electric-engine-unit'}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -46,6 +69,54 @@ local market = {
|
|||||||
price = 2,
|
price = 2,
|
||||||
distance_factor = 1 / 512,
|
distance_factor = 1 / 512,
|
||||||
min_price = 0.2
|
min_price = 0.2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'engine-unit',
|
||||||
|
price = 4,
|
||||||
|
distance_factor = 2 / 512,
|
||||||
|
min_price = 0.4
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'electric-engine-unit',
|
||||||
|
price = 8,
|
||||||
|
distance_factor = 4 / 512,
|
||||||
|
min_price = 0.8
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'car',
|
||||||
|
price = 50,
|
||||||
|
distance_factor = 25 / 512,
|
||||||
|
min_price = 40
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'rail',
|
||||||
|
price = 1,
|
||||||
|
distance_factor = 0.5 / 512,
|
||||||
|
min_price = 0.1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'tank',
|
||||||
|
price = 250,
|
||||||
|
distance_factor = 125 / 512,
|
||||||
|
min_price = 25
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'locomotive',
|
||||||
|
price = 100,
|
||||||
|
distance_factor = 50 / 512,
|
||||||
|
min_price = 10
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'cargo-wagon',
|
||||||
|
price = 20,
|
||||||
|
distance_factor = 10 / 512,
|
||||||
|
min_price = 2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'fluid-wagon',
|
||||||
|
price = 40,
|
||||||
|
distance_factor = 20 / 512,
|
||||||
|
min_price = 4
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -58,7 +129,26 @@ local level3 =
|
|||||||
base_factory[2],
|
base_factory[2],
|
||||||
{
|
{
|
||||||
factory = factory,
|
factory = factory,
|
||||||
fallback = level2
|
fallback = level2,
|
||||||
|
max_count = 4
|
||||||
|
}
|
||||||
|
)
|
||||||
|
local level3b =
|
||||||
|
ob.extend_1_way(
|
||||||
|
base_factory[2],
|
||||||
|
{
|
||||||
|
factory = factory_b,
|
||||||
|
fallback = level2,
|
||||||
|
max_count = 2
|
||||||
|
}
|
||||||
|
)
|
||||||
|
local level3c =
|
||||||
|
ob.extend_1_way(
|
||||||
|
base_factory[2],
|
||||||
|
{
|
||||||
|
factory = factory_c,
|
||||||
|
fallback = level3b,
|
||||||
|
max_count = 2
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
local level4 =
|
local level4 =
|
||||||
@ -66,7 +156,7 @@ local level4 =
|
|||||||
base_factory[3],
|
base_factory[3],
|
||||||
{
|
{
|
||||||
market = market,
|
market = market,
|
||||||
fallback = level3
|
fallback = level3c
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
return {
|
return {
|
||||||
@ -80,6 +170,6 @@ return {
|
|||||||
require 'map_gen.presets.crash_site.outpost_data.heavy_gun_turrets'
|
require 'map_gen.presets.crash_site.outpost_data.heavy_gun_turrets'
|
||||||
},
|
},
|
||||||
bases = {
|
bases = {
|
||||||
{level4, level2}
|
{level4, level3, level2}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ local factory = {
|
|||||||
callback = ob.magic_item_crafting_callback,
|
callback = ob.magic_item_crafting_callback,
|
||||||
data = {
|
data = {
|
||||||
recipe = 'production-science-pack',
|
recipe = 'production-science-pack',
|
||||||
output = {min_rate = 0.05 / 60, distance_factor = 0.05 / 60 / 512, item = 'production-science-pack'}
|
output = {min_rate = 0.25 / 60, distance_factor = 0.25 / 60 / 512, item = 'production-science-pack'}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -33,7 +33,7 @@ local factory_b = {
|
|||||||
callback = ob.magic_item_crafting_callback,
|
callback = ob.magic_item_crafting_callback,
|
||||||
data = {
|
data = {
|
||||||
recipe = 'high-tech-science-pack',
|
recipe = 'high-tech-science-pack',
|
||||||
output = {min_rate = 0.05 / 60, distance_factor = 0.05 / 60 / 512, item = 'high-tech-science-pack'}
|
output = {min_rate = 0.25 / 60, distance_factor = 0.25 / 60 / 512, item = 'high-tech-science-pack'}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
134
map_gen/presets/crash_site/outpost_data/big_stone_factory.lua
Normal file
134
map_gen/presets/crash_site/outpost_data/big_stone_factory.lua
Normal file
@ -0,0 +1,134 @@
|
|||||||
|
local ob = require 'map_gen.presets.crash_site.outpost_builder'
|
||||||
|
local Token = require 'utils.global_token'
|
||||||
|
|
||||||
|
local loot = {
|
||||||
|
{weight = 5},
|
||||||
|
{stack = {name = 'coin', count = 250, distance_factor = 1 / 20}, weight = 5},
|
||||||
|
{stack = {name = 'stone', count = 1600}, weight = 8},
|
||||||
|
{stack = {name = 'stone-brick', count = 2000, distance_factor = 1 / 2}, weight = 5},
|
||||||
|
{stack = {name = 'concrete', count = 2000, distance_factor = 1 / 2}, weight = 5},
|
||||||
|
{stack = {name = 'refined-concrete', count = 4000, distance_factor = 1 / 2}, weight = 10},
|
||||||
|
{stack = {name = 'stone-wall', count = 1000, distance_factor = 1 / 5}, weight = 5},
|
||||||
|
{stack = {name = 'gate', count = 250, distance_factor = 1 / 5}, 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 = {
|
||||||
|
furance_item = 'stone',
|
||||||
|
output = {min_rate = 2 / 60, distance_factor = 2 / 60 / 512, item = 'stone-brick'}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
local factory_b = {
|
||||||
|
callback = ob.magic_item_crafting_callback,
|
||||||
|
data = {
|
||||||
|
recipe = 'refined-concrete',
|
||||||
|
output = {min_rate = 2 / 60, distance_factor = 2 / 60 / 512, item = 'refined-concrete'}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
local factory_c = {
|
||||||
|
callback = ob.magic_item_crafting_callback,
|
||||||
|
data = {
|
||||||
|
recipe = 'electric-engine-unit',
|
||||||
|
output = {min_rate = 2 / 60, distance_factor = 2 / 60 / 512, item = 'electric-engine-unit'}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
local market = {
|
||||||
|
callback = ob.market_set_items_callback,
|
||||||
|
data = {
|
||||||
|
{
|
||||||
|
name = 'stone',
|
||||||
|
price = 0.25,
|
||||||
|
distance_factor = 0.125 / 512,
|
||||||
|
min_price = 0.025
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'stone-brick',
|
||||||
|
price = 0.5,
|
||||||
|
distance_factor = 0.25 / 512,
|
||||||
|
min_price = 0.05
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'concrete',
|
||||||
|
price = 0.5,
|
||||||
|
distance_factor = 0.25 / 512,
|
||||||
|
min_price = 0.05
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'refined-concrete',
|
||||||
|
price = 1,
|
||||||
|
distance_factor = 0.5 / 512,
|
||||||
|
min_price = 0.1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'stone-wall',
|
||||||
|
price = 1,
|
||||||
|
distance_factor = 0.5 / 512,
|
||||||
|
min_price = 0.1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'gate',
|
||||||
|
price = 2,
|
||||||
|
distance_factor = 1 / 512,
|
||||||
|
min_price = 0.2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
local base_factory = require 'map_gen.presets.crash_site.outpost_data.big_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 =
|
||||||
|
ob.extend_1_way(
|
||||||
|
base_factory[2],
|
||||||
|
{
|
||||||
|
factory = factory,
|
||||||
|
fallback = level2,
|
||||||
|
max_count = 1
|
||||||
|
}
|
||||||
|
)
|
||||||
|
local level3b =
|
||||||
|
ob.extend_1_way(
|
||||||
|
base_factory2[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 = 9,
|
||||||
|
variance = 3,
|
||||||
|
min_step = 2,
|
||||||
|
max_level = 2
|
||||||
|
},
|
||||||
|
walls = {
|
||||||
|
require 'map_gen.presets.crash_site.outpost_data.heavy_gun_turrets',
|
||||||
|
require 'map_gen.presets.crash_site.outpost_data.walls'
|
||||||
|
},
|
||||||
|
bases = {
|
||||||
|
{level4, level2}
|
||||||
|
}
|
||||||
|
}
|
278
map_gen/presets/crash_site/outpost_data/big_weapon_factory.lua
Normal file
278
map_gen/presets/crash_site/outpost_data/big_weapon_factory.lua
Normal file
@ -0,0 +1,278 @@
|
|||||||
|
local ob = require 'map_gen.presets.crash_site.outpost_builder'
|
||||||
|
local Token = require 'utils.global_token'
|
||||||
|
|
||||||
|
local loot = {
|
||||||
|
{weight = 3},
|
||||||
|
{stack = {name = 'coin', count = 500, distance_factor = 1 / 8}, weight = 3},
|
||||||
|
{stack = {name = 'raw-fish', count = 1000, distance_factor = 1}, weight = 1},
|
||||||
|
{stack = {name = 'explosive-rocket', count = 1000, distance_factor = 1}, weight = 1},
|
||||||
|
{stack = {name = 'laser-turret', count = 500, distance_factor = 1 / 8}, weight = 1},
|
||||||
|
{stack = {name = 'cluster-grenade', count = 1000, distance_factor = 1}, weight = 1},
|
||||||
|
{stack = {name = 'destroyer-capsule', count = 250, distance_factor = 1 / 8}, weight = 1},
|
||||||
|
{stack = {name = 'power-armor-mk2', count = 5, distance_factor = 1 / 128}, weight = 1},
|
||||||
|
{stack = {name = 'fusion-reactor-equipment', count = 25, distance_factor = 1 / 128}, weight = 1},
|
||||||
|
{stack = {name = 'battery-mk2-equipment', count = 25, distance_factor = 1 / 128}, weight = 1},
|
||||||
|
{stack = {name = 'energy-shield-mk2-equipment', count = 10, distance_factor = 1 / 64}, weight = 1},
|
||||||
|
{stack = {name = 'exoskeleton-equipment', count = 10, distance_factor = 1 / 64}, weight = 1},
|
||||||
|
{stack = {name = 'personal-laser-defense-equipment', count = 10, distance_factor = 1 / 64}, 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 = 'destroyer-capsule',
|
||||||
|
output = {min_rate = 0.5 / 60, distance_factor = 0.5 / 60 / 512, item = 'destroyer-capsule'}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
local factory_b = {
|
||||||
|
callback = ob.magic_item_crafting_callback,
|
||||||
|
data = {
|
||||||
|
recipe = 'laser-turret',
|
||||||
|
output = {min_rate = 0.2 / 60, distance_factor = 0.2 / 60 / 512, item = 'laser-turret'}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
local market = {
|
||||||
|
callback = ob.market_set_items_callback,
|
||||||
|
data = {
|
||||||
|
{
|
||||||
|
name = 'raw-fish',
|
||||||
|
price = 1,
|
||||||
|
distance_factor = 0.5 / 512,
|
||||||
|
min_price = 0.1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'combat-shotgun',
|
||||||
|
price = 125,
|
||||||
|
distance_factor = 62.5 / 512,
|
||||||
|
min_price = 62.5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'shotgun-shell',
|
||||||
|
price = 1,
|
||||||
|
distance_factor = 0.5 / 512,
|
||||||
|
min_price = 0.1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'piercing-shotgun-shell',
|
||||||
|
price = 3,
|
||||||
|
distance_factor = 1.5 / 512,
|
||||||
|
min_price = 0.3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'flamethrower',
|
||||||
|
price = 175,
|
||||||
|
distance_factor = 87.5 / 512,
|
||||||
|
min_price = 87.5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'flamethrower-ammo',
|
||||||
|
price = 7.5,
|
||||||
|
distance_factor = 3.75 / 512,
|
||||||
|
min_price = 0.75
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'rocket-launcher',
|
||||||
|
price = 250,
|
||||||
|
distance_factor = 125 / 512,
|
||||||
|
min_price = 125
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'rocket',
|
||||||
|
price = 10,
|
||||||
|
distance_factor = 5 / 512,
|
||||||
|
min_price = 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'explosive-rocket',
|
||||||
|
price = 20,
|
||||||
|
distance_factor = 10 / 512,
|
||||||
|
min_price = 2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'grenade',
|
||||||
|
price = 5,
|
||||||
|
distance_factor = 5 / 512,
|
||||||
|
min_price = 0.5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'cluster-grenade',
|
||||||
|
price = 50,
|
||||||
|
distance_factor = 25 / 512,
|
||||||
|
min_price = 5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'destroyer-capsule',
|
||||||
|
price = 50,
|
||||||
|
distance_factor = 25 / 512,
|
||||||
|
min_price = 5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'modular-armor',
|
||||||
|
price = 175
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'power-armor',
|
||||||
|
price = 500,
|
||||||
|
distance_factor = 250 / 512,
|
||||||
|
min_price = 250
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'power-armor-mk2',
|
||||||
|
price = 1000,
|
||||||
|
distance_factor = 500 / 512,
|
||||||
|
min_price = 250
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'solar-panel-equipment',
|
||||||
|
price = 10,
|
||||||
|
distance_factor = 5 / 512,
|
||||||
|
min_price = 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'fusion-reactor-equipment',
|
||||||
|
price = 250,
|
||||||
|
distance_factor = 125 / 512,
|
||||||
|
min_price = 75
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'battery-equipment',
|
||||||
|
price = 10,
|
||||||
|
distance_factor = 5 / 512,
|
||||||
|
min_price = 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'battery-mk2-equipment',
|
||||||
|
price = 50,
|
||||||
|
distance_factor = 25 / 512,
|
||||||
|
min_price = 5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'energy-shield-equipment',
|
||||||
|
price = 10,
|
||||||
|
distance_factor = 5 / 512,
|
||||||
|
min_price = 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'energy-shield-mk2-equipment',
|
||||||
|
price = 50,
|
||||||
|
distance_factor = 25 / 512,
|
||||||
|
min_price = 5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'exoskeleton-equipment',
|
||||||
|
price = 50,
|
||||||
|
distance_factor = 25 / 512,
|
||||||
|
min_price = 5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'night-vision-equipment',
|
||||||
|
price = 10,
|
||||||
|
distance_factor = 5 / 512,
|
||||||
|
min_price = 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'personal-laser-defense-equipment',
|
||||||
|
price = 100,
|
||||||
|
distance_factor = 50 / 512,
|
||||||
|
min_price = 10
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'vehicle-machine-gun',
|
||||||
|
price = 1000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'tank-cannon',
|
||||||
|
price = 500
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'artillery-wagon-cannon',
|
||||||
|
price = 2000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'gun-turret',
|
||||||
|
price = 10,
|
||||||
|
distance_factor = 5 / 512,
|
||||||
|
min_price = 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'flamethrower-turret',
|
||||||
|
price = 20,
|
||||||
|
distance_factor = 10 / 512,
|
||||||
|
min_price = 2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'laser-turret',
|
||||||
|
price = 30,
|
||||||
|
distance_factor = 15 / 512,
|
||||||
|
min_price = 3
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
local base_factory = require 'map_gen.presets.crash_site.outpost_data.small_factory'
|
||||||
|
|
||||||
|
local level2 = ob.extend_1_way(base_factory[1], {loot = {callback = loot_callback}})
|
||||||
|
local level3 =
|
||||||
|
ob.extend_1_way(
|
||||||
|
base_factory[2],
|
||||||
|
{
|
||||||
|
factory = factory,
|
||||||
|
fallback = level2,
|
||||||
|
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
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
local artillery =
|
||||||
|
ob.extend_1_way(
|
||||||
|
require 'map_gen.presets.crash_site.outpost_data.artillery_block',
|
||||||
|
{fallback = level4, max_count = 1}
|
||||||
|
)
|
||||||
|
|
||||||
|
return {
|
||||||
|
settings = {
|
||||||
|
blocks = 11,
|
||||||
|
variance = 3,
|
||||||
|
min_step = 2,
|
||||||
|
max_level = 5
|
||||||
|
},
|
||||||
|
walls = {
|
||||||
|
require 'map_gen.presets.crash_site.outpost_data.heavy_gun_turrets',
|
||||||
|
require 'map_gen.presets.crash_site.outpost_data.heavy_laser_turrets',
|
||||||
|
require 'map_gen.presets.crash_site.outpost_data.heavy_flame_turrets'
|
||||||
|
},
|
||||||
|
bases = {
|
||||||
|
{require 'map_gen.presets.crash_site.outpost_data.laser_block'},
|
||||||
|
{level2},
|
||||||
|
{level4},
|
||||||
|
{artillery}
|
||||||
|
}
|
||||||
|
}
|
@ -3,20 +3,14 @@ local Token = require 'utils.global_token'
|
|||||||
|
|
||||||
local loot = {
|
local loot = {
|
||||||
{weight = 10},
|
{weight = 10},
|
||||||
{stack = {name = 'coin', count = 75, distance_factor = 1 / 20}, weight = 5},
|
{stack = {name = 'coin', count = 150, distance_factor = 1 / 8}, weight = 5},
|
||||||
{stack = {name = 'piercing-rounds-magazine', count = 500, distance_factor = 1 / 2}, weight = 5},
|
{stack = {name = 'piercing-rounds-magazine', count = 500, distance_factor = 1}, weight = 5},
|
||||||
{stack = {name = 'uranium-rounds-magazine', count = 300, distance_factor = 1 / 2}, weight = 5},
|
{stack = {name = 'uranium-rounds-magazine', count = 250, distance_factor = 1 / 2}, weight = 5},
|
||||||
{stack = {name = 'piercing-shotgun-shell', count = 200, distance_factor = 1 / 4}, weight = 2},
|
{stack = {name = 'grenade', count = 200, distance_factor = 1 / 8}, weight = 1},
|
||||||
{stack = {name = 'grenade', count = 100, distance_factor = 1 / 8}, weight = 1},
|
|
||||||
{stack = {name = 'land-mine', count = 400, distance_factor = 1}, 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 = '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 = '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 = '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}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
local weights = ob.prepare_weighted_loot(loot)
|
local weights = ob.prepare_weighted_loot(loot)
|
||||||
@ -32,7 +26,7 @@ local factory = {
|
|||||||
callback = ob.magic_item_crafting_callback,
|
callback = ob.magic_item_crafting_callback,
|
||||||
data = {
|
data = {
|
||||||
recipe = 'piercing-rounds-magazine',
|
recipe = 'piercing-rounds-magazine',
|
||||||
output = {min_rate = 1 / 60, distance_factor = 1 / 60 / 512, item = 'piercing-rounds-magazine'}
|
output = {min_rate = 1.5 / 60, distance_factor = 1.5 / 60 / 512, item = 'piercing-rounds-magazine'}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -40,7 +34,7 @@ local factory_b = {
|
|||||||
callback = ob.magic_item_crafting_callback,
|
callback = ob.magic_item_crafting_callback,
|
||||||
data = {
|
data = {
|
||||||
recipe = 'cannon-shell',
|
recipe = 'cannon-shell',
|
||||||
output = {min_rate = 1 / 3 / 60, distance_factor = 1 / 60 / 512, item = 'cannon-shell'}
|
output = {min_rate = 1 / 2 / 60, distance_factor = 1 / 2 / 60 / 512, item = 'cannon-shell'}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -48,7 +42,7 @@ local factory_c = {
|
|||||||
callback = ob.magic_item_crafting_callback,
|
callback = ob.magic_item_crafting_callback,
|
||||||
data = {
|
data = {
|
||||||
recipe = 'uranium-rounds-magazine',
|
recipe = 'uranium-rounds-magazine',
|
||||||
output = {min_rate = 1 / 3 / 60, distance_factor = 1 / 3 / 60 / 512, item = 'uranium-rounds-magazine'}
|
output = {min_rate = 1 / 2 / 60, distance_factor = 1 / 2 / 60 / 512, item = 'uranium-rounds-magazine'}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -73,18 +67,6 @@ local market = {
|
|||||||
distance_factor = 4.5 / 512,
|
distance_factor = 4.5 / 512,
|
||||||
min_price = 0.9
|
min_price = 0.9
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name = 'shotgun-shell',
|
|
||||||
price = 2,
|
|
||||||
distance_factor = 1 / 512,
|
|
||||||
min_price = 0.2
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name = 'piercing-shotgun-shell',
|
|
||||||
price = 6,
|
|
||||||
distance_factor = 3 / 512,
|
|
||||||
min_price = 0.6
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name = 'grenade',
|
name = 'grenade',
|
||||||
price = 10,
|
price = 10,
|
||||||
@ -97,59 +79,23 @@ local market = {
|
|||||||
distance_factor = 0.5 / 512,
|
distance_factor = 0.5 / 512,
|
||||||
min_price = 0.1
|
min_price = 0.1
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name = 'rocket',
|
|
||||||
price = 20,
|
|
||||||
distance_factor = 10 / 512,
|
|
||||||
min_price = 2
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name = 'explosive-rocket',
|
|
||||||
price = 40,
|
|
||||||
distance_factor = 20 / 512,
|
|
||||||
min_price = 4
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name = 'rocket-launcher',
|
|
||||||
price = 250,
|
|
||||||
distance_factor = 125 / 512,
|
|
||||||
min_price = 125
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name = 'cluster-grenade',
|
name = 'cluster-grenade',
|
||||||
price = 100,
|
price = 100,
|
||||||
distance_factor = 50 / 512,
|
distance_factor = 50 / 512,
|
||||||
min_price = 10
|
min_price = 10
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name = 'poison-capsule',
|
|
||||||
price = 60,
|
|
||||||
distance_factor = 30 / 512,
|
|
||||||
min_price = 6
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name = 'slowdown-capsule',
|
|
||||||
price = 60,
|
|
||||||
distance_factor = 30 / 512,
|
|
||||||
min_price = 6
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name = 'cannon-shell',
|
name = 'cannon-shell',
|
||||||
price = 60,
|
price = 15,
|
||||||
distance_factor = 30 / 512,
|
distance_factor = 7.5 / 512,
|
||||||
min_price = 6
|
min_price = 1.5
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name = 'explosive-cannon-shell',
|
name = 'explosive-cannon-shell',
|
||||||
price = 120,
|
price = 30,
|
||||||
distance_factor = 60 / 512,
|
distance_factor = 15 / 512,
|
||||||
min_price = 12
|
min_price = 3
|
||||||
},
|
|
||||||
{
|
|
||||||
name = 'destroyer-capsule',
|
|
||||||
price = 80,
|
|
||||||
distance_factor = 40 / 512,
|
|
||||||
min_price = 8
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -162,7 +108,8 @@ local level3 =
|
|||||||
base_factory[2],
|
base_factory[2],
|
||||||
{
|
{
|
||||||
factory = factory,
|
factory = factory,
|
||||||
fallback = level2
|
fallback = level2,
|
||||||
|
max_count = 4
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
local level3b =
|
local level3b =
|
||||||
@ -179,8 +126,8 @@ local level3c =
|
|||||||
base_factory[2],
|
base_factory[2],
|
||||||
{
|
{
|
||||||
factory = factory_c,
|
factory = factory_c,
|
||||||
fallback = level3b,
|
fallback = level3,
|
||||||
max_count = 1
|
max_count = 2
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
local level4 =
|
local level4 =
|
||||||
@ -204,6 +151,6 @@ return {
|
|||||||
require 'map_gen.presets.crash_site.outpost_data.heavy_flame_turrets'
|
require 'map_gen.presets.crash_site.outpost_data.heavy_flame_turrets'
|
||||||
},
|
},
|
||||||
bases = {
|
bases = {
|
||||||
{level4, level2}
|
{level4, level3b, level2}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,9 @@ local loot = {
|
|||||||
{stack = {name = 'sulfur', count = 500, distance_factor = 1 / 2}, weight = 3},
|
{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 = 'plastic-bar', count = 500, distance_factor = 1 / 2}, weight = 3},
|
||||||
{stack = {name = 'battery', count = 600, distance_factor = 1 / 2}, weight = 5},
|
{stack = {name = 'battery', count = 600, distance_factor = 1 / 2}, weight = 5},
|
||||||
{stack = {name = 'explosives', count = 400, distance_factor = 1 / 2}, weight = 5}
|
{stack = {name = 'explosives', count = 400, distance_factor = 1 / 2}, weight = 5},
|
||||||
|
{stack = {name = 'poison-capsule', count = 100, distance_factor = 1 / 16}, weight = 2},
|
||||||
|
{stack = {name = 'slowdown-capsule', count = 100, distance_factor = 1 / 16}, weight = 1}
|
||||||
}
|
}
|
||||||
|
|
||||||
local weights = ob.prepare_weighted_loot(loot)
|
local weights = ob.prepare_weighted_loot(loot)
|
||||||
@ -74,7 +76,19 @@ local market = {
|
|||||||
price = 3,
|
price = 3,
|
||||||
distance_factor = 1.5 / 512,
|
distance_factor = 1.5 / 512,
|
||||||
min_price = 0.3
|
min_price = 0.3
|
||||||
}
|
},
|
||||||
|
{
|
||||||
|
name = 'poison-capsule',
|
||||||
|
price = 30,
|
||||||
|
distance_factor = 15 / 512,
|
||||||
|
min_price = 3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'slowdown-capsule',
|
||||||
|
price = 30,
|
||||||
|
distance_factor = 15 / 512,
|
||||||
|
min_price = 3
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,11 +2,18 @@ local ob = require 'map_gen.presets.crash_site.outpost_builder'
|
|||||||
local Token = require 'utils.global_token'
|
local Token = require 'utils.global_token'
|
||||||
|
|
||||||
local loot = {
|
local loot = {
|
||||||
{weight = 10},
|
{weight = 5},
|
||||||
{stack = {name = 'coin', count = 75, distance_factor = 1 / 20}, weight = 5},
|
{stack = {name = 'coin', count = 75, distance_factor = 1 / 20}, weight = 5},
|
||||||
{stack = {name = 'iron-plate', count = 750, distance_factor = 1 / 2}, weight = 5},
|
{stack = {name = 'iron-plate', count = 1000, distance_factor = 1}, weight = 5},
|
||||||
{stack = {name = 'steel-plate', count = 200, distance_factor = 1 / 5}, weight = 1},
|
{stack = {name = 'steel-plate', count = 500, distance_factor = 1 / 2}, weight = 1},
|
||||||
{stack = {name = 'iron-gear-wheel', count = 1500, distance_factor = 1}, weight = 5}
|
{stack = {name = 'iron-gear-wheel', count = 1500, distance_factor = 1}, weight = 10},
|
||||||
|
{stack = {name = 'engine-unit', count = 200, distance_factor = 1 / 2}, weight = 5},
|
||||||
|
{stack = {name = 'electric-engine-unit', count = 100, distance_factor = 1 / 2}, weight = 5},
|
||||||
|
{stack = {name = 'rail', count = 500, distance_factor = 1}, weight = 2},
|
||||||
|
{stack = {name = 'tank', count = 1, distance_factor = 1 / 128}, weight = 2},
|
||||||
|
{stack = {name = 'locomotive', count = 5, distance_factor = 1 / 128}, weight = 2},
|
||||||
|
{stack = {name = 'cargo-wagon', count = 5, distance_factor = 1 / 128}, weight = 2},
|
||||||
|
{stack = {name = 'fluid-wagon', count = 5, distance_factor = 1 / 128}, weight = 2}
|
||||||
}
|
}
|
||||||
|
|
||||||
local weights = ob.prepare_weighted_loot(loot)
|
local weights = ob.prepare_weighted_loot(loot)
|
||||||
@ -22,7 +29,23 @@ local factory = {
|
|||||||
callback = ob.magic_item_crafting_callback,
|
callback = ob.magic_item_crafting_callback,
|
||||||
data = {
|
data = {
|
||||||
recipe = 'iron-gear-wheel',
|
recipe = 'iron-gear-wheel',
|
||||||
output = {min_rate = 1 / 60, distance_factor = 1 / 60 / 512, item = 'iron-gear-wheel'}
|
output = {min_rate = 2 / 60, distance_factor = 2 / 60 / 512, item = 'iron-gear-wheel'}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
local factory_b = {
|
||||||
|
callback = ob.magic_item_crafting_callback,
|
||||||
|
data = {
|
||||||
|
recipe = 'engine-unit',
|
||||||
|
output = {min_rate = 1 / 60, distance_factor = 1 / 60 / 512, item = 'engine-unit'}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
local factory_c = {
|
||||||
|
callback = ob.magic_item_crafting_callback,
|
||||||
|
data = {
|
||||||
|
recipe = 'electric-engine-unit',
|
||||||
|
output = {min_rate = 1 / 60, distance_factor = 1 / 60 / 512, item = 'electric-engine-unit'}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -46,6 +69,54 @@ local market = {
|
|||||||
price = 2,
|
price = 2,
|
||||||
distance_factor = 1 / 512,
|
distance_factor = 1 / 512,
|
||||||
min_price = 0.2
|
min_price = 0.2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'engine-unit',
|
||||||
|
price = 4,
|
||||||
|
distance_factor = 2 / 512,
|
||||||
|
min_price = 0.4
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'electric-engine-unit',
|
||||||
|
price = 8,
|
||||||
|
distance_factor = 4 / 512,
|
||||||
|
min_price = 0.8
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'car',
|
||||||
|
price = 50,
|
||||||
|
distance_factor = 25 / 512,
|
||||||
|
min_price = 40
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'tank',
|
||||||
|
price = 250,
|
||||||
|
distance_factor = 125 / 512,
|
||||||
|
min_price = 25
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'locomotive',
|
||||||
|
price = 100,
|
||||||
|
distance_factor = 50 / 512,
|
||||||
|
min_price = 40
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'cargo-wagon',
|
||||||
|
price = 20,
|
||||||
|
distance_factor = 10 / 512,
|
||||||
|
min_price = 10
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'fluid-wagon',
|
||||||
|
price = 40,
|
||||||
|
distance_factor = 20 / 512,
|
||||||
|
min_price = 20
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'rail',
|
||||||
|
price = 1,
|
||||||
|
distance_factor = 0.5 / 512,
|
||||||
|
min_price = 0.1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -58,7 +129,27 @@ local level3 =
|
|||||||
base_factory[2],
|
base_factory[2],
|
||||||
{
|
{
|
||||||
factory = factory,
|
factory = factory,
|
||||||
fallback = level2
|
fallback = level2,
|
||||||
|
max_count = 2
|
||||||
|
}
|
||||||
|
)
|
||||||
|
local level3b =
|
||||||
|
ob.extend_1_way(
|
||||||
|
base_factory[2],
|
||||||
|
{
|
||||||
|
factory = factory_b,
|
||||||
|
fallback = level2,
|
||||||
|
max_count = 2
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
local level3c =
|
||||||
|
ob.extend_1_way(
|
||||||
|
base_factory[2],
|
||||||
|
{
|
||||||
|
factory = factory_c,
|
||||||
|
fallback = level3b,
|
||||||
|
max_count = 2
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
local level4 =
|
local level4 =
|
||||||
@ -66,7 +157,7 @@ local level4 =
|
|||||||
base_factory[3],
|
base_factory[3],
|
||||||
{
|
{
|
||||||
market = market,
|
market = market,
|
||||||
fallback = level3
|
fallback = level3c
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
return {
|
return {
|
||||||
@ -80,6 +171,6 @@ return {
|
|||||||
require 'map_gen.presets.crash_site.outpost_data.medium_gun_turrets'
|
require 'map_gen.presets.crash_site.outpost_data.medium_gun_turrets'
|
||||||
},
|
},
|
||||||
bases = {
|
bases = {
|
||||||
{level4, level2}
|
{level4, level3, level2}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@ local factory = {
|
|||||||
callback = ob.magic_item_crafting_callback,
|
callback = ob.magic_item_crafting_callback,
|
||||||
data = {
|
data = {
|
||||||
recipe = 'military-science-pack',
|
recipe = 'military-science-pack',
|
||||||
output = {min_rate = 0.05 / 60, distance_factor = 0.05 / 60 / 512, item = 'military-science-pack'}
|
output = {min_rate = 0.25 / 60, distance_factor = 0.25 / 60 / 512, item = 'military-science-pack'}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -31,7 +31,7 @@ local factory_b = {
|
|||||||
callback = ob.magic_item_crafting_callback,
|
callback = ob.magic_item_crafting_callback,
|
||||||
data = {
|
data = {
|
||||||
recipe = 'science-pack-3',
|
recipe = 'science-pack-3',
|
||||||
output = {min_rate = 0.05 / 60, distance_factor = 0.05 / 60 / 512, item = 'science-pack-3'}
|
output = {min_rate = 0.25 / 60, distance_factor = 0.25 / 60 / 512, item = 'science-pack-3'}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
120
map_gen/presets/crash_site/outpost_data/medium_stone_factory.lua
Normal file
120
map_gen/presets/crash_site/outpost_data/medium_stone_factory.lua
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
local ob = require 'map_gen.presets.crash_site.outpost_builder'
|
||||||
|
local Token = require 'utils.global_token'
|
||||||
|
|
||||||
|
local loot = {
|
||||||
|
{weight = 5},
|
||||||
|
{stack = {name = 'coin', count = 75, distance_factor = 1 / 20}, weight = 5},
|
||||||
|
{stack = {name = 'stone', count = 1600}, weight = 8},
|
||||||
|
{stack = {name = 'stone-brick', count = 1000, distance_factor = 1 / 2}, weight = 10},
|
||||||
|
{stack = {name = 'concrete', count = 1000, distance_factor = 1 / 2}, weight = 10},
|
||||||
|
{stack = {name = 'stone-wall', count = 500, distance_factor = 1 / 5}, weight = 5},
|
||||||
|
{stack = {name = 'gate', count = 100, distance_factor = 1 / 5}, 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 = {
|
||||||
|
furance_item = 'stone',
|
||||||
|
output = {min_rate = 2 / 60, distance_factor = 2 / 60 / 512, item = 'stone-brick'}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
local factory_b = {
|
||||||
|
callback = ob.magic_item_crafting_callback,
|
||||||
|
data = {
|
||||||
|
recipe = 'concrete',
|
||||||
|
output = {min_rate = 2 / 60, distance_factor = 2 / 60 / 512, item = 'concrete'}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
local market = {
|
||||||
|
callback = ob.market_set_items_callback,
|
||||||
|
data = {
|
||||||
|
{
|
||||||
|
name = 'stone',
|
||||||
|
price = 0.25,
|
||||||
|
distance_factor = 0.125 / 512,
|
||||||
|
min_price = 0.025
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'stone-brick',
|
||||||
|
price = 0.5,
|
||||||
|
distance_factor = 0.25 / 512,
|
||||||
|
min_price = 0.05
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'concrete',
|
||||||
|
price = 0.5,
|
||||||
|
distance_factor = 0.25 / 512,
|
||||||
|
min_price = 0.05
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'stone-wall',
|
||||||
|
price = 1,
|
||||||
|
distance_factor = 0.5 / 512,
|
||||||
|
min_price = 0.1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'gate',
|
||||||
|
price = 2,
|
||||||
|
distance_factor = 1 / 512,
|
||||||
|
min_price = 0.2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
local base_factory = require 'map_gen.presets.crash_site.outpost_data.medium_furance'
|
||||||
|
local base_factory2 = require 'map_gen.presets.crash_site.outpost_data.medium_factory'
|
||||||
|
|
||||||
|
local level2 = ob.extend_1_way(base_factory[1], {loot = {callback = loot_callback}})
|
||||||
|
local level3 =
|
||||||
|
ob.extend_1_way(
|
||||||
|
base_factory[2],
|
||||||
|
{
|
||||||
|
factory = factory,
|
||||||
|
fallback = level2,
|
||||||
|
max_count = 1
|
||||||
|
}
|
||||||
|
)
|
||||||
|
local level3b =
|
||||||
|
ob.extend_1_way(
|
||||||
|
base_factory2[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 = 7,
|
||||||
|
variance = 3,
|
||||||
|
min_step = 2,
|
||||||
|
max_level = 2
|
||||||
|
},
|
||||||
|
walls = {
|
||||||
|
require 'map_gen.presets.crash_site.outpost_data.medium_gun_turrets',
|
||||||
|
require 'map_gen.presets.crash_site.outpost_data.walls'
|
||||||
|
},
|
||||||
|
bases = {
|
||||||
|
{level4, level2}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,254 @@
|
|||||||
|
local ob = require 'map_gen.presets.crash_site.outpost_builder'
|
||||||
|
local Token = require 'utils.global_token'
|
||||||
|
|
||||||
|
local loot = {
|
||||||
|
{weight = 5},
|
||||||
|
{stack = {name = 'coin', count = 150, distance_factor = 1 / 8}, weight = 3},
|
||||||
|
{stack = {name = 'raw-fish', count = 100, distance_factor = 1 / 8}, weight = 1},
|
||||||
|
{stack = {name = 'piercing-shotgun-shell', count = 500, distance_factor = 1 / 8}, weight = 1},
|
||||||
|
{stack = {name = 'flamethrower-ammo', count = 250, distance_factor = 1 / 8}, weight = 1},
|
||||||
|
{stack = {name = 'rocket', count = 200, distance_factor = 1 / 8}, weight = 1},
|
||||||
|
{stack = {name = 'explosive-rocket', count = 200, distance_factor = 1 / 8}, weight = 1},
|
||||||
|
{stack = {name = 'gun-turret', count = 250, distance_factor = 1 / 16}, weight = 1},
|
||||||
|
{stack = {name = 'flamethrower-turret', count = 250, distance_factor = 1 / 16}, weight = 1},
|
||||||
|
{stack = {name = 'cluster-grenade', count = 100, distance_factor = 1 / 32}, weight = 1},
|
||||||
|
{stack = {name = 'power-armor', count = 5, distance_factor = 1 / 128}, weight = 1},
|
||||||
|
{stack = {name = 'solar-panel-equipment', count = 25, distance_factor = 1 / 32}, weight = 1},
|
||||||
|
{stack = {name = 'fusion-reactor-equipment', count = 5, distance_factor = 1 / 128}, weight = 1},
|
||||||
|
{stack = {name = 'battery-equipment', count = 25, distance_factor = 1 / 128}, weight = 1},
|
||||||
|
{stack = {name = 'battery-mk2-equipment', count = 5, distance_factor = 1 / 128}, weight = 1},
|
||||||
|
{stack = {name = 'energy-shield-equipment', count = 50, distance_factor = 1 / 64}, weight = 1},
|
||||||
|
{stack = {name = 'energy-shield-mk2-equipment', count = 10, distance_factor = 1 / 64}, weight = 1},
|
||||||
|
{stack = {name = 'exoskeleton-equipment', count = 10, distance_factor = 1 / 64}, weight = 1},
|
||||||
|
{stack = {name = 'night-vision-equipment', count = 5, distance_factor = 1 / 64}, 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 = 'explosive-rocket',
|
||||||
|
output = {min_rate = 0.5 / 60, distance_factor = 0.5 / 60 / 512, item = 'explosive-rocket'}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
local factory_b = {
|
||||||
|
callback = ob.magic_item_crafting_callback,
|
||||||
|
data = {
|
||||||
|
recipe = 'cluster-grenade',
|
||||||
|
output = {min_rate = 0.2 / 60, distance_factor = 0.2 / 60 / 512, item = 'cluster-grenade'}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
local factory_c = {
|
||||||
|
callback = ob.magic_item_crafting_callback,
|
||||||
|
data = {
|
||||||
|
recipe = 'flamethrower-turret',
|
||||||
|
output = {min_rate = 0.2 / 60, distance_factor = 0.2 / 60 / 512, item = 'flamethrower-turret'}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
local market = {
|
||||||
|
callback = ob.market_set_items_callback,
|
||||||
|
data = {
|
||||||
|
{
|
||||||
|
name = 'raw-fish',
|
||||||
|
price = 1,
|
||||||
|
distance_factor = 0.5 / 512,
|
||||||
|
min_price = 0.1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'combat-shotgun',
|
||||||
|
price = 125,
|
||||||
|
distance_factor = 62.5 / 512,
|
||||||
|
min_price = 62.5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'shotgun-shell',
|
||||||
|
price = 1,
|
||||||
|
distance_factor = 0.5 / 512,
|
||||||
|
min_price = 0.1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'piercing-shotgun-shell',
|
||||||
|
price = 3,
|
||||||
|
distance_factor = 1.5 / 512,
|
||||||
|
min_price = 0.3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'flamethrower',
|
||||||
|
price = 175,
|
||||||
|
distance_factor = 87.5 / 512,
|
||||||
|
min_price = 87.5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'flamethrower-ammo',
|
||||||
|
price = 7.5,
|
||||||
|
distance_factor = 3.75 / 512,
|
||||||
|
min_price = 0.75
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'rocket-launcher',
|
||||||
|
price = 250,
|
||||||
|
distance_factor = 125 / 512,
|
||||||
|
min_price = 125
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'rocket',
|
||||||
|
price = 10,
|
||||||
|
distance_factor = 5 / 512,
|
||||||
|
min_price = 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'explosive-rocket',
|
||||||
|
price = 20,
|
||||||
|
distance_factor = 10 / 512,
|
||||||
|
min_price = 2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'grenade',
|
||||||
|
price = 5,
|
||||||
|
distance_factor = 5 / 512,
|
||||||
|
min_price = 0.5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'cluster-grenade',
|
||||||
|
price = 50,
|
||||||
|
distance_factor = 25 / 512,
|
||||||
|
min_price = 5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'modular-armor',
|
||||||
|
price = 175
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'power-armor',
|
||||||
|
price = 500,
|
||||||
|
distance_factor = 250 / 512,
|
||||||
|
min_price = 250
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'solar-panel-equipment',
|
||||||
|
price = 75,
|
||||||
|
distance_factor = 37.5 / 512,
|
||||||
|
min_price = 7.5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'fusion-reactor-equipment',
|
||||||
|
price = 625,
|
||||||
|
distance_factor = 312.5 / 512,
|
||||||
|
min_price = 312.5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'battery-equipment',
|
||||||
|
price = 50,
|
||||||
|
distance_factor = 25 / 512,
|
||||||
|
min_price = 5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'battery-mk2-equipment',
|
||||||
|
price = 250,
|
||||||
|
distance_factor = 125 / 512,
|
||||||
|
min_price = 125
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'energy-shield-equipment',
|
||||||
|
price = 50,
|
||||||
|
distance_factor = 37.5 / 512,
|
||||||
|
min_price = 15
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'energy-shield-mk2-equipment',
|
||||||
|
price = 100,
|
||||||
|
distance_factor = 50 / 512,
|
||||||
|
min_price = 25
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'exoskeleton-equipment',
|
||||||
|
price = 100,
|
||||||
|
distance_factor = 50 / 512,
|
||||||
|
min_price = 10
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'night-vision-equipment',
|
||||||
|
price = 50,
|
||||||
|
distance_factor = 25 / 512,
|
||||||
|
min_price = 5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'gun-turret',
|
||||||
|
price = 20,
|
||||||
|
distance_factor = 10 / 512,
|
||||||
|
min_price = 2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'flamethrower-turret',
|
||||||
|
price = 50,
|
||||||
|
distance_factor = 25 / 512,
|
||||||
|
min_price = 5
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
local base_factory = require 'map_gen.presets.crash_site.outpost_data.small_factory'
|
||||||
|
|
||||||
|
local level2 = ob.extend_1_way(base_factory[1], {loot = {callback = loot_callback}})
|
||||||
|
local level3 =
|
||||||
|
ob.extend_1_way(
|
||||||
|
base_factory[2],
|
||||||
|
{
|
||||||
|
factory = factory,
|
||||||
|
fallback = level2,
|
||||||
|
max_count = 2
|
||||||
|
}
|
||||||
|
)
|
||||||
|
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 =
|
||||||
|
ob.extend_1_way(
|
||||||
|
base_factory[3],
|
||||||
|
{
|
||||||
|
market = market,
|
||||||
|
fallback = level3c
|
||||||
|
}
|
||||||
|
)
|
||||||
|
return {
|
||||||
|
settings = {
|
||||||
|
blocks = 8,
|
||||||
|
variance = 3,
|
||||||
|
min_step = 2,
|
||||||
|
max_level = 2
|
||||||
|
},
|
||||||
|
walls = {
|
||||||
|
require 'map_gen.presets.crash_site.outpost_data.heavy_gun_turrets',
|
||||||
|
require 'map_gen.presets.crash_site.outpost_data.heavy_laser_turrets',
|
||||||
|
require 'map_gen.presets.crash_site.outpost_data.heavy_flame_turrets'
|
||||||
|
},
|
||||||
|
bases = {
|
||||||
|
{level4, level3b, level2}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,41 @@
|
|||||||
|
local ob = require 'map_gen.presets.crash_site.outpost_builder'
|
||||||
|
|
||||||
|
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] = {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 = 'nuclear-reactor', callback = 'power'}, 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'}
|
||||||
|
}
|
@ -3,16 +3,15 @@ local Token = require 'utils.global_token'
|
|||||||
|
|
||||||
local loot = {
|
local loot = {
|
||||||
{weight = 10},
|
{weight = 10},
|
||||||
{stack = {name = 'coin', count = 50, distance_factor = 1 / 20}, weight = 5},
|
{stack = {name = 'coin', count = 100, distance_factor = 1 / 8}, weight = 5},
|
||||||
{stack = {name = 'firearm-magazine', count = 500, distance_factor = 1}, weight = 5},
|
{stack = {name = 'firearm-magazine', count = 500, distance_factor = 1}, weight = 5},
|
||||||
{stack = {name = 'piercing-rounds-magazine', count = 300, distance_factor = 1 / 2}, weight = 5},
|
{stack = {name = 'piercing-rounds-magazine', count = 250, distance_factor = 1 / 2}, weight = 5},
|
||||||
{stack = {name = 'shotgun-shell', count = 200, distance_factor = 1 / 4}, weight = 2},
|
{stack = {name = 'shotgun-shell', count = 200, distance_factor = 1 / 4}, weight = 1},
|
||||||
{stack = {name = 'grenade', count = 100, distance_factor = 1 / 8}, weight = 3},
|
{stack = {name = 'grenade', count = 100, distance_factor = 1 / 8}, weight = 1},
|
||||||
{stack = {name = 'land-mine', count = 400, distance_factor = 1}, weight = 2},
|
{stack = {name = 'land-mine', count = 400, distance_factor = 1}, weight = 1},
|
||||||
{stack = {name = 'rocket', count = 50, distance_factor = 1 / 32}, weight = 1},
|
{stack = {name = 'rocket', count = 50, distance_factor = 1 / 32}, weight = 1},
|
||||||
{stack = {name = 'cannon-shell', count = 50, distance_factor = 1 / 32}, weight = 1},
|
{stack = {name = 'cannon-shell', count = 50, distance_factor = 1 / 32}, weight = 1},
|
||||||
{stack = {name = 'cluster-grenade', count = 10, distance_factor = 1 / 32}, weight = 1},
|
{stack = {name = 'cluster-grenade', count = 10, distance_factor = 1 / 32}, weight = 1}
|
||||||
{stack = {name = 'poison-capsule', count = 10, distance_factor = 1 / 32}, weight = 1}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
local weights = ob.prepare_weighted_loot(loot)
|
local weights = ob.prepare_weighted_loot(loot)
|
||||||
@ -36,15 +35,7 @@ local factory_b = {
|
|||||||
callback = ob.magic_item_crafting_callback,
|
callback = ob.magic_item_crafting_callback,
|
||||||
data = {
|
data = {
|
||||||
recipe = 'piercing-rounds-magazine',
|
recipe = 'piercing-rounds-magazine',
|
||||||
output = {min_rate = 1 / 3 / 60, distance_factor = 1 / 3 / 60 / 512, item = 'piercing-rounds-magazine'}
|
output = {min_rate = 1 / 2 / 60, distance_factor = 1 / 2 / 60 / 512, item = 'piercing-rounds-magazine'}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
local factory_c = {
|
|
||||||
callback = ob.magic_item_crafting_callback,
|
|
||||||
data = {
|
|
||||||
recipe = 'grenade',
|
|
||||||
output = {min_rate = 1 / 3 / 60, distance_factor = 1 / 3 / 60 / 512, item = 'grenade'}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -81,29 +72,11 @@ local market = {
|
|||||||
distance_factor = 0.5 / 512,
|
distance_factor = 0.5 / 512,
|
||||||
min_price = 0.1
|
min_price = 0.1
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name = 'rocket',
|
|
||||||
price = 20,
|
|
||||||
distance_factor = 10 / 512,
|
|
||||||
min_price = 2
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name = 'rocket-launcher',
|
|
||||||
price = 250,
|
|
||||||
distance_factor = 125 / 512,
|
|
||||||
min_price = 125
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name = 'cluster-grenade',
|
name = 'cluster-grenade',
|
||||||
price = 100,
|
price = 100,
|
||||||
distance_factor = 50 / 512,
|
distance_factor = 50 / 512,
|
||||||
min_price = 10
|
min_price = 10
|
||||||
},
|
|
||||||
{
|
|
||||||
name = 'poison-capsule',
|
|
||||||
price = 60,
|
|
||||||
distance_factor = 30 / 512,
|
|
||||||
min_price = 6
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -128,21 +101,13 @@ local level3b =
|
|||||||
max_count = 2
|
max_count = 2
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
local level3c =
|
|
||||||
ob.extend_1_way(
|
|
||||||
base_factory[2],
|
|
||||||
{
|
|
||||||
factory = factory_c,
|
|
||||||
fallback = level3b,
|
|
||||||
max_count = 1
|
|
||||||
}
|
|
||||||
)
|
|
||||||
local level4 =
|
local level4 =
|
||||||
ob.extend_1_way(
|
ob.extend_1_way(
|
||||||
base_factory[3],
|
base_factory[3],
|
||||||
{
|
{
|
||||||
market = market,
|
market = market,
|
||||||
fallback = level3c
|
fallback = level3b
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
return {
|
return {
|
||||||
|
@ -6,7 +6,9 @@ local loot = {
|
|||||||
{stack = {name = 'coin', count = 50, distance_factor = 1 / 20}, weight = 5},
|
{stack = {name = 'coin', count = 50, distance_factor = 1 / 20}, weight = 5},
|
||||||
{stack = {name = 'coal', count = 1000, distance_factor = 1}, weight = 2},
|
{stack = {name = 'coal', count = 1000, distance_factor = 1}, weight = 2},
|
||||||
{stack = {name = 'sulfur', count = 500, distance_factor = 1 / 2}, weight = 5},
|
{stack = {name = 'sulfur', count = 500, distance_factor = 1 / 2}, weight = 5},
|
||||||
{stack = {name = 'plastic-bar', count = 500, distance_factor = 1 / 2}, weight = 5}
|
{stack = {name = 'plastic-bar', count = 500, distance_factor = 1 / 2}, weight = 5},
|
||||||
|
{stack = {name = 'poison-capsule', count = 50, distance_factor = 1 / 32}, weight = 2},
|
||||||
|
{stack = {name = 'slowdown-capsule', count = 50, distance_factor = 1 / 32}, weight = 1}
|
||||||
}
|
}
|
||||||
|
|
||||||
local weights = ob.prepare_weighted_loot(loot)
|
local weights = ob.prepare_weighted_loot(loot)
|
||||||
@ -60,7 +62,19 @@ local market = {
|
|||||||
price = 1,
|
price = 1,
|
||||||
distance_factor = 0.5 / 512,
|
distance_factor = 0.5 / 512,
|
||||||
min_price = 0.1
|
min_price = 0.1
|
||||||
}
|
},
|
||||||
|
{
|
||||||
|
name = 'poison-capsule',
|
||||||
|
price = 30,
|
||||||
|
distance_factor = 15 / 512,
|
||||||
|
min_price = 3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'slowdown-capsule',
|
||||||
|
price = 30,
|
||||||
|
distance_factor = 15 / 512,
|
||||||
|
min_price = 3
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,12 @@ local loot = {
|
|||||||
{stack = {name = 'coin', count = 50, distance_factor = 1 / 20}, weight = 5},
|
{stack = {name = 'coin', count = 50, distance_factor = 1 / 20}, weight = 5},
|
||||||
{stack = {name = 'iron-plate', count = 500, distance_factor = 1 / 2}, weight = 5},
|
{stack = {name = 'iron-plate', count = 500, distance_factor = 1 / 2}, weight = 5},
|
||||||
{stack = {name = 'steel-plate', count = 100, distance_factor = 1 / 5}, weight = 1},
|
{stack = {name = 'steel-plate', count = 100, distance_factor = 1 / 5}, weight = 1},
|
||||||
{stack = {name = 'iron-gear-wheel', count = 1000, distance_factor = 1}, weight = 5}
|
{stack = {name = 'iron-gear-wheel', count = 1000, distance_factor = 1}, weight = 5},
|
||||||
|
{stack = {name = 'pipe', count = 200, distance_factor = 1}, weight = 1},
|
||||||
|
{stack = {name = 'engine-unit', count = 100, distance_factor = 1 / 2}, weight = 10},
|
||||||
|
{stack = {name = 'electric-engine-unit', count = 50, distance_factor = 1 / 2}, weight = 5},
|
||||||
|
{stack = {name = 'car', count = 1, distance_factor = 1 / 128}, weight = 2},
|
||||||
|
{stack = {name = 'rail', count = 100, distance_factor = 1}, weight = 2}
|
||||||
}
|
}
|
||||||
|
|
||||||
local weights = ob.prepare_weighted_loot(loot)
|
local weights = ob.prepare_weighted_loot(loot)
|
||||||
@ -26,6 +31,14 @@ local factory = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
local factory_b = {
|
||||||
|
callback = ob.magic_item_crafting_callback,
|
||||||
|
data = {
|
||||||
|
recipe = 'engine-unit',
|
||||||
|
output = {min_rate = 0.5 / 60, distance_factor = 0.5 / 60 / 512, item = 'engine-unit'}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
local market = {
|
local market = {
|
||||||
callback = ob.market_set_items_callback,
|
callback = ob.market_set_items_callback,
|
||||||
data = {
|
data = {
|
||||||
@ -46,6 +59,36 @@ local market = {
|
|||||||
price = 2,
|
price = 2,
|
||||||
distance_factor = 1 / 512,
|
distance_factor = 1 / 512,
|
||||||
min_price = 0.2
|
min_price = 0.2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'engine-unit',
|
||||||
|
price = 4,
|
||||||
|
distance_factor = 2 / 512,
|
||||||
|
min_price = 0.4
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'electric-engine-unit',
|
||||||
|
price = 8,
|
||||||
|
distance_factor = 4 / 512,
|
||||||
|
min_price = 0.8
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'car',
|
||||||
|
price = 50,
|
||||||
|
distance_factor = 25 / 512,
|
||||||
|
min_price = 40
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'tank',
|
||||||
|
price = 500,
|
||||||
|
distance_factor = 250 / 512,
|
||||||
|
min_price = 250
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'rail',
|
||||||
|
price = 1,
|
||||||
|
distance_factor = 0.5 / 512,
|
||||||
|
min_price = 0.1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -61,12 +104,21 @@ local level3 =
|
|||||||
fallback = level2
|
fallback = level2
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
local level3b =
|
||||||
|
ob.extend_1_way(
|
||||||
|
base_factory[2],
|
||||||
|
{
|
||||||
|
factory = factory_b,
|
||||||
|
fallback = level3,
|
||||||
|
max_count = 1
|
||||||
|
}
|
||||||
|
)
|
||||||
local level4 =
|
local level4 =
|
||||||
ob.extend_1_way(
|
ob.extend_1_way(
|
||||||
base_factory[3],
|
base_factory[3],
|
||||||
{
|
{
|
||||||
market = market,
|
market = market,
|
||||||
fallback = level3
|
fallback = level3b
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
return {
|
return {
|
||||||
|
117
map_gen/presets/crash_site/outpost_data/small_power_factory.lua
Normal file
117
map_gen/presets/crash_site/outpost_data/small_power_factory.lua
Normal file
@ -0,0 +1,117 @@
|
|||||||
|
local ob = require 'map_gen.presets.crash_site.outpost_builder'
|
||||||
|
local Token = require 'utils.global_token'
|
||||||
|
|
||||||
|
local loot = {
|
||||||
|
{weight = 10},
|
||||||
|
{stack = {name = 'coin', count = 50, distance_factor = 1 / 20}, weight = 5},
|
||||||
|
{stack = {name = 'coal', count = 1000, distance_factor = 1}, weight = 5},
|
||||||
|
{stack = {name = 'solid-fuel', count = 500, distance_factor = 1}, weight = 5},
|
||||||
|
{stack = {name = 'boiler', count = 25, distance_factor = 1 / 2}, weight = 5},
|
||||||
|
{stack = {name = 'steam-engine', count = 50, distance_factor = 1 / 5}, weight = 5},
|
||||||
|
{stack = {name = 'offshore-pump', count = 5, distance_factor = 1}, weight = 5},
|
||||||
|
{stack = {name = 'pipe', count = 200, distance_factor = 1}, weight = 5},
|
||||||
|
{stack = {name = 'pipe-to-ground', count = 50, distance_factor = 1 / 2}, weight = 5},
|
||||||
|
{stack = {name = 'medium-electric-pole', count = 50, 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 market = {
|
||||||
|
callback = ob.market_set_items_callback,
|
||||||
|
data = {
|
||||||
|
{
|
||||||
|
name = 'coal',
|
||||||
|
price = 0.5,
|
||||||
|
distance_factor = 0.25 / 512,
|
||||||
|
min_price = 0.05
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'solid-fuel',
|
||||||
|
price = 1.25,
|
||||||
|
distance_factor = 0.75 / 512,
|
||||||
|
min_price = 0.125
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'boiler',
|
||||||
|
price = 3,
|
||||||
|
distance_factor = 1.5 / 512,
|
||||||
|
min_price = 0.3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'steam-engine',
|
||||||
|
price = 6,
|
||||||
|
distance_factor = 3 / 512,
|
||||||
|
min_price = 0.6
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'offshore-pump',
|
||||||
|
price = 2,
|
||||||
|
distance_factor = 1 / 512,
|
||||||
|
min_price = 0.2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'pipe',
|
||||||
|
price = 0.25,
|
||||||
|
distance_factor = 0.125 / 512,
|
||||||
|
min_price = 0.025
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'pipe-to-ground',
|
||||||
|
price = 2.5,
|
||||||
|
distance_factor = 1.25 / 512,
|
||||||
|
min_price = 0.25
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'medium-electric-pole',
|
||||||
|
price = 2,
|
||||||
|
distance_factor = 1 / 512,
|
||||||
|
min_price = 0.2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
local base_factory = require 'map_gen.presets.crash_site.outpost_data.small_factory'
|
||||||
|
local power_factory = require 'map_gen.presets.crash_site.outpost_data.steam_engine_block'
|
||||||
|
|
||||||
|
local level2 = ob.extend_1_way(base_factory[1], {loot = {callback = loot_callback}})
|
||||||
|
local level3 =
|
||||||
|
ob.extend_1_way(
|
||||||
|
power_factory,
|
||||||
|
{
|
||||||
|
power = power,
|
||||||
|
fallback = level2,
|
||||||
|
max_count = 4
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
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_gun_turrets',
|
||||||
|
--require 'map_gen.presets.crash_site.outpost_data.light_laser_turrets'
|
||||||
|
require 'map_gen.presets.crash_site.outpost_data.walls'
|
||||||
|
},
|
||||||
|
bases = {
|
||||||
|
{level4, level2}
|
||||||
|
}
|
||||||
|
}
|
@ -21,7 +21,7 @@ local factory = {
|
|||||||
callback = ob.magic_item_crafting_callback,
|
callback = ob.magic_item_crafting_callback,
|
||||||
data = {
|
data = {
|
||||||
recipe = 'science-pack-1',
|
recipe = 'science-pack-1',
|
||||||
output = {min_rate = 0.05 / 60, distance_factor = 0.05 / 60 / 512, item = 'science-pack-1'}
|
output = {min_rate = 0.25 / 60, distance_factor = 0.25 / 60 / 512, item = 'science-pack-1'}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -29,7 +29,7 @@ local factory_b = {
|
|||||||
callback = ob.magic_item_crafting_callback,
|
callback = ob.magic_item_crafting_callback,
|
||||||
data = {
|
data = {
|
||||||
recipe = 'science-pack-2',
|
recipe = 'science-pack-2',
|
||||||
output = {min_rate = 0.05 / 60, distance_factor = 0.05 / 60 / 512, item = 'science-pack-2'}
|
output = {min_rate = 0.25 / 60, distance_factor = 0.25 / 60 / 512, item = 'science-pack-2'}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
112
map_gen/presets/crash_site/outpost_data/small_stone_factory.lua
Normal file
112
map_gen/presets/crash_site/outpost_data/small_stone_factory.lua
Normal file
@ -0,0 +1,112 @@
|
|||||||
|
local ob = require 'map_gen.presets.crash_site.outpost_builder'
|
||||||
|
local Token = require 'utils.global_token'
|
||||||
|
|
||||||
|
local loot = {
|
||||||
|
{weight = 5},
|
||||||
|
{stack = {name = 'coin', count = 50, distance_factor = 1 / 20}, weight = 5},
|
||||||
|
{stack = {name = 'stone', count = 1600}, weight = 8},
|
||||||
|
{stack = {name = 'stone-brick', count = 500, distance_factor = 1 / 2}, weight = 10},
|
||||||
|
{stack = {name = 'stone-wall', count = 250, distance_factor = 1 / 5}, weight = 5},
|
||||||
|
{stack = {name = 'gate', count = 50, distance_factor = 1 / 5}, 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 = {
|
||||||
|
furance_item = 'stone',
|
||||||
|
output = {min_rate = 1 / 60, distance_factor = 1 / 60 / 512, item = 'stone-brick'}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
local factory_b = {
|
||||||
|
callback = ob.magic_item_crafting_callback,
|
||||||
|
data = {
|
||||||
|
recipe = 'stone-wall',
|
||||||
|
output = {min_rate = 1 / 60, distance_factor = 1 / 60 / 512, item = 'stone-wall'}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
local market = {
|
||||||
|
callback = ob.market_set_items_callback,
|
||||||
|
data = {
|
||||||
|
{
|
||||||
|
name = 'stone',
|
||||||
|
price = 0.25,
|
||||||
|
distance_factor = 0.125 / 512,
|
||||||
|
min_price = 0.025
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'stone-brick',
|
||||||
|
price = 0.5,
|
||||||
|
distance_factor = 0.25 / 512,
|
||||||
|
min_price = 0.05
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'stone-wall',
|
||||||
|
price = 1,
|
||||||
|
distance_factor = 0.5 / 512,
|
||||||
|
min_price = 0.1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'gate',
|
||||||
|
price = 2,
|
||||||
|
distance_factor = 1 / 512,
|
||||||
|
min_price = 0.2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
local base_factory = require 'map_gen.presets.crash_site.outpost_data.small_furance'
|
||||||
|
local base_factory2 = require 'map_gen.presets.crash_site.outpost_data.small_factory'
|
||||||
|
|
||||||
|
local level2 = ob.extend_1_way(base_factory[1], {loot = {callback = loot_callback}})
|
||||||
|
local level3 =
|
||||||
|
ob.extend_1_way(
|
||||||
|
base_factory[2],
|
||||||
|
{
|
||||||
|
factory = factory,
|
||||||
|
fallback = level2,
|
||||||
|
max_count = 1
|
||||||
|
}
|
||||||
|
)
|
||||||
|
local level3b =
|
||||||
|
ob.extend_1_way(
|
||||||
|
base_factory2[2],
|
||||||
|
{
|
||||||
|
factory = factory_b,
|
||||||
|
fallback = level3,
|
||||||
|
max_count = 1
|
||||||
|
}
|
||||||
|
)
|
||||||
|
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_gun_turrets',
|
||||||
|
require 'map_gen.presets.crash_site.outpost_data.walls'
|
||||||
|
},
|
||||||
|
bases = {
|
||||||
|
{level4, level2}
|
||||||
|
}
|
||||||
|
}
|
213
map_gen/presets/crash_site/outpost_data/small_weapon_factory.lua
Normal file
213
map_gen/presets/crash_site/outpost_data/small_weapon_factory.lua
Normal file
@ -0,0 +1,213 @@
|
|||||||
|
local ob = require 'map_gen.presets.crash_site.outpost_builder'
|
||||||
|
local Token = require 'utils.global_token'
|
||||||
|
|
||||||
|
local loot = {
|
||||||
|
{weight = 5},
|
||||||
|
{stack = {name = 'coin', count = 100, distance_factor = 1 / 8}, weight = 3},
|
||||||
|
{stack = {name = 'raw-fish', count = 50, distance_factor = 1 / 16}, weight = 1},
|
||||||
|
{stack = {name = 'combat-shotgun', count = 5, distance_factor = 1 / 128}, weight = 1},
|
||||||
|
{stack = {name = 'shotgun-shell', count = 200, distance_factor = 1 / 8}, weight = 1},
|
||||||
|
{stack = {name = 'piercing-shotgun-shell', count = 50, distance_factor = 1 / 8}, weight = 1},
|
||||||
|
{stack = {name = 'flamethrower', count = 5, distance_factor = 1 / 128}, weight = 1},
|
||||||
|
{stack = {name = 'flamethrower-ammo', count = 50, distance_factor = 1 / 8}, weight = 1},
|
||||||
|
{stack = {name = 'rocket-launcher', count = 5, distance_factor = 1 / 128}, weight = 1},
|
||||||
|
{stack = {name = 'rocket', count = 50, distance_factor = 1 / 8}, weight = 1},
|
||||||
|
{stack = {name = 'gun-turret', count = 50, distance_factor = 1 / 16}, weight = 1},
|
||||||
|
{stack = {name = 'flamethrower-turret', count = 50, distance_factor = 1 / 16}, weight = 1},
|
||||||
|
{stack = {name = 'grenade', count = 100, distance_factor = 1 / 8}, weight = 1},
|
||||||
|
{stack = {name = 'cluster-grenade', count = 10, distance_factor = 1 / 32}, weight = 1},
|
||||||
|
{stack = {name = 'modular-armor', count = 5, distance_factor = 1 / 128}, weight = 1},
|
||||||
|
{stack = {name = 'solar-panel-equipment', count = 25, distance_factor = 1 / 32}, weight = 1},
|
||||||
|
{stack = {name = 'battery-equipment', count = 5, distance_factor = 1 / 128}, weight = 1},
|
||||||
|
{stack = {name = 'energy-shield-equipment', count = 10, distance_factor = 1 / 64}, 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 = 'piercing-shotgun-shell',
|
||||||
|
output = {min_rate = 0.5 / 60, distance_factor = 0.5 / 60 / 512, item = 'piercing-shotgun-shell'}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
local factory_b = {
|
||||||
|
callback = ob.magic_item_crafting_callback,
|
||||||
|
data = {
|
||||||
|
recipe = 'grenade',
|
||||||
|
output = {min_rate = 0.2 / 60, distance_factor = 0.2 / 60 / 512, item = 'grenade'}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
local factory_c = {
|
||||||
|
callback = ob.magic_item_crafting_callback,
|
||||||
|
data = {
|
||||||
|
recipe = 'gun-turret',
|
||||||
|
output = {min_rate = 0.2 / 60, distance_factor = 0.2 / 60 / 512, item = 'gun-turret'}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
local market = {
|
||||||
|
callback = ob.market_set_items_callback,
|
||||||
|
data = {
|
||||||
|
{
|
||||||
|
name = 'raw-fish',
|
||||||
|
price = 1,
|
||||||
|
distance_factor = 0.5 / 512,
|
||||||
|
min_price = 0.1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'combat-shotgun',
|
||||||
|
price = 125,
|
||||||
|
distance_factor = 62.5 / 512,
|
||||||
|
min_price = 62.5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'shotgun-shell',
|
||||||
|
price = 1,
|
||||||
|
distance_factor = 0.5 / 512,
|
||||||
|
min_price = 0.1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'piercing-shotgun-shell',
|
||||||
|
price = 3,
|
||||||
|
distance_factor = 1.5 / 512,
|
||||||
|
min_price = 0.3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'flamethrower',
|
||||||
|
price = 175,
|
||||||
|
distance_factor = 87.5 / 512,
|
||||||
|
min_price = 87.5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'flamethrower-ammo',
|
||||||
|
price = 7.5,
|
||||||
|
distance_factor = 3.75 / 512,
|
||||||
|
min_price = 0.75
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'rocket-launcher',
|
||||||
|
price = 250,
|
||||||
|
distance_factor = 125 / 512,
|
||||||
|
min_price = 125
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'rocket',
|
||||||
|
price = 20,
|
||||||
|
distance_factor = 10 / 512,
|
||||||
|
min_price = 2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'grenade',
|
||||||
|
price = 5,
|
||||||
|
distance_factor = 5 / 512,
|
||||||
|
min_price = 0.5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'cluster-grenade',
|
||||||
|
price = 100,
|
||||||
|
distance_factor = 50 / 512,
|
||||||
|
min_price = 10
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'modular-armor',
|
||||||
|
price = 350,
|
||||||
|
distance_factor = 175 / 512,
|
||||||
|
min_price = 175
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'solar-panel-equipment',
|
||||||
|
price = 75,
|
||||||
|
distance_factor = 37.5 / 512,
|
||||||
|
min_price = 37.5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'battery-equipment',
|
||||||
|
price = 50,
|
||||||
|
distance_factor = 25 / 512,
|
||||||
|
min_price = 25
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'energy-shield-equipment',
|
||||||
|
price = 75,
|
||||||
|
distance_factor = 37.5 / 512,
|
||||||
|
min_price = 37.5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'gun-turret',
|
||||||
|
price = 20,
|
||||||
|
distance_factor = 10 / 512,
|
||||||
|
min_price = 2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = 'flamethrower-turret',
|
||||||
|
price = 100,
|
||||||
|
distance_factor = 50 / 512,
|
||||||
|
min_price = 50
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
local base_factory = require 'map_gen.presets.crash_site.outpost_data.small_factory'
|
||||||
|
|
||||||
|
local level2 = ob.extend_1_way(base_factory[1], {loot = {callback = loot_callback}})
|
||||||
|
local level3 =
|
||||||
|
ob.extend_1_way(
|
||||||
|
base_factory[2],
|
||||||
|
{
|
||||||
|
factory = factory,
|
||||||
|
fallback = level2,
|
||||||
|
max_count = 1
|
||||||
|
}
|
||||||
|
)
|
||||||
|
local level3b =
|
||||||
|
ob.extend_1_way(
|
||||||
|
base_factory[2],
|
||||||
|
{
|
||||||
|
factory = factory_b,
|
||||||
|
fallback = level3,
|
||||||
|
max_count = 1
|
||||||
|
}
|
||||||
|
)
|
||||||
|
local level3c =
|
||||||
|
ob.extend_1_way(
|
||||||
|
base_factory[2],
|
||||||
|
{
|
||||||
|
factory = factory_c,
|
||||||
|
fallback = level3b,
|
||||||
|
max_count = 4
|
||||||
|
}
|
||||||
|
)
|
||||||
|
local level4 =
|
||||||
|
ob.extend_1_way(
|
||||||
|
base_factory[3],
|
||||||
|
{
|
||||||
|
market = market,
|
||||||
|
fallback = level3c
|
||||||
|
}
|
||||||
|
)
|
||||||
|
return {
|
||||||
|
settings = {
|
||||||
|
blocks = 7,
|
||||||
|
variance = 3,
|
||||||
|
min_step = 2,
|
||||||
|
max_level = 2
|
||||||
|
},
|
||||||
|
walls = {
|
||||||
|
require 'map_gen.presets.crash_site.outpost_data.medium_gun_turrets',
|
||||||
|
require 'map_gen.presets.crash_site.outpost_data.medium_laser_turrets',
|
||||||
|
require 'map_gen.presets.crash_site.outpost_data.medium_flame_turrets'
|
||||||
|
},
|
||||||
|
bases = {
|
||||||
|
{level4, level3b, level2}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,41 @@
|
|||||||
|
local ob = require 'map_gen.presets.crash_site.outpost_builder'
|
||||||
|
|
||||||
|
return 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] = {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 = 'solar-panel', callback = 'power'}, 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'}
|
||||||
|
}
|
@ -0,0 +1,41 @@
|
|||||||
|
local ob = require 'map_gen.presets.crash_site.outpost_builder'
|
||||||
|
|
||||||
|
return ob.make_1_way {
|
||||||
|
force = 'neutral',
|
||||||
|
[1] = {tile = 'stone-path'},
|
||||||
|
[2] = {tile = 'concrete'},
|
||||||
|
[3] = {tile = 'concrete'},
|
||||||
|
[4] = {tile = 'concrete'},
|
||||||
|
[5] = {tile = 'stone-path'},
|
||||||
|
[6] = {tile = 'stone-path'},
|
||||||
|
[7] = {tile = 'stone-path'},
|
||||||
|
[8] = {tile = 'concrete'},
|
||||||
|
[9] = {tile = 'concrete'},
|
||||||
|
[10] = {tile = 'concrete'},
|
||||||
|
[11] = {tile = 'stone-path'},
|
||||||
|
[12] = {tile = 'stone-path'},
|
||||||
|
[13] = {tile = 'stone-path'},
|
||||||
|
[14] = {tile = 'concrete'},
|
||||||
|
[15] = {entity = {name = 'steam-engine', callback = 'power'}, tile = 'concrete'},
|
||||||
|
[16] = {tile = 'concrete'},
|
||||||
|
[17] = {tile = 'stone-path'},
|
||||||
|
[18] = {tile = 'stone-path'},
|
||||||
|
[19] = {tile = 'stone-path'},
|
||||||
|
[20] = {tile = 'concrete'},
|
||||||
|
[21] = {tile = 'concrete'},
|
||||||
|
[22] = {tile = 'concrete'},
|
||||||
|
[23] = {tile = 'stone-path'},
|
||||||
|
[24] = {tile = 'stone-path'},
|
||||||
|
[25] = {tile = 'stone-path'},
|
||||||
|
[26] = {tile = 'concrete'},
|
||||||
|
[27] = {tile = 'concrete'},
|
||||||
|
[28] = {tile = 'concrete'},
|
||||||
|
[29] = {tile = 'stone-path'},
|
||||||
|
[30] = {tile = 'stone-path'},
|
||||||
|
[31] = {tile = 'stone-path'},
|
||||||
|
[32] = {tile = 'concrete'},
|
||||||
|
[33] = {tile = 'concrete'},
|
||||||
|
[34] = {tile = 'concrete'},
|
||||||
|
[35] = {tile = 'stone-path'},
|
||||||
|
[36] = {tile = 'stone-path'}
|
||||||
|
}
|
@ -13,7 +13,31 @@ return {
|
|||||||
[9] = {entity = {name = 'stone-wall'}},
|
[9] = {entity = {name = 'stone-wall'}},
|
||||||
[10] = {entity = {name = 'stone-wall'}},
|
[10] = {entity = {name = 'stone-wall'}},
|
||||||
[11] = {entity = {name = 'stone-wall'}},
|
[11] = {entity = {name = 'stone-wall'}},
|
||||||
[12] = {entity = {name = 'stone-wall'}}
|
[12] = {entity = {name = 'stone-wall'}},
|
||||||
|
[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 = 'concrete'},
|
||||||
|
[20] = {tile = 'concrete'},
|
||||||
|
[21] = {tile = 'concrete'},
|
||||||
|
[22] = {tile = 'concrete'},
|
||||||
|
[23] = {tile = 'concrete'},
|
||||||
|
[24] = {tile = 'concrete'},
|
||||||
|
[25] = {tile = 'concrete'},
|
||||||
|
[26] = {tile = 'concrete'},
|
||||||
|
[27] = {tile = 'concrete'},
|
||||||
|
[28] = {tile = 'concrete'},
|
||||||
|
[29] = {tile = 'concrete'},
|
||||||
|
[30] = {tile = 'concrete'},
|
||||||
|
[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 {
|
ob.make_4_way {
|
||||||
[1] = {entity = {name = 'stone-wall'}},
|
[1] = {entity = {name = 'stone-wall'}},
|
||||||
@ -30,17 +54,65 @@ return {
|
|||||||
[12] = {entity = {name = 'stone-wall'}},
|
[12] = {entity = {name = 'stone-wall'}},
|
||||||
[13] = {entity = {name = 'stone-wall'}},
|
[13] = {entity = {name = 'stone-wall'}},
|
||||||
[14] = {entity = {name = 'stone-wall'}},
|
[14] = {entity = {name = 'stone-wall'}},
|
||||||
|
[15] = {tile = 'stone-path'},
|
||||||
|
[16] = {tile = 'stone-path'},
|
||||||
|
[17] = {tile = 'stone-path'},
|
||||||
|
[18] = {tile = 'stone-path'},
|
||||||
[19] = {entity = {name = 'stone-wall'}},
|
[19] = {entity = {name = 'stone-wall'}},
|
||||||
[20] = {entity = {name = 'stone-wall'}},
|
[20] = {entity = {name = 'stone-wall'}},
|
||||||
|
[21] = {tile = 'stone-path'},
|
||||||
|
[22] = {tile = 'concrete'},
|
||||||
|
[23] = {tile = 'concrete'},
|
||||||
|
[24] = {tile = 'concrete'},
|
||||||
[25] = {entity = {name = 'stone-wall'}},
|
[25] = {entity = {name = 'stone-wall'}},
|
||||||
[26] = {entity = {name = 'stone-wall'}},
|
[26] = {entity = {name = 'stone-wall'}},
|
||||||
|
[27] = {tile = 'stone-path'},
|
||||||
|
[28] = {tile = 'concrete'},
|
||||||
|
[29] = {tile = 'concrete'},
|
||||||
|
[30] = {tile = 'concrete'},
|
||||||
[31] = {entity = {name = 'stone-wall'}},
|
[31] = {entity = {name = 'stone-wall'}},
|
||||||
[32] = {entity = {name = 'stone-wall'}}
|
[32] = {entity = {name = 'stone-wall'}},
|
||||||
|
[33] = {tile = 'stone-path'},
|
||||||
|
[34] = {tile = 'concrete'},
|
||||||
|
[35] = {tile = 'concrete'},
|
||||||
|
[36] = {tile = 'stone-path'}
|
||||||
},
|
},
|
||||||
ob.make_4_way {
|
ob.make_4_way {
|
||||||
[1] = {entity = {name = 'stone-wall'}},
|
[1] = {entity = {name = 'stone-wall'}},
|
||||||
[2] = {entity = {name = 'stone-wall'}},
|
[2] = {entity = {name = 'stone-wall'}},
|
||||||
|
[3] = {tile = 'stone-path'},
|
||||||
|
[4] = {tile = 'concrete'},
|
||||||
|
[5] = {tile = 'concrete'},
|
||||||
|
[6] = {tile = 'stone-path'},
|
||||||
[7] = {entity = {name = 'stone-wall'}},
|
[7] = {entity = {name = 'stone-wall'}},
|
||||||
[8] = {entity = {name = 'stone-wall'}}
|
[8] = {entity = {name = 'stone-wall'}},
|
||||||
|
[9] = {tile = 'stone-path'},
|
||||||
|
[10] = {tile = 'concrete'},
|
||||||
|
[11] = {tile = 'concrete'},
|
||||||
|
[12] = {tile = 'stone-path'},
|
||||||
|
[13] = {tile = 'stone-path'},
|
||||||
|
[14] = {tile = 'stone-path'},
|
||||||
|
[15] = {tile = 'stone-path'},
|
||||||
|
[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'}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@ local Event = require 'utils.event'
|
|||||||
local player_ammo_starting_modifiers = {
|
local player_ammo_starting_modifiers = {
|
||||||
['artillery-shell'] = -0.75,
|
['artillery-shell'] = -0.75,
|
||||||
['biological'] = -0.5,
|
['biological'] = -0.5,
|
||||||
['bullet'] = -0.25,
|
['bullet'] = -0.35,
|
||||||
['cannon-shell'] = -0.75,
|
['cannon-shell'] = -0.75,
|
||||||
['capsule'] = -0.5,
|
['capsule'] = -0.5,
|
||||||
['combat-robot-beam'] = -0.5,
|
['combat-robot-beam'] = -0.5,
|
||||||
@ -17,7 +17,7 @@ local player_ammo_starting_modifiers = {
|
|||||||
['melee'] = 0,
|
['melee'] = 0,
|
||||||
['railgun'] = 0,
|
['railgun'] = 0,
|
||||||
['rocket'] = -0.5,
|
['rocket'] = -0.5,
|
||||||
['shotgun-shell'] = -0.5
|
['shotgun-shell'] = -0.25
|
||||||
}
|
}
|
||||||
|
|
||||||
local player_ammo_research_modifiers = {
|
local player_ammo_research_modifiers = {
|
||||||
@ -36,7 +36,7 @@ local player_ammo_research_modifiers = {
|
|||||||
['melee'] = -0.5,
|
['melee'] = -0.5,
|
||||||
['railgun'] = -0.5,
|
['railgun'] = -0.5,
|
||||||
['rocket'] = -0.5,
|
['rocket'] = -0.5,
|
||||||
['shotgun-shell'] = -0.5
|
['shotgun-shell'] = -0.25
|
||||||
}
|
}
|
||||||
|
|
||||||
local player_turrets_research_modifiers = {
|
local player_turrets_research_modifiers = {
|
||||||
|
@ -55,7 +55,7 @@ local player_name_heading_name = Gui.uid_name()
|
|||||||
local time_heading_name = Gui.uid_name()
|
local time_heading_name = Gui.uid_name()
|
||||||
local rank_heading_name = Gui.uid_name()
|
local rank_heading_name = Gui.uid_name()
|
||||||
local distance_heading_name = Gui.uid_name()
|
local distance_heading_name = Gui.uid_name()
|
||||||
local fish_heading_name = Gui.uid_name()
|
local coin_heading_name = Gui.uid_name()
|
||||||
local deaths_heading_name = Gui.uid_name()
|
local deaths_heading_name = Gui.uid_name()
|
||||||
local poke_name_heading_name = Gui.uid_name()
|
local poke_name_heading_name = Gui.uid_name()
|
||||||
|
|
||||||
@ -64,7 +64,7 @@ local player_name_cell_name = Gui.uid_name()
|
|||||||
local time_cell_name = Gui.uid_name()
|
local time_cell_name = Gui.uid_name()
|
||||||
local rank_cell_name = Gui.uid_name()
|
local rank_cell_name = Gui.uid_name()
|
||||||
local distance_cell_name = Gui.uid_name()
|
local distance_cell_name = Gui.uid_name()
|
||||||
local fish_cell_name = Gui.uid_name()
|
local coin_cell_name = Gui.uid_name()
|
||||||
local deaths_cell_name = Gui.uid_name()
|
local deaths_cell_name = Gui.uid_name()
|
||||||
local poke_cell_name = Gui.uid_name()
|
local poke_cell_name = Gui.uid_name()
|
||||||
|
|
||||||
@ -283,29 +283,29 @@ local column_builders = {
|
|||||||
return label
|
return label
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
[fish_heading_name] = {
|
[coin_heading_name] = {
|
||||||
create_data = function(player)
|
create_data = function(player)
|
||||||
local index = player.index
|
local index = player.index
|
||||||
return {
|
return {
|
||||||
fish_earned = PlayerStats.get_fish_earned(index),
|
coin_earned = PlayerStats.get_coin_earned(index),
|
||||||
fish_spent = PlayerStats.get_fish_spent(index)
|
coin_spent = PlayerStats.get_coin_spent(index)
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
sort = function(a, b)
|
sort = function(a, b)
|
||||||
local a_fish_earned, b_fish_earned = a.fish_earned, b.fish_earned
|
local a_coin_earned, b_coin_earned = a.coin_earned, b.coin_earned
|
||||||
if a_fish_earned == b_fish_earned then
|
if a_coin_earned == b_coin_earned then
|
||||||
return a.fish_spent < b.fish_spent
|
return a.coin_spent < b.coin_spent
|
||||||
else
|
else
|
||||||
return a_fish_earned < b_fish_earned
|
return a_coin_earned < b_coin_earned
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
draw_heading = function(parent)
|
draw_heading = function(parent)
|
||||||
local label =
|
local label =
|
||||||
parent.add {
|
parent.add {
|
||||||
type = 'label',
|
type = 'label',
|
||||||
name = fish_heading_name,
|
name = coin_heading_name,
|
||||||
caption = 'Fish',
|
caption = 'Coins',
|
||||||
tooltip = 'Fish earned / spent.'
|
tooltip = 'Coins earned / spent.'
|
||||||
}
|
}
|
||||||
local label_style = label.style
|
local label_style = label.style
|
||||||
apply_heading_style(label_style)
|
apply_heading_style(label_style)
|
||||||
@ -314,9 +314,9 @@ local column_builders = {
|
|||||||
return label
|
return label
|
||||||
end,
|
end,
|
||||||
draw_cell = function(parent, cell_data)
|
draw_cell = function(parent, cell_data)
|
||||||
local text = table.concat({cell_data.fish_earned, '/', cell_data.fish_spent})
|
local text = table.concat({cell_data.coin_earned, '/', cell_data.coin_spent})
|
||||||
|
|
||||||
local label = parent.add {type = 'label', name = fish_cell_name, caption = text}
|
local label = parent.add {type = 'label', name = coin_cell_name, caption = text}
|
||||||
local label_style = label.style
|
local label_style = label.style
|
||||||
label_style.align = 'center'
|
label_style.align = 'center'
|
||||||
label_style.width = 80
|
label_style.width = 80
|
||||||
@ -415,7 +415,7 @@ local function get_default_player_settings()
|
|||||||
time_heading_name,
|
time_heading_name,
|
||||||
rank_heading_name,
|
rank_heading_name,
|
||||||
distance_heading_name,
|
distance_heading_name,
|
||||||
--fish_heading_name,
|
coin_heading_name,
|
||||||
deaths_heading_name,
|
deaths_heading_name,
|
||||||
poke_name_heading_name
|
poke_name_heading_name
|
||||||
},
|
},
|
||||||
|
@ -3,8 +3,8 @@ local Global = require 'utils.global'
|
|||||||
|
|
||||||
local player_last_position = {}
|
local player_last_position = {}
|
||||||
local player_walk_distances = {}
|
local player_walk_distances = {}
|
||||||
local player_fish_earned = {}
|
local player_coin_earned = {}
|
||||||
local player_fish_spent = {}
|
local player_coin_spent = {}
|
||||||
local player_deaths = {}
|
local player_deaths = {}
|
||||||
local total_players = {0}
|
local total_players = {0}
|
||||||
|
|
||||||
@ -12,16 +12,16 @@ Global.register(
|
|||||||
{
|
{
|
||||||
player_last_position = player_last_position,
|
player_last_position = player_last_position,
|
||||||
player_walk_distances = player_walk_distances,
|
player_walk_distances = player_walk_distances,
|
||||||
player_fish_earned = player_fish_earned,
|
player_coin_earned = player_coin_earned,
|
||||||
player_fish_spent = player_fish_spent,
|
player_coin_spent = player_coin_spent,
|
||||||
player_deaths = player_deaths,
|
player_deaths = player_deaths,
|
||||||
total_players = total_players
|
total_players = total_players
|
||||||
},
|
},
|
||||||
function(tbl)
|
function(tbl)
|
||||||
player_last_position = tbl.player_last_position
|
player_last_position = tbl.player_last_position
|
||||||
player_walk_distances = tbl.player_walk_distances
|
player_walk_distances = tbl.player_walk_distances
|
||||||
player_fish_earned = tbl.player_fish_earned
|
player_coin_earned = tbl.player_coin_earned
|
||||||
player_fish_spent = tbl.player_fish_spent
|
player_coin_spent = tbl.player_coin_spent
|
||||||
player_deaths = tbl.player_deaths
|
player_deaths = tbl.player_deaths
|
||||||
total_players = tbl.total_players
|
total_players = tbl.total_players
|
||||||
end
|
end
|
||||||
@ -32,8 +32,8 @@ local function player_created(event)
|
|||||||
|
|
||||||
player_last_position[index] = game.players[index].position
|
player_last_position[index] = game.players[index].position
|
||||||
player_walk_distances[index] = 0
|
player_walk_distances[index] = 0
|
||||||
player_fish_earned[index] = 0
|
player_coin_earned[index] = 0
|
||||||
player_fish_spent[index] = 0
|
player_coin_spent[index] = 0
|
||||||
player_deaths[index] = {causes = {}, count = 0}
|
player_deaths[index] = {causes = {}, count = 0}
|
||||||
total_players[1] = total_players[1] + 1
|
total_players[1] = total_players[1] + 1
|
||||||
end
|
end
|
||||||
@ -69,9 +69,9 @@ end
|
|||||||
local function picked_up_item(event)
|
local function picked_up_item(event)
|
||||||
local stack = event.item_stack
|
local stack = event.item_stack
|
||||||
|
|
||||||
if stack.name == 'raw-fish' then
|
if stack.name == 'coin' then
|
||||||
local player_index = event.player_index
|
local player_index = event.player_index
|
||||||
player_fish_earned[player_index] = player_fish_earned[player_index] + stack.count
|
player_coin_earned[player_index] = player_coin_earned[player_index] + stack.count
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -102,28 +102,28 @@ function Public.get_walk_distance(player_index)
|
|||||||
return player_walk_distances[player_index]
|
return player_walk_distances[player_index]
|
||||||
end
|
end
|
||||||
|
|
||||||
function Public.get_fish_earned(player_index)
|
function Public.get_coin_earned(player_index)
|
||||||
return player_fish_earned[player_index]
|
return player_coin_earned[player_index]
|
||||||
end
|
end
|
||||||
|
|
||||||
function Public.set_fish_earned(player_index, value)
|
function Public.set_coin_earned(player_index, value)
|
||||||
player_fish_earned[player_index] = value
|
player_coin_earned[player_index] = value
|
||||||
end
|
end
|
||||||
|
|
||||||
function Public.change_fish_earned(player_index, amount)
|
function Public.change_coin_earned(player_index, amount)
|
||||||
player_fish_earned[player_index] = player_fish_earned[player_index] + amount
|
player_coin_earned[player_index] = player_coin_earned[player_index] + amount
|
||||||
end
|
end
|
||||||
|
|
||||||
function Public.get_fish_spent(player_index)
|
function Public.get_coin_spent(player_index)
|
||||||
return player_fish_spent[player_index]
|
return player_coin_spent[player_index]
|
||||||
end
|
end
|
||||||
|
|
||||||
function Public.set_fish_spent(player_index, value)
|
function Public.set_coin_spent(player_index, value)
|
||||||
player_fish_spent[player_index] = value
|
player_coin_spent[player_index] = value
|
||||||
end
|
end
|
||||||
|
|
||||||
function Public.change_fish_spent(player_index, amount)
|
function Public.change_coin_spent(player_index, amount)
|
||||||
player_fish_spent[player_index] = player_fish_spent[player_index] + amount
|
player_coin_spent[player_index] = player_coin_spent[player_index] + amount
|
||||||
end
|
end
|
||||||
|
|
||||||
function Public.get_death_count(player_index)
|
function Public.get_death_count(player_index)
|
||||||
|
@ -267,7 +267,6 @@ return {
|
|||||||
['warnotte'] = true,
|
['warnotte'] = true,
|
||||||
['watchinghawk'] = true,
|
['watchinghawk'] = true,
|
||||||
['wekkka'] = true,
|
['wekkka'] = true,
|
||||||
['wesoly1234'] = true,
|
|
||||||
['wickvitaminc'] = true,
|
['wickvitaminc'] = true,
|
||||||
['williambellwisdo'] = true,
|
['williambellwisdo'] = true,
|
||||||
['wurzeltroll42'] = true,
|
['wurzeltroll42'] = true,
|
||||||
@ -445,7 +444,6 @@ return {
|
|||||||
['SmotPokin42000'] = true,
|
['SmotPokin42000'] = true,
|
||||||
['Theysaywhatnow'] = true,
|
['Theysaywhatnow'] = true,
|
||||||
['SwampD0nkey'] = true,
|
['SwampD0nkey'] = true,
|
||||||
['BTG'] = true,
|
|
||||||
['Anubi5'] = true,
|
['Anubi5'] = true,
|
||||||
['Slas'] = true,
|
['Slas'] = true,
|
||||||
['McTheDerp'] = true,
|
['McTheDerp'] = true,
|
||||||
@ -527,5 +525,21 @@ return {
|
|||||||
['Cruelcoder'] = true,
|
['Cruelcoder'] = true,
|
||||||
['Unrealrules'] = true,
|
['Unrealrules'] = true,
|
||||||
['Lithidoria'] = true,
|
['Lithidoria'] = true,
|
||||||
['LordElmi'] = true
|
['LordElmi'] = true,
|
||||||
|
['Kane.Nexus'] = true,
|
||||||
|
['OmegaLunch'] = true,
|
||||||
|
['korokoroneruneru'] = true,
|
||||||
|
['Krengrus'] = true,
|
||||||
|
['Rinncar72'] = true,
|
||||||
|
['Patti2507'] = true,
|
||||||
|
['f198904011'] = true,
|
||||||
|
['BTG'] = true,
|
||||||
|
['SwaggerC4'] = true,
|
||||||
|
['biohaze'] = true,
|
||||||
|
['SMikiS'] = true,
|
||||||
|
['sejyoo'] = true,
|
||||||
|
['Askiph'] = true,
|
||||||
|
['undefinable'] = true,
|
||||||
|
['snapboogie'] = true,
|
||||||
|
['Wesoly1234'] = true
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user