From 5bd85795f9f69f91803b258db1fb3f063bf83e7d Mon Sep 17 00:00:00 2001 From: ChimneySwift Date: Tue, 5 Feb 2019 20:32:20 +1000 Subject: [PATCH] Add Mitril and Crystal Multitool --- init.lua | 89 +++++++++++++++++++++++++++++++++ textures/multitool_crystal.png | Bin 0 -> 290 bytes textures/multitool_mithril.png | Bin 0 -> 268 bytes 3 files changed, 89 insertions(+) create mode 100644 textures/multitool_crystal.png create mode 100644 textures/multitool_mithril.png diff --git a/init.lua b/init.lua index 5f83881..c478c5e 100644 --- a/init.lua +++ b/init.lua @@ -67,6 +67,95 @@ minetest.override_item("multitools:multitool_mese", { after_use = toolranks.new_afteruse}) end +minetest.register_tool("multitools:multitool_mithril", { + description = "Mithril Multitool", + inventory_image = "multitool_mithril.png", + range = 8.0, + tool_capabilities = { + full_punch_interval = 0.9, + max_drop_level = 3, + groupcaps = { + cracky = {times={[1]=2.25, [2]=0.55, [3]=0.35}, uses=200, maxlevel=2}, + crumbly = {times={[1]=0.70, [2]=0.35, [3]=0.20}, uses=200, maxlevel=2}, + choppy = {times={[1]=1.75, [2]=0.45, [3]=0.45}, uses=200, maxlevel=2}, + snappy = {times={[2]=0.70, [3]=0.30}, uses=100, maxlevel=1}, + }, + damage_groups = {fleshy=9}, + }, + sound = {breaks = "default_tool_breaks"}, +}) + +minetest.register_craft({ + output = "multitools:multitool_mithril", + recipe = { + {"", "moreores:shovel_mithril", ""}, + {"moreores:axe_mithril", "moreores:pick_mithril", "moreores:sword_mithril"}, + } +}) + +-- Add [toolranks] mod support if found +if minetest.get_modpath("toolranks") then + +minetest.override_item("multitools:multitool_mithril", { + original_description = "Mithril Multitool", + description = toolranks.create_description("Mithril Multitool", 0, 1), + after_use = toolranks.new_afteruse}) +end + +minetest.register_tool("multitools:multitool_crystal", { + description = "Crystal Multitool", + inventory_image = "multitool_crystal.png", + range = 8.0, + tool_capabilities = { + full_punch_interval = 0.9, + max_drop_level = 3, + groupcaps = { + cracky = {times={[1]=1.8, [2]=0.8, [3]=0.40}, uses=20, maxlevel=3}, + crumbly = {times={[1]=0.70, [2]=0.35, [3]=0.20}, uses=50, maxlevel=2}, + choppy = {times={[1]=1.75, [2]=0.45, [3]=0.45}, uses=50, maxlevel=2}, + snappy = {times={[1]=1.70, [2]=0.70, [3]=0.25}, uses=50, maxlevel=3}, + }, + damage_groups = {fleshy=10}, + }, + sound = {breaks = "default_tool_breaks"}, +}) + +-- From Etheral mod +local old_handle_node_drops = minetest.handle_node_drops + +function minetest.handle_node_drops(pos, drops, digger) + + -- are we holding Crystal Multitool? + if digger:get_wielded_item():get_name() ~= "multitools:multitool_crystal" then + return old_handle_node_drops(pos, drops, digger) + end + + local nn = minetest.get_node(pos).name + + if minetest.get_item_group(nn, "crumbly") == 0 and minetest.get_item_group(nn, "cracky") == 0 then + return old_handle_node_drops(pos, drops, digger) + end + + return old_handle_node_drops(pos, {ItemStack(nn)}, digger) +end + +minetest.register_craft({ + output = "multitools:multitool_crystal", + recipe = { + {"", "ethereal:shovel_crystal", ""}, + {"default:axe_diamond", "ethereal:pick_crystal", "ethereal:sword_crystal"}, + } +}) + +-- Add [toolranks] mod support if found +if minetest.get_modpath("toolranks") then + +minetest.override_item("multitools:multitool_crystal", { + original_description = "Crystal Multitool", + description = toolranks.create_description("Crystal Multitool", 0, 1), + after_use = toolranks.new_afteruse}) +end + if minetest.get_modpath("mobs_monster") or minetest.get_modpath("lavastuff") then local img = "multitool_lava.png" if minetest.get_modpath("lavastuff") then diff --git a/textures/multitool_crystal.png b/textures/multitool_crystal.png new file mode 100644 index 0000000000000000000000000000000000000000..60819a4ebca9fe0a03146853393007c22ff8e58d GIT binary patch literal 290 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`>?NMQuI!H)g@o1Q_8h(D1{C5f z@Q5sCV30cm!i;$rO6`DxEa{HEjtmSN`?>!lvI6-VJzX3_DsCkwC@_8TvHmGP^X`V9 z91_Bd#n&;;(hr!2qlUqz%LaCWvG^Z3(5W^?q6AUq* gTyFYJOH*KAu!%om*7DwA7trwxp00i_>zopr0DV_sTmS$7 literal 0 HcmV?d00001 diff --git a/textures/multitool_mithril.png b/textures/multitool_mithril.png new file mode 100644 index 0000000000000000000000000000000000000000..2a4f50aed8ed301e7d4a42926fab33250d732670 GIT binary patch literal 268 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`>?NMQuI!JQn7K5V|88!lvI6wT4<|k4;4x=ettR1inP;=;Oy4=?4h+i}J(_tJxESB~`6Pp_ zFfq>QV^d%2`+5PjC6Z|jZD})9x)dW!7I!>mD!86-nWtN|#=*gX;f;Hxsq-5y&YOHj z3@x5!49g@VmHnJISV~V{%fid3$?#J$g+Z@!QI5K|G0=xsHf%jn5S{P>=u8GrS3j3^ HP6