From b618a31bc235b48974ad1c32c1761cbd70577cee Mon Sep 17 00:00:00 2001 From: Brevven Date: Thu, 13 Jan 2022 22:44:57 -0800 Subject: [PATCH] new feature: reuse diamonds --- carbon-recipe-updates.lua | 8 +++++++- carbon-recipe.lua | 15 +++++++++------ changelog.txt | 5 +++++ data-final-fixes.lua | 16 +++++++++++++++- graphics/icons/nanotube.xcf | Bin 2427348 -> 2422674 bytes info.json | 2 +- locale/en/carbon.cfg | 2 ++ me.lua | 5 +++++ settings.lua | 7 +++++++ thumbnail.xcf | Bin 80137 -> 80533 bytes 10 files changed, 51 insertions(+), 9 deletions(-) diff --git a/carbon-recipe-updates.lua b/carbon-recipe-updates.lua index 46269d3..6237bb3 100644 --- a/carbon-recipe-updates.lua +++ b/carbon-recipe-updates.lua @@ -89,10 +89,16 @@ else util.add_ingredient("effectivity-module-2", "diamond", 1) util.add_ingredient("productivity-module-2", "diamond", 1) end +util.add_ingredient("laser-turret", "diamond", 1) util.add_ingredient("assembling-machine-3", "diamond", 4) + util.add_ingredient("low-density-structure", "diamond", 1) util.add_ingredient("se-low-density-structure-beryllium", "diamond", 1) -util.add_ingredient("laser-turret", "diamond", 1) +if util.me.reuse() then + util.add_product("low-density-structure", {type="item", name="diamond", amount=1, probability = 0.5}) + util.add_product("low-density-structure-nanotubes", {type="item", name="diamond", amount=1, probability = 0.5}) + util.add_product("se-low-density-structure-beryllium", {type="item", name="diamond", amount=1, probability = 0.5}) +end if mods.Krastorio2 then util.replace_some_ingredient("steel-plate", "iron-plate", 2, "graphite", 4) diff --git a/carbon-recipe.lua b/carbon-recipe.lua index 70fb803..4469f2e 100644 --- a/carbon-recipe.lua +++ b/carbon-recipe.lua @@ -403,12 +403,12 @@ data:extend({ { icon = "__bzcarbon__/graphics/icons/nanotube.png", icon_size = 128, scale=0.125, shift= {-8, -8}}, }, category = "advanced-crafting", + subgroup = data.raw.item["low-density-structure"].subgroup, order = "o[low-density-structure-nanotubes]", enabled = false, energy_required = 20, ingredients = lds_recipe(), - result = "low-density-structure", - result_count = 1, + results = {{"low-density-structure", 1}}, }, { type = "technology", @@ -461,8 +461,7 @@ data:extend({ type = "item", name = "carbon-black", icon = "__bzcarbon__/graphics/icons/carbon-black.png", - icon_size = 64, - icon_mipmaps = 3, + icon_size = 64, icon_mipmaps = 3, subgroup = "intermediate-product", order = "g[graphite-carbon-black]", stack_size = util.get_stack_size(100), @@ -470,6 +469,8 @@ data:extend({ { type = "recipe", name = "carbon-black", + icon = "__bzcarbon__/graphics/icons/carbon-black.png", + icon_size = 64, icon_mipmaps = 3, category = "chemistry", order = "d[graphite-carbon-black]", enabled = false, @@ -477,8 +478,9 @@ data:extend({ ingredients = { {type="item", name="coal", amount=1}, }, - result = "carbon-black", - result_count = 1, + results = { + {type="item", name= "carbon-black", amount=1}, + } }, { type = "recipe", @@ -500,6 +502,7 @@ data:extend({ }) end +-- crucible data:extend({ { type = "item", diff --git a/changelog.txt b/changelog.txt index 064a33a..04c75ad 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,9 @@ --------------------------------------------------------------------------------------------------- +Version: 0.0.15 +Date: 2022-01-13 + Features: + - Setting to enable reusing diamond grinding grit for LDS recipes +--------------------------------------------------------------------------------------------------- Version: 0.0.14 Date: 2022-01-12 Changes: diff --git a/data-final-fixes.lua b/data-final-fixes.lua index dc93298..9eea18d 100644 --- a/data-final-fixes.lua +++ b/data-final-fixes.lua @@ -8,7 +8,6 @@ local util = require("data-util"); -- Green circuits in final fixes due to K2 shenanigans - if not mods.MDbobelectronics then util.replace_some_ingredient("electronic-circuit", "copper-cable", 1, "graphite", 1) -- AAI alternate green circuit @@ -18,6 +17,20 @@ else util.replace_ingredient("basic-electronic-component", "coke", "graphite") end +if data.raw.recipe["low-density-structure"] and + not data.raw.recipe["low-density-structure"].icon and + not data.raw.recipe["low-density-structure"].icons + then + util.set_subgroup("low-density-structure", data.raw.item["low-density-structure"].subgroup) + util.set_icons("low-density-structure", { + { icon = "__base__/graphics/icons/low-density-structure.png", icon_size = 64, icon_mipmaps = 4}, + }) + util.set_subgroup("se-low-density-structure-beryllium", data.raw.item["low-density-structure"].subgroup) + util.set_icons("se-low-density-structure-beryllium", { + { icon = "__base__/graphics/icons/low-density-structure.png", icon_size = 64, icon_mipmaps = 4}, + }) +end + -- Only electric smelters can make Diamonds function diamondsInElectricSmelter(entity) @@ -47,6 +60,7 @@ for i, furnace in pairs(util.me.furnaces) do end end +-- Vanilla burner phase tweaks -- green circuits after electronics if not mods.Krastorio2 and not mods["aai-industry"] then util.replace_ingredient("offshore-pump", "electronic-circuit", "copper-cable") util.replace_ingredient("lab", "electronic-circuit", "copper-cable") diff --git a/graphics/icons/nanotube.xcf b/graphics/icons/nanotube.xcf index 090b9bef1497454eccf3c33aa1a9c684dfe18829..0697e6898a19d5d2b4fcadcf5fac8352be2faeed 100644 GIT binary patch delta 3172 zcmX}t3s6*57{Kwnu&}@i%X62DzVFQ)BFBR`snb+6%-B5ba}N2OAO z_hJk#&~@;hvykNsDf`(#YR8AH&$ zgy!*C%?y1u{>Z@2Ls^T85*5k;Zal8YkUBfxQ<7Rrs?*c34?<1So zt@)>{kQeypF2$1hSYyX~EOkKKX_*IP@&yCjOUSonV9cqHrX`uu}4&A6dE)^R=r8hFhDlj)_vY$g=A;zfB~ zVD-m%m$N1)=DN&--W2y2&)0&+ze8bqIL^z)?IZCr2aP4*qRcJb8ZbW|SEu1mEU~5S zRhb93?~g<2q2T%4CwONu_3NMV{)dFJ*CD-5%7Ku{Wp1>V{Sbb^PYzvWGli? z*HCXfgm-Ahh@fRMk9cJV=5gdkl(@(bvEmW8+!U1YaOqX&5$JP zwwJ%e_rAp<9&FolhWscqw$;(hwks2o z^Qa_NENV<9`7$+L#ok8UW~R|LRy4ZL7I|Itv~xJS7K;u`-O;P~=McUAECbv3Vihxs zKF@=qpU@*Q9sZExF~i2gzX?$+!#ZgWA) zeSC6P8tZ=^Z3cARz$A{+*q#pZjK?^EFBV(eLVl3*B({l_aD(8(fL&K&`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Il%g?idR8)*}5rY*FUw$XOlK|5&|?WSj_*29Zl+DEU@0Xj&B=rA3l;}HMPF8-!8 zGPh7aYNK|jS;JXyP#0BcJWZg9G>InD6q-iUX(r90*)&J0xvjY@Xvj=%GkMsT@ zoq1YEp8NVA^MC)Hd7gideLcwhd+h81*3$oZ`0r^RU*KVWrRTmLVE#RKcK`El^ECgS aSM2>iMDNQ}%<$CUscu#7{cirKn(}W5)+8PP diff --git a/info.json b/info.json index 02e4823..693bab2 100644 --- a/info.json +++ b/info.json @@ -1,6 +1,6 @@ { "name": "bzcarbon", - "version": "0.0.14", + "version": "0.0.15", "factorio_version": "1.1", "title": "Graphite & Diamonds", "author": "Brevven", diff --git a/locale/en/carbon.cfg b/locale/en/carbon.cfg index 11d6a34..941fd24 100644 --- a/locale/en/carbon.cfg +++ b/locale/en/carbon.cfg @@ -65,6 +65,7 @@ bzcarbon-list=Make a list of modified recipes bzcarbon-enable-fullerenes=Enable fullerenes & nanotubes bzcarbon-enable-carbon-black=Enable carbon black bzcarbon-enable-rough-diamond=Enable diamond mining +bzcarbon-reuse=Reuse grinding grit [mod-setting-description] bzcarbon-recipe-bypass=Skip modifying these recipes (comma-separated list). @@ -72,3 +73,4 @@ bzcarbon-list=If enabled, the text command [color=orange]BZList[/color] will dum bzcarbon-enable-fullerenes=Enable the fullerenes & nanotubes intermediate products.\nFullerenes are used primarily in bio-related things. Nanotubes for structures. bzcarbon-enable-carbon-black=Enable carbon black byproduct. Primarily used to make plastics. bzcarbon-enable-rough-diamond=Enables diamond ore patches for new games. +bzcarbon-reuse=A chance to reuse diamond grinding grit in recipes like LDS. More complex, but saves resources. diff --git a/me.lua b/me.lua index 33cbd14..8d8d641 100644 --- a/me.lua +++ b/me.lua @@ -7,6 +7,11 @@ function me.use_fullerenes() return me.get_setting("bzcarbon-enable-fullerenes") == "yes" end +function me.reuse() + return me.get_setting("bzcarbon-reuse") == "yes" +end + + function me.use_carbon_black() return me.get_setting("bzcarbon-enable-carbon-black") == "yes" end diff --git a/settings.lua b/settings.lua index 26e42f1..ea921e1 100644 --- a/settings.lua +++ b/settings.lua @@ -33,4 +33,11 @@ data:extend({ setting_type = "startup", default_value = false, }, + { + type = "string-setting", + name = "bzcarbon-reuse", + setting_type = "startup", + default_value = "no", + allowed_values = {"no", "yes"}, + }, }) diff --git a/thumbnail.xcf b/thumbnail.xcf index 9b1564892232cd0c6a8377f7b3140e9b39d052ed..0609aee6934b4a5a4c47440da3ec774f7ce42fc2 100644 GIT binary patch delta 1258 zcmZvaZ%9*76u{rzn^S7IT;iWMq-T?w8&eXkz4^gDNCX+YP^d@|Gl{J=qbx|NwO*TR|>DK4mL0=o|V$R67lnN`_KzSs~r zoWr2mUQm1r>|^LRQj0-Oic|Rc;rg`1@!b&zdRzHes?> z9!UnOPf~|KB?t|j9JG6r<0{MZFBby|`c0WNEY5sFN<9u*2%L0ALb*Im{EEEx89D6m z7y37e&cDoP_NDajZnnucZUwCUvWSK9$odj&lKLs=CGkb6UOXoQxDuZio#oINvoc7|yaJHjlGID*mGZ=_KqiAwCJ z5Jh3(Nn~^Z*-(l+Afd2kxmZ9y#t&5yzaeAs`FmkDQfh$fT!t1xEbOW{XPEU&|F& SERn$hk3xeGW#UhadH(@;g`4vL delta 949 zcmZwEK}Zx)7zgn8oNbkgbXRn8b8%!Nc1K4=6PH>9Z$Xixtl(kqvWx7&Lx_UAEM9~? z2xIO==vE{`!lSx)kc>>|u+UA6q971Glof>RYH#2F8=OM}-}}Aq``*mFdGq*>Z|TIh zscB;=rmn^oXdJ-k188kS`yNck;q)=gA1Qh4Dssj|O53U9hGY0|v?bi4^sbCnDc+vTqw!;IS z2kCO|`Jl|GGn&!)l$gpCHS4!$VeRBpB*EskIW*QStGy0M_=Ha>ks4$ zWRCu8J}73hbIsN-wAENU;vE_E;zEb2@+daPW6bF&=(!iF%9c*y6WYK!9o~8c^>-8S z(>AP3lh^?FEvTG_p2O${xkY{;4@i2xcv(n2vx2IKVOdfOO{Lr%hVh?dwKQyUePk7> d^$Pa*Vc%aka0YK*hC@x{A&mFGUN!mrwSQAhfMx&y