get working in 2.0
This commit is contained in:
parent
00cc9df72c
commit
d0aaba1d07
6 changed files with 68 additions and 60 deletions
|
|
@ -1,3 +1,7 @@
|
|||
local util = require("control-util")
|
||||
script.on_configuration_changed(util.ore_fix)
|
||||
util.add_regenerate_command_handler()
|
||||
|
||||
script.on_event( defines.events.on_console_chat, function(event)
|
||||
-- refresh recipes, in case of settings change
|
||||
if event.message and event.message == "ZirconiumRecipes" and (not event.player_index or not game.players[event.player_index] or game.players[event.player_index].admin) then
|
||||
|
|
|
|||
|
|
@ -1,13 +1,14 @@
|
|||
{
|
||||
"name": "bzzirconium",
|
||||
"version": "0.7.3",
|
||||
"factorio_version": "1.1",
|
||||
"version": "2.0.0",
|
||||
"factorio_version": "2.0",
|
||||
"title": "Zirconium",
|
||||
"author": "Brevven",
|
||||
"contact": "",
|
||||
"homepage": "",
|
||||
"dependencies": [
|
||||
"base >= 1.1.0",
|
||||
"? space-age",
|
||||
"? space-exploration",
|
||||
"? aai-industry",
|
||||
"? Krastorio2",
|
||||
|
|
@ -19,6 +20,6 @@
|
|||
"? bztitanium >= 0.12.4",
|
||||
"? bztungsten >= 0.5.0"
|
||||
],
|
||||
"description": "Adds zircon, zirconia, zirconium, and cermet to the base game.\n\nCompatible with Krastorio 2, Space Exploration, FE+, and more. A standalone piece of BZ Mods."
|
||||
"description": "Adds zircon, zirconia, zirconium, and cermet to the base game.\n\nCompatible with Space Age and more. A standalone piece of BZ Mods."
|
||||
}
|
||||
|
||||
|
|
|
|||
22
magazine.lua
22
magazine.lua
|
|
@ -3,21 +3,21 @@ local util = require("data-util");
|
|||
|
||||
if util.me.ammo() then
|
||||
local mag = {
|
||||
{"zirconium-plate", 1},
|
||||
util.item("zirconium-plate", 1),
|
||||
}
|
||||
local ct = 1
|
||||
if mods.bztungsten then
|
||||
table.insert(mag, {"tungsten-carbide", 1})
|
||||
table.insert(mag, util.item("tungsten-carbide", 1))
|
||||
ct = ct + 1
|
||||
end
|
||||
-- add any other count-incrementing ingredients before silica, oil, and magazine
|
||||
if mods.bzsilicon then
|
||||
table.insert(mag, {"silica", ct})
|
||||
table.insert(mag, util.item("silica", ct))
|
||||
end
|
||||
table.insert(mag, {type="fluid", name="heavy-oil", amount=ct})
|
||||
|
||||
if not mods.Krastorio2 or not util.get_setting("kr-more-realistic-weapon") then
|
||||
table.insert(mag, {"piercing-rounds-magazine", ct})
|
||||
table.insert(mag, util.item("piercing-rounds-magazine", ct))
|
||||
|
||||
data:extend({
|
||||
{
|
||||
|
|
@ -25,6 +25,7 @@ if util.me.ammo() then
|
|||
name = "explosive-rounds-magazine",
|
||||
icon = "__bzzirconium__/graphics/icons/magazine.png",
|
||||
icon_size = 64, icon_mipmaps = 4,
|
||||
ammo_category = "bullet",
|
||||
ammo_type =
|
||||
{
|
||||
category = "bullet",
|
||||
|
|
@ -90,8 +91,7 @@ if util.me.ammo() then
|
|||
enabled = false,
|
||||
energy_required = 6 * ct,
|
||||
ingredients = mag,
|
||||
result = "explosive-rounds-magazine",
|
||||
result_count = ct,
|
||||
results = {util.item("explosive-rounds-magazine", ct)},
|
||||
},
|
||||
})
|
||||
|
||||
|
|
@ -104,9 +104,9 @@ if util.me.ammo() then
|
|||
end
|
||||
|
||||
rmag = futil.table.deepcopy(mag)
|
||||
table.insert(rmag, {"armor-piercing-rifle-magazine", ct})
|
||||
table.insert(rmag, util.item("armor-piercing-rifle-magazine", ct))
|
||||
ammag = futil.table.deepcopy(mag)
|
||||
table.insert(ammag, {"armor-piercing-anti-material-rifle-magazine", ct})
|
||||
table.insert(ammag, util.item("armor-piercing-anti-material-rifle-magazine", ct))
|
||||
|
||||
|
||||
data:extend({
|
||||
|
|
@ -220,8 +220,7 @@ if util.me.ammo() then
|
|||
energy_required = 2.5*ct,
|
||||
enabled = false,
|
||||
ingredients = rmag,
|
||||
result = "explosive-rounds-rifle-magazine",
|
||||
result_count = ct,
|
||||
results = {util.item("explosive-rounds-rifle-magazine", ct)},
|
||||
},
|
||||
|
||||
------------------------
|
||||
|
|
@ -330,8 +329,7 @@ if util.me.ammo() then
|
|||
energy_required = 6*ct,
|
||||
enabled = false,
|
||||
ingredients = ammag,
|
||||
result = "explosive-rounds-anti-material-rifle-magazine",
|
||||
result_count = ct,
|
||||
results = {util.item("explosive-rounds-anti-material-rifle-magazine", ct)},
|
||||
},
|
||||
})
|
||||
|
||||
|
|
|
|||
1
me.lua
1
me.lua
|
|
@ -1,6 +1,7 @@
|
|||
local me = {}
|
||||
|
||||
me.name = "bzzirconium"
|
||||
me.resources = {"zircon"}
|
||||
me.recipes = {"zirconium-plate", "zirconia", "cermet",
|
||||
"enriched-zirconia-smelting",
|
||||
"enriched-zircon",
|
||||
|
|
|
|||
31
zircon.lua
31
zircon.lua
|
|
@ -1,19 +1,24 @@
|
|||
local resource_autoplace = require('resource-autoplace');
|
||||
local noise = require('noise');
|
||||
|
||||
local util = require("data-util");
|
||||
|
||||
|
||||
data.raw.planet.nauvis.map_gen_settings.autoplace_controls["zircon"] = {}
|
||||
data.raw.planet.nauvis.map_gen_settings.autoplace_settings.entity.settings["zircon"] = {}
|
||||
resource_autoplace.initialize_patch_set("zircon", true)
|
||||
|
||||
if mods.tenebris then
|
||||
data.raw.planet.tenebris.map_gen_settings.autoplace_controls["zircon"] = {}
|
||||
data.raw.planet.tenebris.map_gen_settings.autoplace_settings.entity.settings["zircon"] = {}
|
||||
end
|
||||
|
||||
data:extend({
|
||||
{
|
||||
type = "autoplace-control",
|
||||
category = "resource",
|
||||
name = "zircon",
|
||||
richness = true,
|
||||
order = "b-e"
|
||||
},
|
||||
{
|
||||
type = "noise-layer",
|
||||
name = "zircon"
|
||||
order = "a-z"
|
||||
},
|
||||
{
|
||||
type = "resource",
|
||||
|
|
@ -37,7 +42,7 @@ data:extend({
|
|||
|
||||
autoplace = resource_autoplace.resource_autoplace_settings{
|
||||
name = "zircon",
|
||||
order = "b-z",
|
||||
order = "a-z",
|
||||
base_density = 4,
|
||||
has_starting_area_placement = true,
|
||||
regular_rq_factor_multiplier = 1.2,
|
||||
|
|
@ -80,8 +85,12 @@ local richness = data.raw.resource["zircon"].autoplace.richness_expression
|
|||
-- Modify zircon autoplace richness:
|
||||
-- After 500 tiles it's standard
|
||||
-- Up to 500 tiles, it scales up
|
||||
data.raw.resource["zircon"].autoplace.richness_expression =
|
||||
richness * noise.if_else_chain(
|
||||
noise.less_than(noise.distance_from(noise.var("x"), noise.var("y"), noise.var("starting_positions")), noise.to_noise_expression(500)),
|
||||
(noise.distance_from(noise.var("x"), noise.var("y"), noise.var("starting_positions")) + 25)/525,
|
||||
data.raw.resource["zircon"].autoplace.richness_expression = richness..[[*
|
||||
if(distance_from_nearest_point{x = x, y = y, points = starting_positions} < 500,
|
||||
(distance_from_nearest_point{x = x, y = y, points = starting_positions} + 25)/525,
|
||||
1)
|
||||
]]
|
||||
-- richness * noise.if_else_chain(
|
||||
-- noise.less_than(noise.distance_from(noise.var("x"), noise.var("y"), noise.var("starting_positions")), noise.to_noise_expression(500)),
|
||||
-- (noise.distance_from(noise.var("x"), noise.var("y"), noise.var("starting_positions")) + 25)/525,
|
||||
-- 1)
|
||||
|
|
|
|||
|
|
@ -35,31 +35,31 @@ data:extend({
|
|||
main_product = "zirconia",
|
||||
enabled = false,
|
||||
energy_required = 8,
|
||||
ingredients = {{"zircon", 5}},
|
||||
ingredients = {util.item("zircon", 5)},
|
||||
results = mods.bztitanium and util.me.byproduct() and {
|
||||
{name="zirconia", amount_min=4, amount_max=5},
|
||||
{name="titanium-ore", amount=1, probability=.5}
|
||||
} or {{"zirconia", 5}}
|
||||
} or {util.item("zirconia", 5)}
|
||||
} or
|
||||
{
|
||||
main_product = "zirconia",
|
||||
enabled = false,
|
||||
energy_required = 3.2,
|
||||
ingredients = {{"zircon", 1}},
|
||||
ingredients = {util.item("zircon", 1)},
|
||||
results = mods.bztitanium and util.me.byproduct() and {
|
||||
{name="zirconia", amount=2, probability=.95},
|
||||
{name="titanium-ore", amount=1, probability=.1}
|
||||
} or {{"zirconia", 2}}
|
||||
} or {util.item("zirconia", 2)}
|
||||
}),
|
||||
expensive =
|
||||
{
|
||||
main_product = "zirconia",
|
||||
enabled = false,
|
||||
energy_required = 3.2,
|
||||
ingredients = {{"zircon", 1}},
|
||||
ingredients = {util.item("zircon", 1)},
|
||||
results = mods.bztitanium and util.me.byproduct() and {
|
||||
{"zirconia", 1}, {name="titanium-ore", amount=1, probability=.05}
|
||||
} or {{"zirconia", 2}}
|
||||
util.item("zirconia", 1), {name="titanium-ore", amount=1, probability=.05}
|
||||
} or {util.item("zirconia", 2)}
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
@ -89,22 +89,20 @@ data:extend({
|
|||
{
|
||||
enabled = false,
|
||||
energy_required = 8,
|
||||
ingredients = {{"zirconia", 15}},
|
||||
result = "zirconium-plate",
|
||||
result_count = 5,
|
||||
ingredients = {util.item("zirconia", 15)},
|
||||
results = {util.item("zirconium-plate", 5)},
|
||||
} or
|
||||
{
|
||||
enabled = false,
|
||||
energy_required = 9.6,
|
||||
ingredients = {{"zirconia", 3}},
|
||||
result = "zirconium-plate",
|
||||
result_count = 1,
|
||||
ingredients = {util.item("zirconia", 3)},
|
||||
results = {util.item("zirconium-plate", 1)},
|
||||
}),
|
||||
expensive =
|
||||
{
|
||||
enabled = false,
|
||||
energy_required = 9.6,
|
||||
ingredients = {{"zirconia", 6}},
|
||||
ingredients = {util.item("zirconia", 6)},
|
||||
result = "zirconium-plate",
|
||||
}
|
||||
},
|
||||
|
|
@ -149,16 +147,16 @@ data:extend({
|
|||
|
||||
-- cermet only if setting enabled
|
||||
if util.me.use_cermet() then
|
||||
local cermet_i = {{"zirconia", 2}, {"copper-plate", 1}}
|
||||
local cermet_i = {util.item("zirconia", 2), util.item("copper-plate", 1)}
|
||||
if mods.bztitanium then
|
||||
local tme = require("__bztitanium__.me");
|
||||
table.insert(cermet_i, {tme.titanium_plate, 1})
|
||||
table.insert(cermet_i, util.item(tme.titanium_plate, 1))
|
||||
end
|
||||
if mods.bzsilicon then
|
||||
table.insert(cermet_i, {"silica", 1})
|
||||
table.insert(cermet_i, util.item("silica", 1))
|
||||
end
|
||||
if mods.bzaluminum then
|
||||
table.insert(cermet_i, {"alumina", 1})
|
||||
table.insert(cermet_i, util.item("alumina", 1))
|
||||
end
|
||||
data:extend({
|
||||
{
|
||||
|
|
@ -187,8 +185,7 @@ data:extend({
|
|||
enabled = false,
|
||||
energy_required = #cermet_i + 1,
|
||||
ingredients = cermet_i,
|
||||
result = "cermet",
|
||||
result_count = #cermet_i + 1,
|
||||
results = {util.item("cermet", #cermet_i + 1)},
|
||||
},
|
||||
{
|
||||
type = "technology",
|
||||
|
|
@ -237,7 +234,7 @@ data:extend({
|
|||
},
|
||||
enabled = true,
|
||||
energy_required = 1,
|
||||
ingredients = {{"stone", 2}},
|
||||
ingredients = {util.item("stone", 2)},
|
||||
results = {
|
||||
{type="item", name="zircon", amount=1, probability=.999999},
|
||||
{type="item", name="stone", amount=1, probability=0.5},
|
||||
|
|
@ -255,7 +252,7 @@ data:extend({
|
|||
},
|
||||
enabled = true,
|
||||
energy_required = 1,
|
||||
ingredients = {{"zircon", 2}},
|
||||
ingredients = {util.item("zircon", 2)},
|
||||
results = {
|
||||
{type="item", name="stone", amount=1, probability=.999999},
|
||||
{type="item", name="zircon", amount=1, probability=0.5},
|
||||
|
|
@ -265,7 +262,7 @@ data:extend({
|
|||
end
|
||||
|
||||
-- Zirconium Tungstate, only if needed
|
||||
if mods.bztungsten and (mods["Krastorio2"] or mods["space-exploration"]) then
|
||||
if mods["space-age"] or (mods.bztungsten and (mods["Krastorio2"] or mods["space-exploration"])) then
|
||||
data:extend({
|
||||
{
|
||||
type = "item",
|
||||
|
|
@ -284,9 +281,8 @@ data:extend({
|
|||
order = "z[zz]",
|
||||
enabled = false,
|
||||
energy_required = 2,
|
||||
ingredients = {{"zirconium-plate", 1}, {"tungsten-plate", 1},},
|
||||
result = "zirconium-tungstate",
|
||||
result_count = 2,
|
||||
ingredients = {util.item("zirconium-plate", 1), util.item("tungsten-plate", 1),},
|
||||
results = {util.item("zirconium-tungstate", 2)},
|
||||
},
|
||||
})
|
||||
util.add_effect("zirconia-processing", { type = "unlock-recipe", recipe = "zirconium-tungstate" })
|
||||
|
|
@ -295,9 +291,9 @@ end
|
|||
-- Zircaloy-4 only if needed
|
||||
if mods.bztin then
|
||||
local zircaloyi = {
|
||||
{"zirconium-plate", 17},
|
||||
{"tin-plate", 2},
|
||||
{"iron-plate", 1},
|
||||
util.item("zirconium-plate", 17),
|
||||
util.item("tin-plate", 2),
|
||||
util.item("iron-plate", 1),
|
||||
}
|
||||
data:extend({
|
||||
{
|
||||
|
|
@ -316,8 +312,7 @@ data:extend({
|
|||
enabled = false,
|
||||
energy_required = 60,
|
||||
ingredients = zircaloyi,
|
||||
result = "zircaloy-4",
|
||||
result_count = 20,
|
||||
results = {util.item("zircaloy-4", 20)},
|
||||
},
|
||||
})
|
||||
util.add_effect("zirconia-processing", { type = "unlock-recipe", recipe = "zircaloy-4" })
|
||||
|
|
@ -331,8 +326,8 @@ data:extend({
|
|||
category = "double-smelting",
|
||||
enabled = false,
|
||||
energy_required = 19.2,
|
||||
ingredients = {{"zircon", 3}},
|
||||
results = {{"zirconium-plate", 2}},
|
||||
ingredients = {util.item("zircon", 3)},
|
||||
results = {util.item("zirconium-plate", 2)},
|
||||
}
|
||||
})
|
||||
util.add_effect("zirconia-processing", {type = "unlock-recipe", recipe = "double-zirconium"})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue