advanced belts
This commit is contained in:
parent
7711e99d84
commit
1ce0015459
4 changed files with 52 additions and 1 deletions
|
|
@ -1,4 +1,9 @@
|
||||||
---------------------------------------------------------------------------------------------------
|
---------------------------------------------------------------------------------------------------
|
||||||
|
Version: 1.2.8
|
||||||
|
Date: 2022-08-23
|
||||||
|
Changes:
|
||||||
|
- Recipe compatibility with new advanced belts mod
|
||||||
|
---------------------------------------------------------------------------------------------------
|
||||||
Version: 1.2.7
|
Version: 1.2.7
|
||||||
Date: 2022-08-17
|
Date: 2022-08-17
|
||||||
Fixes:
|
Fixes:
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
-- WARNING WARNING WARNING
|
-- WARNING WARNING WARNING
|
||||||
-- This file will be overwritten in mod zipfiles, edit bzlib/data-util.lua
|
-- This file will be overwritten in mod zipfiles, edit bzlib/data-util.lua
|
||||||
-- WARNING WARNING WARNING
|
-- WARNING WARNING WARNING
|
||||||
|
--
|
||||||
|
|
||||||
local me = require("me")
|
local me = require("me")
|
||||||
local util = {}
|
local util = {}
|
||||||
|
|
@ -252,6 +253,9 @@ function util.add_prerequisite(technology_name, prerequisite)
|
||||||
local technology = data.raw.technology[technology_name]
|
local technology = data.raw.technology[technology_name]
|
||||||
if technology and data.raw.technology[prerequisite] then
|
if technology and data.raw.technology[prerequisite] then
|
||||||
if technology.prerequisites then
|
if technology.prerequisites then
|
||||||
|
for i, pre in pairs(technology.prerequisites) do
|
||||||
|
if pre == prerequisite then return end
|
||||||
|
end
|
||||||
table.insert(technology.prerequisites, prerequisite)
|
table.insert(technology.prerequisites, prerequisite)
|
||||||
else
|
else
|
||||||
technology.prerequisites = {prerequisite}
|
technology.prerequisites = {prerequisite}
|
||||||
|
|
@ -1146,4 +1150,36 @@ function util.add_unlock_force(technology_name, recipe)
|
||||||
util.add_unlock(technology_name, recipe)
|
util.add_unlock(technology_name, recipe)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- sum the products of a recipe
|
||||||
|
function util.sum_products(recipe_name)
|
||||||
|
-- this is going to end up approximate in some cases, integer division is probs fine
|
||||||
|
if data.raw.recipe[recipe_name] then
|
||||||
|
local recipe = data.raw.recipe[recipe_name]
|
||||||
|
if not recipe.results then return recipe.result_count end
|
||||||
|
local sum = 0
|
||||||
|
for i, result in pairs(recipe.results) do
|
||||||
|
local amt = 0
|
||||||
|
if result[2] then amt = result[2]
|
||||||
|
elseif result.amount then amt = result.amount
|
||||||
|
elseif result.amount_min then amt = (result.amount_min + result.amount_max)/2
|
||||||
|
end
|
||||||
|
if result.probability then amt = amt * result.probability end
|
||||||
|
sum = sum + amt
|
||||||
|
end
|
||||||
|
return sum
|
||||||
|
end
|
||||||
|
return 0
|
||||||
|
end
|
||||||
|
|
||||||
|
function util.set_vtk_dcm_ingredients()
|
||||||
|
if mods["vtk-deep-core-mining"] then
|
||||||
|
local sum = util.sum_products("vtk-deepcore-mining-ore-chunk-refining")
|
||||||
|
log("setting vtk deepcore based on " .. serpent.dump(sum) .. " to " ..serpent.dump(sum*0.8))
|
||||||
|
util.set_ingredient("vtk-deepcore-mining-ore-chunk-refining", "vtk-deepcore-mining-ore-chunk", sum * 0.8)
|
||||||
|
local sum = 1+util.sum_products("vtk-deepcore-mining-ore-chunk-refining-no-uranium")
|
||||||
|
log("setting vtk deepcore no uranium to " .. serpent.dump(sum))
|
||||||
|
util.set_ingredient("vtk-deepcore-mining-ore-chunk-refining-no-uranium", "vtk-deepcore-mining-ore-chunk", sum)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
return util
|
return util
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "bztitanium",
|
"name": "bztitanium",
|
||||||
"version": "1.2.7",
|
"version": "1.2.8",
|
||||||
"factorio_version": "1.1",
|
"factorio_version": "1.1",
|
||||||
"title": "Titanium",
|
"title": "Titanium",
|
||||||
"author": "Brevven",
|
"author": "Brevven",
|
||||||
|
|
|
||||||
|
|
@ -150,6 +150,16 @@ if not mods.bzaluminum then
|
||||||
util.replace_ingredient("extreme-fast-belt-loader", "express-transport-belt-loader", util.me.titanium_plate, 20)
|
util.replace_ingredient("extreme-fast-belt-loader", "express-transport-belt-loader", util.me.titanium_plate, 20)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Advanced belts
|
||||||
|
util.add_ingredient("extreme-belt", util.me.titanium_plate, 5) -- Advanced
|
||||||
|
util.add_ingredient("extreme-underground", util.me.titanium_plate, 20)
|
||||||
|
if not mods.bzaluminum then
|
||||||
|
util.add_ingredient("ultimate-belt", util.me.titanium_plate, 10) -- Elite
|
||||||
|
util.add_ingredient("ultimate-underground", util.me.titanium_plate, 40)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
-- bob belts, logistics
|
||||||
util.replace_ingredient("turbo-transport-belt", "steel-plate", util.me.titanium_plate, 20)
|
util.replace_ingredient("turbo-transport-belt", "steel-plate", util.me.titanium_plate, 20)
|
||||||
util.replace_ingredient("ultimate-transport-belt", "steel-plate", util.me.titanium_plate)
|
util.replace_ingredient("ultimate-transport-belt", "steel-plate", util.me.titanium_plate)
|
||||||
util.replace_ingredient("turbo-underground-belt", "steel-plate", util.me.titanium_plate)
|
util.replace_ingredient("turbo-underground-belt", "steel-plate", util.me.titanium_plate)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue