From 44a91443953e72231ae787a9a9a1ccdce2f18b2c Mon Sep 17 00:00:00 2001 From: IIIullaIII Date: Sat, 15 Jul 2017 22:22:02 +0200 Subject: [PATCH] Add files via upload --- LICENSE.txt | 200 +++++++++++++++++++ README_LEGGIMI.txt | 7 + armor.lua | 259 ++++++++++++++++++++++++ canapa.lua | 150 ++++++++++++++ craft.lua | 157 +++++++++++++++ depends.txt | 7 + init.lua | 142 ++++++++++++++ tools.lua | 477 +++++++++++++++++++++++++++++++++++++++++++++ 8 files changed, 1399 insertions(+) create mode 100644 LICENSE.txt create mode 100644 README_LEGGIMI.txt create mode 100644 armor.lua create mode 100644 canapa.lua create mode 100644 craft.lua create mode 100644 depends.txt create mode 100644 init.lua create mode 100644 tools.lua diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..ceb10a5 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,200 @@ +CANNABIS_MOD"BY ULLA" + + +THIS MODE IS CREATED FOR MINETEST FROM +ULLA +USE PERSONAL CODE (CC BY-SA 3.0 IT) +AND MODIFIED CODE REQUIRED BY OTHER MODS WHICH: + 3d_armor_ modpack + MINETEST default + +FOR THESE MODS YOU MUST VISIT ORIGINAL LICENSES OF WHICH: + +3D Armor - Visible Player Armor +=============================== + +License Source Code: Copyright (C) 2013-2017 Stuart Jones - LGPL v2.1 + +Armor Textures: Copyright (C) 2013-2017 Ryan Jones - CC-BY-SA 3.0 + +Special credit to Jordach and MirceaKitsune for providing the default 3d character model. + + +MINETEST DEFAULT LICENSE +License of source code +---------------------- + +GNU Lesser General Public License, version 2.1 +Copyright (C) 2011-2016 celeron55, Perttu Ahola +Copyright (C) 2011-2016 Various Minetest developers and contributors + +This program is free software; you can redistribute it and/or modify it under the terms +of the GNU Lesser General Public License as published by the Free Software Foundation; +either version 2.1 of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; +without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +See the GNU Lesser General Public License for more details: +https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html + + +Licenses of media (textures, models and sounds) +----------------------------------------------- + +Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) +Copyright (C) 2010-2016: + celeron55, Perttu Ahola + Cisoun + G4JC + VanessaE + RealBadAngel + Calinou + MirceaKitsune + Jordach + PilzAdam + jojoa1997 + InfinityProject + Splizard + Zeg9 + paramat + BlockMen + sofar + Neuromancer + Gambit + asl97 + KevDoy + Mito551 + GreenXenith + kaeza + kilbith + +You are free to: +Share — copy and redistribute the material in any medium or format. +Adapt — remix, transform, and build upon the material for any purpose, even commercially. +The licensor cannot revoke these freedoms as long as you follow the license terms. + +Under the following terms: + +Attribution — You must give appropriate credit, provide a link to the license, and +indicate if changes were made. You may do so in any reasonable manner, but not in any way +that suggests the licensor endorses you or your use. + +ShareAlike — If you remix, transform, or build upon the material, you must distribute +your contributions under the same license as the original. + +No additional restrictions — You may not apply legal terms or technological measures that +legally restrict others from doing anything the license permits. + +Notices: + +You do not have to comply with the license for elements of the material in the public +domain or where your use is permitted by an applicable exception or limitation. +No warranties are given. The license may not give you all of the permissions necessary +for your intended use. For example, other rights such as publicity, privacy, or moral +rights may limit how you use the material. + +For more details: +http://creativecommons.org/licenses/by-sa/3.0/ + +----------------------- + +Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) +Copyright (C) 2014-2016 brunob.santos + +You are free to: +Share — copy and redistribute the material in any medium or format. +Adapt — remix, transform, and build upon the material for any purpose, even commercially. +The licensor cannot revoke these freedoms as long as you follow the license terms. + +Under the following terms: + +Attribution — You must give appropriate credit, provide a link to the license, and +indicate if changes were made. You may do so in any reasonable manner, but not in any way +that suggests the licensor endorses you or your use. + +ShareAlike — If you remix, transform, or build upon the material, you must distribute +your contributions under the same license as the original. + +No additional restrictions — You may not apply legal terms or technological measures that +legally restrict others from doing anything the license permits. + +Notices: + +You do not have to comply with the license for elements of the material in the public +domain or where your use is permitted by an applicable exception or limitation. +No warranties are given. The license may not give you all of the permissions necessary +for your intended use. For example, other rights such as publicity, privacy, or moral +rights may limit how you use the material. + +For more details: +http://creativecommons.org/licenses/by-sa/4.0/ + +----------------------- + +Attribution-ShareAlike 2.0 Generic (CC BY-SA 2.0) +Copyright (C) 2014-2016 Neuromancer + + +You are free to: +Share — copy and redistribute the material in any medium or format. +Adapt — remix, transform, and build upon the material for any purpose, even commercially. +The licensor cannot revoke these freedoms as long as you follow the license terms. + +Under the following terms: + +Attribution — You must give appropriate credit, provide a link to the license, and +indicate if changes were made. You may do so in any reasonable manner, but not in any way +that suggests the licensor endorses you or your use. + +ShareAlike — If you remix, transform, or build upon the material, you must distribute +your contributions under the same license as the original. + +No additional restrictions — You may not apply legal terms or technological measures that +legally restrict others from doing anything the license permits. + +Notices: + +You do not have to comply with the license for elements of the material in the public +domain or where your use is permitted by an applicable exception or limitation. +No warranties are given. The license may not give you all of the permissions necessary +for your intended use. For example, other rights such as publicity, privacy, or moral +rights may limit how you use the material. + +For more details: +http://creativecommons.org/licenses/by-sa/2.0/ + +----------------------- + +Attribution 3.0 Unported (CC BY 3.0) +Copyright (C) 2009 cmusounddesign +Copyright (C) 2010 Tomlija +Copyright (C) 2010 lsprice +Copyright (C) 2014 sonictechtonic +Copyright (C) 2015 yadronoff +Copyright (C) 2007 HerbertBoland +Copyright (C) 2006 AGFX + +You are free to: +Share — copy and redistribute the material in any medium or format. +Adapt — remix, transform, and build upon the material for any purpose, even commercially. +The licensor cannot revoke these freedoms as long as you follow the license terms. + +Under the following terms: + +Attribution — You must give appropriate credit, provide a link to the license, and +indicate if changes were made. You may do so in any reasonable manner, but not in any way +that suggests the licensor endorses you or your use. + +No additional restrictions — You may not apply legal terms or technological measures that +legally restrict others from doing anything the license permits. + +Notices: + +You do not have to comply with the license for elements of the material in the public +domain or where your use is permitted by an applicable exception or limitation. +No warranties are given. The license may not give you all of the permissions necessary +for your intended use. For example, other rights such as publicity, privacy, or moral +rights may limit how you use the material. + +For more details: +http://creativecommons.org/licenses/by/3.0/ diff --git a/README_LEGGIMI.txt b/README_LEGGIMI.txt new file mode 100644 index 0000000..7e96ca2 --- /dev/null +++ b/README_LEGGIMI.txt @@ -0,0 +1,7 @@ +rename the mod to: + +cannabis + +rinominare la mod in + +cannabis diff --git a/armor.lua b/armor.lua new file mode 100644 index 0000000..b56678c --- /dev/null +++ b/armor.lua @@ -0,0 +1,259 @@ + + --armor + + if minetest.get_modpath("cannabis") then + local stats = { + fibra = { name="fibra", armor=1.8, heal=10, use=650 }, + tessuto= { name="tessuto", armor=2.5, heal=8, use=200 }, + foglie = { name="foglie", armor=2.7, heal=10, use=100 }, + high = { name="high_performance", armor=2.7, heal=10, use=75 }, + } + local mats = { + fibra="cannabis:fibra_ingot", + tessuto="cannabis:tessuto_ingot", + foglie="cannabis:foglie_ingot", + high="cannabis:high_performance_ingot", + } + for k, v in pairs(stats) do + minetest.register_tool("cannabis:helmet_"..k, { + description = v.name.." Helmet", + inventory_image = "cannabis_armor_inv_helmet_"..k..".png", + groups = {armor_head=math.floor(5*v.armor), armor_heal=v.heal, armor_use=v.use}, + wear = 0, + }) + minetest.register_tool("cannabis:chestplate_"..k, { + description = v.name.." Chestplate", + inventory_image = "cannabis_armor_inv_chestplate_"..k..".png", + groups = {armor_torso=math.floor(8*v.armor), armor_heal=v.heal, armor_use=v.use}, + wear = 0, + }) + minetest.register_tool("cannabis:leggings_"..k, { + description = v.name.." Leggings", + inventory_image = "cannabis_armor_inv_leggings_"..k..".png", + groups = {armor_legs=math.floor(7*v.armor), armor_heal=v.heal, armor_use=v.use}, + wear = 0, + }) + minetest.register_tool("cannabis:boots_"..k, { + description = v.name.." Boots", + inventory_image = "cannabis_armor_inv_boots_"..k..".png", + groups = {armor_feet=math.floor(4*v.armor), armor_heal=v.heal, armor_use=v.use}, + wear = 0, + }) + end + + for k, v in pairs(mats) do + minetest.register_craft({ + output = "cannabis:helmet_"..k, + recipe = { + {v, v, v}, + {v, "", v}, + {"", "", ""}, + }, + }) + minetest.register_craft({ + output = "cannabis:chestplate_"..k, + recipe = { + {v, "", v}, + {v, v, v}, + {v, v, v}, + }, + }) + minetest.register_craft({ + output = "cannabis:leggings_"..k, + recipe = { + {v, v, v}, + {v, "", v}, + {v, "", v}, + }, + }) + minetest.register_craft({ + output = "cannabis:boots_"..k, + recipe = { + {v, "", v}, + {v, "", v}, + }, + }) + end + if minetest.get_modpath("shields") then + for k, v in pairs(stats) do + minetest.register_tool("cannabis:shield_"..k, { + description = v.name.." hemp Shield", + inventory_image = "cannabis_armor_inv_shield_"..k..".png", + groups = {armor_shield=math.floor(5*v.armor), armor_heal=v.heal, armor_use=v.use}, + wear = 0, + }) + local m = mats[k] + minetest.register_craft({ + output = "cannabis:shield_"..k, + recipe = { + {m, m, m}, + {m, m, m}, + {"", m, ""}, + }, + }) + end + end +end + +minetest.register_craftitem("cannabis:mixed_hr_ingot", { + description = ("Mixed HR Ingot"), + inventory_image = "cannabis_mixed_hr_ingot.png", +}) + +minetest.register_craftitem(":cannabis:fibra_ingot", { + description = ("fibra Ingot"), + inventory_image = "cannabis_fibra_ingot.png", +}) +minetest.register_craftitem(":cannabis:foglie_ingot", { + description = ("foglie Ingot"), + inventory_image = "cannabis_foglie_ingot.png", +}) +minetest.register_craftitem("cannabis:high_performance_ingot", { + description = ("High Performance Ingot"), + inventory_image = "cannabis_high_performance_ingot.png", +}) +minetest.register_craftitem(":cannabis:tessuto_ingot", { + description = ("Tessuto Ingot"), + inventory_image = "cannabis_tessuto_ingot.png", +}) +local function for_each_registered_item(action) + local already_reg = {} + for k, _ in pairs(minetest.registered_items) do + table.insert(already_reg, k) + end + local really_register_craftitem = minetest.register_craftitem + minetest.register_craftitem = function(name, def) + really_register_craftitem(name, def) + action(string.gsub(name, "^:", "")) + end + local really_register_tool = minetest.register_tool + minetest.register_tool = function(name, def) + really_register_tool(name, def) + action(string.gsub(name, "^:", "")) + end + local really_register_node = minetest.register_node + minetest.register_node = function(name, def) + really_register_node(name, def) + action(string.gsub(name, "^:", "")) + end + for _, name in ipairs(already_reg) do + action(name) + end +end + +local function register_block(block, ingot) + minetest.register_craft({ + output = block, + recipe = { + {ingot, ingot, ingot}, + {ingot, ingot, ingot}, + {ingot, ingot, ingot}, + } + }) + + minetest.register_craft({ + output = ingot.." 9", + recipe = { + {block} + } + }) +end + +register_block("cannabis:cannabis_fibra_block", "cannabis:fibra_ingot") +register_block("cannabis:cannabis_high_performance_block", "cannabis:high_performance_ingot") +register_block("cannabis:cannabis_tessuto_block", "cannabis:tessuto_ingot") +register_block("cannabis:cannabis_foglie_block", "cannabis:foglie_ingot") + +minetest.register_node("cannabis:cannabis_foglie_block", { + description = ("Foglie Block"), + tiles = { "cannabis_foglie_block.png" }, + is_ground_content = true, + groups = {cracky=1, level=2}, + sounds = "cannabis:cannabis_canapa_s3" +}) + +minetest.register_node("cannabis:cannabis_tessuto_block", { + description = ("Tessuto Block"), + tiles = { "cannabis_tessuto_block.png" }, + is_ground_content = true, + groups = {cracky=1, level=2}, + sounds = "cannabis_canapa_s3" +}) +--register node + + +minetest.register_node("cannabis:hp_block_canapa", + { + description = "hp_block_canapa", + tiles = {"hp_block_canapa.png"}, + is_ground_content = false, + groups = {choppy = 30, oddly_breakable_by_hand = 1, flammable = 3, wood = 1}, + sounds = "cannabis:cannabis_canapa_s2", +}) + + +minetest.register_node("cannabis:cannabis_high_performance_block", { + description = ("High Performance Block"), + tiles = { "cannabis_high_performance_block.png" }, + is_ground_content = true, + groups = {cracky=1, level=2}, + sounds = "cannabis_canapa_s3" +}) +minetest.register_node("cannabis:cannabis_fibra_block", { + description = ("Fibra Block"), + tiles = { "cannabis_fibra_block.png" }, + is_ground_content = true, + groups = {cracky=1, level=2}, + sounds = "cannabis_canapa_s3" +}) + +minetest.register_craft({ + type = 'cooking', + recipe = "cannabis:canapa_fiber", + output = "cannabis:fibra_ingot", +}) + + +minetest.register_craft({ + type = 'cooking', + recipe = "cannabis:canapa_leaves", + output = "cannabis:foglie_ingot", +}) + +minetest.register_craft({ + type = 'cooking', + recipe = "cannabis:canapa_paper", + output = "cannabis:tessuto_ingot", +}) + +minetest.register_craft({ + type = 'cooking', + recipe = "cannabis:canapa_plastic", + cooktime = 2, + output = "cannabis:high_performance_ingot", +}) + +local function for_each_registered_item(action) + local already_reg = {} + for k, _ in pairs(minetest.registered_items) do + table.insert(already_reg, k) + end + local really_register_craftitem = minetest.register_craftitem + minetest.register_craftitem = function(name, def) + really_register_craftitem(name, def) + action(string.gsub(name, "^:", "")) + end + local really_register_tool = minetest.register_tool + minetest.register_tool = function(name, def) + really_register_tool(name, def) + action(string.gsub(name, "^:", "")) + end + local really_register_node = minetest.register_node + minetest.register_node = function(name, def) + really_register_node(name, def) + action(string.gsub(name, "^:", "")) + end + for _, name in ipairs(already_reg) do + action(name) + end +end diff --git a/canapa.lua b/canapa.lua new file mode 100644 index 0000000..3a6a674 --- /dev/null +++ b/canapa.lua @@ -0,0 +1,150 @@ +minetest.register_alias("canapa", "cannabis:canapa") +--nodes + +minetest.register_node("cannabis:canapa", { + description = "canapa", + drawtype = "plantlike", + tiles = {"cannabis_canapa.png"}, + inventory_image = "cannabis_canapa.png", + wield_image = "cannabis_canapa.png", + paramtype = "light", + sunlight_propagates = true, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3} + }, + groups = {snappy=3,flammable=2}, + sounds = default.node_sound_leaves_defaults(), + drop = { + max_items = 2, + items = { + {items = {"cannabis:canapa"}, rarity = 1 }, + {items = {"cannabis:canapa_leaves"}, rarity = 1 }, + } +}, + after_dig_node = function(pos, node, metadata, digger) + default.dig_up(pos, node, digger) + end, +}) + +-- Papyrus + + + -- canapa mapgen + + minetest.register_decoration({ + deco_type = "simple", + place_on = {"default:dirt_with_grass"}, + sidelen = 16, + noise_params = { + offset = -0.3, + scale = 0.7, + spread = {x = 50, y = 50, z = 50}, + seed = 454, + octaves = 3, + persist = 0.7 + }, + y_min = 1, + y_max = 1, + decoration = "cannabis:canapa", + height = 2, + height_max = 6, + spawn_by = "default:water_source", + num_spawn_by = 1, + }) + + + +--mapgen cannabis + minetest.register_decoration({ + deco_type = "schematic", + place_on = {"default:dirt", "default:dirt_with_grass"}, + sidelen = 16, + noise_params = { + offset = -0.3, + scale = 0.7, + spread = {x=100, y=100, z=100}, + seed = 354, + octaves = 3, + persist = 0.7 + }, + biomes = {"savanna_shore"}, + y_min = 1, + y_max = 6, + schematic = minetest.get_modpath("cannabis").."/schematics/canapa.mts", + }) + + -- canapa grow + + function minetest.grow_canapa(pos, node) + pos.y = pos.y - 1 + local name = minetest.get_node(pos).name + if name ~= "default:dirt_with_grass" and name ~= "default:dirt" then + return + end + if not minetest.find_node_near(pos, 3, {"group:water"}) then + return + end + pos.y = pos.y + 1 + local height = 0 + while node.name == "cannabis:canapa" and height < 6 do + height = height + 1 + pos.y = pos.y + 1 + node = minetest.get_node(pos) + end + if height == 6 or node.name ~= "air" then + return + end + minetest.set_node(pos, {name = "cannabis:canapa"}) + return true + end + +minetest.register_abm({ + nodenames = {"cannabis:canapa"}, + neighbors = {"default:dirt", "default:dirt_with_grass"}, + interval = 10, + chance = 2, + action = function(...) + minetest.grow_canapa(...) + end +}) + + + +function default.dig_up(pos, node, digger) + if digger == nil then return end + local np = {x = pos.x, y = pos.y + 1, z = pos.z} + local nn = minetest.get_node(np) + if nn.name == node.name then + minetest.node_dig(np, nn, digger) + end +end + +--craft + +minetest.register_craft({ + output = 'cannabis:paper', + recipe = { + {'cannabis:canapa', 'cannabis:canapa', 'cannabis:canapa'}, + } +}) +minetest.register_craft({ + output = 'cannabis:canapa_fuel 4 ', + recipe ={ + {"cannabis:canapa","cannabis:canapa",""}, + {"cannabis:canapa","cannabis:canapa",""}, + {"cannabis:canapa","cannabis:canapa",""}, + } +}) + minetest.register_craft({ + type = "fuel", + recipe = "cannabis:canapa_fuel", + burntime = 25, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "cannabis:canapa", + burntime = 10, +}) diff --git a/craft.lua b/craft.lua new file mode 100644 index 0000000..6c52252 --- /dev/null +++ b/craft.lua @@ -0,0 +1,157 @@ +--crafting + +minetest.register_craft({ + output = 'cannabis:canapa_oil 4 ', + recipe = { + {"","",""}, + {"","",""}, + {"cannabis:canapa_flower","cannabis:canapa_raisin","cannabis:canapa_flower"}, + } +}) + + + +minetest.register_craft({ + output = 'cannabis:canapa_plastic 8 ', + recipe ={ + {"cannabis:canapa","cannabis:canapa","cannabis:canapa"}, + {"cannabis:canapa","cannabis:canapa","cannabis:canapa"}, + } +}) + + + minetest.register_craft({ + output = 'cannabis:canapa_glue 10 ', + recipe = { + {"cannabis:canapa_plastic","cannabis:canapa_raisin","cannabis:canapa_plastic"}, + {"cannabis:canapa_raisin","cannabis:canapa_oil","cannabis:canapa_raisin"}, + {"cannabis:canapa_plastic","cannabis:canapa_raisin","cannabis:canapa_plastic"}, + } +}) + + minetest.register_craft({ + output = 'cannabis:hp_block_canapa 4 ', + recipe = { + {"cannabis:canapa_fiber","cannabis:canapa_glue","cannabis:canapa_fiber"}, + {"cannabis:canapa_glue","cannabis:canapa_fiber","cannabis:canapa_glue"}, + {"cannabis:canapa_fiber","cannabis:canapa_glue","cannabis:canapa_fiber"}, + } +}) + + + minetest.register_craft({ + output = 'cannabis:canapa_raisin 3 ', + recipe = { + {"","",""}, + {"","",""}, + {"cannabis:canapa_flower","cannabis:canapa_flower",""}, + } +}) + + +minetest.register_craft({ + output = 'cannabis:canapa_flower 5 ', + recipe = { + {"","",""}, + {"","",""}, + {"cannabis:canapa_leaves","cannabis:canapa_leaves",""}, + } +}) + + +minetest.register_craft({ + output = 'cannabis:canapa_seed 10 ', + recipe = { + {"cannabis:canapa","",""}, + {"","cannabis:canapa",""}, + {"","","cannabis:canapa"}, + } +}) + + +minetest.register_craft({ + output = 'cannabis:canapa_fiber 10 ', + recipe = { + {"","","cannabis:canapa"}, + {"","cannabis:canapa",""}, + {"cannabis:canapa","",""}, + } +}) + +minetest.register_craft({ + type = "shapeless", + output = "cannabis:canapa_flour 4", + recipe = {"cannabis:canapa_seed", "cannabis:canapa_seed", "cannabis:canapa_seed", "cannabis:canapa_seed"} +}) + +minetest.register_craft({ + type = "cooking", + cooktime = 15, + output = "cannabis:canapa_bread", + recipe = "cannabis:canapa_flour" +}) +--__________________________________________________________________________________________________ + +minetest.register_craft({ + output = 'cannabis:canapa_fuel 4 ', + recipe ={ + {"cannabis:canapa","cannabis:canapa",""}, + {"cannabis:canapa","cannabis:canapa",""}, + {"cannabis:canapa","cannabis:canapa",""}, + } +}) + minetest.register_craft({ + type = "fuel", + recipe = "cannabis:canapa_fuel", + burntime = 25, +}) + minetest.register_craft({ + type = "fuel", + recipe = "cannabis:canapa", + burntime = 5, +}) + minetest.register_craft({ + output = 'cannabis:canapa_paper 6 ', + recipe = { + {'cannabis:canapa', 'cannabis:canapa', 'cannabis:canapa' + }, + } +}) + +minetest.register_craft({ + type = "shapeless", + output = "cannabis:climbing 30", + recipe = {"cannabis:cannabis_foglie_block", "cannabis:cannabis_foglie_block", "cannabis:cannabis_foglie_block"} +}) + +minetest.register_craft({ + type = "shapeless", + output = "cannabis:mixed_hr_ingot 3", + recipe = {"cannabis:fibra_ingot", "cannabis:foglie_ingot", "cannabis:tessuto_ingot"} +}) + +minetest.register_craft({ + type = 'cooking', + recipe = "cannabis:canapa_fiber", + output = "cannabis:fibra_ingot", +}) + + +minetest.register_craft({ + type = 'cooking', + recipe = "cannabis:canapa_leaves", + output = "cannabis:foglie_ingot", +}) + +minetest.register_craft({ + type = 'cooking', + recipe = "cannabis:canapa_paper", + output = "cannabis:tessuto_ingot", +}) + +minetest.register_craft({ + type = 'cooking', + recipe = "cannabis:canapa_plastic", + cooktime = 2, + output = "cannabis:high_performance_ingot", +}) diff --git a/depends.txt b/depends.txt new file mode 100644 index 0000000..e5e76f2 --- /dev/null +++ b/depends.txt @@ -0,0 +1,7 @@ +default +3d_armor + + + + + diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..68087ca --- /dev/null +++ b/init.lua @@ -0,0 +1,142 @@ +--aliases +minetest.get_modpath("cannabis") +--minetest.register_alias("canapa","cannabis:canapa") + +--tools +local path = minetest.get_modpath("cannabis") +dofile(path.."/tools.lua") +dofile(path.."/canapa.lua") +dofile(path.."/craft.lua") +dofile(path.."/armor.lua") + + + + + + + +--craft item :fiber, fuel, plastic, paper,flower,oil,flour,bred,raisin,seed,leaves + +minetest.register_craftitem("cannabis:canapa_fiber", { + description = "Fiber", + inventory_image = "cannabis_canapa_fiber.png", +}) +minetest.register_craftitem("cannabis:canapa_fuel", { + description = "Fuel", + inventory_image = "cannabis_fuel.png", +}) + +minetest.register_craftitem("cannabis:canapa_plastic", { + description = "Plastic", + inventory_image = "cannabis_plastic.png", +}) + +minetest.register_craftitem("cannabis:canapa_paper", { + description = "Paper", + inventory_image = "cannabis_paper.png", +}) +minetest.register_craftitem("cannabis:canapa_flour", { + description = "Flour", + inventory_image = "cannabis_canapa_flour.png", +}) + +minetest.register_craftitem("cannabis:canapa_bread", { + description = "Bread", + inventory_image = "cannabis_canapa_bread.png", + on_use = minetest.item_eat(10), +}) + +minetest.register_craftitem("cannabis:canapa_seed", { + description = "Hemp_Seed", + inventory_image = "cannabis_canapa_seed.png", + on_use = minetest.item_eat(10), +}) + +minetest.register_craftitem("cannabis:canapa_leaves", { + description = "Hemp_Leaves", + inventory_image = "cannabis_canapa_leaves.png", + on_use = minetest.item_eat(5), +}) + +minetest.register_craftitem("cannabis:canapa_flower", { + description = "Hemp_Flower", + inventory_image = "cannabis_canapa_flower.png", + on_use = minetest.item_eat(5), +}) + +minetest.register_craftitem("cannabis:canapa_raisin", { + description = "Hemp_Raisin", + inventory_image = "cannabis_canapa_raisin.png", + on_use = minetest.item_eat(5), +}) + +minetest.register_craftitem("cannabis:canapa_oil", { + description = "Hemp_Oil", + inventory_image = "cannabis_canapa_oil.png", + on_use = minetest.item_eat(5), +}) + +minetest.register_craftitem("cannabis:canapa_glue", { + description = "Hemp_Glue", + inventory_image = "cannabis_canapa_glue.png", + on_use = minetest.item_eat(1), +}) + + + + +-- This file supplies hemp for the plantlife modpack +-- Last revision: 2016-01-14 + + + + + +minetest.register_node('cannabis:seedling', { + description = ("hemp (seedling)"), + drawtype = 'plantlike', + waving = 1, + tiles = { '1hemp_seedling.png' }, + inventory_image = '1hemp_seedling.png', + wield_image = '1hemp_seedling.png', + sunlight_propagates = true, + paramtype = 'light', + walkable = false, + groups = { snappy = 3, poisonivy=1, flora_block=1 }, + sounds = "cannabis_canapa_s3", + buildable_to = true, +}) + +minetest.register_node('cannabis:sproutling', { + description = ("hemp (sproutling)"), + drawtype = 'plantlike', + waving = 1, + tiles = { 'hemp_sproutling.png' }, + inventory_image = 'hemp_sproutling.png', + wield_image = 'hemp_sproutling.png', + sunlight_propagates = true, + paramtype = 'light', + walkable = false, + groups = { snappy = 3, poisonivy=1, flora_block=1 }, + sounds = "cannabis_canapa_s3", + buildable_to = true, +}) + +minetest.register_node('cannabis:climbing', { + description = ("hemp (climbing plant)"), + drawtype = 'signlike', + tiles = { 'hemp_climbing.png' }, + inventory_image = 'hemp_climbing.png', + wield_image = 'hemp_climbing.png', + sunlight_propagates = true, + paramtype = 'light', + paramtype2 = 'wallmounted', + walkable = false, + groups = { snappy = 3, poisonivy=1, flora_block=1 }, + sounds = "cannabis_canapa_s3", + selection_box = { + type = "wallmounted", + --wall_side = = + }, + buildable_to = true, +}) diff --git a/tools.lua b/tools.lua new file mode 100644 index 0000000..3f9c263 --- /dev/null +++ b/tools.lua @@ -0,0 +1,477 @@ +-- [[mods/cannabis/tools.lua]] + +--REGISTER TOOLS : PICKS SHOVELS AXES SWORDS +-- +-- Picks______________________________________________________________________________ +-- + + +minetest.register_tool("cannabis:pick_hemp_steel", { + description = "HSteel Pickaxe", + inventory_image = "cannabis_tool_steelpick.png", + tool_capabilities = { + full_punch_interval = 1.0, + max_drop_level=1, + groupcaps={ + cracky = {times={[1]=4.00, [2]=1.60, [3]=0.80}, uses=20, maxlevel=2}, + }, + damage_groups = {fleshy=4}, + }, +}) +minetest.register_tool("cannabis:pick_hemp_bronze", { + description = "HBronze Pickaxe", + inventory_image = "cannabis_tool_bronzepick.png", + tool_capabilities = { + full_punch_interval = 1.0, + max_drop_level=1, + groupcaps={ + cracky = {times={[1]=4.00, [2]=1.60, [3]=0.80}, uses=30, maxlevel=2}, + }, + damage_groups = {fleshy=4}, + }, +}) +minetest.register_tool("cannabis:pick_hemp_mese", { + description = "HMese Pickaxe", + inventory_image = "cannabis_tool_mesepick.png", + tool_capabilities = { + full_punch_interval = 0.9, + max_drop_level=3, + groupcaps={ + cracky = {times={[1]=2.4, [2]=1.2, [3]=0.60}, uses=20, maxlevel=3}, + }, + damage_groups = {fleshy=5}, + }, +}) +minetest.register_tool("cannabis:pick_hemp_diamond", { + description = "HDiamond Pickaxe", + inventory_image = "cannabis_tool_diamondpick.png", + tool_capabilities = { + full_punch_interval = 0.9, + max_drop_level=3, + groupcaps={ + cracky = {times={[1]=2.0, [2]=1.0, [3]=0.50}, uses=30, maxlevel=3}, + }, + damage_groups = {fleshy=5}, + }, +}) +minetest.register_tool("cannabis:pick_hemp_high", { + description = "Hemp_high Pickaxe", + inventory_image = "cannabis_tool_highpick.png", + tool_capabilities = { + full_punch_interval = 0.9, + max_drop_level=3, + groupcaps={ + cracky = {times={[1]=0.3, [2]=0.2, [3]=0.1}, uses=40, maxlevel=3}, + }, + damage_groups = {fleshy=5}, + }, +}) +-- +-- Shovels___________________________________________________________________________________________________________ +-- + +minetest.register_tool("cannabis:shovel_hemp_high", { + description = "Hemp_high Shovel", + inventory_image = "cannabis_tool_highshovel.png", + wield_image = "cannabis_tool_highshovel.png^[transformR90", + tool_capabilities = { + full_punch_interval = 1.2, + max_drop_level=3, + groupcaps={ + crumbly = {times={[1]=1.00, [2]=0.40, [3]=0.25}, uses=40, maxlevel=3}, + }, + damage_groups = {fleshy=2}, + }, +}) + +minetest.register_tool("cannabis:shovel_hemp_steel", { + description = "HSteel Shovel", + inventory_image = "cannabis_tool_steelshovel.png", + wield_image = "cannabis_tool_steelshovel.png^[transformR90", + tool_capabilities = { + full_punch_interval = 1.1, + max_drop_level=1, + groupcaps={ + crumbly = {times={[1]=1.50, [2]=0.90, [3]=0.40}, uses=30, maxlevel=2}, + }, + damage_groups = {fleshy=3}, + }, +}) +minetest.register_tool("cannabis:shovel_hemp_bronze", { + description = "HBronze Shovel", + inventory_image = "cannabis_tool_bronzeshovel.png", + wield_image = "cannabis_tool_bronzeshovel.png^[transformR90", + tool_capabilities = { + full_punch_interval = 1.1, + max_drop_level=1, + groupcaps={ + crumbly = {times={[1]=1.50, [2]=0.90, [3]=0.40}, uses=40, maxlevel=2}, + }, + damage_groups = {fleshy=3}, + }, +}) +minetest.register_tool("cannabis:shovel_hemp_mese", { + description = "HMese Shovel", + inventory_image = "cannabis_tool_meseshovel.png", + wield_image = "cannabis_tool_meseshovel.png^[transformR90", + tool_capabilities = { + full_punch_interval = 1.0, + max_drop_level=3, + groupcaps={ + crumbly = {times={[1]=1.20, [2]=0.60, [3]=0.30}, uses=20, maxlevel=3}, + }, + damage_groups = {fleshy=4}, + }, +}) +minetest.register_tool("cannabis:shovel_hemp_diamond", { + description = "HDiamond Shovel", + inventory_image = "cannabis_tool_diamondshovel.png", + wield_image = "cannabis_tool_diamondshovel.png^[transformR90", + tool_capabilities = { + full_punch_interval = 1.0, + max_drop_level=1, + groupcaps={ + crumbly = {times={[1]=1.10, [2]=0.50, [3]=0.30}, uses=30, maxlevel=3}, + }, + damage_groups = {fleshy=4}, + }, +}) + + --[[minetest.register_item(":", { + type = "none", + wield_image = "wieldhand.png", + wield_scale = {x=1,y=1,z=2.5}, + tool_capabilities = { + full_punch_interval = 0.9, + max_drop_level = 0, + groupcaps = { + crumbly = {times={[2]=3.00, [3]=0.70}, uses=0, maxlevel=1}, + snappy = {times={[3]=0.40}, uses=0, maxlevel=1}, + oddly_breakable_by_hand = {times={[1]=3.50,[2]=2.00,[3]=0.70}, uses=0} + }, + damage_groups = {fleshy=1}, + } +}) + +]]-- +-- Axes____________________________________________________________________________________________________ +-- +minetest.register_tool("cannabis:axe_hemp_steel", { + description = "HSteel Axe", + inventory_image = "cannabis_tool_steelaxe.png", + tool_capabilities = { + full_punch_interval = 1.0, + max_drop_level=1, + groupcaps={ + choppy={times={[1]=2.50, [2]=1.40, [3]=1.00}, uses=20, maxlevel=2}, + }, + damage_groups = {fleshy=4}, + }, +}) +minetest.register_tool("cannabis:axe_hemp_bronze", { + description = "HBronze Axe", + inventory_image = "cannabis_tool_bronzeaxe.png", + tool_capabilities = { + full_punch_interval = 1.0, + max_drop_level=1, + groupcaps={ + choppy={times={[1]=2.50, [2]=1.40, [3]=1.00}, uses=30, maxlevel=2}, + }, + damage_groups = {fleshy=4}, + }, +}) +minetest.register_tool("cannabis:axe_hemp_mese", { + description = "HMese Axe", + inventory_image = "cannabis_tool_meseaxe.png", + tool_capabilities = { + full_punch_interval = 0.9, + max_drop_level=1, + groupcaps={ + choppy={times={[1]=2.20, [2]=1.00, [3]=0.60}, uses=20, maxlevel=3}, + }, + damage_groups = {fleshy=6}, + }, +}) +minetest.register_tool("cannabis:axe_hemp_diamond", { + description = "HDiamond Axe", + inventory_image = "cannabis_tool_diamondaxe.png", + tool_capabilities = { + full_punch_interval = 0.9, + max_drop_level=1, + groupcaps={ + choppy={times={[1]=2.10, [2]=0.90, [3]=0.50}, uses=30, maxlevel=2}, + }, + damage_groups = {fleshy=7}, + }, +}) +minetest.register_tool("cannabis:axe_hemp_high", { + description = "Hemp_high Axe", + inventory_image = "cannabis_tool_highaxe.png", + tool_capabilities = { + full_punch_interval = 0.9, + max_drop_level=1, + groupcaps={ + choppy={times={[1]=2.00, [2]=0.80, [3]=0.40}, uses=40, maxlevel=3}, + }, + damage_groups = {fleshy=8}, + }, +}) +-- +-- Swords___________________________________________________________________________________________________ + +minetest.register_tool("cannabis:sword_hemp_steel", { + description = "HSteel Sword", + inventory_image = "cannabis_tool_steelsword.png", + tool_capabilities = { + full_punch_interval = 0.8, + max_drop_level=1, + groupcaps={ + snappy={times={[1]=2.5, [2]=1.20, [3]=0.35}, uses=30, maxlevel=2}, + }, + damage_groups = {fleshy=6}, + } +}) +minetest.register_tool("cannabis:sword_hemp_bronze", { + description = "HBronze Sword", + inventory_image = "cannabis_tool_bronzesword.png", + tool_capabilities = { + full_punch_interval = 0.8, + max_drop_level=1, + groupcaps={ + snappy={times={[1]=2.5, [2]=1.20, [3]=0.35}, uses=40, maxlevel=2}, + }, + damage_groups = {fleshy=6}, + } +}) +minetest.register_tool("cannabis:sword_hemp_mese", { + description = "HMese Sword", + inventory_image = "cannabis_tool_mesesword.png", + tool_capabilities = { + full_punch_interval = 0.7, + max_drop_level=1, + groupcaps={ + snappy={times={[1]=2.0, [2]=1.00, [3]=0.35}, uses=30, maxlevel=3}, + }, + damage_groups = {fleshy=7}, + } +}) +minetest.register_tool("cannabis:sword_hemp_diamond", { + description = "HDiamond Sword", + inventory_image = "cannabis_tool_diamondsword.png", + tool_capabilities = { + full_punch_interval = 0.7, + max_drop_level=1, + groupcaps={ + snappy={times={[1]=1.90, [2]=0.90, [3]=0.30}, uses=40, maxlevel=3}, + }, + damage_groups = {fleshy=8}, + } +}) +minetest.register_tool("cannabis:sword_hemp_high", { + description = "Hemp_high Sword", + inventory_image = "cannabis_tool_highsword.png", + tool_capabilities = { + full_punch_interval = 0.7, + max_drop_level=1, + groupcaps={ + snappy={times={[1]=1.80, [2]=0.80, [3]=0.25}, uses=50, maxlevel=3}, + }, + damage_groups = {fleshy=9}, + } +}) + +--CRAFT RECIPE + +--pick:___________________________________________________________________ + +minetest.register_craft({ + output = 'cannabis:pick_hemp_high', + recipe = { + {'cannabis:mixed_hr_ingot', 'cannabis:mixed_hr_ingot', 'cannabis:mixed_hr_ingot'}, + {'', 'group:stick', ''}, + {'', 'group:stick', ''}, + } +}) + + + +minetest.register_craft({ + output = 'cannabis:pick_hemp_steel', + recipe = { + {'default:steel_ingot', 'cannabis:high_performance_ingot', 'default:steel_ingot'}, + {'', 'group:stick', ''}, + {'', 'group:stick', ''}, + } +}) + +minetest.register_craft({ + output = 'cannabis:pick_hemp_bronze', + recipe = { + {'default:bronze_ingot', 'cannabis:foglie_ingot', 'default:bronze_ingot'}, + {'', 'group:stick', ''}, + {'', 'group:stick', ''}, + } +}) + +minetest.register_craft({ + output = 'cannabis:pick_hemp_mese', + recipe = { + {'default:mese_crystal', 'cannabis:fibra_ingot', 'default:mese_crystal'}, + {'', 'group:stick', ''}, + {'', 'group:stick', ''}, + } +}) + +minetest.register_craft({ + output = 'cannabis:pick_hemp_diamond', + recipe = { + {'default:diamond', 'cannabis:tessuto_ingot', 'default:diamond'}, + {'', 'group:stick', ''}, + {'', 'group:stick', ''}, + } +}) + +--shovel__________________________________________________________________________________________ + +minetest.register_craft({ + output = 'cannabis:shovel_hemp_high', + recipe = { + {'cannabis:mixed_hr_ingot'}, + {'group:stick'}, + {'group:stick'}, + } +}) + + + +minetest.register_craft({ + output = 'cannabis:shovel_hemp_steel', + recipe = { + {'default:steel_ingot'}, + {'group:stick'}, + {'cannabis:high_performance_ingot'}, + } +}) + +minetest.register_craft({ + output = 'cannabis:shovel_hemp_bronze', + recipe = { + {'default:bronze_ingot'}, + {'group:stick'}, + {'cannabis:foglie_ingot'}, + } +}) + +minetest.register_craft({ + output = 'cannabis:shovel_hemp_mese', + recipe = { + {'default:mese_crystal'}, + {'group:stick'}, + {'cannabis:fibra_ingot'}, + } +}) + +minetest.register_craft({ + output = 'cannabis:shovel_hemp_diamond', + recipe = { + {'default:diamond'}, + {'group:stick'}, + {'cannabis:tessuto_ingot'}, + } +}) + +--axe_______________________________________________________________________________________________ + +minetest.register_craft({ + output = 'cannabis:axe_hemp_high', + recipe = { + {'cannabis:mixed_hr_ingot', 'cannabis:mixed_hr_ingot'}, + {'group:stick', 'cannabis:mixed_hr_ingot'}, + {'group:stick',''}, + } +}) + + +minetest.register_craft({ + output = 'cannabis:axe_hemp_steel', + recipe = { + {'cannabis:high_performance_ingot', 'default:steel_ingot'}, + {'group:stick', 'default:steel_ingot'}, + {'group:stick', ''}, + } +}) + +minetest.register_craft({ + output = 'cannabis:axe_hemp_bronze', + recipe = { + {'cannabis:foglie_ingot', 'default:bronze_ingot'}, + {'group:stick', 'default:bronze_ingot'}, + {'group:stick', ''}, + } +}) + +minetest.register_craft({ + output = 'cannabis:axe_hemp_mese', + recipe = { + {'cannabis:fibra_ingot', 'default:mese_crystal'}, + {'group:stick', 'default:mese_crystal'}, + {'group:stick', ''}, + } +}) + +minetest.register_craft({ + output = 'cannabis:axe_hemp_diamond', + recipe = { + {'cannabis:tessuto_ingot', 'default:diamond'}, + {'group:stick', 'default:diamond'}, + {'group:stick', ''}, + } +}) + +--sword_________________________________________________________________________________________________________ + +minetest.register_craft({ + output = 'cannabis:sword_hemp_high', + recipe = { + {'cannabis:mixed_hr_ingot'}, + {'cannabis:mixed_hr_ingot'}, + {'group:stick'}, + } +}) + + +minetest.register_craft({ + output = 'cannabis:sword_hemp_steel', + recipe = { + {'default:steel_ingot'}, + {'cannabis:high_performance_ingot'}, + {'group:stick'}, + } +}) + +minetest.register_craft({ + output = 'cannabis:sword_hemp_bronze', + recipe = { + {'default:bronze_ingot'}, + {'cannabis:foglie_ingot'}, + {'group:stick'}, + } +}) + +minetest.register_craft({ + output = 'cannabis:sword_hemp_mese', + recipe = { + {'default:mese_crystal'}, + {'cannabis:fibra_ingot'}, + {'group:stick'}, + } +}) + +minetest.register_craft({ + output = 'cannabis:sword_hemp_diamond', + recipe = { + {'default:diamond'}, + {'cannabis:tessuto_ingot'}, + {'group:stick'}, + } +})