From 5c2a6f6f2af7578f599422a6bd6f129020a125f0 Mon Sep 17 00:00:00 2001 From: Evert Prants Date: Wed, 12 Dec 2018 15:04:53 +0200 Subject: [PATCH] Concept of soldering, tiers of power storage cells --- elepower_dynamics/craftitems.lua | 4 +- elepower_dynamics/init.lua | 2 +- elepower_dynamics/nodes.lua | 12 + .../textures/elepower_hard_glass_detail.png | Bin 0 -> 970 bytes elepower_fapi/init.lua | 2 +- elepower_farming/init.lua | 2 +- elepower_machines/crafting.lua | 5 + elepower_machines/craftitems.lua | 29 ++ elepower_machines/init.lua | 5 +- elepower_machines/machines/bases/crafter.lua | 254 ++++++++++-------- .../machines/bases/fluid_generator.lua | 2 +- .../machines/bases/generator.lua | 3 +- elepower_machines/machines/grindstone.lua | 6 + elepower_machines/machines/storage.lua | 60 +++++ .../textures/elepower_overlay_hardened.png | Bin 0 -> 6619 bytes .../textures/elepower_overlay_reinforced.png | Bin 0 -> 6930 bytes .../textures/elepower_overlay_resonant.png | Bin 0 -> 6959 bytes .../textures/elepower_overlay_super.png | Bin 0 -> 6989 bytes .../elepower_upgrade_hardened_capacitor.png | Bin 0 -> 1223 bytes .../elepower_upgrade_reinforced_capacitor.png | Bin 0 -> 1743 bytes .../elepower_upgrade_resonant_capacitor.png | Bin 0 -> 1809 bytes .../elepower_upgrade_supercapacitor.png | Bin 0 -> 1710 bytes elepower_machines/upgrading.lua | 59 ++++ elepower_nuclear/init.lua | 2 +- elepower_papi/init.lua | 2 +- elepower_papi/machine.lua | 63 ++++- elepower_solar/init.lua | 2 +- elepower_tools/crafting.lua | 10 + elepower_tools/init.lua | 8 +- elepower_tools/soldering.lua | 172 ++++++++++++ .../textures/eletools_soldering_iron.png | Bin 0 -> 1314 bytes elepower_tools/tools.lua | 4 +- elepower_wireless/init.lua | 2 +- 33 files changed, 566 insertions(+), 144 deletions(-) create mode 100644 elepower_dynamics/textures/elepower_hard_glass_detail.png create mode 100644 elepower_machines/textures/elepower_overlay_hardened.png create mode 100644 elepower_machines/textures/elepower_overlay_reinforced.png create mode 100644 elepower_machines/textures/elepower_overlay_resonant.png create mode 100644 elepower_machines/textures/elepower_overlay_super.png create mode 100644 elepower_machines/textures/elepower_upgrade_hardened_capacitor.png create mode 100644 elepower_machines/textures/elepower_upgrade_reinforced_capacitor.png create mode 100644 elepower_machines/textures/elepower_upgrade_resonant_capacitor.png create mode 100644 elepower_machines/textures/elepower_upgrade_supercapacitor.png create mode 100644 elepower_machines/upgrading.lua create mode 100644 elepower_tools/soldering.lua create mode 100644 elepower_tools/textures/eletools_soldering_iron.png diff --git a/elepower_dynamics/craftitems.lua b/elepower_dynamics/craftitems.lua index 66c58b9..1b93dbf 100644 --- a/elepower_dynamics/craftitems.lua +++ b/elepower_dynamics/craftitems.lua @@ -213,9 +213,9 @@ minetest.register_craftitem("elepower_dynamics:soc", { }) minetest.register_craftitem("elepower_dynamics:capacitor", { - description = "Capacitor", + description = "Capacitor\nTier 1 Capacitor", inventory_image = "elepower_capacitor.png", - groups = {capacitor = 2, component = 1} + groups = {capacitor = 1, component = 1} }) -- Assembled Components diff --git a/elepower_dynamics/init.lua b/elepower_dynamics/init.lua index 5610a86..350ea26 100644 --- a/elepower_dynamics/init.lua +++ b/elepower_dynamics/init.lua @@ -1,4 +1,4 @@ --- A Elepower Mod +-- An Elepower Mod -- Copyright 2018 Evert "Diamond" Prants local modpath = minetest.get_modpath(minetest.get_current_modname()) diff --git a/elepower_dynamics/nodes.lua b/elepower_dynamics/nodes.lua index 6b54a4d..1eb0af4 100644 --- a/elepower_dynamics/nodes.lua +++ b/elepower_dynamics/nodes.lua @@ -51,6 +51,18 @@ minetest.register_node("elepower_dynamics:particle_board", { sounds = default.node_sound_wood_defaults(), }) +minetest.register_node("elepower_dynamics:hardened_glass", { + description = "Hardened Obsidian Glass\nDoes not let light through", + drawtype = "glasslike_framed_optional", + tiles = {"default_obsidian_glass.png", "elepower_hard_glass_detail.png"}, + paramtype2 = "glasslikeliquidlevel", + is_ground_content = false, + sunlight_propagates = false, + use_texture_alpha = true, + sounds = default.node_sound_glass_defaults(), + groups = {cracky = 3}, +}) + -- Blocks minetest.register_node("elepower_dynamics:viridisium_block", { diff --git a/elepower_dynamics/textures/elepower_hard_glass_detail.png b/elepower_dynamics/textures/elepower_hard_glass_detail.png new file mode 100644 index 0000000000000000000000000000000000000000..26419a6e897b7de8d60eecda1e2413d468113618 GIT binary patch literal 970 zcmV;*12z1KP) zaB^>EX>4U6ba`-PAZ2)IW&i+q+U=H6j@%#&hTl0wkAQ8A&2b0>sW<5H`$NcdXS>^0 zYF{c%P=GkZHvVj8!ujp%2w!ki0vuCr|S5crn!q zM!6n6Z}|y1V;o!Fww?;PzEM=}7svC9nznx525yVnkkB@;zYld!gs&I06&!nexwyUE zLfh-dUbn)4JIpTiOgUxcXqJnm>>Lwjx!dKHl5b-lJ|{~hq^@v8m`@>z=<{44a9vy~ z#)6)u@RTs-mt19s0i0fJ{L`7wSdC;gaW zSghVy&Oa7~R7d=e4_zpzeUn(vSuMDL;In zWw$JI4O!G$9egL78#efF22v!LvB=X0SBZn#~F{x@+Q`e$3 z%dD=Pv*me;RufC6md(tqSatE_>edzV zdgQ|nKgv-X(x;`SEjMc(T4}X&myYwKqm;Y%((6elQt3>mp82%X&vMp*R2wqV(2<7? zA7#`BH3}EjpW2^OqnjEpQgfj_sNqwyTLsPIL?<&4<3u2ClK>K$C$s335{HRyGK+;# z70U2ZC!9``7zn15SO-1W{UG@2HM`>+v=)zwg0000TNkl local modpath = minetest.get_modpath(minetest.get_current_modname()) diff --git a/elepower_farming/init.lua b/elepower_farming/init.lua index ec9e9ff..1c3dc3f 100644 --- a/elepower_farming/init.lua +++ b/elepower_farming/init.lua @@ -1,4 +1,4 @@ --- A Elepower Mod +-- An Elepower Mod -- Copyright 2018 Evert "Diamond" Prants local modpath = minetest.get_modpath(minetest.get_current_modname()) diff --git a/elepower_machines/crafting.lua b/elepower_machines/crafting.lua index 9fa286b..ca6617b 100644 --- a/elepower_machines/crafting.lua +++ b/elepower_machines/crafting.lua @@ -38,6 +38,11 @@ local alloy_recipes = { output = "elepower_dynamics:silicon_wafer_doped", time = 8, }, + { + recipe = { "default:obsidian_glass", "elepower_dynamics:lead_ingot 4" }, + output = "elepower_dynamics:hardened_glass 4", + time = 8, + }, } -- Register alloy furnace recipes diff --git a/elepower_machines/craftitems.lua b/elepower_machines/craftitems.lua index 6287da2..715859b 100644 --- a/elepower_machines/craftitems.lua +++ b/elepower_machines/craftitems.lua @@ -8,3 +8,32 @@ minetest.register_craftitem("elepower_machines:turbine_blades", { description = "Turbine Blades", inventory_image = "elepower_turbine.png" }) + +--------------- +-- Upgrading -- +--------------- + +-- Capacitors +minetest.register_craftitem("elepower_machines:hardened_capacitor", { + description = "Hardened Capacitor\nTier 2 Capacitor", + groups = {capacitor = 2, ele_upgrade_component = 1}, + inventory_image = "elepower_upgrade_hardened_capacitor.png" +}) + +minetest.register_craftitem("elepower_machines:reinforced_capacitor", { + description = "Reinforced Capacitor\nIt will probably obliterate you if you touched it while charged\nTier 3 Capacitor", + groups = {capacitor = 3, ele_upgrade_component = 1}, + inventory_image = "elepower_upgrade_reinforced_capacitor.png" +}) + +minetest.register_craftitem("elepower_machines:resonant_capacitor", { + description = "Resonant Capacitor\nTier 4 Capacitor", + groups = {capacitor = 4, ele_upgrade_component = 1}, + inventory_image = "elepower_upgrade_resonant_capacitor.png" +}) + +minetest.register_craftitem("elepower_machines:super_capacitor", { + description = "Supercapacitor\nAmazing energy density in a small container! Wow!\nTier 5 Capacitor", + groups = {capacitor = 5, ele_upgrade_component = 1}, + inventory_image = "elepower_upgrade_supercapacitor.png" +}) diff --git a/elepower_machines/init.lua b/elepower_machines/init.lua index 498810b..9d3fc14 100644 --- a/elepower_machines/init.lua +++ b/elepower_machines/init.lua @@ -1,4 +1,4 @@ --- Elepower Mod +-- An Elepower Mod -- Copyright 2018 Evert "Diamond" Prants local modpath = minetest.get_modpath(minetest.get_current_modname()) @@ -12,6 +12,9 @@ dofile(modpath.."/craft.lua") -- Machines dofile(modpath.."/machines/init.lua") +-- Upgrading +dofile(modpath.."/upgrading.lua") + -- Other dofile(modpath.."/nodes.lua") dofile(modpath.."/craftitems.lua") diff --git a/elepower_machines/machines/bases/crafter.lua b/elepower_machines/machines/bases/crafter.lua index 73bac83..0dbaa6a 100644 --- a/elepower_machines/machines/bases/crafter.lua +++ b/elepower_machines/machines/bases/crafter.lua @@ -59,6 +59,134 @@ function ele.formspec.get_crafter_formspec(craft_type, power, percent, pos, stat default.get_hotbar_bg(0, 4.25) end +-- Don't duplicate function for every single crafter node +function crafter_timer (pos, elapsed) + local refresh = false + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + + -- Specialized for universal crafter node + local machine_node = minetest.get_node(pos).name + local machine_def = minetest.registered_nodes[machine_node] + + -- If this is an active node, get the inactive version + if machine_def.groups['ele_active'] == 1 then + machine_node = machine_def.drop -- Reliable + machine_def = minetest.registered_nodes[machine_node] + end + + local capacity = ele.helpers.get_node_property(meta, pos, "capacity") + local usage = ele.helpers.get_node_property(meta, pos, "usage") + local storage = ele.helpers.get_node_property(meta, pos, "storage") + local speed = ele.helpers.get_node_property(meta, pos, "craft_speed") or 1 + local time = meta:get_int("src_time") + local state = meta:get_int("state") + local status = "Idle" + + local is_enabled = ele.helpers.state_enabled(meta, pos, state) + local res_time = 0 + + local get_formspec = machine_def.get_formspec or ele.formspec.get_crafter_formspec + + local pow_buffer = {capacity = capacity, storage = storage, usage = 0} + + while true do + if not is_enabled then + time = 0 + status = "Off" + break + end + + local result = elepm.get_recipe(machine_def.craft_type, inv:get_list("src")) + local power_operation = false + + -- Determine if there is enough power for this action + res_time = result.time + if result.time ~= 0 and pow_buffer.storage >= usage then + power_operation = true + pow_buffer.usage = usage + end + + if result.time == 0 or not power_operation then + ele.helpers.swap_node(pos, machine_node) + + if result.time == 0 then + time = 0 + status = "Idle" + else + status = "Out of Power!" + end + + break + end + + refresh = true + status = "Active" + + -- One step + pow_buffer.storage = pow_buffer.storage - usage + time = time + ele.helpers.round(speed * 10) + + if machine_def.ele_active_node then + local active_node = machine_node.."_active" + if machine_def.ele_active_node ~= true then + active_node = machine_def.ele_active_node + end + + ele.helpers.swap_node(pos, active_node) + end + + if time <= ele.helpers.round(result.time * 10) then + break + end + + local output = result.output + if type(output) ~= "table" then output = { output } end + local output_stacks = {} + for _, o in ipairs(output) do + table.insert(output_stacks, ItemStack(o)) + end + + local room_for_output = true + inv:set_size("dst_tmp", inv:get_size("dst")) + inv:set_list("dst_tmp", inv:get_list("dst")) + + for _, o in ipairs(output_stacks) do + if not inv:room_for_item("dst_tmp", o) then + room_for_output = false + break + end + inv:add_item("dst_tmp", o) + end + + if not room_for_output then + ele.helpers.swap_node(pos, machine_node) + time = ele.helpers.round(res_time*10) + status = "Output Full!" + break + end + + time = 0 + inv:set_list("src", result.new_input) + inv:set_list("dst", inv:get_list("dst_tmp")) + break + end + + local pct = 0 + if res_time > 0 and time > 0 then + pct = math.floor((time / ele.helpers.round(res_time * 10)) * 100) + end + + meta:set_string("formspec", get_formspec(machine_def.craft_type, pow_buffer, pct, pos, state)) + meta:set_string("infotext", ("%s %s"):format(machine_def.description, status) .. + "\n" .. ele.capacity_text(capacity, storage)) + + meta:set_int("src_time", time) + meta:set_int("storage", pow_buffer.storage) + + return refresh +end + function elepm.register_crafter(nodename, nodedef) local craft_type = nodedef.craft_type if not craft_type or not elepm.craft.types[craft_type] then @@ -74,128 +202,12 @@ function elepm.register_crafter(nodename, nodedef) nodedef.groups["tubedevice"] = 1 nodedef.groups["tubedevice_receiver"] = 1 + nodedef.on_timer = crafter_timer + -- Allow for custom formspec local get_formspec = ele.formspec.get_crafter_formspec if nodedef.get_formspec then get_formspec = nodedef.get_formspec - nodedef.get_formspec = nil - end - - nodedef.on_timer = function (pos, elapsed) - local refresh = false - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - - local machine_node = nodename - local machine_speed = nodedef.craft_speed or 1 - - local capacity = ele.helpers.get_node_property(meta, pos, "capacity") - local usage = ele.helpers.get_node_property(meta, pos, "usage") - local storage = ele.helpers.get_node_property(meta, pos, "storage") - local time = meta:get_int("src_time") - local state = meta:get_int("state") - local status = "Idle" - - local is_enabled = ele.helpers.state_enabled(meta, pos, state) - local res_time = 0 - - local pow_buffer = {capacity = capacity, storage = storage, usage = 0} - - while true do - if not is_enabled then - time = 0 - status = "Off" - break - end - - local result = elepm.get_recipe(craft_type, inv:get_list("src")) - local power_operation = false - - -- Determine if there is enough power for this action - res_time = result.time - if result.time ~= 0 and pow_buffer.storage >= usage then - power_operation = true - pow_buffer.usage = usage - end - - if result.time == 0 or not power_operation then - ele.helpers.swap_node(pos, machine_node) - - if result.time == 0 then - time = 0 - status = "Idle" - else - status = "Out of Power!" - end - - break - end - - refresh = true - status = "Active" - - -- One step - pow_buffer.storage = pow_buffer.storage - usage - time = time + ele.helpers.round(machine_speed * 10) - - if nodedef.ele_active_node then - local active_node = nodename.."_active" - if nodedef.ele_active_node ~= true then - active_node = nodedef.ele_active_node - end - - ele.helpers.swap_node(pos, active_node) - end - - if time <= ele.helpers.round(result.time * 10) then - break - end - - local output = result.output - if type(output) ~= "table" then output = { output } end - local output_stacks = {} - for _, o in ipairs(output) do - table.insert(output_stacks, ItemStack(o)) - end - - local room_for_output = true - inv:set_size("dst_tmp", inv:get_size("dst")) - inv:set_list("dst_tmp", inv:get_list("dst")) - - for _, o in ipairs(output_stacks) do - if not inv:room_for_item("dst_tmp", o) then - room_for_output = false - break - end - inv:add_item("dst_tmp", o) - end - - if not room_for_output then - ele.helpers.swap_node(pos, machine_node) - time = ele.helpers.round(res_time*10) - status = "Output Full!" - break - end - - time = 0 - inv:set_list("src", result.new_input) - inv:set_list("dst", inv:get_list("dst_tmp")) - break - end - - local pct = 0 - if res_time > 0 and time > 0 then - pct = math.floor((time / ele.helpers.round(res_time * 10)) * 100) - end - - meta:set_string("formspec", get_formspec(craft_type, pow_buffer, pct, pos, state)) - meta:set_string("infotext", ("%s %s"):format(nodedef.description, status) .. - "\n" .. ele.capacity_text(capacity, storage)) - - meta:set_int("src_time", time) - meta:set_int("storage", pow_buffer.storage) - - return refresh end local sizes = elepm.craft.types[craft_type] @@ -211,5 +223,11 @@ function elepm.register_crafter(nodename, nodedef) meta:set_string("formspec", get_formspec(craft_type, pow_buffer, nil, pos)) end + -- Upgradable + nodedef.ele_upgrades = { + machine_chip = {"craft_speed", "usage", "inrush"}, + capacitor = {"capacity"}, + } + ele.register_machine(nodename, nodedef) end diff --git a/elepower_machines/machines/bases/fluid_generator.lua b/elepower_machines/machines/bases/fluid_generator.lua index 3f63e75..4816a6c 100644 --- a/elepower_machines/machines/bases/fluid_generator.lua +++ b/elepower_machines/machines/bases/fluid_generator.lua @@ -44,7 +44,7 @@ function ele.register_fluid_generator(nodename, nodedef) on_timer = function (pos, elapsed) local refresh = false local meta = minetest.get_meta(pos) - local nodename = nodename + local nodename = minetest.get_node(pos).name local burn_time = meta:get_int("burn_time") local burn_totaltime = meta:get_int("burn_totaltime") diff --git a/elepower_machines/machines/bases/generator.lua b/elepower_machines/machines/bases/generator.lua index 1f7e0c2..1d95f50 100644 --- a/elepower_machines/machines/bases/generator.lua +++ b/elepower_machines/machines/bases/generator.lua @@ -36,7 +36,8 @@ function elepm.register_fuel_generator(nodename, nodedef) nodedef.on_timer = function (pos, elapsed) local refresh = false - local meta = minetest.get_meta(pos) + local meta = minetest.get_meta(pos) + local nodename = minetest.get_node(pos).name local burn_time = meta:get_int("burn_time") local burn_totaltime = meta:get_int("burn_totaltime") diff --git a/elepower_machines/machines/grindstone.lua b/elepower_machines/machines/grindstone.lua index ea08b9a..5cb99da 100644 --- a/elepower_machines/machines/grindstone.lua +++ b/elepower_machines/machines/grindstone.lua @@ -156,6 +156,12 @@ minetest.register_node("elepower_machines:crank", { {-0.03125, -0.5000, -0.03125, 0.03125, -0.1250, 0.03125} } }, + selection_box = { + type = "fixed", + fixed = { + {-0.2500, -0.5000, -0.2500, 0.2500, 0.000, 0.2500} + } + }, on_rightclick = function (pos, node, clicker, itemstack, pointed_thing) local gpos = vector.add(pos, {x = 0, y = -1, z = 0}) local gnode = minetest.get_node_or_nil(gpos) diff --git a/elepower_machines/machines/storage.lua b/elepower_machines/machines/storage.lua index 3d223f0..2afbb8a 100644 --- a/elepower_machines/machines/storage.lua +++ b/elepower_machines/machines/storage.lua @@ -13,3 +13,63 @@ elepm.register_storage("elepower_machines:power_cell", { }, groups = {oddly_breakable_by_hand = 1} }) + +elepm.register_storage("elepower_machines:hardened_power_cell", { + description = "Hardened Power Cell", + ele_capacity = 64000, + ele_inrush = 640, + tiles = { + "elepower_machine_top.png^elepower_overlay_hardened.png", + "elepower_machine_base.png^elepower_overlay_hardened.png", + "elepower_machine_side.png^elepower_overlay_hardened.png", + "elepower_machine_side.png^elepower_overlay_hardened.png", + "elepower_machine_side.png^elepower_overlay_hardened.png", + "elepower_power_cell.png^elepower_overlay_hardened.png", + }, + groups = {oddly_breakable_by_hand = 1} +}) + +elepm.register_storage("elepower_machines:reinforced_power_cell", { + description = "Reinforced Power Cell", + ele_capacity = 128000, + ele_inrush = 1024, + tiles = { + "elepower_machine_top.png^elepower_overlay_reinforced.png", + "elepower_machine_base.png^elepower_overlay_reinforced.png", + "elepower_machine_side.png^elepower_overlay_reinforced.png", + "elepower_machine_side.png^elepower_overlay_reinforced.png", + "elepower_machine_side.png^elepower_overlay_reinforced.png", + "elepower_power_cell.png^elepower_overlay_reinforced.png", + }, + groups = {oddly_breakable_by_hand = 1} +}) + +elepm.register_storage("elepower_machines:resonant_power_cell", { + description = "Resonant Power Cell", + ele_capacity = 640000, + ele_inrush = 2048, + tiles = { + "elepower_machine_top.png^elepower_overlay_resonant.png", + "elepower_machine_base.png^elepower_overlay_resonant.png", + "elepower_machine_side.png^elepower_overlay_resonant.png", + "elepower_machine_side.png^elepower_overlay_resonant.png", + "elepower_machine_side.png^elepower_overlay_resonant.png", + "elepower_power_cell.png^elepower_overlay_resonant.png", + }, + groups = {oddly_breakable_by_hand = 1} +}) + +elepm.register_storage("elepower_machines:super_power_cell", { + description = "Supercapacitor Cell", + ele_capacity = 1280000, + ele_inrush = 4096, + tiles = { + "elepower_machine_top.png^elepower_overlay_super.png", + "elepower_machine_base.png^elepower_overlay_super.png", + "elepower_machine_side.png^elepower_overlay_super.png", + "elepower_machine_side.png^elepower_overlay_super.png", + "elepower_machine_side.png^elepower_overlay_super.png", + "elepower_power_cell.png^elepower_overlay_super.png", + }, + groups = {oddly_breakable_by_hand = 1} +}) diff --git a/elepower_machines/textures/elepower_overlay_hardened.png b/elepower_machines/textures/elepower_overlay_hardened.png new file mode 100644 index 0000000000000000000000000000000000000000..fcc1dfe89dd2b23eafdfd7428f69b52dccd730ca GIT binary patch literal 6619 zcmeHL2~-o;8V*(k5h%3viB=@WvI&!AvXF#CMb@Y+WpP1}PG%+$$;KoQ7V#;d;07X~ z6%;FqRuph~T13%mMXdsg0tzlDE{IqG6_twEnLrWW^V#P+ujjm;V{)?0z2E=c|9j7X%EjbnGdl<4p8;f?LOVVzL&ORgv`+jQt1()N2j zE$x!t6BS5#XFg+_sRMQM!e%2%W7}Cc`HFcs&g z$1IHX&#LauU$`)12PN&&kNddByfULJJFnc?d8YFp4@+7w`MG6ZbR~?8I{QQSqGY`( zm-O4Sl7{-F*X$289-%?nMnyW6ZS_uhCBNS*TW9-|&14JSN=Edj7T2^j=&DsUWf#zn zEQa-}=8JdjE{Ne#nxM#6uezMhS78a$di5@P)zDrjJ#)=2be*_vY8c;}<@2~XSL>;- zP_A>ivTjO8M1wU4lN`U?Xg1HON$C8{KG{y*UYTG z)@xbvm3^tbmH5XiXD&H!7`q8B4!D)yk~xa09+p+Nc#NKVGymqZSKCh+F8*}!`C^L2 zxY8pDTOf|HI-6o-`GxVml<#)8oc()Ql{Pu3ZI~N!J8e`?b6!J7{zMPN!PzL)H`h7a z>}FI`N!qSY62TMW_8ynbxJ-Jn@`C-LYotbJUwUYiYuwCX24(_Nu8WDmm8ssgYXT)( zT@8?-Q^yqVe-ca@xx7Qqr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n+fn>Is}M0D8ghS9Hv<8IEcarlj5Nb z$p(8xP$4)K%BG_T4D$dKgv0=g34s6?&SI2 zzA{K7QDSl-Wu{aS74xPeKq^Q5H4q^hgUw~(f2K@>!f3in0quR@e_`?uS85gi8P6N&0E;uG(JHYBAIwL*0EIR0=Xn=+fXNT9 zQECkqEBb>;{S!{m7nPp4trCkJG`>F?*>}}fNMur-RAjO)dHE1bs3@eUp=cD*Edj1$ zUl$w>DZ)^^O7^G7@9oleM5`m4%iuC$2w+I)c(igEc%U-aAizT*4#-1!Y&HbG&8}8T zG+GElox|`P!q*wkAl*8XZFNCr_cmG^j^a+*)0uoaozl0w{mcF5%!kWD5iZK(0vs`n z0xU zv9}A$?}hf?;0D?E7xh0f9}MfWc2TNg@x3ivvqqrOJu<)+_kH2m}Nr1Iv)L-3|C8n-zb7p0tdwm|B?y(MdI3f}4H!*^o@So!?rjOOx|g_Gf;3Ue2OB^#N$>I`it+!mAi zAlKyByuI}op9>l8>rg1i`p9z`=gUQl7Wvk_Oxj%B#y=H#2Rl?*&8u%?^TM#|ljeHn z%a#P$ADC5EyfrJ4aj)pWGUh3PiKR)(F~OFSl9K142H<%nC9&}F?jz5GsiPMZr50k^ zPQ!1^hwnb%8L_&!ZT^sLSvY&`xcWwqpYk#an>QXVG97Y>)w#ko8J$Z~-R9;O(s-VB zx5|&*JuH7$e4Ej>*Y^1LakW>|7`S+c!X$J57LZ-s_Co)lb?dNL T)$BTa1xX?|Z`a~!-z5G9z}cy; literal 0 HcmV?d00001 diff --git a/elepower_machines/textures/elepower_overlay_reinforced.png b/elepower_machines/textures/elepower_overlay_reinforced.png new file mode 100644 index 0000000000000000000000000000000000000000..5e1eeaa2b9cfeaecc3f97dd385d179e8c106dd39 GIT binary patch literal 6930 zcmeHL2~<yks6BY9J9J1Sp_PKJn(}CImtfGmwA?s3;Yw6FyXm zLZN~vU@4Oo6tv(3;sdP{peTbd=i^~%KEoV^LRoS>+5X7?$-0l33G&zB=^GG*GCm&{7_9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{_f2ZEJYra zG{}3S?j<(ok#|led@m0+>W%I<=Tt#D(lcJ}8KOj?CQQ|R3{aU_(~(Y76_>{`y>DSM z)xm_9X&r-f*{L|eDtB45?%e`v^zjz05vwB5x@X~_jT3EAD1&2MHY|#(&qW2q2gkdGSa$JM8MSw8?k0@u7IE z_fT4IGkoy*Q@NX0FUe+Bw#`u&mRrT$K9c#)ea%|cwLTAsq`o3UdeP-8`FSy@RwY3>bYx#Q1ewv^gr^fo<>p&gpv zbWmQf3XWps60fDL_e;eccPjWH3DtPrFR3uUI&{&|gKA2?t>L6eP8DV$TaGO%Do$US iGXY%gd)AMTXpnjN{?~r1mf0hFi{f&8*d=ajH~kYuO(=5! literal 0 HcmV?d00001 diff --git a/elepower_machines/textures/elepower_overlay_resonant.png b/elepower_machines/textures/elepower_overlay_resonant.png new file mode 100644 index 0000000000000000000000000000000000000000..648a63dee49c9a0db1b3b0d09b25fbb16dfbbbbb GIT binary patch literal 6959 zcmeHM3piA3+a5XO5OOM1yD@~FmYG@RoFO@vQwSwx&6+h#%)!iJMiJVD&Wh+D9d?@( z9VokOQIv{OyHcdmfn6eM+a2iitr>Rd`}+3xcm4mquK&BP#x-Ns``*v}KJWcL&-1=( z&8h%DPhD+uZ5$4#>+R(hi2Wa{cx!54pOgDPKscOw^OE2&G!T;E#S#&ZAB*78L@|O# z5kS`Ah6mW0^;VA2#p%T}P7cbfBus zQT_L4lsVPtu4+Bw9hvUq8Fo)*u75cy#D?Z>BPp?a^RA{>(7I&`TeQ3Q{gvmP8gDNq z$@3WLUKbvAwH6vX4A$PTd0p!78Zp1ST_^diX#LbW>*|TjHAOx;lP=00Xcw$4ijRA8 zZ&93({X=70;I6av)_?Rr@4kF!=RD#1F6{xGy|N8=&+p8lHSUf&l{~}t?$bPpw*HC4 zboBnqqms3+8iB&!aU)^MBK@-JTYJ^Z2de-pl^N(-)ANDo(#> zuozwg6)SI)B?33S4vTHbk@`^Ch0V^Dm-=kikyTfpZ+L3gayGm5Fo)p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+TFNGE8n!W$+imh(sa% zE7!+EMr9dy-$H#J?L+Tz=(Q04=3Y2fR?#i_JAcN?_1`%K7W;9M57PIeTp#87AO$`M z{4u&d%Jo4Cd=U6!bp4;nW%TyV5+Xq#l+@^Zqa~DosL*##2HfS#JTb4ezx&R7y%X)3 zBJ)|Pz+k4DYd?CJqGC(5(@^Of;APluY+!DK>135Tqg}I=UL2)|RIGisfEjzd#j1r$ z0ap7g9I3yAJ zY<6VDVP4c^)smt*Q{Pp+^XDov55h!yuq{W-#*X+UoVLp;UXq=(+9YRE)Vw=04@~Qj z1E!>7N414I3rMPw6zV2xyx{DZJuRzZV_jM`%0bbNHxBvhE literal 0 HcmV?d00001 diff --git a/elepower_machines/textures/elepower_upgrade_hardened_capacitor.png b/elepower_machines/textures/elepower_upgrade_hardened_capacitor.png new file mode 100644 index 0000000000000000000000000000000000000000..e591a7dbc2d41c5f375dd88c0f1f4549738909f8 GIT binary patch literal 1223 zcmV;&1UUPNP) zaB^>EX>4U6ba`-PAZ2)IW&i+q+U=KJlJh7GMc=iGSpt#}Kg+>js%8hX{J9Y9PIuBt zzV19tjj32zU`gl*lFCDb*)uko1%d}!RfMhO-;dfdIZ7(+%siSrS8Ya`HJC6D)PTZX{g!Jt3H~K5mG!uFZ z=odoaly~)PA9}h*I=NkW4&n6tNuT@a;v`20zTR8veZQ=(_<$vcwWwn$vxj-x$ku!- zphbMlrIGB>GFrlxsHmfcBHPd^XBJ@W?74B_&ij;=D?;?LON11uqFf2e1Q=QB#O+7p zE)mEZ;EPt2gF-83EIi%j>8^5u{AOF&;+D3&l`2%V`f4@QSX0flG-=wfk6UQ5rIuUSc}FSj zez!gBaZh{ROGl}7?Y>(NJ@(Wy^>R{MSZ~@NP~$~SCaEzop46a?@i4*TII+PD#Kbdz z$3cLVLhWBtIfRJ~Pqk--Pa<|;> zQEO#>(di^Kw&6&sQ|!K;`<{xVGQKGvN_sZoRr$Z6cNl8D%r1WE+?P71(i?)gHFP>x zD@&D*GDDw9uKS}=x*7hVq({+&k7)9eSad^gZEa<4bO1wgWnpw> zWFU8GbZ8()Nlj2!fese{003i2L_t(I%hi#w3cxT3L@%Y2ACT3L&6j4)4>%~;wS$6? zLg<@LgyTGc-_x=MGy8jquH6#P8*INZ lWsKpGE}uX|q5iys^E~}YEFj!@G8_N^002ovPDHLkV1gtHI~xE1 literal 0 HcmV?d00001 diff --git a/elepower_machines/textures/elepower_upgrade_reinforced_capacitor.png b/elepower_machines/textures/elepower_upgrade_reinforced_capacitor.png new file mode 100644 index 0000000000000000000000000000000000000000..081d8e18b114a7043459ee310fe9f08137beae2c GIT binary patch literal 1743 zcmV;=1~B=FP) zaB^>EX>4U6ba`-PAZ2)IW&i+q+U-|cmgFW3{bv(S zO!Acz(`B$M#6?$t5hmaW5pa7Vz7!E8CFpUOBAiV{OYP z)BL!Fy7l{hKizkLc*5Q-qf`fT1MJ2yftSf zw2WW$I-EV4p(#?LB90n@>_Dqz#GtWLphkr{owKi00Wt8&89j4lq3R%1kYQXW-C;E9 zoI!a5`79OTAdvEnh32w0m#d^$xRE+U55X8=%0FuE9i`q!LJ@hreFa=RG7TsOb41P) z)W8V!?bJ9Oe6`nW@G4+1PB$wySo|?8fc_)WM{vm`TA&!wuLP#twgI>Z2qM6cfB~OK zA|>*f*<~U)QbAAwbe6yeXrUOn0VD?`6v#mqU~SCFG*vnB5~C1;h$zWP1~*7bkQG8i z{N$jBp%NvA7-Nb#YP49Aq>*7MC(H4aI!325HWh2^!@j4$i1Rl%{&b*C67#SerAg9q_3=D>oICi?Z`(Q3QN&gOS4n*+3!JHe^y}{gP z-o9e3mHDBQ$O2*HM_~{1D|{B9{we?N(nfxo^P&TfDH$z4kaKbxs`v5NZgEEU^7~RcPA(d;g9)PkfxVNW#3QNO{RM{+)4X1F}iRJ6wHqJ3^XI4nLZP{aNI{lnB@5JbH z_N0}x;ZC1RlaB45oz0*%Y>c`FI6%W;+w;w=<4gOUgWm1oNV}YUl^8H_zQhN@gFlI+ zwby8J?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_{`U>lHhKm$ol9_vtQ%kHI;E(3ThC6p z!y)|?cziF{RI|WOPj!^~t5?s0_q`dM4Qt7i%+<~9ibtfW>5x48ZP!AQrHa7ZnA-rZ zhA=R-r1vy>bp~&H%6qko4bio{LK#bSxdb58L_%*wuHK~Wnm?w(!YTu*IF}=Bn_oM* zB0(j2Hu7EX`!Y~{h~A~c&PG9P9HU4NOO{)dUW&EX1a4Jp!b`7g-I|Dews6Q_1yRyX zjP~!y{f@&$LCdD7%w-{V3!x2=KZmlLJA6Dg-93@$cnWgPi9axHyf)JjQVjbe^v2N1&U`>0dz!!Dn&bI*POys*JD5#XsS zEpZ!L69|W%>?tg=K^5E)+6FJYC@JdKN=G@Rs~>33jww3Xe|qXj_+O{_qwfdm#{PLP8#vatF+?8D#~$F`dsrqFLi^kQP@Q9 z@YA;x;a&1~?Z@3<4blli%bcz>R+5E>sn9%Srq^P00v@9M??Ss06PFjImKl?00009a7bBm001r{001r{0eGc9b^rhX z2XskIMF-*u9TX81Y8L_90000PbVXQnLvL+uWo~o;Lvm$dbY)~9cWHEJAV*0}P*;Ht z7XSbOPf0{UR5;76k}*<|ZyNySTvt8|@QHm7Q3rtpfr= z0!y?`_Q(haFcAQ$SOXBHe_t^Faa$@lJ%A#i?1bkv0Km-1E{d;vxCysJc$8XXtF<)& z%e4WE?^pQwW$Al9hY*Cnqrfxn0m=x`I^M-Ckv$+Kw4B4602!+G?}C?a*F*$1`UHZA zsM-AsAU#cgN4MPpVB=_qoC@3$iXeVH)^4YMiNkFO4~iBn7UfWuKTBdVet(Ee#vs$# zmwhTfIy?N_*xU@LApL&7giXfudOez&|4Y0A;DCPl%ueve00000NkvXXu0mjf&G|^g literal 0 HcmV?d00001 diff --git a/elepower_machines/textures/elepower_upgrade_supercapacitor.png b/elepower_machines/textures/elepower_upgrade_supercapacitor.png new file mode 100644 index 0000000000000000000000000000000000000000..01dc8ff45ebac3901c3eef4f6066614448bf2efc GIT binary patch literal 1710 zcmV;f22uHmP) zaB^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4(0&u{`Rpj zdOYp8?l`byuPPwhN@U abscap then + storage = abscap + meta:set_int("storage", storage) + end + end + + -- Set variable to zero in metadata + if meta:get_int(c) ~= 0 then + meta:set_int(c, 0) + end + elseif nodedef["ele_" .. c] ~= nil then + -- Set updated value in metadata + local default = nodedef["ele_" .. c] + local ulevel = minetest.get_item_group(comps[comp], comp) - 1 + local multiplier = 1 + + -- Capacitor value is multiplied + if comp == "capacitor" then + multiplier = math.pow(10, ulevel) + end + + meta:set_int(c, math.abs(default + (default * ulevel * multiplier))) + end + end + end + end + + local t = minetest.get_node_timer(pos) + if not t:is_started() then + t:start(1.0) + end +end diff --git a/elepower_nuclear/init.lua b/elepower_nuclear/init.lua index a5e550b..aba8053 100644 --- a/elepower_nuclear/init.lua +++ b/elepower_nuclear/init.lua @@ -1,4 +1,4 @@ --- A Elepower Mod +-- An Elepower Mod -- Copyright 2018 Evert "Diamond" Prants local modpath = minetest.get_modpath(minetest.get_current_modname()) diff --git a/elepower_papi/init.lua b/elepower_papi/init.lua index 0e49d17..df9c554 100644 --- a/elepower_papi/init.lua +++ b/elepower_papi/init.lua @@ -1,4 +1,4 @@ --- Elepower Mod +-- An Elepower Mod -- Copyright 2018 Evert "Diamond" Prants local modpath = minetest.get_modpath(minetest.get_current_modname()) diff --git a/elepower_papi/machine.lua b/elepower_papi/machine.lua index 7a2c336..26ff5a9 100644 --- a/elepower_papi/machine.lua +++ b/elepower_papi/machine.lua @@ -96,19 +96,28 @@ ele.default.states = { -- Preserve power storage in the item stack dropped local function preserve_metadata(pos, oldnode, oldmeta, drops) local meta = minetest.get_meta(pos) - local capacity = ele.helpers.get_node_property(meta, pos, "capacity") local storage = ele.helpers.get_node_property(meta, pos, "storage") + local capacity = ele.helpers.get_node_property(meta, pos, "capacity") - local nodedesc = minetest.registered_nodes[oldnode.name].description + local nodedesc = minetest.registered_nodes[oldnode.name].description + local partsstr = meta:get_string("components") - if storage == 0 then + if storage == 0 and partsstr == "" then return drops end for i,stack in pairs(drops) do local stack_meta = stack:get_meta() stack_meta:set_int("storage", storage) - stack_meta:set_string("description", nodedesc .. "\n" .. ele.capacity_text(capacity, storage)) + + local desc = ele.capacity_text(capacity, storage) + + if partsstr ~= "" then + stack_meta:set_string("components", partsstr) + desc = desc .. "\n" .. minetest.colorize("#9647ff", "Modified Device") + end + + stack_meta:set_string("description", nodedesc .. "\n" .. desc) drops[i] = stack end @@ -119,11 +128,24 @@ end local function retrieve_metadata(pos, placer, itemstack, pointed_thing) local item_meta = itemstack:get_meta() local storage = item_meta:get_int("storage") - - if storage and storage > 0 then + local partsstr = item_meta:get_string("components") + + if storage > 0 or partsstr ~= "" then local meta = minetest.get_meta(pos) + meta:set_int("storage", storage) - minetest.get_node_timer(pos):start(1.0) + if partsstr ~= "" then + meta:set_string("components", partsstr) + + if elepm then + elepm.handle_machine_upgrades(pos) + end + else + local t = minetest.get_node_timer(pos) + if not t:is_started() then + t:start(1.0) + end + end end return false @@ -219,6 +241,17 @@ local function switch_state(pos, state_def) end end +-- Patch a table +local function apply_patches (table, patches) + for k,v in pairs(patches) do + if table[k] and type(table[k]) == "table" then + apply_patches(table[k], v) + else + table[k] = v + end + end +end + -- Register a base device function ele.register_base_device(nodename, nodedef) local tlsupp = tl and nodedef.groups and (nodedef.groups["tubedevice"] or nodedef.groups["tube"]) @@ -393,23 +426,31 @@ function ele.register_base_device(nodename, nodedef) if nodedef.ele_active_node then local active_nodedef = table.copy(nodedef) active_name = nodename.."_active" - + if nodedef.ele_active_node ~= true then active_name = nodedef.ele_active_node + + if i ~= 1 then + active_name = active_name .. "_" .. i + end end if nodedef.ele_active_nodedef then - for k,v in pairs(nodedef.ele_active_nodedef) do - active_nodedef[k] = v - end + apply_patches(active_nodedef, nodedef.ele_active_nodedef) nodedef.ele_active_nodedef = nil active_nodedef.ele_active_nodedef = nil end + -- Remove formspec functions from active nodedefs + if active_nodedef.get_formspec then + active_nodedef.get_formspec = nil + end + active_nodedef.groups["ele_active"] = 1 active_nodedef.groups["not_in_creative_inventory"] = 1 active_nodedef.drop = nodename + minetest.register_node(active_name, active_nodedef) end diff --git a/elepower_solar/init.lua b/elepower_solar/init.lua index 11f6fd1..bf01b21 100644 --- a/elepower_solar/init.lua +++ b/elepower_solar/init.lua @@ -1,4 +1,4 @@ --- A Elepower Mod +-- An Elepower Mod -- Copyright 2018 Evert "Diamond" Prants local modpath = minetest.get_modpath(minetest.get_current_modname()) diff --git a/elepower_tools/crafting.lua b/elepower_tools/crafting.lua index 1a3de66..587688f 100644 --- a/elepower_tools/crafting.lua +++ b/elepower_tools/crafting.lua @@ -35,3 +35,13 @@ minetest.register_craft({ {"elepower_dynamics:motor", "elepower_dynamics:capacitor", ""}, } }) + +-- Soldering Iron +minetest.register_craft({ + output = "elepower_tools:soldering_iron", + recipe = { + {"", "elepower_dynamics:battery", "default:steel_ingot"}, + {"", "elepower_dynamics:wound_silver_coil", ""}, + {"elepower_dynamics:wound_silver_coil", "", ""}, + } +}) diff --git a/elepower_tools/init.lua b/elepower_tools/init.lua index 00b5eb9..579d13b 100644 --- a/elepower_tools/init.lua +++ b/elepower_tools/init.lua @@ -1,4 +1,4 @@ --- A Elepower Mod +-- An Elepower Mod -- Copyright 2018 Evert "Diamond" Prants local modpath = minetest.get_modpath(minetest.get_current_modname()) @@ -6,6 +6,12 @@ local modpath = minetest.get_modpath(minetest.get_current_modname()) eletool = rawget(_G, "eletool") or {} eletool.modpath = modpath +-- Simple tools dofile(modpath .. "/tools.lua") + +-- Complex tools +dofile(modpath .. "/soldering.lua") + +-- Crafting dofile(modpath .. "/craftitems.lua") dofile(modpath .. "/crafting.lua") diff --git a/elepower_tools/soldering.lua b/elepower_tools/soldering.lua new file mode 100644 index 0000000..4e8fd9c --- /dev/null +++ b/elepower_tools/soldering.lua @@ -0,0 +1,172 @@ + +-- Convenience for i18n later on +local dict = { + machine_chip = "Machine Chip", + capacitor = "Capacitor", +} + +local function upgrade_formspec (upgrades, desc) + local posY = 0.5 + local fspec = "" + + for k in pairs(upgrades) do + fspec = fspec .. "label[1,"..(posY + 0.25)..";"..dict[k].."]" + fspec = fspec .. "list[detached:soldering;"..k..";7,"..posY..";1,1;]" + posY = posY + 1 + end + + return "size[8,8.5]".. + default.gui_bg.. + default.gui_bg_img.. + default.gui_slots.. + "label[0,0;Modifying "..desc.."]".. + fspec.. + "list[current_player;main;0,4.25;8,1;]".. + "list[current_player;main;0,5.5;8,3;8]".. + "listring[current_player;main]".. + default.get_hotbar_bg(0, 4.25) +end + +local function set_component_list (pos, list) + local meta = minetest.get_meta(pos) + local len = 0 + for _,v in pairs(list) do + if v ~= nil then + len = len + 1 + end + end + + if len == 0 and meta:get_string("components") ~= "" then + meta:set_string("components", "") + else + meta:set_string("components", minetest.serialize(list)) + end + + if elepm then + elepm.handle_machine_upgrades(pos) + end +end + +local function machine_modify (pos, node, user) + local nodedef = minetest.registered_nodes[node.name] + + if not nodedef.ele_upgrades then + return minetest.chat_send_player(user:get_player_name(), "This machine cannot be modified.") + end + + local meta = minetest.get_meta(pos) + local comps = meta:get_string("components") + + -- Prevent the node from being dug + -- It is recommended to have this check in can_dig callback. + meta:set_int("drop_lock", 1) + + -- Save the soldered machine as an attribute on the player + local umeta = user:get_meta() + umeta:set_string("soldering", minetest.pos_to_string(pos)) + + -- Deserialize component list + if comps ~= "" then + comps = minetest.deserialize(comps) + else + comps = {} + end + + -- Create detached inventory for upgrades + local inv = minetest.create_detached_inventory("soldering", { + allow_move = function (inv, from_list, from_index, to_list, to_index, count, player) + return 0 + end, + + allow_put = function (inv, listname, index, stack, player) + if minetest.get_item_group(stack:get_name(), "ele_upgrade_component") == 0 or + minetest.get_item_group(stack:get_name(), listname) < 2 then + return 0 + end + + return 1 + end, + + allow_take = function (inv, listname, index, stack, player) + return stack:get_count() + end, + + on_put = function (inv, listname, index, stack, player) + comps[listname] = stack:get_name() + set_component_list(pos, comps) + end, + + on_take = function (inv, listname, index, stack, player) + comps[listname] = nil + set_component_list(pos, comps) + end, + }, user:get_player_name()) + + -- Add lists + for k in pairs(nodedef.ele_upgrades) do + inv:set_size(k, 1) + + if comps[k] then + inv:set_stack(k, 1, ItemStack(comps[k])) + end + end + + -- Open the formspec + minetest.show_formspec(user:get_player_name(), "elepower_tools:soldering_iron", + upgrade_formspec(nodedef.ele_upgrades, nodedef.description)) +end + +minetest.register_on_player_receive_fields(function (player, formname, fields) + if formname ~= "elepower_tools:soldering_iron" or not player then return false end + + local umeta = player:get_meta() + local pos = umeta:get_string("soldering") + if not pos then return false end + + pos = minetest.string_to_pos(pos) + local meta = minetest.get_meta(pos) + + if fields["quit"] then + meta:set_int("drop_lock", 0) + umeta:set_string("soldering", "") + end + + return true +end) + +minetest.register_on_leaveplayer(function (player) + local umeta = player:get_meta() + local soldering = umeta:get_string("soldering") + if soldering == "" then return end + local pos = minetest.string_to_pos(soldering) + local meta = minetest.get_meta(pos) + if meta:get_int("drop_lock") == 1 then + meta:set_int("drop_lock", 0) + end + umeta:set_string("soldering", "") +end) + +ele.register_tool("elepower_tools:soldering_iron", { + description = "Soldering Iron\nUsed to replace components in machines", + inventory_image = "eletools_soldering_iron.png", + wield_image = "eletools_soldering_iron.png^[transformR270", + ele_capacity = 8000, + ele_usage = 64, + on_use = function (itemstack, user, pointed_thing) + if not user or user:get_player_name() == "" then return itemstack end + if pointed_thing and pointed_thing.type == "node" then + local pos = pointed_thing.under + local node = minetest.get_node_or_nil(pos) + + if not node or node.name == "air" or minetest.is_protected(pos, user:get_player_name()) then + return itemstack + end + + if ele.helpers.get_item_group(node.name, "ele_machine") then + machine_modify(pos, node, user) + end + end + + return itemstack + end +}) diff --git a/elepower_tools/textures/eletools_soldering_iron.png b/elepower_tools/textures/eletools_soldering_iron.png new file mode 100644 index 0000000000000000000000000000000000000000..d7970734542f3eb26cd785bcfa13e240fbd8651b GIT binary patch literal 1314 zcmV+-1>O3IP) zaB^>EX>4U6ba`-PAZ2)IW&i+q+U1vRa_cG#hX1pQy96X55X-@Q%-kK^<)0S^yGfI_ zX`7kzR=;M(@r6 zhDy-O<|*!*p=l-ctsAE>+Lcv zAG4+FDb!^@*7#lq{M876{W7}}BBmVIq>icV6705Ft^KZu zmhe+=v)Hp`G{cstSVs+uY(uM*iGguYphkrT^}VlDkz(M^;Kx5z>Umd^$?s9ZuwPn&lrs{Hx!Y#vsTE9=T1WwlN^!r z1Tzq!v5KmDfsgk7m|O(}buY7Fg2ivs1MqK3Z;MNI&;mn6f7!s4+H!yrAp=D+*fs%+ zfJ7;hPs}b6p^yeZSRKX^cmozv<%T3Vh(y4_EMT9TxYG{uyXrJRa0v0!S^l9^>InX}-Ds~P(- zTh6%@1TFAfaCd=0DI0IHg-y4(rOmdymCCM44OMHbsanmoG;Y$ck6Uc1S<9_->R3uW zbnUUHZaw!hu+)Z(Fm%L`hK=k-IjJqIckLV0Xi?*x)HF;dHE2^hT+n=+=wt?B90b@xR1Bf|gzOTp9(PUzB?3=@3pu)hiQs zJ@lLY#u4?bQ@|IT`Xe)0f|xDIKkD5_1K;SS;~C~w+;k{wE~{RJR(AM$S`vNSyRQr$ z_NmF?JB*9q@L6z-)|w8na68JD^eOM|M`>s{P_!eU8$#{(@Ri)xhSUdM11p! local modpath = minetest.get_modpath(minetest.get_current_modname())