mirror of
https://github.com/Refactorio/RedMew.git
synced 2024-12-12 10:04:40 +02:00
updates
This commit is contained in:
parent
c489dca223
commit
3fac2b3ab0
@ -686,8 +686,7 @@ local function init()
|
||||
local ore_grid = b.grid_pattern_full_overlap(ore_pattern, 35, 35, 56, 56)
|
||||
ore_grid = b.choose(b.rectangle(126), b.no_entity, ore_grid)
|
||||
|
||||
--local map = b.if_else(outposts, enemy_shape)
|
||||
local map = b.if_else(outposts, b.full_shape)
|
||||
local map = b.if_else(outposts, enemy_shape)
|
||||
|
||||
map = b.if_else(map, b.full_shape)
|
||||
|
||||
|
@ -45,7 +45,7 @@ local wall_west_inner = 0xe0000001
|
||||
|
||||
local default_part_size = 6
|
||||
|
||||
local magic_crafters_per_tick = 2
|
||||
local magic_crafters_per_tick = 3
|
||||
local magic_fluid_crafters_per_tick = 8
|
||||
|
||||
local refill_turrets = {index = 1}
|
||||
@ -1292,6 +1292,62 @@ Public.magic_item_crafting_callback =
|
||||
end
|
||||
)
|
||||
|
||||
Public.magic_item_crafting_callback_weighted =
|
||||
Token.register(
|
||||
function(entity, data)
|
||||
local outpost_id = data.outpost_id
|
||||
local callback_data = data.callback_data
|
||||
|
||||
entity.minable = false
|
||||
entity.destructible = false
|
||||
entity.operable = false
|
||||
|
||||
local weights = callback_data.weights
|
||||
local loot = callback_data.loot
|
||||
|
||||
local i = math.random() * weights.total
|
||||
|
||||
local index = table.binary_search(weights, i)
|
||||
if (index < 0) then
|
||||
index = bit32.bnot(index)
|
||||
end
|
||||
|
||||
local stack = loot[index].stack
|
||||
if not stack then
|
||||
return
|
||||
end
|
||||
|
||||
local recipe = stack.recipe
|
||||
if recipe then
|
||||
entity.set_recipe(recipe)
|
||||
else
|
||||
local furance_item = stack.furance_item
|
||||
if furance_item then
|
||||
local inv = entity.get_inventory(2) -- defines.inventory.furnace_source
|
||||
inv.insert(furance_item)
|
||||
end
|
||||
end
|
||||
|
||||
local p = entity.position
|
||||
local x, y = p.x, p.y
|
||||
local distance = math.sqrt(x * x + y * y)
|
||||
|
||||
local output = stack.output
|
||||
if #output == 0 then
|
||||
add_magic_crafter_output(entity, output, distance, outpost_id)
|
||||
else
|
||||
for i = 1, #output do
|
||||
local o = output[i]
|
||||
add_magic_crafter_output(entity, o, distance, outpost_id)
|
||||
end
|
||||
end
|
||||
|
||||
if not callback_data.keep_active then
|
||||
Task.set_timeout_in_ticks(2, set_inactive_token, entity) -- causes problems with refineries.
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
Public.wall_callback =
|
||||
Token.register(
|
||||
function(entity, data)
|
||||
|
@ -24,7 +24,7 @@ local factory = {
|
||||
callback = ob.magic_item_crafting_callback,
|
||||
data = {
|
||||
recipe = 'piercing-rounds-magazine',
|
||||
output = {min_rate = 3 / 60, distance_factor = 2 / 60 / 512, item = 'piercing-rounds-magazine'}
|
||||
output = {min_rate = 1.5 / 60, distance_factor = 1 / 60 / 512, item = 'piercing-rounds-magazine'}
|
||||
}
|
||||
}
|
||||
|
||||
@ -32,7 +32,7 @@ local factory_b = {
|
||||
callback = ob.magic_item_crafting_callback,
|
||||
data = {
|
||||
recipe = 'uranium-rounds-magazine',
|
||||
output = {min_rate = 1 / 60, distance_factor = 1 / 60 / 512, item = 'uranium-rounds-magazine'}
|
||||
output = {min_rate = 0.5 / 60, distance_factor = 0.5 / 60 / 512, item = 'uranium-rounds-magazine'}
|
||||
}
|
||||
}
|
||||
|
||||
@ -40,7 +40,7 @@ local factory_c = {
|
||||
callback = ob.magic_item_crafting_callback,
|
||||
data = {
|
||||
recipe = 'explosive-uranium-cannon-shell',
|
||||
output = {min_rate = 1 / 2 / 60, distance_factor = 1 / 2 / 60 / 512, item = 'explosive-uranium-cannon-shell'}
|
||||
output = {min_rate = 0.5 / 2 / 60, distance_factor = 0.5 / 2 / 60 / 512, item = 'explosive-uranium-cannon-shell'}
|
||||
}
|
||||
}
|
||||
|
||||
@ -49,7 +49,7 @@ local market = {
|
||||
data = {
|
||||
market_name = 'Big Ammo Factory',
|
||||
upgrade_rate = 0.5,
|
||||
upgrade_base_cost = 250,
|
||||
upgrade_base_cost = 500,
|
||||
upgrade_cost_base = 2,
|
||||
{
|
||||
name = 'firearm-magazine',
|
||||
|
@ -27,7 +27,7 @@ local factory = {
|
||||
callback = ob.magic_item_crafting_callback,
|
||||
data = {
|
||||
recipe = 'plastic-bar',
|
||||
output = {min_rate = 2.5 / 60, distance_factor = 2 / 60 / 512, item = 'plastic-bar'}
|
||||
output = {min_rate = 1.25 / 60, distance_factor = 1 / 60 / 512, item = 'plastic-bar'}
|
||||
}
|
||||
}
|
||||
|
||||
@ -35,14 +35,14 @@ local factory_b = {
|
||||
callback = ob.magic_item_crafting_callback,
|
||||
data = {
|
||||
recipe = 'sulfuric-acid',
|
||||
output = {min_rate = 20 / 60, distance_factor = 20 / 60 / 512, item = 'sulfuric-acid', fluidbox_index = 2}
|
||||
output = {min_rate = 10 / 60, distance_factor = 10 / 60 / 512, item = 'sulfuric-acid', fluidbox_index = 2}
|
||||
}
|
||||
}
|
||||
local factory_c = {
|
||||
callback = ob.magic_item_crafting_callback,
|
||||
data = {
|
||||
recipe = 'rocket-fuel',
|
||||
output = {min_rate = 1 / 60, distance_factor = 1 / 60 / 512, item = 'rocket-fuel'}
|
||||
output = {min_rate = 0.5 / 60, distance_factor = 0.5 / 60 / 512, item = 'rocket-fuel'}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,7 @@ local factory_b = {
|
||||
callback = ob.magic_item_crafting_callback,
|
||||
data = {
|
||||
recipe = 'advanced-circuit',
|
||||
output = {min_rate = 1 / 60, distance_factor = 1 / 60 / 512, item = 'advanced-circuit'}
|
||||
output = {min_rate = 0.5 / 60, distance_factor = 0.5 / 60 / 512, item = 'advanced-circuit'}
|
||||
}
|
||||
}
|
||||
|
||||
@ -32,7 +32,7 @@ local factory_c = {
|
||||
callback = ob.magic_item_crafting_callback,
|
||||
data = {
|
||||
recipe = 'processing-unit',
|
||||
output = {min_rate = 0.2 / 60, distance_factor = 0.2 / 60 / 512, item = 'processing-unit'}
|
||||
output = {min_rate = 0.4 / 60, distance_factor = 0.4 / 60 / 512, item = 'processing-unit'}
|
||||
}
|
||||
}
|
||||
|
||||
@ -40,7 +40,7 @@ local factory_d = {
|
||||
callback = ob.magic_item_crafting_callback,
|
||||
data = {
|
||||
recipe = 'rocket-control-unit',
|
||||
output = {min_rate = 0.1 / 60, distance_factor = 0.1 / 60 / 512, item = 'rocket-control-unit'}
|
||||
output = {min_rate = 0.05 / 60, distance_factor = 0.05 / 60 / 512, item = 'rocket-control-unit'}
|
||||
}
|
||||
}
|
||||
|
||||
@ -49,7 +49,7 @@ local market = {
|
||||
data = {
|
||||
market_name = 'Big Circuit Factory',
|
||||
upgrade_rate = 0.5,
|
||||
upgrade_base_cost = 250,
|
||||
upgrade_base_cost = 350,
|
||||
upgrade_cost_base = 2,
|
||||
{
|
||||
name = 'copper-cable',
|
||||
|
@ -22,7 +22,7 @@ local factory = {
|
||||
callback = ob.magic_item_crafting_callback,
|
||||
data = {
|
||||
furance_item = {name = 'copper-ore', count = 100},
|
||||
output = {min_rate = 5 / 60, distance_factor = 2 / 60 / 512, item = 'copper-plate'}
|
||||
output = {min_rate = 2.5 / 60, distance_factor = 2.5 / 60 / 512, item = 'copper-plate'}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,7 @@ local factory = {
|
||||
callback = ob.magic_item_crafting_callback,
|
||||
data = {
|
||||
recipe = 'iron-gear-wheel',
|
||||
output = {min_rate = 4 / 60, distance_factor = 4 / 60 / 512, item = 'iron-gear-wheel'}
|
||||
output = {min_rate = 2 / 60, distance_factor = 2 / 60 / 512, item = 'iron-gear-wheel'}
|
||||
}
|
||||
}
|
||||
|
||||
@ -37,7 +37,7 @@ 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'}
|
||||
output = {min_rate = 1 / 60, distance_factor = 1 / 60 / 512, item = 'engine-unit'}
|
||||
}
|
||||
}
|
||||
|
||||
@ -45,7 +45,7 @@ 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'}
|
||||
output = {min_rate = 1 / 60, distance_factor = 1 / 60 / 512, item = 'electric-engine-unit'}
|
||||
}
|
||||
}
|
||||
|
||||
@ -54,7 +54,7 @@ local market = {
|
||||
data = {
|
||||
market_name = 'Big Gear Factory',
|
||||
upgrade_rate = 0.5,
|
||||
upgrade_base_cost = 250,
|
||||
upgrade_base_cost = 200,
|
||||
upgrade_cost_base = 2,
|
||||
{
|
||||
name = 'iron-gear-wheel',
|
||||
|
@ -24,7 +24,7 @@ local factory = {
|
||||
callback = ob.magic_item_crafting_callback,
|
||||
data = {
|
||||
furance_item = {name = 'iron-ore', count = 100},
|
||||
output = {min_rate = 5 / 60, distance_factor = 2 / 60 / 512, item = 'iron-plate'}
|
||||
output = {min_rate = 2.5 / 60, distance_factor = 2.5 / 60 / 512, item = 'iron-plate'}
|
||||
}
|
||||
}
|
||||
|
||||
@ -32,7 +32,7 @@ local factory_b = {
|
||||
callback = ob.magic_item_crafting_callback,
|
||||
data = {
|
||||
furance_item = {name = 'iron-plate', count = 100},
|
||||
output = {min_rate = 3 / 60, distance_factor = 1.5 / 60 / 512, item = 'steel-plate'}
|
||||
output = {min_rate = 1.5 / 60, distance_factor = 1.5 / 60 / 512, item = 'steel-plate'}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -41,9 +41,9 @@ local factory = {
|
||||
recipe = 'advanced-oil-processing',
|
||||
keep_active = true,
|
||||
output = {
|
||||
{min_rate = 5 / 60, distance_factor = 5 / 60 / 512, item = 'heavy-oil', fluidbox_index = 3},
|
||||
{min_rate = 22.5 / 60, distance_factor = 22.5 / 60 / 512, item = 'light-oil', fluidbox_index = 4},
|
||||
{min_rate = 27.5 / 60, distance_factor = 27.5 / 60 / 512, item = 'petroleum-gas', fluidbox_index = 5}
|
||||
{min_rate = 2.5 / 60, distance_factor = 2.5 / 60 / 512, item = 'heavy-oil', fluidbox_index = 3},
|
||||
{min_rate = 11.25 / 60, distance_factor = 11.25 / 60 / 512, item = 'light-oil', fluidbox_index = 4},
|
||||
{min_rate = 13.75 / 60, distance_factor = 13.75 / 60 / 512, item = 'petroleum-gas', fluidbox_index = 5}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ local factory = {
|
||||
callback = ob.magic_item_crafting_callback,
|
||||
data = {
|
||||
recipe = 'uranium-processing',
|
||||
output = {min_rate = 1 / 60, distance_factor = 1 / 60 / 512, item = 'uranium-238'}
|
||||
output = {min_rate = 0.5 / 60, distance_factor = 0.5 / 60 / 512, item = 'uranium-238'}
|
||||
}
|
||||
}
|
||||
|
||||
@ -38,7 +38,7 @@ local factory_b = {
|
||||
callback = ob.magic_item_crafting_callback,
|
||||
data = {
|
||||
recipe = 'uranium-fuel-cell',
|
||||
output = {min_rate = 0.05 / 60, distance_factor = 0.05 / 60 / 512, item = 'uranium-fuel-cell'}
|
||||
output = {min_rate = 0.025 / 60, distance_factor = 0.025 / 60 / 512, item = 'uranium-fuel-cell'}
|
||||
}
|
||||
}
|
||||
|
||||
@ -46,7 +46,7 @@ local factory_c = {
|
||||
callback = ob.magic_item_crafting_callback,
|
||||
data = {
|
||||
recipe = 'nuclear-fuel',
|
||||
output = {min_rate = 0.05 / 60, distance_factor = 0.05 / 60 / 512, item = 'nuclear-fuel'}
|
||||
output = {min_rate = 0.025 / 60, distance_factor = 0.025 / 60 / 512, item = 'nuclear-fuel'}
|
||||
}
|
||||
}
|
||||
|
||||
@ -55,7 +55,7 @@ local market = {
|
||||
data = {
|
||||
market_name = 'Big Power Factory',
|
||||
upgrade_rate = 0.5,
|
||||
upgrade_base_cost = 250,
|
||||
upgrade_base_cost = 350,
|
||||
upgrade_cost_base = 2,
|
||||
{
|
||||
name = 'coal',
|
||||
|
@ -25,7 +25,7 @@ local factory = {
|
||||
callback = ob.magic_item_crafting_callback,
|
||||
data = {
|
||||
recipe = 'production-science-pack',
|
||||
output = {min_rate = 0.125 / 60, distance_factor = 0.125 / 60 / 512, item = 'production-science-pack'}
|
||||
output = {min_rate = 0.0625 / 60, distance_factor = 0.0625 / 60 / 512, item = 'production-science-pack'}
|
||||
}
|
||||
}
|
||||
|
||||
@ -33,7 +33,7 @@ local factory_b = {
|
||||
callback = ob.magic_item_crafting_callback,
|
||||
data = {
|
||||
recipe = 'high-tech-science-pack',
|
||||
output = {min_rate = 0.125 / 60, distance_factor = 0.125 / 60 / 512, item = 'high-tech-science-pack'}
|
||||
output = {min_rate = 0.0625 / 60, distance_factor = 0.0625 / 60 / 512, item = 'high-tech-science-pack'}
|
||||
}
|
||||
}
|
||||
|
||||
@ -42,7 +42,7 @@ local market = {
|
||||
data = {
|
||||
market_name = 'Big Science Factory',
|
||||
upgrade_rate = 0.5,
|
||||
upgrade_base_cost = 250,
|
||||
upgrade_base_cost = 500,
|
||||
upgrade_cost_base = 2,
|
||||
{
|
||||
name = 'science-pack-1',
|
||||
|
@ -25,7 +25,7 @@ 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'}
|
||||
output = {min_rate = 1 / 60, distance_factor = 1 / 60 / 512, item = 'stone-brick'}
|
||||
}
|
||||
}
|
||||
|
||||
@ -33,15 +33,7 @@ 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'}
|
||||
output = {min_rate = 1 / 60, distance_factor = 1 / 60 / 512, item = 'refined-concrete'}
|
||||
}
|
||||
}
|
||||
|
||||
@ -50,7 +42,7 @@ local market = {
|
||||
data = {
|
||||
market_name = 'Big Stone Factory',
|
||||
upgrade_rate = 0.5,
|
||||
upgrade_base_cost = 250,
|
||||
upgrade_base_cost = 125,
|
||||
upgrade_cost_base = 2,
|
||||
{
|
||||
name = 'stone',
|
||||
|
@ -30,7 +30,7 @@ local factory = {
|
||||
callback = ob.magic_item_crafting_callback,
|
||||
data = {
|
||||
recipe = 'destroyer-capsule',
|
||||
output = {min_rate = 0.05 / 60, distance_factor = 0.05 / 60 / 512, item = 'destroyer-capsule'}
|
||||
output = {min_rate = 0.025 / 60, distance_factor = 0.025 / 60 / 512, item = 'destroyer-capsule'}
|
||||
}
|
||||
}
|
||||
|
||||
@ -38,7 +38,7 @@ local factory_b = {
|
||||
callback = ob.magic_item_crafting_callback,
|
||||
data = {
|
||||
recipe = 'laser-turret',
|
||||
output = {min_rate = 0.05 / 60, distance_factor = 0.05 / 60 / 512, item = 'laser-turret'}
|
||||
output = {min_rate = 0.025 / 60, distance_factor = 0.025 / 60 / 512, item = 'laser-turret'}
|
||||
}
|
||||
}
|
||||
|
||||
@ -47,7 +47,7 @@ local market = {
|
||||
data = {
|
||||
market_name = 'Big Weapon Factory',
|
||||
upgrade_rate = 0.5,
|
||||
upgrade_base_cost = 250,
|
||||
upgrade_base_cost = 500,
|
||||
upgrade_cost_base = 2,
|
||||
{
|
||||
name = 'raw-fish',
|
||||
|
@ -26,7 +26,7 @@ local factory = {
|
||||
callback = ob.magic_item_crafting_callback,
|
||||
data = {
|
||||
recipe = 'piercing-rounds-magazine',
|
||||
output = {min_rate = 2 / 60, distance_factor = 2 / 60 / 512, item = 'piercing-rounds-magazine'}
|
||||
output = {min_rate = 1 / 60, distance_factor = 1 / 60 / 512, item = 'piercing-rounds-magazine'}
|
||||
}
|
||||
}
|
||||
|
||||
@ -34,7 +34,7 @@ local factory_b = {
|
||||
callback = ob.magic_item_crafting_callback,
|
||||
data = {
|
||||
recipe = 'explosive-cannon-shell',
|
||||
output = {min_rate = 1 / 2 / 60, distance_factor = 1 / 2 / 60 / 512, item = 'explosive-cannon-shell'}
|
||||
output = {min_rate = 0.5 / 2 / 60, distance_factor = 0.5 / 2 / 60 / 512, item = 'explosive-cannon-shell'}
|
||||
}
|
||||
}
|
||||
|
||||
@ -42,7 +42,7 @@ local factory_c = {
|
||||
callback = ob.magic_item_crafting_callback,
|
||||
data = {
|
||||
recipe = 'uranium-rounds-magazine',
|
||||
output = {min_rate = 0.5 / 60, distance_factor = 0.5 / 60 / 512, item = 'uranium-rounds-magazine'}
|
||||
output = {min_rate = 0.25 / 60, distance_factor = 0.25 / 60 / 512, item = 'uranium-rounds-magazine'}
|
||||
}
|
||||
}
|
||||
|
||||
@ -51,7 +51,7 @@ local market = {
|
||||
data = {
|
||||
market_name = 'Medium Ammo Factory',
|
||||
upgrade_rate = 0.5,
|
||||
upgrade_base_cost = 250,
|
||||
upgrade_base_cost = 500,
|
||||
upgrade_cost_base = 2,
|
||||
{
|
||||
name = 'firearm-magazine',
|
||||
|
@ -26,7 +26,7 @@ local factory = {
|
||||
callback = ob.magic_item_crafting_callback,
|
||||
data = {
|
||||
recipe = 'battery',
|
||||
output = {min_rate = 1.25 / 60, distance_factor = 1.25 / 60 / 512, item = 'battery'}
|
||||
output = {min_rate = 0.75 / 60, distance_factor = 0.75 / 60 / 512, item = 'battery'}
|
||||
}
|
||||
}
|
||||
|
||||
@ -34,7 +34,7 @@ local factory_b = {
|
||||
callback = ob.magic_item_crafting_callback,
|
||||
data = {
|
||||
recipe = 'explosives',
|
||||
output = {min_rate = 2 / 60, distance_factor = 2 / 60 / 512, item = 'explosives'}
|
||||
output = {min_rate = 1 / 60, distance_factor = 1 / 60 / 512, item = 'explosives'}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -15,7 +15,7 @@ local factory = {
|
||||
callback = ob.magic_item_crafting_callback,
|
||||
data = {
|
||||
recipe = 'electronic-circuit',
|
||||
output = {min_rate = 2 / 60, distance_factor = 2 / 60 / 512, item = 'electronic-circuit'}
|
||||
output = {min_rate = 1 / 60, distance_factor = 1 / 60 / 512, item = 'electronic-circuit'}
|
||||
}
|
||||
}
|
||||
|
||||
@ -23,7 +23,7 @@ local factory_b = {
|
||||
callback = ob.magic_item_crafting_callback,
|
||||
data = {
|
||||
recipe = 'advanced-circuit',
|
||||
output = {min_rate = 1 / 600, distance_factor = 1 / 600 / 512, item = 'advanced-circuit'}
|
||||
output = {min_rate = 0.5 / 600, distance_factor = 0.5 / 600 / 512, item = 'advanced-circuit'}
|
||||
}
|
||||
}
|
||||
|
||||
@ -32,7 +32,7 @@ local market = {
|
||||
data = {
|
||||
market_name = 'Medium Circuit Factory',
|
||||
upgrade_rate = 0.5,
|
||||
upgrade_base_cost = 250,
|
||||
upgrade_base_cost = 350,
|
||||
upgrade_cost_base = 2,
|
||||
{
|
||||
name = 'copper-cable',
|
||||
|
@ -22,7 +22,7 @@ local factory = {
|
||||
callback = ob.magic_item_crafting_callback,
|
||||
data = {
|
||||
furance_item = 'copper-ore',
|
||||
output = {min_rate = 5 / 60, distance_factor = 2 / 60 / 512, item = 'copper-plate'}
|
||||
output = {min_rate = 2.5 / 60, distance_factor = 2.5 / 60 / 512, item = 'copper-plate'}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -37,7 +37,7 @@ 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'}
|
||||
output = {min_rate = 0.5 / 60, distance_factor = 0.5 / 60 / 512, item = 'engine-unit'}
|
||||
}
|
||||
}
|
||||
|
||||
@ -45,7 +45,7 @@ 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'}
|
||||
output = {min_rate = 0.5 / 60, distance_factor = 0.5 / 60 / 512, item = 'electric-engine-unit'}
|
||||
}
|
||||
}
|
||||
|
||||
@ -54,7 +54,7 @@ local market = {
|
||||
data = {
|
||||
market_name = 'Medium Gear Factory',
|
||||
upgrade_rate = 0.5,
|
||||
upgrade_base_cost = 250,
|
||||
upgrade_base_cost = 200,
|
||||
upgrade_cost_base = 2,
|
||||
{
|
||||
name = 'iron-gear-wheel',
|
||||
|
@ -22,7 +22,7 @@ local factory = {
|
||||
callback = ob.magic_item_crafting_callback,
|
||||
data = {
|
||||
furance_item = 'iron-ore',
|
||||
output = {min_rate = 5 / 60, distance_factor = 2 / 60 / 512, item = 'iron-plate'}
|
||||
output = {min_rate = 2.5 / 60, distance_factor = 2.5 / 60 / 512, item = 'iron-plate'}
|
||||
}
|
||||
}
|
||||
|
||||
@ -30,7 +30,7 @@ local factory_b = {
|
||||
callback = ob.magic_item_crafting_callback,
|
||||
data = {
|
||||
furance_item = {name = 'iron-plate', count = 100},
|
||||
output = {min_rate = 1.5 / 60, distance_factor = 1.5 / 60 / 512, item = 'steel-plate'}
|
||||
output = {min_rate = 0.75 / 60, distance_factor = 0.75 / 60 / 512, item = 'steel-plate'}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -41,9 +41,9 @@ local factory = {
|
||||
recipe = 'advanced-oil-processing',
|
||||
keep_active = true,
|
||||
output = {
|
||||
{min_rate = 5 / 60, distance_factor = 51 / 60 / 512, item = 'heavy-oil', fluidbox_index = 3},
|
||||
{min_rate = 22.5 / 60, distance_factor = 22.5 / 60 / 512, item = 'light-oil', fluidbox_index = 4},
|
||||
{min_rate = 27.5 / 60, distance_factor = 27.5 / 60 / 512, item = 'petroleum-gas', fluidbox_index = 5}
|
||||
{min_rate = 2.5 / 60, distance_factor = 2.5 / 60 / 512, item = 'heavy-oil', fluidbox_index = 3},
|
||||
{min_rate = 11.25 / 60, distance_factor = 11.25 / 60 / 512, item = 'light-oil', fluidbox_index = 4},
|
||||
{min_rate = 13.75 / 60, distance_factor = 13.75 / 60 / 512, item = 'petroleum-gas', fluidbox_index = 5}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ local factory = {
|
||||
callback = ob.magic_item_crafting_callback,
|
||||
data = {
|
||||
recipe = 'accumulator',
|
||||
output = {min_rate = 0.84 / 2 / 60, distance_factor = 0.84 / 2 / 60 / 512, item = 'accumulator'}
|
||||
output = {min_rate = 0.42 / 2 / 60, distance_factor = 0.42 / 2 / 60 / 512, item = 'accumulator'}
|
||||
}
|
||||
}
|
||||
|
||||
@ -35,7 +35,7 @@ local factory_b = {
|
||||
callback = ob.magic_item_crafting_callback,
|
||||
data = {
|
||||
recipe = 'solar-panel',
|
||||
output = {min_rate = 1 / 2 / 60, distance_factor = 1 / 2 / 60 / 512, item = 'solar-panel'}
|
||||
output = {min_rate = 0.5 / 2 / 60, distance_factor = 0.5 / 2 / 60 / 512, item = 'solar-panel'}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@ local factory = {
|
||||
callback = ob.magic_item_crafting_callback,
|
||||
data = {
|
||||
recipe = 'military-science-pack',
|
||||
output = {min_rate = 0.15 / 60, distance_factor = 0.125 / 60 / 512, item = 'military-science-pack'}
|
||||
output = {min_rate = 0.075 / 60, distance_factor = 0.075 / 60 / 512, item = 'military-science-pack'}
|
||||
}
|
||||
}
|
||||
|
||||
@ -31,7 +31,7 @@ local factory_b = {
|
||||
callback = ob.magic_item_crafting_callback,
|
||||
data = {
|
||||
recipe = 'science-pack-3',
|
||||
output = {min_rate = 0.25 / 60, distance_factor = 0.15 / 60 / 512, item = 'science-pack-3'}
|
||||
output = {min_rate = 0.125 / 60, distance_factor = 0.125 / 60 / 512, item = 'science-pack-3'}
|
||||
}
|
||||
}
|
||||
|
||||
@ -40,7 +40,7 @@ local market = {
|
||||
data = {
|
||||
market_name = 'Medium Science Factory',
|
||||
upgrade_rate = 0.5,
|
||||
upgrade_base_cost = 250,
|
||||
upgrade_base_cost = 500,
|
||||
upgrade_cost_base = 2,
|
||||
{
|
||||
name = 'science-pack-1',
|
||||
|
@ -24,7 +24,7 @@ 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'}
|
||||
output = {min_rate = 1 / 60, distance_factor = 1 / 60 / 512, item = 'stone-brick'}
|
||||
}
|
||||
}
|
||||
|
||||
@ -32,7 +32,7 @@ local factory_b = {
|
||||
callback = ob.magic_item_crafting_callback,
|
||||
data = {
|
||||
recipe = 'concrete',
|
||||
output = {min_rate = 2 / 60, distance_factor = 2 / 60 / 512, item = 'concrete'}
|
||||
output = {min_rate = 1 / 60, distance_factor = 1 / 60 / 512, item = 'concrete'}
|
||||
}
|
||||
}
|
||||
|
||||
@ -41,7 +41,7 @@ local market = {
|
||||
data = {
|
||||
market_name = 'Medium Stone Factory',
|
||||
upgrade_rate = 0.5,
|
||||
upgrade_base_cost = 250,
|
||||
upgrade_base_cost = 125,
|
||||
upgrade_cost_base = 2,
|
||||
{
|
||||
name = 'stone',
|
||||
|
@ -35,7 +35,7 @@ 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'}
|
||||
output = {min_rate = 0.25 / 60, distance_factor = 0.25 / 60 / 512, item = 'explosive-rocket'}
|
||||
}
|
||||
}
|
||||
|
||||
@ -60,7 +60,7 @@ local market = {
|
||||
data = {
|
||||
market_name = 'Medium Weapon Factory',
|
||||
upgrade_rate = 0.5,
|
||||
upgrade_base_cost = 250,
|
||||
upgrade_base_cost = 500,
|
||||
upgrade_cost_base = 2,
|
||||
{
|
||||
name = 'raw-fish',
|
||||
|
@ -24,20 +24,45 @@ local loot_callback =
|
||||
)
|
||||
|
||||
local factory_loot = {
|
||||
{stack = {name = 'piercing-rounds-magazine', count = 200, distance_factor = 0}, weight = 10},
|
||||
{stack = {name = 'rocket', count = 50, distance_factor = 1 / 8}, weight = 5},
|
||||
{stack = {name = 'cannon-shell', count = 50, distance_factor = 1 / 8}, weight = 5},
|
||||
{stack = {name = 'cluster-grenade', count = 10, distance_factor = 1 / 16}, weight = 5}
|
||||
{
|
||||
stack = {
|
||||
recipe = 'piercing-rounds-magazine',
|
||||
output = {item = 'piercing-rounds-magazine', min_rate = 1 / 3 / 60, distance_factor = 1 / 3 / 60 / 512}
|
||||
},
|
||||
weight = 10
|
||||
},
|
||||
{
|
||||
stack = {
|
||||
recipe = 'rocket',
|
||||
output = {item = 'rocket', min_rate = 0.5 / 8 / 60, distance_factor = 1 / 8 / 60 / 512}
|
||||
},
|
||||
weight = 5
|
||||
},
|
||||
{
|
||||
stack = {
|
||||
recipe = 'cannon-shell',
|
||||
output = {item = 'cannon-shell', min_rate = 0.5 / 8 / 60, distance_factor = 1 / 8 / 60 / 512}
|
||||
},
|
||||
weight = 5
|
||||
},
|
||||
{
|
||||
stack = {
|
||||
recipe = 'cluster-grenade',
|
||||
output = {item = 'cluster-grenade', min_rate = 0.1 / 8 / 60, distance_factor = 1 / 8 / 60 / 512}
|
||||
},
|
||||
weight = 5
|
||||
}
|
||||
}
|
||||
|
||||
local factory_weights = ob.prepare_weighted_loot(factory_loot)
|
||||
|
||||
local factory_callback =
|
||||
Token.register(
|
||||
function(factory)
|
||||
ob.do_factory_loot(factory, factory_weights, factory_loot)
|
||||
end
|
||||
)
|
||||
local factory_callback = {
|
||||
callback = ob.magic_item_crafting_callback_weighted,
|
||||
data = {
|
||||
loot = factory_loot,
|
||||
weights = factory_weights
|
||||
}
|
||||
}
|
||||
|
||||
local wall_chests = require 'map_gen.presets.crash_site.outpost_data.mini_wall_chests'
|
||||
local turret = require 'map_gen.presets.crash_site.outpost_data.mini_gun_turret'
|
||||
@ -49,7 +74,7 @@ local blank = require 'map_gen.presets.crash_site.outpost_data.mini_blank'
|
||||
local base_factory = require 'map_gen.presets.crash_site.outpost_data.mini_factory'
|
||||
local gun_turret_block = require 'map_gen.presets.crash_site.outpost_data.mini_gun_turret_block'
|
||||
|
||||
local factory = ob.extend_1_way(base_factory, {factory = {callback = factory_callback}, fallback = blank})
|
||||
local factory = ob.extend_1_way(base_factory, {factory = factory_callback, fallback = blank})
|
||||
local gun = ob.extend_1_way(gun_turret_block, {fallback = factory})
|
||||
|
||||
return {
|
||||
|
@ -19,19 +19,38 @@ local loot_callback =
|
||||
)
|
||||
|
||||
local factory_loot = {
|
||||
{stack = {name = 'effectivity-module', count = 25, distance_factor = 1 / 5}, weight = 5},
|
||||
{stack = {name = 'speed-module', count = 15, distance_factor = 1 / 5}, weight = 5},
|
||||
{stack = {name = 'productivity-module', count = 15, distance_factor = 1 / 5}, weight = 5}
|
||||
{
|
||||
stack = {
|
||||
recipe = 'effectivity-module',
|
||||
output = {item = 'effectivity-module', min_rate = 0.5 / 15 / 60, distance_factor = 0.5 / 15 / 60 / 512}
|
||||
},
|
||||
weight = 5
|
||||
},
|
||||
{
|
||||
stack = {
|
||||
recipe = 'speed-module',
|
||||
output = {item = 'speed-module', min_rate = 0.5 / 15 / 60, distance_factor = 0.5 / 15 / 60 / 512}
|
||||
},
|
||||
weight = 5
|
||||
},
|
||||
{
|
||||
stack = {
|
||||
recipe = 'productivity-module',
|
||||
output = {item = 'productivity-module', min_rate = 0.5 / 15 / 60, distance_factor = 0.5 / 15 / 60 / 512}
|
||||
},
|
||||
weight = 5
|
||||
}
|
||||
}
|
||||
|
||||
local factory_weights = ob.prepare_weighted_loot(factory_loot)
|
||||
|
||||
local factory_callback =
|
||||
Token.register(
|
||||
function(factory)
|
||||
ob.do_factory_loot(factory, factory_weights, factory_loot)
|
||||
end
|
||||
)
|
||||
local factory_callback = {
|
||||
callback = ob.magic_item_crafting_callback_weighted,
|
||||
data = {
|
||||
loot = factory_loot,
|
||||
weights = factory_weights
|
||||
}
|
||||
}
|
||||
|
||||
local wall_chests = require 'map_gen.presets.crash_site.outpost_data.mini_wall_chests'
|
||||
local turret = require 'map_gen.presets.crash_site.outpost_data.mini_gun_turret'
|
||||
@ -51,7 +70,7 @@ local blank = require 'map_gen.presets.crash_site.outpost_data.mini_blank'
|
||||
local base_factory = require 'map_gen.presets.crash_site.outpost_data.mini_factory'
|
||||
local gun_turret_block = require 'map_gen.presets.crash_site.outpost_data.mini_gun_turret_block'
|
||||
|
||||
local factory = ob.extend_1_way(base_factory, {factory = {callback = factory_callback}, fallback = blank})
|
||||
local factory = ob.extend_1_way(base_factory, {factory = factory_callback, fallback = blank})
|
||||
local gun =
|
||||
ob.extend_1_way(
|
||||
gun_turret_block,
|
||||
|
@ -21,20 +21,45 @@ local loot_callback =
|
||||
)
|
||||
|
||||
local factory_loot = {
|
||||
{stack = {name = 'steel-furnace', count = 50, distance_factor = 1}, weight = 3},
|
||||
{stack = {name = 'electric-mining-drill', count = 50, distance_factor = 1}, weight = 3},
|
||||
{stack = {name = 'pumpjack', count = 5, distance_factor = 1 / 32}, weight = 2},
|
||||
{stack = {name = 'oil-refinery', count = 3, distance_factor = 1 / 32}, weight = 1}
|
||||
{
|
||||
stack = {
|
||||
recipe = 'steel-furnace',
|
||||
output = {item = 'steel-furnace', min_rate = 1 / 6 / 60, distance_factor = 1 / 6 / 60 / 512}
|
||||
},
|
||||
weight = 3
|
||||
},
|
||||
{
|
||||
stack = {
|
||||
recipe = 'electric-mining-drill',
|
||||
output = {item = 'electric-mining-drill', min_rate = 1 / 3 / 60, distance_factor = 1 / 3 / 60 / 512}
|
||||
},
|
||||
weight = 3
|
||||
},
|
||||
{
|
||||
stack = {
|
||||
recipe = 'pumpjack',
|
||||
output = {item = 'pumpjack', min_rate = 1 / 20 / 60, distance_factor = 1 / 20 / 60 / 512}
|
||||
},
|
||||
weight = 2
|
||||
},
|
||||
{
|
||||
stack = {
|
||||
recipe = 'oil-refinery',
|
||||
output = {item = 'oil-refinery', min_rate = 1 / 40 / 60, distance_factor = 1 / 40 / 60 / 512}
|
||||
},
|
||||
weight = 1
|
||||
}
|
||||
}
|
||||
|
||||
local factory_weights = ob.prepare_weighted_loot(factory_loot)
|
||||
|
||||
local factory_callback =
|
||||
Token.register(
|
||||
function(factory)
|
||||
ob.do_factory_loot(factory, factory_weights, factory_loot)
|
||||
end
|
||||
)
|
||||
local factory_callback = {
|
||||
callback = ob.magic_item_crafting_callback_weighted,
|
||||
data = {
|
||||
loot = factory_loot,
|
||||
weights = factory_weights
|
||||
}
|
||||
}
|
||||
|
||||
local wall_chests = require 'map_gen.presets.crash_site.outpost_data.mini_wall_chests'
|
||||
local turret = require 'map_gen.presets.crash_site.outpost_data.mini_gun_turret'
|
||||
@ -46,7 +71,7 @@ local blank = require 'map_gen.presets.crash_site.outpost_data.mini_blank'
|
||||
local base_factory = require 'map_gen.presets.crash_site.outpost_data.mini_factory'
|
||||
local gun_turret_block = require 'map_gen.presets.crash_site.outpost_data.mini_gun_turret_block'
|
||||
|
||||
local factory = ob.extend_1_way(base_factory, {factory = {callback = factory_callback}, fallback = blank})
|
||||
local factory = ob.extend_1_way(base_factory, {factory = factory_callback, fallback = blank})
|
||||
local gun = ob.extend_1_way(gun_turret_block, {fallback = factory})
|
||||
|
||||
return {
|
||||
|
@ -24,17 +24,38 @@ local loot_callback =
|
||||
)
|
||||
|
||||
local factory_loot = {
|
||||
{stack = {name = 'roboport', count = 10, distance_factor = 1 / 16}, weight = 1}
|
||||
{
|
||||
stack = {
|
||||
recipe = 'construction-robot',
|
||||
output = {item = 'construction-robot', min_rate = 1 / 4 / 60, distance_factor = 1 / 4 / 60 / 512}
|
||||
},
|
||||
weight = 5
|
||||
},
|
||||
{
|
||||
stack = {
|
||||
recipe = 'logistic-robot',
|
||||
output = {item = 'logistic-robot', min_rate = 1 / 4 / 60, distance_factor = 1 / 4 / 60 / 512}
|
||||
},
|
||||
weight = 5
|
||||
},
|
||||
{
|
||||
stack = {
|
||||
recipe = 'roboport',
|
||||
output = {item = 'roboport', min_rate = 1 / 20 / 60, distance_factor = 1 / 20 / 60 / 512}
|
||||
},
|
||||
weight = 5
|
||||
}
|
||||
}
|
||||
|
||||
local factory_weights = ob.prepare_weighted_loot(factory_loot)
|
||||
|
||||
local factory_callback =
|
||||
Token.register(
|
||||
function(factory)
|
||||
ob.do_factory_loot(factory, factory_weights, factory_loot)
|
||||
end
|
||||
)
|
||||
local factory_callback = {
|
||||
callback = ob.magic_item_crafting_callback_weighted,
|
||||
data = {
|
||||
loot = factory_loot,
|
||||
weights = factory_weights
|
||||
}
|
||||
}
|
||||
|
||||
local wall_chests = require 'map_gen.presets.crash_site.outpost_data.mini_wall_chests'
|
||||
local turret = require 'map_gen.presets.crash_site.outpost_data.mini_gun_turret'
|
||||
@ -54,7 +75,7 @@ local blank = require 'map_gen.presets.crash_site.outpost_data.mini_blank'
|
||||
local base_factory = require 'map_gen.presets.crash_site.outpost_data.mini_factory'
|
||||
local gun_turret_block = require 'map_gen.presets.crash_site.outpost_data.mini_gun_turret_block'
|
||||
|
||||
local factory = ob.extend_1_way(base_factory, {factory = {callback = factory_callback}, fallback = blank})
|
||||
local factory = ob.extend_1_way(base_factory, {factory = factory_callback, fallback = blank})
|
||||
local gun =
|
||||
ob.extend_1_way(
|
||||
gun_turret_block,
|
||||
|
@ -22,14 +22,31 @@ local factory_loot = {
|
||||
{stack = {name = 'science-pack-2', count = 50, distance_factor = 1 / 2}, weight = 5}
|
||||
}
|
||||
|
||||
local factory_weights = ob.prepare_weighted_loot(factory_loot)
|
||||
local factory_loot = {
|
||||
{
|
||||
stack = {
|
||||
recipe = 'science-pack-1',
|
||||
output = {item = 'science-pack-1', min_rate = 1 / 5 / 60, distance_factor = 1 / 5 / 60 / 512}
|
||||
},
|
||||
weight = 5
|
||||
},
|
||||
{
|
||||
stack = {
|
||||
recipe = 'science-pack-2',
|
||||
output = {item = 'science-pack-2', min_rate = 1 / 6 / 60, distance_factor = 1 / 6 / 60 / 512}
|
||||
},
|
||||
weight = 5
|
||||
}
|
||||
}
|
||||
|
||||
local factory_callback =
|
||||
Token.register(
|
||||
function(factory)
|
||||
ob.do_factory_loot(factory, factory_weights, factory_loot)
|
||||
end
|
||||
)
|
||||
local factory_weights = ob.prepare_weighted_loot(factory_loot)
|
||||
local factory_callback = {
|
||||
callback = ob.magic_item_crafting_callback_weighted,
|
||||
data = {
|
||||
loot = factory_loot,
|
||||
weights = factory_weights
|
||||
}
|
||||
}
|
||||
|
||||
local wall_chests = require 'map_gen.presets.crash_site.outpost_data.mini_wall_chests'
|
||||
local turret = require 'map_gen.presets.crash_site.outpost_data.mini_gun_turret'
|
||||
@ -49,7 +66,7 @@ local blank = require 'map_gen.presets.crash_site.outpost_data.mini_blank'
|
||||
local base_factory = require 'map_gen.presets.crash_site.outpost_data.mini_factory'
|
||||
local gun_turret_block = require 'map_gen.presets.crash_site.outpost_data.mini_gun_turret_block'
|
||||
|
||||
local factory = ob.extend_1_way(base_factory, {factory = {callback = factory_callback}, fallback = blank})
|
||||
local factory = ob.extend_1_way(base_factory, {factory = factory_callback, fallback = blank})
|
||||
local gun =
|
||||
ob.extend_1_way(
|
||||
gun_turret_block,
|
||||
|
@ -23,17 +23,24 @@ local loot_callback =
|
||||
)
|
||||
|
||||
local factory_loot = {
|
||||
{stack = {name = 'rail', count = 100, distance_factor = 0}, weight = 5}
|
||||
{
|
||||
stack = {
|
||||
recipe = 'rail',
|
||||
output = {item = 'rail', min_rate = 1 / 1 / 60, distance_factor = 1 / 1 / 60 / 512}
|
||||
},
|
||||
weight = 5
|
||||
}
|
||||
}
|
||||
|
||||
local factory_weights = ob.prepare_weighted_loot(factory_loot)
|
||||
|
||||
local factory_callback =
|
||||
Token.register(
|
||||
function(factory)
|
||||
ob.do_factory_loot(factory, factory_weights, factory_loot)
|
||||
end
|
||||
)
|
||||
local factory_callback = {
|
||||
callback = ob.magic_item_crafting_callback_weighted,
|
||||
data = {
|
||||
loot = factory_loot,
|
||||
weights = factory_weights
|
||||
}
|
||||
}
|
||||
|
||||
local wall_chests = require 'map_gen.presets.crash_site.outpost_data.mini_wall_chests'
|
||||
local turret = require 'map_gen.presets.crash_site.outpost_data.mini_gun_turret'
|
||||
@ -45,7 +52,7 @@ local blank = require 'map_gen.presets.crash_site.outpost_data.mini_blank'
|
||||
local base_factory = require 'map_gen.presets.crash_site.outpost_data.mini_factory'
|
||||
local gun_turret_block = require 'map_gen.presets.crash_site.outpost_data.mini_gun_turret_block'
|
||||
|
||||
local factory = ob.extend_1_way(base_factory, {factory = {callback = factory_callback}, fallback = blank})
|
||||
local factory = ob.extend_1_way(base_factory, {factory = factory_callback, fallback = blank})
|
||||
local gun = ob.extend_1_way(gun_turret_block, {fallback = factory})
|
||||
|
||||
return {
|
||||
|
@ -23,18 +23,31 @@ local loot_callback =
|
||||
)
|
||||
|
||||
local factory_loot = {
|
||||
{stack = {name = 'piercing-shotgun-shell', count = 200, distance_factor = 0}, weight = 1},
|
||||
{stack = {name = 'gun-turret', count = 50, distance_factor = 0}, weight = 1}
|
||||
{
|
||||
stack = {
|
||||
recipe = 'piercing-shotgun-shell',
|
||||
output = {item = 'piercing-shotgun-shell', min_rate = 0.5 / 8 / 60, distance_factor = 1 / 8 / 60 / 512}
|
||||
},
|
||||
weight = 5
|
||||
},
|
||||
{
|
||||
stack = {
|
||||
recipe = 'gun-turret',
|
||||
output = {item = 'gun-turret', min_rate = 0.5 / 15 / 60, distance_factor = 0.5 / 15 / 60 / 512}
|
||||
},
|
||||
weight = 5
|
||||
}
|
||||
}
|
||||
|
||||
local factory_weights = ob.prepare_weighted_loot(factory_loot)
|
||||
|
||||
local factory_callback =
|
||||
Token.register(
|
||||
function(factory)
|
||||
ob.do_factory_loot(factory, factory_weights, factory_loot)
|
||||
end
|
||||
)
|
||||
local factory_callback = {
|
||||
callback = ob.magic_item_crafting_callback_weighted,
|
||||
data = {
|
||||
loot = factory_loot,
|
||||
weights = factory_weights
|
||||
}
|
||||
}
|
||||
|
||||
local wall_chests = require 'map_gen.presets.crash_site.outpost_data.mini_wall_chests'
|
||||
local turret = require 'map_gen.presets.crash_site.outpost_data.mini_gun_turret'
|
||||
@ -46,7 +59,7 @@ local blank = require 'map_gen.presets.crash_site.outpost_data.mini_blank'
|
||||
local base_factory = require 'map_gen.presets.crash_site.outpost_data.mini_factory'
|
||||
local gun_turret_block = require 'map_gen.presets.crash_site.outpost_data.mini_gun_turret_block'
|
||||
|
||||
local factory = ob.extend_1_way(base_factory, {factory = {callback = factory_callback}, fallback = blank})
|
||||
local factory = ob.extend_1_way(base_factory, {factory = factory_callback, fallback = blank})
|
||||
local gun = ob.extend_1_way(gun_turret_block, {fallback = factory})
|
||||
|
||||
return {
|
||||
|
@ -7,7 +7,7 @@ local loot = {
|
||||
{stack = {name = 'piercing-rounds-magazine', count = 125, distance_factor = 1 / 4}, weight = 5},
|
||||
{stack = {name = 'uranium-rounds-magazine', count = 25, distance_factor = 1 / 8}, weight = 5},
|
||||
{stack = {name = 'grenade', count = 100, distance_factor = 1 / 16}, weight = 1},
|
||||
{stack = {name = 'land-mine', count = 200, distance_factor = 1/2}, weight = 1},
|
||||
{stack = {name = 'land-mine', count = 200, distance_factor = 1 / 2}, weight = 1},
|
||||
{stack = {name = 'cannon-shell', count = 50, distance_factor = 1 / 32}, weight = 2},
|
||||
{stack = {name = 'explosive-cannon-shell', count = 25, distance_factor = 1 / 32}, weight = 1},
|
||||
{stack = {name = 'cluster-grenade', count = 25, distance_factor = 1 / 32}, weight = 1}
|
||||
@ -23,19 +23,38 @@ local loot_callback =
|
||||
)
|
||||
|
||||
local factory_loot = {
|
||||
{stack = {name = 'uranium-rounds-magazine', count = 200, distance_factor = 0}, weight = 5},
|
||||
{stack = {name = 'uranium-cannon-shell', count = 200, distance_factor = 0}, weight = 5},
|
||||
{stack = {name = 'poison-capsule', count = 100, distance_factor = 0}, weight = 5}
|
||||
{
|
||||
stack = {
|
||||
recipe = 'uranium-rounds-magazine',
|
||||
output = {item = 'uranium-rounds-magazine', min_rate = 1 / 10 / 60, distance_factor = 1 / 10 / 60 / 512}
|
||||
},
|
||||
weight = 5
|
||||
},
|
||||
{
|
||||
stack = {
|
||||
recipe = 'uranium-cannon-shell',
|
||||
output = {item = 'uranium-cannon-shell', min_rate = 0.25 / 12 / 60, distance_factor = 0.5 / 12 / 60 / 512}
|
||||
},
|
||||
weight = 5
|
||||
},
|
||||
{
|
||||
stack = {
|
||||
recipe = 'poison-capsule',
|
||||
output = {item = 'poison-capsule', min_rate = 0.5 / 8 / 60, distance_factor = 1 / 8 / 60 / 512}
|
||||
},
|
||||
weight = 5
|
||||
}
|
||||
}
|
||||
|
||||
local factory_weights = ob.prepare_weighted_loot(factory_loot)
|
||||
|
||||
local factory_callback =
|
||||
Token.register(
|
||||
function(factory)
|
||||
ob.do_factory_loot(factory, factory_weights, factory_loot)
|
||||
end
|
||||
)
|
||||
local factory_callback = {
|
||||
callback = ob.magic_item_crafting_callback_weighted,
|
||||
data = {
|
||||
loot = factory_loot,
|
||||
weights = factory_weights
|
||||
}
|
||||
}
|
||||
|
||||
local wall_chests = require 'map_gen.presets.crash_site.outpost_data.mini_wall_chests'
|
||||
local turret = require 'map_gen.presets.crash_site.outpost_data.mini_gun_turret'
|
||||
@ -55,7 +74,7 @@ local blank = require 'map_gen.presets.crash_site.outpost_data.mini_blank'
|
||||
local base_factory = require 'map_gen.presets.crash_site.outpost_data.mini_factory'
|
||||
local gun_turret_block = require 'map_gen.presets.crash_site.outpost_data.mini_gun_turret_block'
|
||||
|
||||
local factory = ob.extend_1_way(base_factory, {factory = {callback = factory_callback}, fallback = blank})
|
||||
local factory = ob.extend_1_way(base_factory, {factory = factory_callback, fallback = blank})
|
||||
local gun =
|
||||
ob.extend_1_way(
|
||||
gun_turret_block,
|
||||
|
@ -21,18 +21,31 @@ local loot_callback =
|
||||
)
|
||||
|
||||
local factory_loot = {
|
||||
{stack = {name = 'solar-panel', count = 25, distance_factor = 1 / 25}, weight = 3},
|
||||
{stack = {name = 'accumulator', count = 21, distance_factor = 1 / 21}, weight = 3}
|
||||
{
|
||||
stack = {
|
||||
recipe = 'solar-panel',
|
||||
output = {item = 'solar-panel', min_rate = 0.25 / 4 / 60, distance_factor = 0.25 / 4 / 60 / 512}
|
||||
},
|
||||
weight = 3
|
||||
},
|
||||
{
|
||||
stack = {
|
||||
recipe = 'accumulator',
|
||||
output = {item = 'accumulator', min_rate = 0.21 / 4 / 60, distance_factor = 0.21 / 4 / 60 / 512}
|
||||
},
|
||||
weight = 3
|
||||
}
|
||||
}
|
||||
|
||||
local factory_weights = ob.prepare_weighted_loot(factory_loot)
|
||||
|
||||
local factory_callback =
|
||||
Token.register(
|
||||
function(factory)
|
||||
ob.do_factory_loot(factory, factory_weights, factory_loot)
|
||||
end
|
||||
)
|
||||
local factory_callback = {
|
||||
callback = ob.magic_item_crafting_callback_weighted,
|
||||
data = {
|
||||
loot = factory_loot,
|
||||
weights = factory_weights
|
||||
}
|
||||
}
|
||||
|
||||
local wall_chests = require 'map_gen.presets.crash_site.outpost_data.mini_wall_chests'
|
||||
local turret = require 'map_gen.presets.crash_site.outpost_data.mini_gun_turret'
|
||||
@ -52,7 +65,7 @@ local blank = require 'map_gen.presets.crash_site.outpost_data.mini_blank'
|
||||
local base_factory = require 'map_gen.presets.crash_site.outpost_data.mini_factory'
|
||||
local gun_turret_block = require 'map_gen.presets.crash_site.outpost_data.mini_gun_turret_block'
|
||||
|
||||
local factory = ob.extend_1_way(base_factory, {factory = {callback = factory_callback}, fallback = blank})
|
||||
local factory = ob.extend_1_way(base_factory, {factory = factory_callback, fallback = blank})
|
||||
local gun =
|
||||
ob.extend_1_way(
|
||||
gun_turret_block,
|
||||
|
@ -21,21 +21,52 @@ local loot_callback =
|
||||
)
|
||||
|
||||
local factory_loot = {
|
||||
{stack = {name = 'fast-transport-belt', count = 100, distance_factor = 0}, weight = 5},
|
||||
{stack = {name = 'fast-underground-belt', count = 50, distance_factor = 0}, weight = 5},
|
||||
{stack = {name = 'fast-splitter', count = 25, distance_factor = 1 / 32}, weight = 5},
|
||||
{stack = {name = 'fast-inserter', count = 50, distance_factor = 0}, weight = 5},
|
||||
{stack = {name = 'assembling-machine-2', count = 25, distance_factor = 1 / 32}, weight = 5}
|
||||
{
|
||||
stack = {
|
||||
recipe = 'fast-transport-belt',
|
||||
output = {item = 'fast-transport-belt', min_rate = 1 / 2 / 60, distance_factor = 1 / 2 / 60 / 512}
|
||||
},
|
||||
weight = 5
|
||||
},
|
||||
{
|
||||
stack = {
|
||||
recipe = 'fast-underground-belt',
|
||||
output = {item = 'fast-underground-belt', min_rate = 1 / 8 / 60, distance_factor = 1 / 8 / 60 / 512}
|
||||
},
|
||||
weight = 5
|
||||
},
|
||||
{
|
||||
stack = {
|
||||
recipe = 'fast-splitter',
|
||||
output = {item = 'fast-splitter', min_rate = 1 / 8 / 60, distance_factor = 1 / 8 / 60 / 512}
|
||||
},
|
||||
weight = 5
|
||||
},
|
||||
{
|
||||
stack = {
|
||||
recipe = 'fast-inserter',
|
||||
output = {item = 'fast-inserter', min_rate = 1 / 2 / 60, distance_factor = 1 / 2 / 60 / 512}
|
||||
},
|
||||
weight = 5
|
||||
},
|
||||
{
|
||||
stack = {
|
||||
recipe = 'assembling-machine-2',
|
||||
output = {item = 'assembling-machine-2', min_rate = 1 / 4 / 60, distance_factor = 1 / 4 / 60 / 512}
|
||||
},
|
||||
weight = 5
|
||||
}
|
||||
}
|
||||
|
||||
local factory_weights = ob.prepare_weighted_loot(factory_loot)
|
||||
|
||||
local factory_callback =
|
||||
Token.register(
|
||||
function(factory)
|
||||
ob.do_factory_loot(factory, factory_weights, factory_loot)
|
||||
end
|
||||
)
|
||||
local factory_callback = {
|
||||
callback = ob.magic_item_crafting_callback_weighted,
|
||||
data = {
|
||||
loot = factory_loot,
|
||||
weights = factory_weights
|
||||
}
|
||||
}
|
||||
|
||||
local wall_chests = require 'map_gen.presets.crash_site.outpost_data.mini_wall_chests'
|
||||
local turret = require 'map_gen.presets.crash_site.outpost_data.mini_gun_turret'
|
||||
@ -47,7 +78,7 @@ local blank = require 'map_gen.presets.crash_site.outpost_data.mini_blank'
|
||||
local base_factory = require 'map_gen.presets.crash_site.outpost_data.mini_factory'
|
||||
local gun_turret_block = require 'map_gen.presets.crash_site.outpost_data.mini_gun_turret_block'
|
||||
|
||||
local factory = ob.extend_1_way(base_factory, {factory = {callback = factory_callback}, fallback = blank})
|
||||
local factory = ob.extend_1_way(base_factory, {factory = factory_callback, fallback = blank})
|
||||
local gun = ob.extend_1_way(gun_turret_block, {fallback = factory})
|
||||
|
||||
return {
|
||||
|
@ -19,19 +19,38 @@ local loot_callback =
|
||||
)
|
||||
|
||||
local factory_loot = {
|
||||
{stack = {name = 'effectivity-module-2', count = 25, distance_factor = 1 / 5}, weight = 5},
|
||||
{stack = {name = 'speed-module-2', count = 15, distance_factor = 1 / 5}, weight = 5},
|
||||
{stack = {name = 'productivity-module-2', count = 15, distance_factor = 1 / 5}, weight = 5}
|
||||
{
|
||||
stack = {
|
||||
recipe = 'effectivity-module-2',
|
||||
output = {item = 'effectivity-module-2', min_rate = 0.5 / 30 / 60, distance_factor = 0.5 / 30 / 60 / 512}
|
||||
},
|
||||
weight = 5
|
||||
},
|
||||
{
|
||||
stack = {
|
||||
recipe = 'speed-module-2',
|
||||
output = {item = 'speed-module-2', min_rate = 0.5 / 30 / 60, distance_factor = 0.5 / 30 / 60 / 512}
|
||||
},
|
||||
weight = 5
|
||||
},
|
||||
{
|
||||
stack = {
|
||||
recipe = 'productivity-module-2',
|
||||
output = {item = 'productivity-module-2', min_rate = 0.5 / 30 / 60, distance_factor = 0.5 / 30 / 60 / 512}
|
||||
},
|
||||
weight = 5
|
||||
}
|
||||
}
|
||||
|
||||
local factory_weights = ob.prepare_weighted_loot(factory_loot)
|
||||
|
||||
local factory_callback =
|
||||
Token.register(
|
||||
function(factory)
|
||||
ob.do_factory_loot(factory, factory_weights, factory_loot)
|
||||
end
|
||||
)
|
||||
local factory_callback = {
|
||||
callback = ob.magic_item_crafting_callback_weighted,
|
||||
data = {
|
||||
loot = factory_loot,
|
||||
weights = factory_weights
|
||||
}
|
||||
}
|
||||
|
||||
local wall_chests = require 'map_gen.presets.crash_site.outpost_data.mini_hazard_wall_chests'
|
||||
local turret = require 'map_gen.presets.crash_site.outpost_data.mini_laser_turret'
|
||||
@ -43,7 +62,7 @@ local blank = require 'map_gen.presets.crash_site.outpost_data.mini_blank'
|
||||
local base_factory = require 'map_gen.presets.crash_site.outpost_data.mini_factory'
|
||||
local laser_turret_block = require 'map_gen.presets.crash_site.outpost_data.mini_laser_turret_block'
|
||||
|
||||
local factory = ob.extend_1_way(base_factory, {factory = {callback = factory_callback}, fallback = blank})
|
||||
local factory = ob.extend_1_way(base_factory, {factory = factory_callback, fallback = blank})
|
||||
local gun = ob.extend_1_way(laser_turret_block, {fallback = factory})
|
||||
|
||||
return {
|
||||
|
@ -18,18 +18,31 @@ local loot_callback =
|
||||
)
|
||||
|
||||
local factory_loot = {
|
||||
{stack = {name = 'military-science-pack', count = 50, distance_factor = 1 / 5}, weight = 5},
|
||||
{stack = {name = 'science-pack-3', count = 50, distance_factor = 1 / 5}, weight = 5}
|
||||
{
|
||||
stack = {
|
||||
recipe = 'military-science-pack',
|
||||
output = {item = 'military-science-pack', min_rate = 2 / 10 / 60, distance_factor = 1 / 10 / 60 / 512}
|
||||
},
|
||||
weight = 5
|
||||
},
|
||||
{
|
||||
stack = {
|
||||
recipe = 'science-pack-3',
|
||||
output = {item = 'science-pack-3', min_rate = 1 / 12 / 60, distance_factor = 1 / 12 / 60 / 512}
|
||||
},
|
||||
weight = 5
|
||||
}
|
||||
}
|
||||
|
||||
local factory_weights = ob.prepare_weighted_loot(factory_loot)
|
||||
|
||||
local factory_callback =
|
||||
Token.register(
|
||||
function(factory)
|
||||
ob.do_factory_loot(factory, factory_weights, factory_loot)
|
||||
end
|
||||
)
|
||||
local factory_callback = {
|
||||
callback = ob.magic_item_crafting_callback_weighted,
|
||||
data = {
|
||||
loot = factory_loot,
|
||||
weights = factory_weights
|
||||
}
|
||||
}
|
||||
|
||||
local wall_chests = require 'map_gen.presets.crash_site.outpost_data.mini_hazard_wall_chests'
|
||||
local turret = require 'map_gen.presets.crash_site.outpost_data.mini_laser_turret'
|
||||
@ -41,7 +54,7 @@ local blank = require 'map_gen.presets.crash_site.outpost_data.mini_blank'
|
||||
local base_factory = require 'map_gen.presets.crash_site.outpost_data.mini_factory'
|
||||
local laser_turret_block = require 'map_gen.presets.crash_site.outpost_data.mini_laser_turret_block'
|
||||
|
||||
local factory = ob.extend_1_way(base_factory, {factory = {callback = factory_callback}, fallback = blank})
|
||||
local factory = ob.extend_1_way(base_factory, {factory = factory_callback, fallback = blank})
|
||||
local gun = ob.extend_1_way(laser_turret_block, {fallback = factory})
|
||||
|
||||
return {
|
||||
|
@ -29,18 +29,31 @@ local loot_callback =
|
||||
)
|
||||
|
||||
local factory_loot = {
|
||||
{stack = {name = 'laser-turret', count = 25, distance_factor = 1 / 32}, weight = 1},
|
||||
{stack = {name = 'flamethrower-turret', count = 25, distance_factor = 1 / 32}, weight = 1}
|
||||
{
|
||||
stack = {
|
||||
recipe = 'laser-turret',
|
||||
output = {item = 'laser-turret', min_rate = 1 / 20 / 60, distance_factor = 1 / 20 / 60 / 512}
|
||||
},
|
||||
weight = 1
|
||||
},
|
||||
{
|
||||
stack = {
|
||||
recipe = 'flamethrower-turret',
|
||||
output = {item = 'flamethrower-turret', min_rate = 1 / 20 / 60, distance_factor = 1 / 20 / 60 / 512}
|
||||
},
|
||||
weight = 1
|
||||
}
|
||||
}
|
||||
|
||||
local factory_weights = ob.prepare_weighted_loot(factory_loot)
|
||||
|
||||
local factory_callback =
|
||||
Token.register(
|
||||
function(factory)
|
||||
ob.do_factory_loot(factory, factory_weights, factory_loot)
|
||||
end
|
||||
)
|
||||
local factory_callback = {
|
||||
callback = ob.magic_item_crafting_callback_weighted,
|
||||
data = {
|
||||
loot = factory_loot,
|
||||
weights = factory_weights
|
||||
}
|
||||
}
|
||||
|
||||
local wall_chests = require 'map_gen.presets.crash_site.outpost_data.mini_wall_chests'
|
||||
local turret = require 'map_gen.presets.crash_site.outpost_data.mini_gun_turret'
|
||||
@ -60,7 +73,7 @@ local blank = require 'map_gen.presets.crash_site.outpost_data.mini_blank'
|
||||
local base_factory = require 'map_gen.presets.crash_site.outpost_data.mini_factory'
|
||||
local gun_turret_block = require 'map_gen.presets.crash_site.outpost_data.mini_gun_turret_block'
|
||||
|
||||
local factory = ob.extend_1_way(base_factory, {factory = {callback = factory_callback}, fallback = blank})
|
||||
local factory = ob.extend_1_way(base_factory, {factory = factory_callback, fallback = blank})
|
||||
local gun =
|
||||
ob.extend_1_way(
|
||||
gun_turret_block,
|
||||
|
@ -21,21 +21,52 @@ local loot_callback =
|
||||
)
|
||||
|
||||
local factory_loot = {
|
||||
{stack = {name = 'express-transport-belt', count = 100, distance_factor = 0}, weight = 5},
|
||||
{stack = {name = 'express-underground-belt', count = 50, distance_factor = 0}, weight = 5},
|
||||
{stack = {name = 'express-splitter', count = 25, distance_factor = 1 / 32}, weight = 5},
|
||||
{stack = {name = 'stack-inserter', count = 50, distance_factor = 0}, weight = 5},
|
||||
{stack = {name = 'assembling-machine-3', count = 25, distance_factor = 1 / 32}, weight = 5}
|
||||
{
|
||||
stack = {
|
||||
recipe = 'express-transport-belt',
|
||||
output = {item = 'express-transport-belt', min_rate = 1 / 2 / 60, distance_factor = 1 / 2 / 60 / 512}
|
||||
},
|
||||
weight = 5
|
||||
},
|
||||
{
|
||||
stack = {
|
||||
recipe = 'express-underground-belt',
|
||||
output = {item = 'express-underground-belt', min_rate = 1 / 8 / 60, distance_factor = 1 / 8 / 60 / 512}
|
||||
},
|
||||
weight = 5
|
||||
},
|
||||
{
|
||||
stack = {
|
||||
recipe = 'express-splitter',
|
||||
output = {item = 'express-splitter', min_rate = 1 / 8 / 60, distance_factor = 1 / 8 / 60 / 512}
|
||||
},
|
||||
weight = 5
|
||||
},
|
||||
{
|
||||
stack = {
|
||||
recipe = 'stack-inserter',
|
||||
output = {item = 'stack-inserter', min_rate = 1 / 2 / 60, distance_factor = 1 / 2 / 60 / 512}
|
||||
},
|
||||
weight = 5
|
||||
},
|
||||
{
|
||||
stack = {
|
||||
recipe = 'assembling-machine-3',
|
||||
output = {item = 'assembling-machine-3', min_rate = 1 / 4 / 60, distance_factor = 1 / 4 / 60 / 512}
|
||||
},
|
||||
weight = 5
|
||||
}
|
||||
}
|
||||
|
||||
local factory_weights = ob.prepare_weighted_loot(factory_loot)
|
||||
|
||||
local factory_callback =
|
||||
Token.register(
|
||||
function(factory)
|
||||
ob.do_factory_loot(factory, factory_weights, factory_loot)
|
||||
end
|
||||
)
|
||||
local factory_callback = {
|
||||
callback = ob.magic_item_crafting_callback_weighted,
|
||||
data = {
|
||||
loot = factory_loot,
|
||||
weights = factory_weights
|
||||
}
|
||||
}
|
||||
|
||||
local wall_chests = require 'map_gen.presets.crash_site.outpost_data.mini_wall_chests'
|
||||
local turret = require 'map_gen.presets.crash_site.outpost_data.mini_gun_turret'
|
||||
@ -55,7 +86,7 @@ local blank = require 'map_gen.presets.crash_site.outpost_data.mini_blank'
|
||||
local base_factory = require 'map_gen.presets.crash_site.outpost_data.mini_factory'
|
||||
local gun_turret_block = require 'map_gen.presets.crash_site.outpost_data.mini_gun_turret_block'
|
||||
|
||||
local factory = ob.extend_1_way(base_factory, {factory = {callback = factory_callback}, fallback = blank})
|
||||
local factory = ob.extend_1_way(base_factory, {factory = factory_callback, fallback = blank})
|
||||
local gun =
|
||||
ob.extend_1_way(
|
||||
gun_turret_block,
|
||||
|
@ -19,19 +19,38 @@ local loot_callback =
|
||||
)
|
||||
|
||||
local factory_loot = {
|
||||
{stack = {name = 'effectivity-module-3', count = 10, distance_factor = 1 / 16}, weight = 5},
|
||||
{stack = {name = 'speed-module-3', count = 7, distance_factor = 1 / 16}, weight = 5},
|
||||
{stack = {name = 'productivity-module-3', count = 7, distance_factor = 1 / 16}, weight = 5}
|
||||
{
|
||||
stack = {
|
||||
recipe = 'effectivity-module-3',
|
||||
output = {item = 'effectivity-module-3', min_rate = 0.5 / 60 / 60, distance_factor = 0.5 / 60 / 60 / 512}
|
||||
},
|
||||
weight = 5
|
||||
},
|
||||
{
|
||||
stack = {
|
||||
recipe = 'speed-module-3',
|
||||
output = {item = 'speed-module-3', min_rate = 0.5 / 60 / 60, distance_factor = 0.5 / 60 / 60 / 512}
|
||||
},
|
||||
weight = 5
|
||||
},
|
||||
{
|
||||
stack = {
|
||||
recipe = 'productivity-module-3',
|
||||
output = {item = 'productivity-module-3', min_rate = 0.5 / 60 / 60, distance_factor = 0.5 / 60 / 60 / 512}
|
||||
},
|
||||
weight = 5
|
||||
}
|
||||
}
|
||||
|
||||
local factory_weights = ob.prepare_weighted_loot(factory_loot)
|
||||
|
||||
local factory_callback =
|
||||
Token.register(
|
||||
function(factory)
|
||||
ob.do_factory_loot(factory, factory_weights, factory_loot)
|
||||
end
|
||||
)
|
||||
local factory_callback = {
|
||||
callback = ob.magic_item_crafting_callback_weighted,
|
||||
data = {
|
||||
loot = factory_loot,
|
||||
weights = factory_weights
|
||||
}
|
||||
}
|
||||
|
||||
local wall_chests = require 'map_gen.presets.crash_site.outpost_data.mini_hazard_wall_chests'
|
||||
local turret = require 'map_gen.presets.crash_site.outpost_data.mini_laser_turret'
|
||||
@ -43,7 +62,7 @@ local blank = require 'map_gen.presets.crash_site.outpost_data.mini_blank'
|
||||
local base_factory = require 'map_gen.presets.crash_site.outpost_data.mini_factory'
|
||||
local laser_turret_block = require 'map_gen.presets.crash_site.outpost_data.mini_laser_turret_block'
|
||||
|
||||
local factory = ob.extend_1_way(base_factory, {factory = {callback = factory_callback}, fallback = blank})
|
||||
local factory = ob.extend_1_way(base_factory, {factory = factory_callback, fallback = blank})
|
||||
local gun = ob.extend_1_way(laser_turret_block, {fallback = factory})
|
||||
|
||||
return {
|
||||
|
@ -18,18 +18,31 @@ local loot_callback =
|
||||
)
|
||||
|
||||
local factory_loot = {
|
||||
{stack = {name = 'production-science-pack', count = 75, distance_factor = 1 / 2}, weight = 5},
|
||||
{stack = {name = 'high-tech-science-pack', count = 75, distance_factor = 1 / 2}, weight = 5}
|
||||
{
|
||||
stack = {
|
||||
recipe = 'production-science-pack',
|
||||
output = {item = 'production-science-pack', min_rate = 2 / 14 / 60, distance_factor = 1 / 14 / 60 / 512}
|
||||
},
|
||||
weight = 5
|
||||
},
|
||||
{
|
||||
stack = {
|
||||
recipe = 'high-tech-science-pack',
|
||||
output = {item = 'high-tech-science-pack', min_rate = 2 / 14 / 60, distance_factor = 1 / 14 / 60 / 512}
|
||||
},
|
||||
weight = 5
|
||||
}
|
||||
}
|
||||
|
||||
local factory_weights = ob.prepare_weighted_loot(factory_loot)
|
||||
|
||||
local factory_callback =
|
||||
Token.register(
|
||||
function(factory)
|
||||
ob.do_factory_loot(factory, factory_weights, factory_loot)
|
||||
end
|
||||
)
|
||||
local factory_callback = {
|
||||
callback = ob.magic_item_crafting_callback_weighted,
|
||||
data = {
|
||||
loot = factory_loot,
|
||||
weights = factory_weights
|
||||
}
|
||||
}
|
||||
|
||||
local wall_chests = require 'map_gen.presets.crash_site.outpost_data.mini_hazard_wall_chests'
|
||||
local turret = require 'map_gen.presets.crash_site.outpost_data.mini_laser_turret'
|
||||
@ -41,7 +54,7 @@ local blank = require 'map_gen.presets.crash_site.outpost_data.mini_blank'
|
||||
local base_factory = require 'map_gen.presets.crash_site.outpost_data.mini_factory'
|
||||
local laser_turret_block = require 'map_gen.presets.crash_site.outpost_data.mini_laser_turret_block'
|
||||
|
||||
local factory = ob.extend_1_way(base_factory, {factory = {callback = factory_callback}, fallback = blank})
|
||||
local factory = ob.extend_1_way(base_factory, {factory = factory_callback, fallback = blank})
|
||||
local gun = ob.extend_1_way(laser_turret_block, {fallback = factory})
|
||||
|
||||
return {
|
||||
|
@ -27,7 +27,7 @@ local factory = {
|
||||
callback = ob.magic_item_crafting_callback,
|
||||
data = {
|
||||
recipe = 'firearm-magazine',
|
||||
output = {min_rate = 2 / 60, distance_factor = 2 / 60 / 512, item = 'firearm-magazine'}
|
||||
output = {min_rate = 1 / 60, distance_factor = 1 / 60 / 512, item = 'firearm-magazine'}
|
||||
}
|
||||
}
|
||||
|
||||
@ -35,7 +35,7 @@ local factory_b = {
|
||||
callback = ob.magic_item_crafting_callback,
|
||||
data = {
|
||||
recipe = 'piercing-rounds-magazine',
|
||||
output = {min_rate = 1 / 60, distance_factor = 1 / 60 / 512, item = 'piercing-rounds-magazine'}
|
||||
output = {min_rate = 0.5 / 60, distance_factor = 0.5 / 60 / 512, item = 'piercing-rounds-magazine'}
|
||||
}
|
||||
}
|
||||
|
||||
@ -44,7 +44,7 @@ local market = {
|
||||
data = {
|
||||
market_name = 'Small Ammo Factory',
|
||||
upgrade_rate = 0.5,
|
||||
upgrade_base_cost = 250,
|
||||
upgrade_base_cost = 500,
|
||||
upgrade_cost_base = 2,
|
||||
{
|
||||
name = 'firearm-magazine',
|
||||
|
@ -24,7 +24,7 @@ local factory = {
|
||||
callback = ob.magic_item_crafting_callback,
|
||||
data = {
|
||||
recipe = 'sulfur',
|
||||
output = {min_rate = 2 / 60, distance_factor = 2 / 60 / 512, item = 'sulfur'}
|
||||
output = {min_rate = 1 / 60, distance_factor = 1 / 60 / 512, item = 'sulfur'}
|
||||
}
|
||||
}
|
||||
|
||||
@ -32,7 +32,7 @@ local factory_b = {
|
||||
callback = ob.magic_item_crafting_callback,
|
||||
data = {
|
||||
recipe = 'plastic-bar',
|
||||
output = {min_rate = 2 / 60, distance_factor = 2 / 60 / 512, item = 'plastic-bar'}
|
||||
output = {min_rate = 1 / 60, distance_factor = 1 / 60 / 512, item = 'plastic-bar'}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -15,7 +15,7 @@ local factory = {
|
||||
callback = ob.magic_item_crafting_callback,
|
||||
data = {
|
||||
recipe = 'electronic-circuit',
|
||||
output = {min_rate = 1.5 / 60, distance_factor = 1.5 / 60 / 512, item = 'electronic-circuit'}
|
||||
output = {min_rate = 0.75 / 60, distance_factor = 0.75 / 60 / 512, item = 'electronic-circuit'}
|
||||
}
|
||||
}
|
||||
|
||||
@ -24,7 +24,7 @@ local market = {
|
||||
data = {
|
||||
market_name = 'Small Circuit Factory',
|
||||
upgrade_rate = 0.5,
|
||||
upgrade_base_cost = 250,
|
||||
upgrade_base_cost = 350,
|
||||
upgrade_cost_base = 2,
|
||||
{
|
||||
name = 'copper-cable',
|
||||
|
@ -22,7 +22,7 @@ local factory = {
|
||||
callback = ob.magic_item_crafting_callback,
|
||||
data = {
|
||||
furance_item = 'copper-ore',
|
||||
output = {min_rate = 4 / 60, distance_factor = 1.75 / 60 / 512, item = 'copper-plate'}
|
||||
output = {min_rate = 2 / 60, distance_factor = 2 / 60 / 512, item = 'copper-plate'}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@ local factory = {
|
||||
callback = ob.magic_item_crafting_callback,
|
||||
data = {
|
||||
recipe = 'iron-gear-wheel',
|
||||
output = {min_rate = 1.5 / 60, distance_factor = 1.5 / 60 / 512, item = 'iron-gear-wheel'}
|
||||
output = {min_rate = 0.75 / 60, distance_factor = 0.75 / 60 / 512, item = 'iron-gear-wheel'}
|
||||
}
|
||||
}
|
||||
|
||||
@ -35,7 +35,7 @@ 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'}
|
||||
output = {min_rate = 0.25 / 60, distance_factor = 0.25 / 60 / 512, item = 'engine-unit'}
|
||||
}
|
||||
}
|
||||
|
||||
@ -44,7 +44,7 @@ local market = {
|
||||
data = {
|
||||
market_name = 'Small Gear Factory',
|
||||
upgrade_rate = 0.5,
|
||||
upgrade_base_cost = 250,
|
||||
upgrade_base_cost = 200,
|
||||
upgrade_cost_base = 2,
|
||||
{
|
||||
name = 'iron-gear-wheel',
|
||||
|
@ -22,7 +22,7 @@ local factory = {
|
||||
callback = ob.magic_item_crafting_callback,
|
||||
data = {
|
||||
furance_item = 'iron-ore',
|
||||
output = {min_rate = 4 / 60, distance_factor = 1.75 / 60 / 512, item = 'iron-plate'}
|
||||
output = {min_rate = 2 / 60, distance_factor = 2 / 60 / 512, item = 'iron-plate'}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -41,9 +41,9 @@ local factory = {
|
||||
recipe = 'basic-oil-processing',
|
||||
keep_active = true,
|
||||
output = {
|
||||
{min_rate = 15 / 60, distance_factor = 15 / 60 / 512, item = 'heavy-oil', fluidbox_index = 2},
|
||||
{min_rate = 15 / 60, distance_factor = 15 / 60 / 512, item = 'light-oil', fluidbox_index = 3},
|
||||
{min_rate = 20 / 60, distance_factor = 20 / 60 / 512, item = 'petroleum-gas', fluidbox_index = 4}
|
||||
{min_rate = 7.5 / 60, distance_factor = 7.5 / 60 / 512, item = 'heavy-oil', fluidbox_index = 2},
|
||||
{min_rate = 7.5 / 60, distance_factor = 7.5 / 60 / 512, item = 'light-oil', fluidbox_index = 3},
|
||||
{min_rate = 10 / 60, distance_factor = 10 / 60 / 512, item = 'petroleum-gas', fluidbox_index = 4}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ local loot_callback =
|
||||
local factory = {
|
||||
callback = ob.magic_item_crafting_callback,
|
||||
data = {
|
||||
output = {min_rate = 1.5 / 60, distance_factor = 1.5 / 60 / 512, item = 'coal'}
|
||||
output = {min_rate = 0.75 / 60, distance_factor = 0.75 / 60 / 512, item = 'coal'}
|
||||
}
|
||||
}
|
||||
|
||||
@ -34,7 +34,7 @@ local factory_b = {
|
||||
callback = ob.magic_item_crafting_callback,
|
||||
data = {
|
||||
recipe = 'solid-fuel-from-light-oil',
|
||||
output = {min_rate = 0.75 / 60, distance_factor = 0.75 / 60 / 512, item = 'solid-fuel'}
|
||||
output = {min_rate = 0.375 / 60, distance_factor = 0.375 / 60 / 512, item = 'solid-fuel'}
|
||||
}
|
||||
}
|
||||
|
||||
@ -43,7 +43,7 @@ local market = {
|
||||
data = {
|
||||
market_name = 'Small Power Factory',
|
||||
upgrade_rate = 0.5,
|
||||
upgrade_base_cost = 250,
|
||||
upgrade_base_cost = 200,
|
||||
upgrade_cost_base = 2,
|
||||
{
|
||||
name = 'coal',
|
||||
|
@ -21,7 +21,7 @@ local factory = {
|
||||
callback = ob.magic_item_crafting_callback,
|
||||
data = {
|
||||
recipe = 'science-pack-1',
|
||||
output = {min_rate = 0.35 / 60, distance_factor = 0.35 / 60 / 512, item = 'science-pack-1'}
|
||||
output = {min_rate = 0.175 / 60, distance_factor = 0.175 / 60 / 512, item = 'science-pack-1'}
|
||||
}
|
||||
}
|
||||
|
||||
@ -29,7 +29,7 @@ local factory_b = {
|
||||
callback = ob.magic_item_crafting_callback,
|
||||
data = {
|
||||
recipe = 'science-pack-2',
|
||||
output = {min_rate = 0.35 / 60, distance_factor = 0.35 / 60 / 512, item = 'science-pack-2'}
|
||||
output = {min_rate = 0.175 / 60, distance_factor = 0.175 / 60 / 512, item = 'science-pack-2'}
|
||||
}
|
||||
}
|
||||
|
||||
@ -38,7 +38,7 @@ local market = {
|
||||
data = {
|
||||
market_name = 'Small Science Factory',
|
||||
upgrade_rate = 0.5,
|
||||
upgrade_base_cost = 250,
|
||||
upgrade_base_cost = 350,
|
||||
upgrade_cost_base = 2,
|
||||
{
|
||||
name = 'science-pack-1',
|
||||
|
@ -23,7 +23,7 @@ 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'}
|
||||
output = {min_rate = 0.5 / 60, distance_factor = 0.5 / 60 / 512, item = 'stone-brick'}
|
||||
}
|
||||
}
|
||||
|
||||
@ -31,7 +31,7 @@ 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'}
|
||||
output = {min_rate = 0.1 / 60, distance_factor = 0.1 / 60 / 512, item = 'stone-wall'}
|
||||
}
|
||||
}
|
||||
|
||||
@ -40,7 +40,7 @@ local market = {
|
||||
data = {
|
||||
market_name = 'Small Stone Factory',
|
||||
upgrade_rate = 0.5,
|
||||
upgrade_base_cost = 250,
|
||||
upgrade_base_cost = 125,
|
||||
upgrade_cost_base = 2,
|
||||
{
|
||||
name = 'stone',
|
||||
|
@ -35,7 +35,7 @@ local factory = {
|
||||
callback = ob.magic_item_crafting_callback,
|
||||
data = {
|
||||
recipe = 'piercing-shotgun-shell',
|
||||
output = {min_rate = 0.25 / 60, distance_factor = 0.25 / 60 / 512, item = 'piercing-shotgun-shell'}
|
||||
output = {min_rate = 0.125 / 60, distance_factor = 0.125 / 60 / 512, item = 'piercing-shotgun-shell'}
|
||||
}
|
||||
}
|
||||
|
||||
@ -43,7 +43,7 @@ local factory_b = {
|
||||
callback = ob.magic_item_crafting_callback,
|
||||
data = {
|
||||
recipe = 'rocket',
|
||||
output = {min_rate = 0.2 / 60, distance_factor = 0.2 / 60 / 512, item = 'rocket'}
|
||||
output = {min_rate = 0.1 / 60, distance_factor = 0.1 / 60 / 512, item = 'rocket'}
|
||||
}
|
||||
}
|
||||
|
||||
@ -51,7 +51,7 @@ local factory_c = {
|
||||
callback = ob.magic_item_crafting_callback,
|
||||
data = {
|
||||
recipe = 'gun-turret',
|
||||
output = {min_rate = 0.1 / 60, distance_factor = 0.1 / 60 / 512, item = 'gun-turret'}
|
||||
output = {min_rate = 0.05 / 60, distance_factor = 0.05 / 60 / 512, item = 'gun-turret'}
|
||||
}
|
||||
}
|
||||
|
||||
@ -60,7 +60,7 @@ local market = {
|
||||
data = {
|
||||
market_name = 'Small Weapon Factory',
|
||||
upgrade_rate = 0.5,
|
||||
upgrade_base_cost = 250,
|
||||
upgrade_base_cost = 350,
|
||||
upgrade_cost_base = 2,
|
||||
{
|
||||
name = 'raw-fish',
|
||||
|
Loading…
Reference in New Issue
Block a user