diff --git a/basic-foundry.lua b/basic-foundry.lua new file mode 100644 index 0000000..974308b --- /dev/null +++ b/basic-foundry.lua @@ -0,0 +1,149 @@ +local futil = require("util") +local util = require("data-util"); +local item_sounds = require("__base__.prototypes.item_sounds") +local sounds = require("__base__.prototypes.entity.sounds") +local hit_effects = require("__base__.prototypes.entity.hit-effects") + +if mods["space-age"] then +if not data.raw.item["basic-foundry"] then +local graphics_set = require("__space-age__.prototypes.entity.foundry-pictures").graphics_set +graphics_set.animation.layers[1].tint = {.6, .8, .8} +data:extend({ + { + type = "assembling-machine", + name = "basic-foundry", + icons = {{ + icon = "__space-age__/graphics/icons/foundry.png", + tint = {.6, .8, .8}, + }}, + flags = {"placeable-neutral","player-creation"}, + minable = {mining_time = 0.2, result = "basic-foundry"}, + fast_replaceable_group = "foundry", + max_health = 350, + corpse = "foundry-remnants", + dying_explosion = "foundry-explosion", + -- circuit_wire_max_distance = assembling_machine_circuit_wire_max_distance, + -- circuit_connector = circuit_connector_definitions["foundry"], + collision_box = {{-2.2, -2.2}, {2.2, 2.2}}, + selection_box = {{-2.5, -2.5}, {2.5, 2.5}}, + heating_energy = "300kW", + damaged_trigger_effect = hit_effects.entity(), + drawing_box_vertical_extension = 1.3, + -- effect_receiver = { base_effect = { productivity = 0.5 }}, + -- module_slots = 4, + icon_draw_specification = {scale = 2, shift = {0, -0.3}}, + icons_positioning = + { + {inventory_index = defines.inventory.assembling_machine_modules, shift = {0, 1.25}} + }, + allowed_effects = {"consumption", "speed", "productivity", "pollution", "quality"}, + crafting_categories = {"basic-metallurgy"}, + crafting_speed = 4, + energy_source = + { + type = "burner", + fuel_inventory_size = 3, + usage_priority = "secondary-input", + smoke = { + { + name = "smoke", + frequency = 80, + position = {1.5, -2.3}, + starting_vertical_speed = 0.1, + starting_frame_deviation = 60, + } + } + }, + energy_usage = "5000kW", + perceived_performance = { minimum = 0.25, performance_to_activity_rate = 2.0, maximum = 20 }, + graphics_set = graphics_set, + open_sound = sounds.metal_large_open, + close_sound = sounds.metal_large_close, + working_sound = + { + sound = + { + filename = "__space-age__/sound/entity/foundry/foundry.ogg", volume = 0.5 + }, + --idle_sound = { filename = "__base__/sound/idle1.ogg", volume = 0.3 }, + fade_in_ticks = 4, + fade_out_ticks = 20, + sound_accents = + { + { sound = { filename = "__space-age__/sound/entity/foundry/foundry-pipe-out.ogg", volume = 0.9 }, frame = 2, audible_distance_modifier = 0.4 }, + { sound = { filename = "__space-age__/sound/entity/foundry/foundry-slide-close.ogg", volume = 0.65 }, frame = 18, audible_distance_modifier = 0.3 }, + { sound = { filename = "__space-age__/sound/entity/foundry/foundry-clamp.ogg", volume = 0.45 }, frame = 39, audible_distance_modifier = 0.3 }, + { sound = { filename = "__space-age__/sound/entity/foundry/foundry-slide-stop.ogg", volume = 0.7 }, frame = 43, audible_distance_modifier = 0.4 }, + { sound = { variations = sound_variations("__space-age__/sound/entity/foundry/foundry-fire-whoosh", 3, 0.8 )}, frame = 64, audible_distance_modifier = 0.3 }, + { sound = { filename = "__space-age__/sound/entity/foundry/foundry-metal-clunk.ogg", volume = 0.65 }, frame = 64, audible_distance_modifier = 0.4 }, + { sound = { filename = "__space-age__/sound/entity/foundry/foundry-slide-open.ogg", volume = 0.65 }, frame = 74, audible_distance_modifier = 0.3 }, + { sound = { filename = "__space-age__/sound/entity/foundry/foundry-pipe-in.ogg", volume = 0.75 }, frame = 106, audible_distance_modifier = 0.4 }, + { sound = { filename = "__space-age__/sound/entity/foundry/foundry-smoke-puff.ogg", volume = 0.8 }, frame = 106, audible_distance_modifier = 0.3 }, + { sound = { variations = sound_variations("__space-age__/sound/entity/foundry/foundry-pour", 2, 0.7 )}, frame = 110 }, + { sound = { filename = "__space-age__/sound/entity/foundry/foundry-rocks.ogg", volume = 0.65 }, frame = 120, audible_distance_modifier = 0.3 }, + { sound = { filename = "__space-age__/sound/entity/foundry/foundry-blade.ogg", volume = 0.7 }, frame = 126 }, + }, + audible_distance_modifier = 0.6, + max_sounds_per_type = 2 + }, + fluid_boxes_off_when_no_fluid_recipe = true, + water_reflection = + { + pictures = futil.sprite_load("__space-age__/graphics/entity/foundry/foundry-reflection", + { + scale = 5, + shift = {0,2} + }), + rotate = false + } + }, + { + type = "item", + name = "basic-foundry", + icons = {{ + icon = "__space-age__/graphics/icons/foundry.png", + tint = {.6, .8, .8}, + }}, + subgroup = "smelting-machine", + order = "d[foundry-basic]", + inventory_move_sound = item_sounds.steam_inventory_move, + pick_sound = item_sounds.steam_inventory_pickup, + drop_sound = item_sounds.steam_inventory_move, + place_result = "basic-foundry", + stack_size = 20, + weight = 500 * kg + }, + { + type = "recipe", + name = "basic-foundry", + category = "crafting", + enabled = false, + ingredients = + { + {type = "item", name = "zirconia", amount = 50}, + {type = "item", name = "steel-plate", amount = 50}, + {type = "item", name = "electronic-circuit", amount = 30}, + {type = "item", name = "concrete", amount = 20}, + }, + energy_required = 10, + results = {{type="item", name="basic-foundry", amount=1}} + }, + { + type = "recipe", + name = "steel-basic", -- another steel option + localised_name = {"item-name.steel-plate"}, + category = "basic-metallurgy", + order = "a[smelting]-c[steel-plate]-z", + enabled = false, + energy_required = 3.2, + ingredients = {util.item("iron-plate", 3), util.item("coal", 1)}, + results = {util.item("steel-plate", 1)}, + }, +}) +end +util.add_new_crafting_category("basic-metallurgy") +util.add_crafting_category("assembling-machine", "foundry", "basic-metallurgy") +util.add_unlock("advanced-material-processing-2", "steel-basic") +util.add_unlock("advanced-material-processing-2", "basic-foundry") +util.add_prerequisite("nuclear-power", "advanced-material-processing-2") +end diff --git a/changelog.txt b/changelog.txt index 325fd81..c53febd 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,25 @@ --------------------------------------------------------------------------------------------------- +Version: 2.0.2 +Date: 2025-01-14 + Fixes: + - Working with Asteroid Mining +--------------------------------------------------------------------------------------------------- +Version: 2.0.1 +Date: 2025-01-14 + Fixes: + - Basic foundry supports hot metals + - Prevent a mod load error, improve general mod compatibility +--------------------------------------------------------------------------------------------------- +Version: 2.0.0 +Date: 2025-01-13 + Changes: + - Compatible with 2.0 and Space Age + - New zircon item graphics, improved zircon entity graphics + - Zirconium smelting takes one more step than in 1.1, but has more forgiving ratios. + - Some recipe and tech tree reworks. Cermet no longer used in LDS. + - With Space Age, add an inefficient basic foundry for creating simple alloys on Nauvis. It cannnot craft advanced foundry recipes. + - Alternative production chains on Vulcanus and Gleba. Uses recyclers on Fulgora.... +--------------------------------------------------------------------------------------------------- Version: 0.7.3 Date: 2024-02-07 Fixes: diff --git a/compatibility/hot-metals.lua b/compatibility/hot-metals.lua new file mode 100644 index 0000000..761c6b4 --- /dev/null +++ b/compatibility/hot-metals.lua @@ -0,0 +1,17 @@ +local util = require("data-util"); + +util.add_hot_metals({ + {name="zirconium-plate", icons={ + { icon = "__bzzirconium__/graphics/icons/zirconium-plate.png", icon_size = 128}, + { icon = "__bzzirconium__/graphics/icons/zirconium-plate.png", icon_size = 128, tint={.9,.3,0, .5}}, + }}, + {name="zircaloy-4", icons={ + { icon = "__bzzirconium__/graphics/icons/zircaloy-4.png", icon_size = 128}, + { icon = "__bzzirconium__/graphics/icons/zircaloy-4.png", icon_size = 128, tint={.9,.3,0, .5}}, + }}, + +}) + +if HotMetals then + table.insert(HotMetals.craftingCategories, "basic-metallurgy") +end diff --git a/control-util.lua b/control-util.lua index d744561..ef04e99 100644 --- a/control-util.lua +++ b/control-util.lua @@ -147,8 +147,10 @@ function regenerate_ore(event) for w in event.parameters:gmatch("%S+") do table.insert(params, w) end if #params == 1 and params[1] == "all" then for _, resource in pairs(me.resources) do - game.print("Regenerating "..resource) - game.regenerate_entity(resource) + if prototypes.entity[resource] then + game.print("Regenerating "..resource) + game.regenerate_entity(resource) + end end return end diff --git a/data-final-fixes.lua b/data-final-fixes.lua index 439fbc2..bbc7040 100644 --- a/data-final-fixes.lua +++ b/data-final-fixes.lua @@ -16,3 +16,7 @@ for i, entity in pairs(data.raw.furnace) do end end end + +-- Make sure these don't exist, just in case +util.remove_raw("recipe", "stone-recycling") +util.remove_raw("recipe", "zircon-recycling") diff --git a/data-updates.lua b/data-updates.lua index 15f3083..5fba1fc 100644 --- a/data-updates.lua +++ b/data-updates.lua @@ -1,5 +1,6 @@ require("tech-updates") require("zirconium-recipe-updates") +require("zirconium-asteroid-updates") require("zircon-matter") require("map-gen-preset-updates") require("omni") @@ -10,10 +11,14 @@ require("compatibility/crafting-efficiency") local util = require("data-util"); -if mods.Asteroid_Mining then - require("__Asteroid_Mining__.scripts.addmodule") - if not data.raw.item["asteroid-zircon"] then - -- For Zirconium we only add if it's not already added by Asteroid_Mining - amfunc.addtype("zircon", {a = 0,r = 110, g = 40, b =70}) - end +if mods.Asteroid_Mining and not data.raw.item["asteroid-zircon"] then + util.addtype("zircon", {a = 0,r = 110, g = 40, b =70}) +end + +if mods["any-planet-start"] then + util.set_tech_recipe("zirconia-processing", { + {"automation-science-pack", 1}, + {"logistic-science-pack", 1}, + }) + util.set_prerequisite("zirconia-processing", {"logistic-science-pack"}) end diff --git a/data-util.lua b/data-util.lua index 788a86e..5f39a0d 100644 --- a/data-util.lua +++ b/data-util.lua @@ -2,6 +2,7 @@ -- This file will be overwritten in mod zipfiles, edit bzlib/data-util.lua -- WARNING WARNING WARNING +local futil = require("util") local me = require("me") local util = {} @@ -117,6 +118,15 @@ function util.contains(table, sought) return false end +-- copies a recipe, giving the copy a new name +function util.copy_recipe(recipe_name, new_recipe_name) + if data.raw.recipe[recipe_name] then + new_recipe = futil.table.deepcopy(data.raw.recipe[recipe_name]) + new_recipe.name = new_recipe_name + data:extend({new_recipe}) + end +end + -- Add the gleba rock. If it exists, still add resource to mine from it function util.add_gleba_rock(resource, amount_min, amount_max) if (not data.raw.planet.gleba or @@ -368,6 +378,30 @@ function util.use_fluid_mining_final() util.remove_raw("technology", "uranium-mining") end + +-- Add vacuum if it hasn't been added yet +function util.add_vacuum() + if not data.raw.fluid.vacuum then + data:extend({ + { + type = "fluid", + name = "vacuum", + icons = { util.vacuum_icon, }, + visualization_color = util.vacuum_vis, + subgroup = "fluid", + order = "d[vacuum]", + default_temperature = 1500, + max_temperature = 2000, + gas_temperature = 0, + heat_capacity = "0.01kJ", + base_color = {0.9, 0.9, 0.9}, + flow_color = {0.8, 0.8, 0.9}, + auto_barrel = false, + }, + }) + end +end + -- If Hot metals mod is enabled, mark these metals as hot function util.add_hot_metals(metals) if HotMetals and HotMetals.items then @@ -1093,9 +1127,6 @@ function multiply_recipe(recipe, multiple) else recipe.energy_required = 0.5 * multiple -- 0.5 is factorio default end - if recipe.result_count then - recipe.result_count = recipe.result_count * multiple - end if recipe.results then for i, result in pairs(recipe.results) do if result.name then @@ -1112,10 +1143,22 @@ function multiply_recipe(recipe, multiple) end end end - if not recipe.results and not recipe.result_count then - -- implicit one item result - recipe.result_count = multiple - end + multiply_ingredients(recipe, multiple) + end +end + +-- multiply the ingredient cost of a recipe +function util.multiply_ingredients(recipe_name, multiple, options) + if not should_force(options) and bypass(recipe_name) then return end + if data.raw.recipe[recipe_name] then + me.add_modified(recipe_name) + prepare_redo_recycling(recipe_name) + multiply_ingredients(data.raw.recipe[recipe_name], multiple) + end +end + +function multiply_ingredients(recipe, multiple) + if recipe then if recipe.ingredients then for i, ingredient in pairs(recipe.ingredients) do if ingredient.name then @@ -1276,6 +1319,13 @@ function add_time(recipe, amount) end end +-- Set localised name +function util.set_localised_name(recipe_name, localised_name) + if data.raw.recipe[recipe_name] then + data.raw.recipe[recipe_name].localised_name = localised_name + end +end + -- Set recipe category function util.set_category(recipe_name, category, options) if not should_force(options) and bypass(recipe_name) then return end @@ -1466,12 +1516,14 @@ function util.add_minable_result(t, name, result) if data.raw[t] and data.raw[t][name] and data.raw[t][name].minable then if data.raw[t][name].minable.result and not data.raw[t][name].minable.results then data.raw[t][name].minable.results = { - {data.raw[t][name].minable.result ,data.raw[t][name].minable.count}} + util.item(data.raw[t][name].minable.result ,data.raw[t][name].minable.count)} data.raw[t][name].minable.result = nil data.raw[t][name].minable.result_count = nil end if data.raw[t][name].minable.results then table.insert(data.raw[t][name].minable.results, result) + else + data.raw[t][name].minable.results = {result} end end end @@ -1717,4 +1769,245 @@ function prepare_redo_recycling(recipe_name) end +-- According to https://mods.factorio.com/mod/Asteroid_Mining, the +-- following function is under this MIT license (similar license, different author): +-- +-- Copyright (c) 2021 Silari +-- Permission is hereby granted, free of charge, to any person obtaining a copy of +-- this software and associated documentation files (the "Software"), to deal in +-- the Software without restriction, including without limitation the rights to +-- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +-- the Software, and to permit persons to whom the Software is furnished to do so, +-- subject to the following conditions: +-- +-- The above copyright notice and this permission notice shall be included in all +-- copies or substantial portions of the Software. +-- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +-- FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +-- COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +-- IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +-- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +function util.addtype(name,atint,desc) --,pictures) + require("__Asteroid_Mining__/scripts/icons.lua") -- Has generateicons function + + local allowprod = settings.startup["astmine-allowprod"].value + local useminer = settings.startup["astmine-enableminer"].value + local hiderec = not settings.startup["astmine-hiderecipes"].value + local recenabled = false + + local chunkstacksize = 1000 + if mods["space-exploration"] then + chunkstacksize = 200 + end + + --Adds given recipe to prod modules allowed list + function addmodules(name) + if useminer then -- Only add these if we're actually enabled. + table.insert(data.raw.module["productivity-module"].limitation, name) + table.insert(data.raw.module["productivity-module-2"].limitation, name) + table.insert(data.raw.module["productivity-module-3"].limitation, name) + end + end + + --Result for processing resource specific chunks + local normal = { -- Gives 4000 chunks on average + { + amount_min = 3, + amount_max = 5, + probability = 1 + } + } + local chunkamount = 1000 + + -- Space age makes rockets cost 1/20th as much. Give less materials, same ratio. + if mods["space-age"] then + chunkamount = 50 + end + + --ITEM: Miner-module, which is what we send into space to get the asteroid-mixed item + local minermodule = { + icon = "__Asteroid_Mining__/graphics/mining-sat.png", + icon_mipmaps = 4, + icon_size = 64, + name = "miner-module", + localised_name = {"item-name.miner-module", "Mixed"}, + localised_description = {"item-description.miner-module", "mixed"}, + order = "n[miner-module]", + rocket_launch_products = {{ + name="asteroid-mixed", + amount=chunkamount, + type="item" + }}, + send_to_orbit_mode = "automated", + stack_size = 1, + subgroup = subminer, + type = "item" + } + --Make a new item with the given name+"-chunk" and recipe to turn into name + --eg addtype('iron-ore') makes iron-ore-chunk and recipe for iron-ore-chunk->100 iron-ore + --log("Making new items for " .. name) + --ITEM Resource chunk for this item + + local suffix = "-chunk" + -- Sometimes we need to override the default suffix because the item name already exists. + -- TODO - change this so it automatically detects name-chunk item exists and change suffix - BUT + -- that would cause issues if 'name' is in more than one module - eg angels/bobs overlap, bob+bzlead, etc. + -- Maybe add in something that tracks what 'name's have been added and skip it if it has. + if string.find(name,"angels-ore",1,true) then + suffix = "-chunk-am" + end + --log(name .. " name:suffix " .. suffix) + + local reschunk = { + icons = { + { + icon = "__Asteroid_Mining__/graphics/resource-chunk.png", + icon_mipmaps = 4, + icon_size = 64 + }, + { + icon = "__Asteroid_Mining__/graphics/resource-chunk-mask.png", + icon_mipmaps = 4, + icon_size = 64, + tint = atint + } + }, + name = name .. suffix, + localised_name = {"item-name.resource-chunk", {"item-name." .. name}}, + localised_description = {"item-description.resource-chunk", {"item-name." .. name}}, + order = "d[asteroidchunk-" .. name .. "]", + stack_size = 25, + subgroup = subchunk, + type = "item" + } + + --RECIPE Turn resource chunk into 24 of item + local procreschunk = { + allow_decomposition = false, + always_show_products = true, + category = reccategory, + enabled = hiderec, + energy_required = 5, + ingredients = { + { + name=name .. suffix, + amount=1, + type="item" + } + }, + name = name .. suffix, + order = "d[asteroidchunk-" .. name .. "]", + localised_name = {"recipe-name.resource-chunk", {"item-name." .. name}}, + localised_description = {"recipe-description.resource-chunk", {"item-name." .. name}}, + results = {{name=name,amount=24,type="item"}}, + type = "recipe" + } + if desc == nil then + desc = "" + end + + --ITEM Resource specific asteroid chunk. + local newasteroid = { + icons = { + { + icon = "__Asteroid_Mining__/graphics/asteroid-chunk.png", + icon_mipmaps = 4, + icon_size = 64 + }, + { + icon = "__Asteroid_Mining__/graphics/asteroid-chunk-mask.png", + icon_mipmaps = 4, + icon_size = 64, + tint = atint + } + }, + name = "asteroid-" .. name, + localised_name = {"item-name.asteroid-chunk", {"item-name." .. name}}, + localised_description = {"item-description.asteroid-chunk", {"item-name." .. name}, desc}, + order = "k[zasteroid-" .. name .. "]", + stack_size = chunkstacksize, + subgroup = subchunk, + type = "item" + } + --log(serpent.block(newasteroid)) + --We need to set the result name to the name of our resource chunk + mynormal = table.deepcopy(normal) + mynormal[1].name = name .. suffix + mynormal[1].type = "item" + --Expensive mode is gone. + --myexpensive = table.deepcopy(expensive) + --myexpensive[1].name = name .. suffix + + --RECIPE: Processing the asteroid chunks into resource chunks + local processasteroid = { + allow_decomposition = false, + category = reccategory, + name = "asteroid-" .. name, + localised_name = {"recipe-name.asteroid-chunk", {"item-name." .. name}}, + localised_description = {"recipe-description.asteroid-chunk", {"item-name." .. name}}, + order = "k[zasteroid-" .. name .. "]", + ingredients = {{name="asteroid-" .. name,amount=1,type="item"}}, + results = mynormal, + always_show_products = true, + enabled = hiderec, + energy_required = 10, + --subgroup = subchunk, + type = "recipe" + } + + --ITEM Miner module to get resource specific asteroids. + local minerres = table.deepcopy(minermodule) + minerres.name = "miner-module-" .. name + minerres.rocket_launch_products = {{ + name="asteroid-" .. name, + amount=chunkamount, + type="item" + }} + minerres.order = "n[miner-module" .. name .. "]" + minerres.icons = generateicons(name,atint) --Generate icon layers using given item + minerres.localised_name = {"item-name.miner-module", {"item-name." .. name}} + minerres.localised_description = {"item-description.miner-module", {"item-name." .. name}} + + --RECIPE: Recipe to make miner module to get resource specific asteroids. Always the default category + local newminer = { + enabled = recenabled, + ingredients = { + { + name="electric-mining-drill", + amount=5, + type="item" + }, + { + name="radar", + amount=5, + type="item" + }, + { + name=name, + amount=5, + type="item" + } + }, + name = "miner-module-" .. name, + results = {{name="miner-module-" .. name,amount=1,type="item"}}, + type = "recipe" + } + data:extend{reschunk,procreschunk,newasteroid,processasteroid} + if useminer then -- Disabled in 1.0 for the new generation system, once in place. + data:extend{minerres,newminer} + --This makes the miner module available when rocket silo is researched + table.insert(data.raw.technology["rocket-silo"].effects, {type = "unlock-recipe", recipe = "miner-module-" .. name}) + if not hiderec then + table.insert(data.raw.technology["rocket-silo"].effects, {type = "unlock-recipe", recipe = "asteroid-" .. name}) + table.insert(data.raw.technology["rocket-silo"].effects, {type = "unlock-recipe", recipe = name .. suffix}) + end + end + if allowprod then -- Setting to enable prod module usage in asteroid processing + addmodules(processasteroid.name) + end +end +-- END of alternate licenscing + return util diff --git a/data.lua b/data.lua index b1674ca..22ed834 100644 --- a/data.lua +++ b/data.lua @@ -4,4 +4,5 @@ require("zirconium-recipe") require("magazine") require("zirconium-enriched") -- Enriched for Krastorio 2 require("zirconium-recipe-se") -- Space Exploration special recipes (depends on K2 if present) +require("compatibility.hot-metals") -- require("zirconium-compressed") diff --git a/graphics/entity/ores/hr-zircon.png b/graphics/entity/ores/hr-zircon.png index 27579a9..72c65f7 100644 Binary files a/graphics/entity/ores/hr-zircon.png and b/graphics/entity/ores/hr-zircon.png differ diff --git a/graphics/entity/ores/hr-zircon.xcf b/graphics/entity/ores/hr-zircon.xcf index 75c42f7..3e311f3 100644 Binary files a/graphics/entity/ores/hr-zircon.xcf and b/graphics/entity/ores/hr-zircon.xcf differ diff --git a/graphics/icons/zircon-1.png b/graphics/icons/zircon-1.png new file mode 100644 index 0000000..b474343 Binary files /dev/null and b/graphics/icons/zircon-1.png differ diff --git a/graphics/icons/zircon-2.png b/graphics/icons/zircon-2.png index 19dd7cc..e3f6419 100644 Binary files a/graphics/icons/zircon-2.png and b/graphics/icons/zircon-2.png differ diff --git a/graphics/icons/zircon-2.xcf b/graphics/icons/zircon-2.xcf deleted file mode 100644 index 576ad8e..0000000 Binary files a/graphics/icons/zircon-2.xcf and /dev/null differ diff --git a/graphics/icons/zircon-3.png b/graphics/icons/zircon-3.png index 1e542fd..4567ae6 100644 Binary files a/graphics/icons/zircon-3.png and b/graphics/icons/zircon-3.png differ diff --git a/graphics/icons/zircon-3.xcf b/graphics/icons/zircon-3.xcf deleted file mode 100644 index 7464e55..0000000 Binary files a/graphics/icons/zircon-3.xcf and /dev/null differ diff --git a/graphics/icons/zircon-4.png b/graphics/icons/zircon-4.png index 152fc55..547eaa5 100644 Binary files a/graphics/icons/zircon-4.png and b/graphics/icons/zircon-4.png differ diff --git a/graphics/icons/zircon-4.xcf b/graphics/icons/zircon-4.xcf deleted file mode 100644 index 8a7388c..0000000 Binary files a/graphics/icons/zircon-4.xcf and /dev/null differ diff --git a/graphics/icons/zircon.png b/graphics/icons/zircon.png index b1e423d..fd688fe 100644 Binary files a/graphics/icons/zircon.png and b/graphics/icons/zircon.png differ diff --git a/graphics/icons/zircon.xcf b/graphics/icons/zircon.xcf deleted file mode 100644 index f5cd511..0000000 Binary files a/graphics/icons/zircon.xcf and /dev/null differ diff --git a/graphics/icons/zirconium-sponge-1.png b/graphics/icons/zirconium-sponge-1.png new file mode 100644 index 0000000..5997a3c Binary files /dev/null and b/graphics/icons/zirconium-sponge-1.png differ diff --git a/graphics/icons/zirconium-sponge-1.xcf b/graphics/icons/zirconium-sponge-1.xcf new file mode 100644 index 0000000..bf69f1b Binary files /dev/null and b/graphics/icons/zirconium-sponge-1.xcf differ diff --git a/graphics/icons/zirconium-sponge-2.png b/graphics/icons/zirconium-sponge-2.png new file mode 100644 index 0000000..4688550 Binary files /dev/null and b/graphics/icons/zirconium-sponge-2.png differ diff --git a/graphics/icons/zirconium-sponge-2.xcf b/graphics/icons/zirconium-sponge-2.xcf new file mode 100644 index 0000000..0454c47 Binary files /dev/null and b/graphics/icons/zirconium-sponge-2.xcf differ diff --git a/graphics/icons/zirconium-sponge.png b/graphics/icons/zirconium-sponge.png new file mode 100644 index 0000000..ca19812 Binary files /dev/null and b/graphics/icons/zirconium-sponge.png differ diff --git a/graphics/icons/zirconium-sponge.xcf b/graphics/icons/zirconium-sponge.xcf new file mode 100644 index 0000000..fe85865 Binary files /dev/null and b/graphics/icons/zirconium-sponge.xcf differ diff --git a/info.json b/info.json index ccd469f..558e0ae 100644 --- a/info.json +++ b/info.json @@ -1,6 +1,6 @@ { "name": "bzzirconium", - "version": "2.0.0", + "version": "2.0.2", "factorio_version": "2.0", "title": "Zirconium", "author": "Brevven", @@ -20,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 Space Age and more. A standalone piece of BZ Mods." + "description": "Adds zircon, zirconia, zirconium, and more to the base game.\n\nCompatible with Space Age and many other mods. A standalone piece of BZ Mods." } diff --git a/locale/en/zirconium.cfg b/locale/en/zirconium.cfg index b932f66..6d37de6 100644 --- a/locale/en/zirconium.cfg +++ b/locale/en/zirconium.cfg @@ -1,5 +1,6 @@ [entity-name] zircon=Zircon +basic-foundry=Basic foundry [autoplace-control-names] zircon=[item=zircon] Zircon @@ -10,6 +11,7 @@ zirconium-dust=Zircon dust zirconia=Zirconia zirconium-plate=Zirconium plate zirconium-ingot=Zirconium Ingot +zirconium-sponge=Zirconium sponge enriched-zircon=Enriched zircon compressed-zircon=Compressed zircon cermet=Cermet @@ -18,6 +20,7 @@ zircaloy-4=Zircaloy 4 explosive-rounds-magazine=Explosive rounds magazine explosive-rounds-rifle-magazine=Explosive rounds rifle magazine explosive-rounds-anti-material-rifle-magazine=Explosive rounds anti-materiel rifle magazine +basic-foundry=Basic foundry [item-description] zircon=Can be smelted into zirconia @@ -26,12 +29,15 @@ enriched-zircon=Can be efficiently smelted into zirconia. enriched-zirconia=Can be efficiently smelted into zirconium plates. cermet=Advanced ceramic/metal composites. zirconium-tungstate=A material with interesting thermal properties. +basic-foundry=A burner foundry with limited use. Where could we find better materals to make a better one? [fluid-name] molten-zirconium=Molten zirconium +vacuum=Vacuum [technology-name] zirconia-processing=Zirconia processing +zirconium-processing=Zirconium processing cermet=Cermet enriched-zircon=Enriched zircon enriched-zirconia=Enriched zirconia @@ -51,12 +57,15 @@ zirconium-plate=__ITEM__zirconium-plate__ smelt-compressed-zircon=__ITEM__zirconia__ zircon-dust=__ITEM__zircon-dust__ dirty-water-filtration-zircon=Filter dirty water [item=zircon] +zircon-synthesis=Zircon synthesis +zirconium-gettering=Zirconium gettering [recipe-description] +zircon-synthesis=Use Gleban biological processes to synthesize zircon from purer materials. enriched-zircon=Enrich zircon, purifying with sulfuric-acid [fluid=sulfuric-acid] and water [fluid=water], improving the final yield. Produce dirty water [fluid=dirty-water] as a byproduct. enriched-zirconia=Further enrich zirconia, purifying with hydrogen chloride [fluid=hydrogen-chloride] and water [fluid=water], improving the final yield. Produce dirty water [fluid=dirty-water] as a byproduct. - dirty-water-filtration-zircon=Filter dirty water, giving zircon [item=zircon] and stone [item=stone] (probabilistically). +zirconia-from-egg=Pentapod carapace seems to be made primarily of zirconia, and starts developing in the egg. # Settings [mod-setting-name] @@ -74,6 +83,3 @@ bzzirconium-enable-intermediates=Enable cermet, an advanced intermediate made fr bzzirconium-enable-sorting=Enable "sorting" recipes to convert between zircon and stone. This is no longer as useful for burner phase as it used to be, but left as an option for certain map layouts or existing factories. bzzirconium-early=If [color=green]enabled[/color], zircon is required in small quantities early in the game.\nIf [color=orange]disabled[/color], zircon is not required until after logistic science. bzzirconium-ammo=If enabled, adds a new explosive ammunition magazine. -[string-mod-setting] -bzzirconium-enable-intermediates-lds=Yes, and __ITEM__cermet__ in __ITEM__low-density-structure__ -bzzirconium-enable-intermediates-yes=Yes, but not in __ITEM__low-density-structure__ diff --git a/locale/ja/zirconium.cfg b/locale/ja/zirconium.cfg index 5e24f77..db5fd04 100644 --- a/locale/ja/zirconium.cfg +++ b/locale/ja/zirconium.cfg @@ -74,7 +74,3 @@ bzzirconium-enable-intermediates=セラミックと金属から作られる先 bzzirconium-enable-sorting=ジルコンと石の「選別」レシピを有効にします。燃焼式の時代において以前ほど有用ではなくなりましたが、特定のマップレイアウトや既存の工場のためにオプションとして残してあります。 bzzirconium-early=[color=green]有効[/color]にした場合, ゲーム序盤で小量のジルコンが必要となります。\n[color=orange]無効[/color]にした場合、必要となるのは物流サイエンスパック以降になります。 bzzirconium-ammo=有効にした場合、新たに炸裂弾倉が追加されます。 -[string-mod-setting] -bzzirconium-enable-intermediates-lds=はい: __ITEM__low-density-structure__ にも __ITEM__cermet__ を使用する。 -bzzirconium-enable-intermediates-yes=はい: ただし __ITEM__low-density-structure__ には使用しない。 -bzzirconium-enable-intermediates-no=いいえ diff --git a/locale/ko/zirconium.cfg b/locale/ko/zirconium.cfg index b5fbdb6..981ca0f 100644 --- a/locale/ko/zirconium.cfg +++ b/locale/ko/zirconium.cfg @@ -59,6 +59,3 @@ bzzirconium-enable-sorting=돌 분류 사용 bzzirconium-recipe-bypass=이러한 제작법 수정을 건너뜁니다(콤마로 구분된 목록). bzzirconium-enable-intermediates=세라믹과 금속으로 만든 고급 중간체인 서멧을 활성화합니다. bzzirconium-enable-sorting=지르콘과 돌 사이를 전환하기 위해 "비슷한" 제작법을 활성화합니다. 이 기능은 더 이상 화력 단계에 유용하지 않지만 특정 지도 레이아웃이나 기존 공장에 대한 옵션으로 남아 있습니다. -[string-mod-setting] -bzzirconium-enable-intermediates-lds=예, 그리고 __ITEM__low-density-structure__에 __ITEM__cermet__ -bzzirconium-enable-intermediates-yes=예, 하지만 __ITEM__low-density-structure__에 없음. diff --git a/locale/ru/zirconium.cfg b/locale/ru/zirconium.cfg index a2b07c2..a176677 100644 --- a/locale/ru/zirconium.cfg +++ b/locale/ru/zirconium.cfg @@ -66,6 +66,3 @@ bzzirconium-recipe-bypass=Пропустить изменение этих ре bzzirconium-byproduct=Если включено и используется мод Titanium, производство диоксида циркония будет давать титан в качестве побочного продукта. bzzirconium-enable-intermediates=Включает металлокерамику, продвинутый промежуточный продукт, изготовленный из керамики и металлов. bzzirconium-enable-sorting=Включите рецепты "сортировки" для преобразования между цирконом и камнем. Это уже не так полезно для фазы сгорания, как раньше, но оставлено как опция для определенных макетов карт или существующих фабрик. -[string-mod-setting] -bzzirconium-enable-intermediates-lds=Да, и __ITEM__cermet__ в __ITEM__low-density-structure__ -bzzirconium-enable-intermediates-yes=Да, но не в __ITEM__low-density-structure__ diff --git a/locale/zh-CN/zirconium.cfg b/locale/zh-CN/zirconium.cfg index 13509b8..b198a32 100644 --- a/locale/zh-CN/zirconium.cfg +++ b/locale/zh-CN/zirconium.cfg @@ -65,10 +65,6 @@ bzzirconium-recipe-bypass=跳过修改这些合成(用逗号分开)。 bzzirconium-byproduct=如果启用且和BZ-钛游玩时,氧化锆产线将会产出钛矿为副产品。 bzzirconium-enable-intermediates=启用金属陶瓷,一种由陶瓷和金属制作而成的中间产品。 bzzirconium-enable-sorting=启用分拣配方,用于转换锆矿和石矿。此变动不在像以前一样在热能阶段有用,但可以作为一个选项方便布局。 -[string-mod-setting] -bzzirconium-enable-intermediates-lds=启用:加进轻质框架 -bzzirconium-enable-intermediates-yes=启用:不加进轻质框架 -bzzirconium-enable-intermediates-no=不启用 [mod-name] -bzzirconium=BZ-锆 \ No newline at end of file +bzzirconium=BZ-锆 diff --git a/me.lua b/me.lua index 7051aca..c8588b9 100644 --- a/me.lua +++ b/me.lua @@ -18,18 +18,14 @@ function me.early() end function me.ammo() - return me.get_setting("bzzirconium-ammo") + return true + -- return me.get_setting("bzzirconium-ammo") end function me.use_cermet() if me.get_setting("bz-all-intermediates") then return true end - return me.get_setting("bzzirconium-enable-intermediates") == "yes" or me.cermet_lds() -end - -function me.cermet_lds() - if me.get_setting("bz-all-intermediates") then return true end - return me.get_setting("bzzirconium-enable-intermediates") == "lds" + return me.get_setting("bzzirconium-enable-intermediates") == "yes" end function me.enable_sorting() diff --git a/settings.lua b/settings.lua index 46fb122..383c640 100644 --- a/settings.lua +++ b/settings.lua @@ -18,8 +18,8 @@ data:extend({ type = "string-setting", name = "bzzirconium-enable-intermediates", setting_type = "startup", - default_value = "lds", - allowed_values = {"lds", "yes", "no"}, + default_value = "no", + allowed_values = {"yes", "no"}, order = "b-a-a", }, { @@ -29,18 +29,19 @@ data:extend({ default_value = true, order = "c-a-a", }, - { - type = "bool-setting", - name = "bzzirconium-ammo", - setting_type = "startup", - default_value = true, - order = "d-a-a", - }, +-- { +-- type = "bool-setting", +-- name = "bzzirconium-ammo", +-- setting_type = "startup", +-- default_value = true, +-- order = "d-a-a", +-- }, + not mods.quality and { type = "bool-setting", name = "bzzirconium-enable-sorting", setting_type = "startup", default_value = false, order = "m-a-a", - }, + } or nil, }) diff --git a/tech-updates.lua b/tech-updates.lua index bde8a23..5f27a10 100644 --- a/tech-updates.lua +++ b/tech-updates.lua @@ -1,9 +1,10 @@ local util = require("__bzzirconium__.data-util"); -util.add_prerequisite("advanced-material-processing-2", "zirconia-processing") +util.add_prerequisite("advanced-material-processing", "zirconia-processing") util.add_prerequisite("low-density-structure", "zirconia-processing") -util.add_prerequisite("nuclear-power", "zirconia-processing") -util.add_prerequisite("explosives", "zirconia-processing") +util.set_prerequisite("explosives", {"zirconium-processing"}) +util.add_prerequisite("military-3", "zirconium-processing") +util.add_prerequisite("nuclear-power", "zirconium-processing") -- Nixie tubes util.add_prerequisite("cathodes", "zirconia-processing") diff --git a/zircon-rocks.lua b/zircon-rocks.lua index f40f9bc..d3272ec 100644 --- a/zircon-rocks.lua +++ b/zircon-rocks.lua @@ -1,21 +1,31 @@ local util = require("data-util"); + -- Add zircon to rocks -local min = 9 -local max = 11 -if mods["alien-biomes"] then - min = 5 - max = 7 +local min = 1 +local max = 5 +if util.me.early() then + min = 7 + max = 15 end for _, e in pairs(data.raw["simple-entity"]) do - if (e.subgroup == "grass" or e.subgroup == "wrecks") and e.name:match("rock%-") then + if (e.subgroup == "grass" or e.subgroup == "wrecks") and e.name:match("rock") then local adjusted_max = e.name:match("huge") and max * 2 or max local adjusted_min = e.name:match("huge") and min * 2 or min - util.add_minable_result("simple-entity", e.name, {name="zircon", amount_min=adjusted_min, amount_max=adjusted_max}) + util.add_minable_result("simple-entity", e.name, {type="item", name="zircon", amount_min=adjusted_min, amount_max=adjusted_max}) end end --- Add zircon to poppable rock recipes +-- Add zirconia to stomper shells +min = 1 +max = 10 +for _, e in pairs(data.raw["simple-entity"]) do + if (e.subgroup == "grass") and e.name:match("shell") then + util.add_minable_result("simple-entity", e.name, {type="item", name="zirconia", amount_min=min, amount_max=max}) + end +end + +-- Add zircon to ploppable rock recipes -- K2 util.add_ingredient("rock-big", "zircon", 15) @@ -25,3 +35,6 @@ util.add_ingredient("rock-huge", "zircon", 30) util.add_ingredient("dect-base-rock-big", "zircon", 15) util.add_ingredient("dect-base-sand-rock-big", "zircon", 15) util.add_ingredient("dect-base-rock-huge", "zircon", 30) + +-- Do this last so we don't further modify it with the above +util.add_gleba_rock("zircon") diff --git a/zircon.lua b/zircon.lua index 2cea5e6..0c8449d 100644 --- a/zircon.lua +++ b/zircon.lua @@ -22,12 +22,12 @@ data:extend({ }, { type = "resource", - icon_size = 64, icon_mipmaps = 3, name = "zircon", icon = "__bzzirconium__/graphics/icons/zircon.png", + icon_size = 128, flags = {"placeable-neutral"}, order="a-b-a", - map_color = {r=0.90, g=0.70, b=0.70}, + map_color = {235, 141, 172}, tree_removal_probability = 0.7, tree_removal_max_distance = 32 * 32, minable = @@ -66,16 +66,18 @@ data:extend({ { type = "item", name = "zircon", - icon_size = 64, icon_mipmaps = 3, + icon_size = 128, icon = "__bzzirconium__/graphics/icons/zircon.png", pictures = { - {filename="__bzzirconium__/graphics/icons/zircon.png", size=64, scale=0.25}, - {filename="__bzzirconium__/graphics/icons/zircon-2.png", size=64, scale=0.25}, - {filename="__bzzirconium__/graphics/icons/zircon-3.png", size=64, scale=0.25}, - {filename="__bzzirconium__/graphics/icons/zircon-4.png", size=64, scale=0.25}, + {filename="__bzzirconium__/graphics/icons/zircon.png", size=128, scale=0.25}, + {filename="__bzzirconium__/graphics/icons/zircon-1.png", size=128, scale=0.25}, + {filename="__bzzirconium__/graphics/icons/zircon-2.png", size=128, scale=0.25}, + {filename="__bzzirconium__/graphics/icons/zircon-3.png", size=128, scale=0.25}, + {filename="__bzzirconium__/graphics/icons/zircon-4.png", size=128, scale=0.25}, }, subgroup = "raw-resource", order = "t-c-a", + weight = 1*kg, stack_size = util.get_stack_size(50) }, }) diff --git a/zirconium-asteroid-updates.lua b/zirconium-asteroid-updates.lua new file mode 100644 index 0000000..91af9e1 --- /dev/null +++ b/zirconium-asteroid-updates.lua @@ -0,0 +1,38 @@ +local util = require("data-util"); + +if mods["space-age"] then + -- Due to explosives changes, we have to make some changes to asteroid processing. + -- + data:extend({ + { + type = "recipe", + name = "advanced-oxide-asteroid-crushing-zirc", + localised_name = {"", {"recipe-name.advanced-oxide-asteroid-crushing"},": ", {"item-name.zirconia"}}, + icons = + { + {icon="__space-age__/graphics/icons/advanced-oxide-asteroid-crushing.png", icon_size=64}, + {icon="__bzzirconium__/graphics/icons/zirconia.png", icon_size=128, scale=0.1875, shift={0,8}}, + }, + category = "crushing", + subgroup="space-crushing", + order = "f[advanced-oxide-asteroid-crushing]-z[zirconia]", + auto_recycle = false, + enabled = false, + ingredients = + { + {type = "item", name = "oxide-asteroid-chunk", amount = 1} + }, + energy_required = 5, + results = + { + {type = "item", name = "ice", amount = 1}, + {type = "item", name = "calcite", amount = 1}, + {type = "item", name = "zirconia", amount = 3}, + {type = "item", name = "oxide-asteroid-chunk", amount = 1, probability = 0.05} + }, + allow_productivity = true, + allow_decomposition = false + }, + }) + util.add_unlock("advanced-asteroid-processing", "advanced-oxide-asteroid-crushing-zirc") +end diff --git a/zirconium-recipe-final-stacking.lua b/zirconium-recipe-final-stacking.lua index eeda7ea..7f6a745 100644 --- a/zirconium-recipe-final-stacking.lua +++ b/zirconium-recipe-final-stacking.lua @@ -2,7 +2,7 @@ local util = require("__bzzirconium__.data-util"); -if deadlock then +if deadlock and deadlock["add_stack"] then deadlock.add_stack("zircon", "__bzzirconium__/graphics/icons/stacked/zircon-stacked.png", "deadlock-stacking-1", 64) deadlock.add_stack("zirconia", "__bzzirconium__/graphics/icons/stacked/zirconia-stacked.png", "deadlock-stacking-2", 128) deadlock.add_stack("zirconium-plate", "__bzzirconium__/graphics/icons/stacked/zirconium-plate-stacked.png" , "deadlock-stacking-2", 128) diff --git a/zirconium-recipe-updates-lds.lua b/zirconium-recipe-updates-lds.lua index b4bd27d..0716c0e 100644 --- a/zirconium-recipe-updates-lds.lua +++ b/zirconium-recipe-updates-lds.lua @@ -1,37 +1,11 @@ local util = require("data-util"); -if util.me.cermet_lds() then - util.add_prerequisite("low-density-structure", "cermet") - - if mods.Krastorio2 then - util.add_ingredient("low-density-structure", "cermet", 5) - else - util.add_ingredient("low-density-structure", "cermet", 10) - end - - if mods.bztitanium then - util.remove_ingredient("low-density-structure", "copper-plate") - elseif mods.bzaluminum then - -- do nothing, aluminum already added alloy - elseif mods.Krastorio2 then - util.set_ingredient("low-density-structure", "copper-plate", 5) - else - util.set_ingredient("low-density-structure", "copper-plate", 10) - end - - util.remove_ingredient("low-density-structure", "steel-plate") +if mods.Krastorio2 then + util.replace_some_ingredient("low-density-structure", "copper-plate", 5, "zirconia", 5) else - if mods.Krastorio2 then - util.replace_some_ingredient("low-density-structure", "copper-plate", 5, "zirconia", 5) - else - util.replace_some_ingredient("low-density-structure", "copper-plate", 10, "zirconia", 10) - end + util.replace_some_ingredient("low-density-structure", "copper-plate", 10, "zirconia", 10) end if mods["space-exploration"] then - if util.me.cermet_lds() then - util.replace_some_ingredient("se-aeroframe-scaffold", "se-aeroframe-pole", 1, "cermet", 2) - else - util.replace_some_ingredient("se-aeroframe-scaffold", "se-aeroframe-pole", 1, "zirconia", 2) - end + util.replace_some_ingredient("se-aeroframe-scaffold", "se-aeroframe-pole", 1, "zirconia", 2) end diff --git a/zirconium-recipe-updates.lua b/zirconium-recipe-updates.lua index 32f4f64..e0d5123 100644 --- a/zirconium-recipe-updates.lua +++ b/zirconium-recipe-updates.lua @@ -7,15 +7,33 @@ if mods.bzfoundry and data.raw.item["foundry"] then util.set_to_founding("zircaloy-4") end +if mods["space-age"] then + util.add_ingredient("foundry", "zirconia", 20) +end + +-- space age +util.replace_ingredient("metallurgic-science-pack", "tungsten-plate", "zirconium-tungstate") +util.add_ingredient("cryogenic-plant", "zirconium-tungstate", 20) + +if mods["space-age"] and mods.bztin then + util.copy_recipe("bronze-plate", "bronze-plate-basic") + util.set_category("bronze-plate-basic", "basic-metallurgy") + util.set_localised_name("bronze-plate-basic", {"item-name.bronze-plate"}) + util.add_unlock("advanced-material-processing-2", "bronze-plate-basic") + util.multiply_ingredients("bronze-plate", 2) +end + if util.me.early() then util.replace_some_ingredient("stone-furnace", "stone", 1, "zircon", 1) end if not mods["Krastorio2"] then - if util.me.early() then - util.replace_some_ingredient("steel-furnace", "stone-brick", 4, "zircon", 6) + util.replace_some_ingredient("steel-furnace", "stone-brick", 4, "zirconia", 6) + if mods.bzsilicon then -- this uses enough stone, we can just replace + util.replace_ingredient("electric-furnace", "stone-brick", "zirconia") + else + util.replace_some_ingredient("electric-furnace", "stone-brick", 5, "zirconia", 5) end - util.replace_some_ingredient("electric-furnace", "stone-brick", 5, "zirconia", 5) end util.replace_ingredient("concrete", "iron-ore", "zircon") @@ -23,8 +41,11 @@ if mods["aai-industry"] then util.add_ingredient("concrete", "zircon", 1) end -util.multiply_recipe("explosives", 2) +-- Zirconium in explosives util.add_ingredient("explosives", "zirconium-plate", 1) +util.set_recipe_time("explosives", 6) +util.set_product_amount("explosives", "explosives", 3) + util.add_ingredient("nuclear-reactor", nuclear_z, 100) local ufc_amt = mods["Krastorio2"] and 1 or 5 @@ -44,8 +65,10 @@ if util.me.use_cermet() then util.add_ingredient("rocket-control-unit", "cermet", 1) util.add_ingredient("speed-module-3", "cermet", 1) util.add_ingredient("productivity-module-3", "cermet", 1) - util.add_ingredient("effectivity-module-3", "cermet", 1) + util.add_ingredient("efficiency-module-3", "cermet", 1) + util.add_ingredient("quality-module-3", "cermet", 1) util.add_ingredient("beacon", "cermet", 10) + util.add_ingredient("electromagnetic-plant", "cermet", 50) util.add_ingredient("spidertron", "cermet", 8) if not util.fe_plus("Machines") then util.add_ingredient("assembling-machine-3", "cermet", 2) @@ -184,6 +207,18 @@ util.add_ingredient("rfp-particle-decelerator", "zirconium-plate", 1000) util.replace_some_ingredient("rfp-matter-antimatter-fuel-cell-empty", "steel-plate", 10, nuclear_z, 10) +-- Transplutonic +util.add_ingredient("pu238-fuel", nuclear_z, 5) +util.add_ingredient("np237-fuel", nuclear_z, 5) +util.add_ingredient("plutonium-mix-fuel", nuclear_z, 5) +util.add_ingredient("neptunium-mix-fuel", nuclear_z, 5) +util.add_ingredient("uranium-mix-fuel", nuclear_z, 5) +util.add_ingredient("plutonium-inv-dead", nuclear_z, 5) +util.add_ingredient("neptunium-inv-dead", nuclear_z, 5) +util.add_ingredient("uranium-inv-dead", nuclear_z, 5) +util.add_ingredient("castorempty", nuclear_z, 50) +util.add_ingredient("breeder-reactor", nuclear_z, 250) +util.add_ingredient("particle-accelerator", nuclear_z, 250) diff --git a/zirconium-recipe.lua b/zirconium-recipe.lua index c531f3c..1583f6e 100644 --- a/zirconium-recipe.lua +++ b/zirconium-recipe.lua @@ -14,6 +14,7 @@ data:extend({ icon_size = 128, subgroup = "raw-material", order = "z[zirconia]", + weight = 1*kg, stack_size = util.get_stack_size(200) }, { @@ -21,46 +22,73 @@ data:extend({ name = "zirconia", subgroup = "raw-material", category = "smelting", + allow_productivity = true, order = "z[zirconia]", icons = (mods["Krastorio2"] and { { icon = "__bzzirconium__/graphics/icons/zirconia.png", icon_size = 128 }, - { icon = "__bzzirconium__/graphics/icons/zircon.png", icon_size = 64, scale=0.25, shift= {-8, -8}}, + { icon = "__bzzirconium__/graphics/icons/zircon.png", icon_size = 128, scale=0.25, shift= {-8, -8}}, } or { { icon = "__bzzirconium__/graphics/icons/zirconia.png", icon_size = 128, }, } ), - normal = (mods["Krastorio2"] and - { - main_product = "zirconia", - enabled = false, - energy_required = 8, - 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 {util.item("zirconia", 5)} - } or - { - main_product = "zirconia", - enabled = false, - energy_required = 3.2, - 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 {util.item("zirconia", 2)} - }), - expensive = - { - main_product = "zirconia", - enabled = false, - energy_required = 3.2, - ingredients = {util.item("zircon", 1)}, - results = mods.bztitanium and util.me.byproduct() and { - util.item("zirconia", 1), {name="titanium-ore", amount=1, probability=.05} - } or {util.item("zirconia", 2)} - } + -- (mods["Krastorio2"] and + -- { + -- main_product = "zirconia", + -- enabled = false, + -- energy_required = 8, + -- 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 {util.item("zirconia", 5)} + -- } or + main_product = "zirconia", + enabled = false, + energy_required = 6.4, + ingredients = {util.item("zircon", 1)}, + results = mods.bztitanium and util.me.byproduct() and { + {type="item", name="zirconia", amount=2, probability=.95}, + {type="item", name="titanium-ore", amount=1, probability=.1} + } or {util.item("zirconia", 2)} + -- expensive = + -- { + -- main_product = "zirconia", + -- enabled = false, + -- energy_required = 3.2, + -- ingredients = {util.item("zircon", 1)}, + -- results = mods.bztitanium and util.me.byproduct() and { + -- util.item("zirconia", 1), {name="titanium-ore", amount=1, probability=.05} + -- } or {util.item("zirconia", 2)} + -- } + }, + { + type = "item", + name = "zirconium-sponge", + icon = "__bzzirconium__/graphics/icons/zirconium-sponge.png", + icon_size = 128, + pictures = { + {filename = "__bzzirconium__/graphics/icons/zirconium-sponge.png", size=128, scale=0.25}, + {filename = "__bzzirconium__/graphics/icons/zirconium-sponge-1.png", size=128, scale=0.25}, + {filename = "__bzzirconium__/graphics/icons/zirconium-sponge-2.png", size=128, scale=0.25}, + }, + subgroup = "raw-material", + order = "z[zirconia]", + weight = 1*kg, + stack_size = util.get_stack_size(50) + }, + { + type = "recipe", + name = "zirconium-sponge", + main_product = "zirconium-sponge", + subgroup = "raw-material", + category = "chemistry", + allow_productivity = true, + order = "z[zirconia]", + energy_required = 1.6, + enabled = false, + ingredients = {util.item("zirconia", 1), util.fluid("sulfuric-acid", 5)}, + results = {util.item("zirconium-sponge", 1)}, }, { type = "item", @@ -69,12 +97,14 @@ data:extend({ icon_size = 128, subgroup = "raw-material", order = "d[zirconium-plate]", + weight = 1*kg, stack_size = util.get_stack_size(100) }, { type = "recipe", name = "zirconium-plate", category = "smelting", + allow_productivity = true, subgroup = "raw-material", order = "d[zirconium-plate]", icons = (mods["Krastorio2"] and @@ -85,26 +115,24 @@ data:extend({ { icon = "__bzzirconium__/graphics/icons/zirconium-plate.png", icon_size = 128, }, } ), - normal = (mods["Krastorio2"] and - { - enabled = false, - energy_required = 8, - ingredients = {util.item("zirconia", 15)}, - results = {util.item("zirconium-plate", 5)}, - } or - { - enabled = false, - energy_required = 9.6, - ingredients = {util.item("zirconia", 3)}, - results = {util.item("zirconium-plate", 1)}, - }), - expensive = - { - enabled = false, - energy_required = 9.6, - ingredients = {util.item("zirconia", 6)}, - result = "zirconium-plate", - } + -- (mods["Krastorio2"] and + -- { + -- enabled = false, + -- energy_required = 8, + -- ingredients = {util.item("zirconia", 15)}, + -- results = {util.item("zirconium-plate", 5)}, + -- } or + enabled = false, + energy_required = 3.2, + ingredients = {util.item("zirconium-sponge", 1)}, + results = {util.item("zirconium-plate", 1)}, + -- expensive = + -- { + -- enabled = false, + -- energy_required = 9.6, + -- ingredients = {util.item("zirconia", 6)}, + -- result = "zirconium-plate", + -- } }, { type = "technology", @@ -117,18 +145,25 @@ data:extend({ type = "unlock-recipe", recipe = "zirconia" }, + }, + research_trigger = {type="mine-entity", entity="zircon"}, + order = "z" + }, + { + type = "technology", + name = "zirconium-processing", + icon_size = 128, + icon = "__bzzirconium__/graphics/icons/zirconium-plate.png", + effects = + { + { + type = "unlock-recipe", + recipe = "zirconium-sponge", + }, { type = "unlock-recipe", recipe = "zirconium-plate", }, - -- mods["TheBigFurnace"] and { - -- type = "unlock-recipe", - -- recipe = "big-zirconium-plate", - -- } or nil, - -- mods["TheBigFurnace"] and { - -- type = "unlock-recipe", - -- recipe = "big-zirconia", - -- } or nil, }, unit = { @@ -140,7 +175,7 @@ data:extend({ }, time = 30, }, - prerequisites = {"automation-2", (not mods.bzzirconium and "advanced-material-processing") or nil }, + prerequisites = {"zirconia-processing", "sulfur-processing"}, order = "z" }, }) @@ -173,6 +208,7 @@ data:extend({ }, subgroup = "intermediate-product", order = "z[cermet]", + weight = 0.5*kg, stack_size = util.get_stack_size(200) }, { @@ -180,6 +216,7 @@ data:extend({ name = "cermet", category = "crafting", subgroup = "intermediate-product", + allow_productivity = true, order = "z[zirconia]", icons = { { icon = "__bzzirconium__/graphics/icons/cermet.png", icon_size = 128, } }, enabled = false, @@ -220,45 +257,141 @@ end end -- sorting -if util.me.enable_sorting() then +if util.me.enable_sorting() or mods.quality then data:extend({ { type = "recipe", name = "sort-stone-zircon", - category = "crafting", + category = mods["quality"] and "recycling-or-hand-crafting" or "crafting", subgroup = "raw-resource", order = "bzz", icons = { - { icon = "__bzzirconium__/graphics/icons/zircon.png", icon_size = 64 }, - { icon = "__base__/graphics/icons/stone.png", icon_size = 64, scale=0.25, shift= {-8, -8}}, + { icon = "__bzzirconium__/graphics/icons/zircon.png", icon_size=128, scale=0.25, shift={4,4}}, + { icon = "__base__/graphics/icons/stone.png", icon_size=64, scale=0.25, shift={-4,-4}}, }, - enabled = true, + enabled = not mods.quality, energy_required = 1, + allow_decomposition = false, ingredients = {util.item("stone", 2)}, results = { - {type="item", name="zircon", amount=1, probability=.999999}, + {type="item", name="zircon", amount=1}, {type="item", name="stone", amount=1, probability=0.5}, } }, { type = "recipe", name = "sort-zircon-stone", - category = "crafting", + category = mods["quality"] and "recycling-or-hand-crafting" or "crafting", subgroup = "raw-resource", order = "bzz", icons = { - { icon = "__base__/graphics/icons/stone.png", icon_size = 64 }, - { icon = "__bzzirconium__/graphics/icons/zircon.png", icon_size = 64, scale=0.25, shift= {-8, -8}}, + { icon = "__base__/graphics/icons/stone.png", icon_size=64, scale=0.5, shift={4,4} }, + { icon = "__bzzirconium__/graphics/icons/zircon.png", icon_size=128, scale=0.125, shift={-4,-4}}, }, - enabled = true, + enabled = not mods.quality, energy_required = 1, + allow_decomposition = false, ingredients = {util.item("zircon", 2)}, results = { - {type="item", name="stone", amount=1, probability=.999999}, + {type="item", name="stone", amount=1}, {type="item", name="zircon", amount=1, probability=0.5}, } } }) +util.add_unlock("recycling", "sort-zircon-stone") +util.add_unlock("recycling", "sort-stone-zircon") +end + +if mods["space-age"] then +-- Gleba +local synth_i = "stone" +if mods.bzsilicon then + synth_i = "silica" +elseif data.raw.item["sand"] then + synth_i = "sand" +end +data:extend({ + { + type = "recipe", + name = "zircon-synthesis", + category = "organic", + subgroup = "raw-material", + order = "z[zircon]", + icons = { + { icon = "__bzzirconium__/graphics/icons/zircon.png", icon_size=128}, + { icon = "__bzzirconium__/graphics/icons/zirconium-sponge.png", icon_size=128, scale=0.25, shift={-8,-8}}, + }, + energy_required = 10, + allow_decomposition = false, + ingredients = { + util.item("zirconium-sponge", 1), + util.item(synth_i, 1), + }, + results = {util.item("zircon", 1)}, + }, + { + type = "recipe", + name = "zirconia-from-egg", + localised_name = {"item-name.zirconia"}, + category = "organic", + subgroup = "raw-material", + order = "z[zircon]", + icons = { + { icon = "__bzzirconium__/graphics/icons/zirconia.png", icon_size=128}, + { icon = "__space-age__/graphics/icons/pentapod-egg.png", icon_size=64, scale=0.25, shift={-4,-4}}, + }, + energy_required = 6, + allow_decomposition = false, + ingredients = { + util.item("pentapod-egg", 1), + }, + results = {util.item("zirconia", 3)}, + }, +}) +util.add_unlock("biochamber", "zircon-synthesis") +util.add_unlock("biochamber", "zirconia-from-egg") + +-- Vulcanus +util.add_vacuum() +data:extend({ + { + type = "recipe", + name = "zirconium-in-foundry", + localised_name = {"item-name.zirconium-plate"}, + category = "metallurgy", + allow_productivity = true, + subgroup = "vulcanus-processes", + order = "d[zirconium-plate]", + icons ={{ icon = "__bzzirconium__/graphics/icons/zirconium-plate.png", icon_size = 128}}, + enabled = false, + energy_required = 3.2, + ingredients = {util.item("zirconium-sponge", 1), util.fluid("vacuum")}, + results = {util.item("zirconium-plate", 1)}, + }, + { + type = "recipe", + name = "zirconium-gettering", + main_product = "vacuum", + category = "chemistry", + subgroup = "vulcanus-processes", + order = "d[zirconium-gettering]", + icons = { + util.vacuum_icon, + { icon = "__bzzirconium__/graphics/icons/zirconium-sponge.png", icon_size = 128, scale=0.125, shift = {-8, -8}}, + }, + enabled = false, + allow_productivity = true, + energy_required = 5, + ingredients = {util.item("zirconium-sponge")}, + results = { + util.fluid("vacuum", 100), + util.item("stone", 1), + }, + show_amount_in_title = false, + }, +}) +util.add_unlock("foundry", "zirconium-in-foundry") +util.add_unlock("foundry", "zirconium-gettering") end -- Zirconium Tungstate, only if needed @@ -271,13 +404,15 @@ data:extend({ icon_size = 64, tint = {a=1, r=.95, g=.75, b=0}}}, subgroup = "intermediate-product", order = "z[zz]", + weight = 2*kg, stack_size = util.get_stack_size(100) }, { type = "recipe", name = "zirconium-tungstate", - category = "crafting", + category = "chemistry", subgroup = "intermediate-product", + allow_productivity = true, order = "z[zz]", enabled = false, energy_required = 2, @@ -285,13 +420,18 @@ data:extend({ results = {util.item("zirconium-tungstate", 2)}, }, }) -util.add_effect("zirconia-processing", { type = "unlock-recipe", recipe = "zirconium-tungstate" }) +if mods["space-age"] then + util.add_effect("tungsten-steel", { type = "unlock-recipe", recipe = "zirconium-tungstate" }) +else + util.add_effect("zirconia-processing", { type = "unlock-recipe", recipe = "zirconium-tungstate" }) +end end -- Zircaloy-4 only if needed if mods.bztin then +require("basic-foundry") local zircaloyi = { - util.item("zirconium-plate", 17), + util.item("zirconium-sponge", 17), util.item("tin-plate", 2), util.item("iron-plate", 1), } @@ -302,12 +442,14 @@ data:extend({ icons = {{icon = "__bzzirconium__/graphics/icons/zircaloy-4.png", icon_size = 128}}, subgroup = "intermediate-product", order = "z[zz]", + weight = 5*kg, stack_size = util.get_stack_size(100), }, { type = "recipe", name = "zircaloy-4", - category = "crafting", + category = mods["space-age"] and "basic-metallurgy" or "advanced-crafting", + allow_productivity = true, order = "z[zz]", enabled = false, energy_required = 60, @@ -315,21 +457,5 @@ data:extend({ results = {util.item("zircaloy-4", 20)}, }, }) -util.add_effect("zirconia-processing", { type = "unlock-recipe", recipe = "zircaloy-4" }) +util.add_effect("advanced-material-processing-2", { type = "unlock-recipe", recipe = "zircaloy-4" }) end - -if mods.DoubleFurnace then -data:extend({ - { - type = "recipe", - name = "double-zirconium", - category = "double-smelting", - enabled = false, - energy_required = 19.2, - ingredients = {util.item("zircon", 3)}, - results = {util.item("zirconium-plate", 2)}, - } -}) -util.add_effect("zirconia-processing", {type = "unlock-recipe", recipe = "double-zirconium"}) -end -