diff options
author | Vanessa Ezekowitz <vanessaezekowitz@gmail.com> | 2016-04-01 21:00:20 -0400 |
---|---|---|
committer | Vanessa Ezekowitz <vanessaezekowitz@gmail.com> | 2016-04-01 21:10:04 -0400 |
commit | 888b0ebfec8c2eff9015163549a7e47443cb8665 (patch) | |
tree | 915080159bfaa6ba6e226087c7ce0e8d5464b518 /glooptest/tools_module | |
parent | da66780a569712c23ae4f2996cfb4608a9f9d69d (diff) | |
download | dreambuilder_modpack-888b0ebfec8c2eff9015163549a7e47443cb8665.tar dreambuilder_modpack-888b0ebfec8c2eff9015163549a7e47443cb8665.tar.gz dreambuilder_modpack-888b0ebfec8c2eff9015163549a7e47443cb8665.tar.bz2 dreambuilder_modpack-888b0ebfec8c2eff9015163549a7e47443cb8665.tar.xz dreambuilder_modpack-888b0ebfec8c2eff9015163549a7e47443cb8665.zip |
"explode" all modpacks into their individual components
(you can't have a modpack buried inside a modpack)
Diffstat (limited to 'glooptest/tools_module')
-rw-r--r-- | glooptest/tools_module/api.lua | 98 | ||||
-rw-r--r-- | glooptest/tools_module/init.lua | 237 |
2 files changed, 335 insertions, 0 deletions
diff --git a/glooptest/tools_module/api.lua b/glooptest/tools_module/api.lua new file mode 100644 index 0000000..5db65f9 --- /dev/null +++ b/glooptest/tools_module/api.lua @@ -0,0 +1,98 @@ +function glooptest.tools_module.set_tool_recipe(modname,type,material,name) + if type == "sword" then + minetest.register_craft({ + recipe = {{material},{material},{"default:stick"}}, + output = modname..":sword_"..name, + }) + end + if type == "axe" then + minetest.register_craft({ + recipe = {{material, material}, {material, "default:stick"}, {"","default:stick"}}, + output = modname..":axe_"..name, + }) + minetest.register_craft({ + recipe = {{material, material}, {"default:stick", material}, {"default:stick", ""}}, + output = modname..":axe_"..name, + }) + end + if type == "pick" or type == "pickaxe" then + minetest.register_craft({ + recipe = {{material, material, material}, {"","default:stick",""}, {"","default:stick",""}}, + output = modname..":pick_"..name, + }) + end + if type == "shovel" then + minetest.register_craft({ + recipe = {{material},{"default:stick"},{"default:stick"}}, + output = modname..":shovel_"..name, + }) + end + if type == "handsaw" then + minetest.register_craft({ + recipe = {{material, "default:stick"},{material, "default:stick"},{"", "default:stick"}}, + output = modname..":handsaw_"..name, + }) + minetest.register_craft({ + recipe = {{"default:stick", material},{"default:stick", material},{"default:stick", ""}}, + output = modname..":handsaw_"..name, + }) + end + if type == "hammer" then + minetest.register_craft({ + recipe = {{material, "default:stick", material}, {material, "default:stick", material}, {"", "default:stick", ""}}, + output = modname..":hammer_"..name, + }) + end +end + +function glooptest.tools_module.register_tools(modname, name, desc, material, uses) + if uses.handsaw ~= nil and uses.handsaw.makes ~= false then + minetest.register_tool(modname..":handsaw_"..name, { + description = desc.." Handsaw", + inventory_image = uses.handsaw.texture, + tool_capabilities = uses.handsaw.caps, + }) + glooptest.tools_module.set_tool_recipe(modname,"handsaw",material,name) + end + if uses.hammer ~= nil and uses.hammer.makes ~= false then + minetest.register_tool(modname..":hammer_"..name, { + description = desc.." Hammer", + inventory_image = uses.hammer.texture, + tool_capabilities = uses.hammer.caps, + }) + glooptest.tools_module.set_tool_recipe(modname,"hammer",material,name) + end + if uses.sword ~= nil and uses.sword.makes ~= false then + minetest.register_tool(modname..":sword_"..name, { + description = desc.." Sword", + inventory_image = uses.sword.texture, + tool_capabilities = uses.sword.caps, + }) + glooptest.tools_module.set_tool_recipe(modname,"sword",material,name) + end + if uses.axe ~= nil and uses.axe.makes ~= false then + minetest.register_tool(modname..":axe_"..name, { + description = desc.." Axe", + inventory_image = uses.axe.texture, + tool_capabilities = uses.axe.caps, + }) + glooptest.tools_module.set_tool_recipe(modname,"axe",material,name) + end + if uses.pick ~= nil and uses.pick.makes ~= false then + minetest.register_tool(modname..":pick_"..name, { + description = desc.." Pickaxe", + inventory_image = uses.pick.texture, + tool_capabilities = uses.pick.caps, + }) + glooptest.tools_module.set_tool_recipe(modname,"pick",material,name) + end + if uses.shovel ~= nil and uses.shovel.makes ~= false then + minetest.register_tool(modname..":shovel_"..name, { + description = desc.." Shovel", + inventory_image = uses.shovel.texture, + wield_image = uses.shovel.texture.."^[transformR90", + tool_capabilities = uses.shovel.caps, + }) + glooptest.tools_module.set_tool_recipe(modname,"shovel",material,name) + end +end
\ No newline at end of file diff --git a/glooptest/tools_module/init.lua b/glooptest/tools_module/init.lua new file mode 100644 index 0000000..3c1cabc --- /dev/null +++ b/glooptest/tools_module/init.lua @@ -0,0 +1,237 @@ +glooptest.tools_module = {} +glooptest.debug("MESSAGE","Loading Tools Module Now!") + +dofile(minetest.get_modpath("glooptest").."/tools_module/api.lua") + +glooptest.tools_module.register_tools("glooptest", "wood", "Wooden", "group:wood", { + handsaw = { + makes = true, + texture = "glooptest_tool_woodhandsaw.png", + caps = { + full_punch_interval = 1.0, + max_drop_level = 0, + groupcaps = { + snappy = {times={[2]=1.10, [3]=0.60}, uses=10, maxlevel=1}, + fleshy = {times={[3]=0.90}, uses=10, maxlevel=0} + }, + damage_groups = {fleshy=2, snappy=3}, + }, + }, + hammer = { + makes = true, + texture = "glooptest_tool_woodhammer.png", + caps = { + full_punch_interval = 1.0, + max_drop_level = 0, + groupcaps = { + bendy = {times={[2]=1.00, [3]=0.55}, uses=10, maxlevel=1}, + cracky = {times={[3]=1.10}, uses=10, maxlevel=0} + }, + damage_groups = {fleshy=2, bendy=2, cracky=1}, + }, + }, +}) + +glooptest.tools_module.register_tools("glooptest", "stone", "Stone", "group:stone", { + handsaw = { + makes = true, + texture = "glooptest_tool_stonehandsaw.png", + caps = { + full_punch_interval = 1.1, + max_drop_level = 0, + groupcaps = { + snappy = {times={[2]=0.80, [3]=0.40}, uses=20, maxlevel=1}, + fleshy = {times={[3]=0.70}, uses=20, maxlevel=0} + }, + damage_groups = {fleshy=3, snappy=3}, + }, + }, + hammer = { + makes = true, + texture = "glooptest_tool_stonehammer.png", + caps = { + full_punch_interval = 1.1, + max_drop_level = 0, + groupcaps = { + bendy = {times={[2]=0.90, [3]=0.60}, uses=20, maxlevel=1}, + cracky = {times={[3]=1.00}, uses=20, maxlevel=0} + }, + damage_groups = {fleshy=2, bendy=2, cracky=1}, + }, + }, +}) + +glooptest.tools_module.register_tools("glooptest", "steel", "Steel", "default:steel_ingot", { + handsaw = { + makes = true, + texture = "glooptest_tool_steelhandsaw.png", + caps = { + full_punch_interval = 0.9, + max_drop_level = 0, + groupcaps = { + snappy = {times={[1]=1.00, [2]=0.65, [3]=0.25}, uses=30, maxlevel=2}, + fleshy = {times={[2]=1.10, [3]=0.60}, uses=30, maxlevel=1} + }, + damage_groups = {fleshy=4, snappy=5}, + }, + }, + hammer = { + makes = true, + texture = "glooptest_tool_steelhammer.png", + caps = { + full_punch_interval = 1.0, + max_drop_level = 0, + groupcaps = { + bendy = {times={[1]=1.30, [2]=0.80, [3]=0.50}, uses=30, maxlevel=2}, + cracky = {times={[2]=1.80, [3]=0.90}, uses=30, maxlevel=0} + }, + damage_groups = {fleshy=3, bendy=3, cracky=2}, + }, + }, +}) + +glooptest.tools_module.register_tools("glooptest", "bronze", "Bronze", "default:bronze_ingot", { + handsaw = { + makes = true, + texture = "glooptest_tool_bronzehandsaw.png", + caps = { + full_punch_interval = 0.9, + max_drop_level = 0, + groupcaps = { + snappy = {times={[1]=1.00, [2]=0.65, [3]=0.25}, uses=40, maxlevel=2}, + fleshy = {times={[2]=1.10, [3]=0.60}, uses=40, maxlevel=1} + }, + damage_groups = {fleshy=4, snappy=5}, + }, + }, + hammer = { + makes = true, + texture = "glooptest_tool_bronzehammer.png", + caps = { + full_punch_interval = 1.0, + max_drop_level = 0, + groupcaps = { + bendy = {times={[1]=1.30, [2]=0.80, [3]=0.50}, uses=40, maxlevel=2}, + cracky = {times={[2]=1.80, [3]=0.90}, uses=40, maxlevel=0} + }, + damage_groups = {fleshy=3, bendy=3, cracky=2}, + }, + }, +}) + +glooptest.tools_module.register_tools("glooptest", "mese", "Mese", "default:mese_crystal", { + handsaw = { + makes = true, + texture = "glooptest_tool_mesehandsaw.png", + caps = { + full_punch_interval = 0.9, + max_drop_level = 0, + groupcaps = { + snappy = {times={[1]=0.70, [2]=0.40, [3]=0.20}, uses=30, maxlevel=3}, + fleshy = {times={[2]=1.00, [3]=0.55}, uses=30, maxlevel=1} + }, + damage_groups = {fleshy=5, snappy=6}, + }, + }, + hammer = { + makes = true, + texture = "glooptest_tool_mesehammer.png", + caps = { + full_punch_interval = 1.0, + max_drop_level = 0, + groupcaps = { + bendy = {times={[1]=1.00, [2]=0.60, [3]=0.40}, uses=30, maxlevel=3}, + cracky = {times={[2]=1.70, [3]=0.85}, uses=30, maxlevel=0} + }, + damage_groups = {fleshy=4, bendy=4, cracky=2}, + }, + }, +}) + +glooptest.tools_module.register_tools("glooptest", "diamond", "Diamond", "default:diamond", { + handsaw = { + makes = true, + texture = "glooptest_tool_diamondhandsaw.png", + caps = { + full_punch_interval = 0.9, + max_drop_level = 0, + groupcaps = { + snappy = {times={[1]=0.60, [2]=0.30, [3]=0.20}, uses=30, maxlevel=3}, + fleshy = {times={[2]=0.90, [3]=0.55}, uses=30, maxlevel=1} + }, + damage_groups = {fleshy=5, snappy=7}, + }, + }, + hammer = { + makes = true, + texture = "glooptest_tool_diamondhammer.png", + caps = { + full_punch_interval = 1.0, + max_drop_level = 0, + groupcaps = { + bendy = {times={[1]=0.90, [2]=0.50, [3]=0.40}, uses=30, maxlevel=3}, + cracky = {times={[2]=1.70, [3]=0.85}, uses=30, maxlevel=0} + }, + damage_groups = {fleshy=4, bendy=5, cracky=2}, + }, + }, +}) + +if LOAD_ORE_MODULE == true then + glooptest.tools_module.register_tools("glooptest", "alatro", "Alatro", "glooptest:alatro_ingot", { + handsaw = { + makes = true, + texture = "glooptest_tool_alatrohandsaw.png", + caps = { + full_punch_interval = 1.0, + max_drop_level = 0, + groupcaps = { + snappy = {times={[2]=0.70, [3]=0.30}, uses=40, maxlevel=1}, + fleshy = {times={[3]=0.65}, uses=40, maxlevel=0} + }, + damage_groups = {fleshy=3, snappy=3}, + }, + }, + hammer = { + makes = true, + texture = "glooptest_tool_alatrohammer.png", + caps = { + full_punch_interval = 1.0, + max_drop_level = 0, + groupcaps = { + bendy = {times={[2]=0.85, [3]=0.55}, uses=40, maxlevel=1}, + cracky = {times={[3]=0.95}, uses=40, maxlevel=0} + }, + damage_groups = {fleshy=2, bendy=2, cracky=1}, + }, + }, + }) + glooptest.tools_module.register_tools("glooptest", "arol", "Arol", "glooptest:arol_ingot", { + handsaw = { + makes = true, + texture = "glooptest_tool_arolhandsaw.png", + caps = { + full_punch_interval = 0.5, + max_drop_level = 0, + groupcaps = { + snappy = {times={[2]=1.00, [3]=0.80}, uses=300, maxlevel=1}, + fleshy = {times={[3]=1.20}, uses=300, maxlevel=0} + }, + damage_groups = {fleshy=3, snappy=3}, + }, + }, + hammer = { + makes = true, + texture = "glooptest_tool_arolhammer.png", + caps = { + full_punch_interval = 0.5, + max_drop_level = 0, + groupcaps = { + bendy = {times={[2]=1.65, [3]=1.00}, uses=300, maxlevel=1}, + cracky = {times={[3]=1.65}, uses=300, maxlevel=0} + }, + damage_groups = {fleshy=2, bendy=2, cracky=1}, + }, + }, + }) +end
\ No newline at end of file |