From 2de09b4e127d4a636b62b23aa6e600c0fe9ae9e1 Mon Sep 17 00:00:00 2001 From: Brevven Date: Mon, 5 Jul 2021 14:55:49 -0700 Subject: [PATCH] bobplates --- changelog.txt | 2 ++ data-util.lua | 4 ++- locale/en/tungsten.cfg | 2 +- tungsten-recipe.lua | 77 ++++++++++++++++++++++++------------------ 4 files changed, 51 insertions(+), 34 deletions(-) diff --git a/changelog.txt b/changelog.txt index 9009792..74b4ad9 100644 --- a/changelog.txt +++ b/changelog.txt @@ -2,6 +2,8 @@ Version: 0.3.0 Date: 2021-07-06 Features: + - Bob's MCI (bobplates) compatibility. If you use bob's library without bobplates, you might + Need to re-research tungsten processing. Nothing else should change. - Useful equipment compatibility --------------------------------------------------------------------------------------------------- Version: 0.2.8 diff --git a/data-util.lua b/data-util.lua index e105fed..1e1eefb 100644 --- a/data-util.lua +++ b/data-util.lua @@ -3,10 +3,12 @@ local util = {} util.name = "bztungsten" util.tungsten_ore = "tungsten-ore" util.tungsten_plate = "tungsten-plate" +util.tungsten_carbide_recipe = "tungsten-carbide" util.tungsten_processing = "tungsten-processing" -if bobmods and bobmods.lib and bobmods.lib.recipe and bobmods.lib.tech then +if mods.bobplates then util.tungsten_processing = "bz-tungsten-processing" + util.tungsten_carbide_recipe = "bz-tungsten-carbide" end function util.fe_plus(sub) diff --git a/locale/en/tungsten.cfg b/locale/en/tungsten.cfg index 757c1e3..1e3cae4 100644 --- a/locale/en/tungsten.cfg +++ b/locale/en/tungsten.cfg @@ -28,7 +28,7 @@ advanced-carbon-furnace=For making tungsten carbide quickly and efficiently. Bur [technology-name] tungsten-processing=Tungsten processing -bz-tungsten-processing=Tungsten processing +bz-tungsten-processing=Basic tungsten processing enriched-tungsten=Enriched tungsten tungsten-matter-processing=Tungsten conversion advanced-carbon-furnace=__ITEM__advanced-carbon-furnace__ diff --git a/tungsten-recipe.lua b/tungsten-recipe.lua index d1d8365..f316796 100644 --- a/tungsten-recipe.lua +++ b/tungsten-recipe.lua @@ -5,22 +5,46 @@ local util = require("__bztungsten__.data-util"); data:extend({ { type = "recipe-category", name = "smelting-carbon"}, }) -data:extend( -{ + +if not mods.bobplates then +data:extend({ + { + type = "item", + name = "tungsten-carbide", + icon = "__bztungsten__/graphics/icons/tungsten-carbide.png", + icon_size = 128, + subgroup = "raw-material", + order = "z[tungsten-carbide]", + stack_size = util.get_stack_size(100) + }, + { + type = "item", + name = util.tungsten_plate, + icon = "__bztungsten__/graphics/icons/tungsten-plate.png", + icon_size = 128, icon_mipmaps = 3, + subgroup = "raw-material", + order = "b[tungsten-plate]", + stack_size = util.get_stack_size(100) + } +}) +end + +data:extend({ { type = "recipe", name = util.tungsten_plate, category = "smelting", subgroup = "raw-material", order = "d[tungsten-plate]", - icons = (mods["Krastorio2"] and - { + icons = (mods["Krastorio2"] and { { icon = "__bztungsten__/graphics/icons/tungsten-plate.png", icon_size = 128, icon_mipmaps = 3, }, { icon = "__bztungsten__/graphics/icons/tungsten-ore.png", icon_size = 64, icon_mipmaps = 3, scale=0.25, shift= {-8, -8}}, - } or { - { icon = "__bztungsten__/graphics/icons/tungsten-plate.png", icon_size = 128, icon_mipmaps = 3, }, - } -), + } or mods.bobplates and { + { icon = "__bobplates__/graphics/icons/plate/tungsten-plate.png", icon_size = 32}, + } or + { + { icon = "__bztungsten__/graphics/icons/tungsten-plate.png", icon_size = 128}, + }), normal = (mods["Krastorio2"] and { enabled = false, @@ -32,7 +56,7 @@ data:extend( { enabled = false, energy_required = 32/15, - ingredients = {{"tungsten-ore", 2}}, + ingredients = {{"tungsten-ore", mods.bobplates and 4 or 2}}, result = util.tungsten_plate, }), expensive = @@ -43,20 +67,15 @@ data:extend( result = util.tungsten_plate } }, - { - type = "item", - name = util.tungsten_plate, - icon = "__bztungsten__/graphics/icons/tungsten-plate.png", - icon_size = 128, icon_mipmaps = 3, - subgroup = "raw-material", - order = "b[tungsten-plate]", - stack_size = util.get_stack_size(100) - }, { type = "technology", name = util.tungsten_processing, - icon_size = 256, icon_mipmaps = 4, - icon = "__bztungsten__/graphics/technology/tungsten-processing.png", + icons = {{ icon = + mods.bobplates + and "__bobplates__/graphics/icons/technology/tungsten-processing.png" + or "__bztungsten__/graphics/technology/tungsten-processing.png", + icon_size = mods.bobplates and 64 or 256, + }}, effects = { { @@ -65,7 +84,7 @@ data:extend( }, { type = "unlock-recipe", - recipe = "tungsten-carbide", + recipe = util.tungsten_carbide_recipe, }, mods["TheBigFurnace"] and { type = "unlock-recipe", @@ -114,22 +133,16 @@ data:extend( }) data:extend({ - { - type = "item", - name = "tungsten-carbide", - icon = "__bztungsten__/graphics/icons/tungsten-carbide.png", - icon_size = 128, - subgroup = "raw-material", - order = "z[tungsten-carbide]", - stack_size = util.get_stack_size(100) - }, { type = "recipe", - name = "tungsten-carbide", + name = util.tungsten_carbide_recipe, category = (mods["Krastorio2"] and "smelting" or "smelting-carbon"), subgroup = "raw-material", order = "z[tungsten-carbide]", - icons = { { icon = "__bztungsten__/graphics/icons/tungsten-carbide.png", icon_size = 128} }, + icons = { mods.bobplates and + { icon = "__bobplates__/graphics/icons/plate/tungsten-carbide-plate.png", icon_size = 64} + or { icon = "__bztungsten__/graphics/icons/tungsten-carbide.png", icon_size = 128} + }, normal = (mods["Krastorio2"] and { enabled = false,