master
IIIullaIII 2020-05-07 18:06:10 +02:00
parent b825487a2d
commit ef33fbc959
7 changed files with 91 additions and 133 deletions

View File

@ -1,6 +1,9 @@
-- get Boilerplate for Translations
local S = cannabis.S
--armor
if minetest.get_modpath("cannabis") then
if minetest.get_modpath("cannabis") then
local stats = {
fibra = { name="fibra", armor=3.8, heal=28, use=100 },
tessuto= { name="tessuto", armor=2.0, heal=18, use=50 },
@ -18,25 +21,25 @@
}
for k, v in pairs(stats) do
minetest.register_tool("cannabis:helmet_"..k, {
description = v.name.." Helmet",
description = v.name..S(" 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",
description = v.name.. S(" 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",
description = v.name.. S(" 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",
description = v.name..S(" 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,
@ -76,10 +79,11 @@
},
})
end
if minetest.get_modpath("shields") then
if minetest.get_modpath("shields") then
for k, v in pairs(stats) do
minetest.register_tool("cannabis:shield_"..k, {
description = v.name.." hemp Shield",
description = v.name.. S(" 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,
@ -93,6 +97,6 @@
{"", m, ""},
},
})
end
end
end
end -- for k,v
end -- if minetest.get_modpath("shields")
end--if minetest.get_modpath("cannabis")

View File

@ -76,7 +76,7 @@ minetest.register_abm({
"default:dirt_with_coniferous_litter"
},
interval = 2,
chance = 10,
chance = 1,
action = function(...)
minetest.grow_canapa(...)
end

View File

@ -1,3 +1,8 @@
--aliases
--minetest.get_modpath("cannabis")
minetest.register_alias("canapa","cannabis:canapa")
--tools
cannabis = {} -- A global Object for the mod
cannabis.path = minetest.get_modpath("cannabis") -- The path of the mod
local path = cannabis.path
@ -12,11 +17,8 @@ else
end
cannabis.S = S
minetest.register_alias("canapa","cannabis:canapa")
cannabis.S = S -- Stores the boilerplate for global access
--tools
local path = minetest.get_modpath("cannabis")
dofile(path.."/tools.lua")
dofile(path.."/canapa.lua")
dofile(path.."/node_ingot.lua")

View File

@ -1,6 +1,8 @@
-- get Boilerplate for Translations
local S = cannabis.S
local path = cannabis.path
minetest.register_craftitem("cannabis:joint_fumo_acceso", {
description = "Joint fumo acceso",
description = S("Joint of hash lit"),
inventory_image = "joint_joint_fac.png",
stack_max = 1 ,
on_use = function(itemstack, user, pointed_thing)
@ -9,53 +11,66 @@
end
})
minetest.register_craftitem("cannabis:joint_erba_acceso", {
description = S("Joint of weed lit"),
inventory_image = "joint_joint_cac.png",
stack_max = 1 ,
-- post_effect_color = smokeCOLOR,
on_use = function(itemstack, user, pointed_thing)
itemstack:add_wear(1000)
return itemstack
end
})
minetest.register_craftitem("cannabis:joint_erba_spento", {
description = "Joint erba spento",
description = S("Joint of weed unlit"),
inventory_image = "joint_joint_csp.png",
})
minetest.register_craftitem("cannabis:joint_fumo_spento", {
description = "Joint fumo spento",
description = S("Joint of hash unlit"),
inventory_image = "joint_joint_fsp.png",
})
minetest.register_craftitem("cannabis:joint_cima", {
description = "Joint cima triturata",
description = S("Flowering chopped"),
inventory_image = "joint_cima_s.png",
})
minetest.register_craftitem("cannabis:joint_fumo", {
description = "Joint fumo triturato",
description = S("Hash melted"),
inventory_image = "joint_fumo_s.png",
})
minetest.register_craftitem("cannabis:joint_cartina", {
description = "Joint cartina",
description = S("Rolling paper"),
inventory_image = "joint_cartina.png",
})
minetest.register_craftitem("cannabis:joint_cartina_cima", {
description = "Joint cartina con erba",
description = S("Rolling paper with hemp leaves and flowering chopped "),
inventory_image = "joint_cartina_cima.png",
})
minetest.register_craftitem("cannabis:joint_cartina_fumo", {
description = "Joint cartina con fumo",
description = S("Rolling paper with hemp leaves melted hash"),
inventory_image = "joint_cartina_fumo.png",
})
minetest.register_craftitem("cannabis:joint_filter_box", {
description = "Joint filter confezione",
description = S("Filters pack"),
inventory_image = "joint_filter_p.png",
})
minetest.register_craftitem("cannabis:joint_filter", {
description = "Joint filto",
description = S("Filter"),
inventory_image = "joint_filter.png",
})
minetest.register_craftitem("cannabis:joint_accendino", {
description = "Joint accendino",
description = S("Lighter"),
inventory_image = "joint_accendino.png",
})
@ -166,18 +181,6 @@ minetest.register_craft({
-- underwatercolor will be the value (one of the tables above)
--for color, smokecolor in pairs(smokeCOLOR) do
-- water
minetest.register_craftitem("cannabis:joint_erba_acceso", {
description = "Joint erba acceso",
inventory_image = "joint_joint_cac.png",
stack_max = 1 ,
-- post_effect_color = smokeCOLOR,
on_use = function(itemstack, user, pointed_thing)
itemstack:add_wear(1000)
return itemstack
end
})
--end

View File

@ -1,3 +1,3 @@
name = cannabis
depends = default
optional_default = 3d_armor
depends = default, fire
optional_default = 3d_armor, maptools

View File

@ -1,27 +1,29 @@
-- get Boilerplate for Translations
local S = cannabis.S
minetest.register_craftitem("cannabis:mixed_hr_ingot", {
description = ("Mixed HR Ingot"),
description = S("Mixed HR Ingot"),
inventory_image = "cannabis_mixed_hr_ingot.png",
})
minetest.register_craftitem(":cannabis:fibra_ingot", {
description = ("fibra Ingot"),
description = S("Fiber Ingot"),
inventory_image = "cannabis_fibra_ingot.png",
})
minetest.register_craftitem(":cannabis:foglie_ingot", {
description = ("foglie Ingot"),
description = S("Leaves Ingot"),
inventory_image = "cannabis_foglie_ingot.png",
})
minetest.register_craftitem("cannabis:high_performance_ingot", {
description = ("High Performance Ingot"),
description = S("High Performance Ingot"),
inventory_image = "cannabis_high_performance_ingot.png",
})
minetest.register_craftitem(":cannabis:tessuto_ingot", {
description = ("Tessuto Ingot"),
description = S("Fabric Ingot"),
inventory_image = "cannabis_tessuto_ingot.png",
})
minetest.register_craftitem(":cannabis:adminh_ingot", {
description = ("Adminh Ingot"),
description = S("Adminh Ingot"),
inventory_image = "cannabis_adminh_ingot.png",
})
local function for_each_registered_item(action)
@ -75,7 +77,7 @@ register_block("cannabis:cannabis_adminh_block", "cannabis:adminh_ingot")
minetest.register_node("cannabis:hp_block_canapa",
{
description = "hp_block_canapa",
description = S("High Performance Block Hemp"),
tiles = {"hp_block_canapa.png"},
is_ground_content = false,
groups = {choppy = 30, oddly_breakable_by_hand = 1, flammable = 3, wood = 1},
@ -83,21 +85,21 @@ minetest.register_node("cannabis:hp_block_canapa",
})
minetest.register_node("cannabis:cannabis_foglie_block", {
description = ("Foglie Block"),
description = S("Leaves Block"),
tiles = { "cannabis_foglie_block.png" },
is_ground_content = false,
groups = {cracky=1, level=2},
sounds = "cannabis:cannabis_canapa_s3"
})
minetest.register_node("cannabis:cannabis_foglie_red_block", {
description = ("Foglie Block"),
description = S("Red Leaves Block"),
tiles = { "cannabis_foglie_red_block.png" },
is_ground_content = false,
groups = {cracky=1, level=2},
sounds = "cannabis:cannabis_canapa_s3"
})
minetest.register_node("cannabis:cannabis_tessuto_block", {
description = ("Tessuto Block"),
description = S("Fabric Block"),
tiles = { "cannabis_tessuto_block.png" },
is_ground_content = false,
groups = {cracky=1, level=2},
@ -106,21 +108,21 @@ minetest.register_node("cannabis:cannabis_tessuto_block", {
minetest.register_node("cannabis:cannabis_high_performance_block", {
description = ("High Performance Block"),
description = S("High Performance Block"),
tiles = { "cannabis_high_performance_block.png" },
is_ground_content = false,
groups = {cracky=1, level=2},
sounds = "cannabis_canapa_s3"
})
minetest.register_node("cannabis:cannabis_fibra_block", {
description = ("Fibra Block"),
description = S("Fiber Block"),
tiles = { "cannabis_fibra_block.png" },
is_ground_content = false,
groups = {cracky=1, level=2},
sounds = "cannabis_canapa_s3"
})
minetest.register_node("cannabis:cannabis_adminh_block", {
description = ("Adminh Block"),
description = S("Adminh Block"),
tiles = { "cannabis_adminh_block.png" },
is_ground_content = false,
groups = {unbreackable =1},

View File

@ -5,9 +5,11 @@
-- Picks______________________________________________________________________________
--
-- get Boilerplate for Translations
local S = cannabis.S
minetest.register_tool("cannabis:pick_hemp_steel", {
description = "HSteel Pickaxe",
description = S("Hemp Steel Pickaxe"),
inventory_image = "cannabis_tool_steelpick.png",
tool_capabilities = {
full_punch_interval = 1.0,
@ -19,7 +21,7 @@ minetest.register_tool("cannabis:pick_hemp_steel", {
},
})
minetest.register_tool("cannabis:pick_hemp_bronze", {
description = "HBronze Pickaxe",
description = S("Hemp Bronze Pickaxe"),
inventory_image = "cannabis_tool_bronzepick.png",
tool_capabilities = {
full_punch_interval = 1.0,
@ -31,7 +33,7 @@ minetest.register_tool("cannabis:pick_hemp_bronze", {
},
})
minetest.register_tool("cannabis:pick_hemp_mese", {
description = "HMese Pickaxe",
description = S("Hemp Mese Pickaxe"),
inventory_image = "cannabis_tool_mesepick.png",
tool_capabilities = {
full_punch_interval = 0.9,
@ -43,7 +45,7 @@ minetest.register_tool("cannabis:pick_hemp_mese", {
},
})
minetest.register_tool("cannabis:pick_hemp_diamond", {
description = "HDiamond Pickaxe",
description = S("Hemp Diamond Pickaxe"),
inventory_image = "cannabis_tool_diamondpick.png",
tool_capabilities = {
full_punch_interval = 0.9,
@ -55,7 +57,7 @@ minetest.register_tool("cannabis:pick_hemp_diamond", {
},
})
minetest.register_tool("cannabis:pick_hemp_high", {
description = "Hemp_high Pickaxe",
description = S("Hemp High Pickaxe"),
inventory_image = "cannabis_tool_highpick.png",
tool_capabilities = {
full_punch_interval = 0.9,
@ -68,7 +70,7 @@ minetest.register_tool("cannabis:pick_hemp_high", {
})
minetest.register_tool("cannabis:pick_hemp_adminh", {
description = "Hemp_adminh Pickaxe",
description = S("Hemp Adminh Pickaxe"),
inventory_image = "cannabis_tool_adminhpick.png",
tool_capabilities = {
full_punch_interval = 0.35,
@ -99,7 +101,7 @@ end)
minetest.register_tool("cannabis:shovel_hemp_high", {
description = "Hemp_high Shovel",
description = S("Hemp High Shovel"),
inventory_image = "cannabis_tool_highshovel.png",
wield_image = "cannabis_tool_highshovel.png^[transformR90",
tool_capabilities = {
@ -113,7 +115,7 @@ minetest.register_tool("cannabis:shovel_hemp_high", {
})
minetest.register_tool("cannabis:shovel_hemp_steel", {
description = "HSteel Shovel",
description = S("Hemp Steel Shovel"),
inventory_image = "cannabis_tool_steelshovel.png",
wield_image = "cannabis_tool_steelshovel.png^[transformR90",
tool_capabilities = {
@ -126,7 +128,7 @@ minetest.register_tool("cannabis:shovel_hemp_steel", {
},
})
minetest.register_tool("cannabis:shovel_hemp_bronze", {
description = "HBronze Shovel",
description = S("Hemp Bronze Shovel"),
inventory_image = "cannabis_tool_bronzeshovel.png",
wield_image = "cannabis_tool_bronzeshovel.png^[transformR90",
tool_capabilities = {
@ -139,7 +141,7 @@ minetest.register_tool("cannabis:shovel_hemp_bronze", {
},
})
minetest.register_tool("cannabis:shovel_hemp_mese", {
description = "HMese Shovel",
description = S("Hemp Mese Shovel"),
inventory_image = "cannabis_tool_meseshovel.png",
wield_image = "cannabis_tool_meseshovel.png^[transformR90",
tool_capabilities = {
@ -152,7 +154,7 @@ minetest.register_tool("cannabis:shovel_hemp_mese", {
},
})
minetest.register_tool("cannabis:shovel_hemp_diamond", {
description = "HDiamond Shovel",
description = S("Hemp Diamond Shovel"),
inventory_image = "cannabis_tool_diamondshovel.png",
wield_image = "cannabis_tool_diamondshovel.png^[transformR90",
tool_capabilities = {
@ -165,27 +167,11 @@ minetest.register_tool("cannabis:shovel_hemp_diamond", {
},
})
--[[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",
description = S("Hemp Steel Axe"),
inventory_image = "cannabis_tool_steelaxe.png",
tool_capabilities = {
full_punch_interval = 1.0,
@ -197,7 +183,7 @@ minetest.register_tool("cannabis:axe_hemp_steel", {
},
})
minetest.register_tool("cannabis:axe_hemp_bronze", {
description = "HBronze Axe",
description = S("Hemp Bronze Axe"),
inventory_image = "cannabis_tool_bronzeaxe.png",
tool_capabilities = {
full_punch_interval = 1.0,
@ -209,7 +195,7 @@ minetest.register_tool("cannabis:axe_hemp_bronze", {
},
})
minetest.register_tool("cannabis:axe_hemp_mese", {
description = "HMese Axe",
description = S("Hemp Mese Axe"),
inventory_image = "cannabis_tool_meseaxe.png",
tool_capabilities = {
full_punch_interval = 0.9,
@ -221,7 +207,7 @@ minetest.register_tool("cannabis:axe_hemp_mese", {
},
})
minetest.register_tool("cannabis:axe_hemp_diamond", {
description = "HDiamond Axe",
description = S("Hemp Diamond Axe"),
inventory_image = "cannabis_tool_diamondaxe.png",
tool_capabilities = {
full_punch_interval = 0.9,
@ -233,7 +219,7 @@ minetest.register_tool("cannabis:axe_hemp_diamond", {
},
})
minetest.register_tool("cannabis:axe_hemp_high", {
description = "Hemp_high Axe",
description = S("Hemp High Performance Axe"),
inventory_image = "cannabis_tool_highaxe.png",
tool_capabilities = {
full_punch_interval = 0.9,
@ -248,7 +234,7 @@ minetest.register_tool("cannabis:axe_hemp_high", {
-- Swords___________________________________________________________________________________________________
minetest.register_tool("cannabis:sword_hemp_steel", {
description = "HSteel Sword",
description = S("Hemp Steel Sword"),
inventory_image = "cannabis_tool_steelsword.png",
tool_capabilities = {
full_punch_interval = 0.8,
@ -260,7 +246,7 @@ minetest.register_tool("cannabis:sword_hemp_steel", {
}
})
minetest.register_tool("cannabis:sword_hemp_bronze", {
description = "HBronze Sword",
description = S("Hemp Bronze Sword"),
inventory_image = "cannabis_tool_bronzesword.png",
tool_capabilities = {
full_punch_interval = 0.8,
@ -272,7 +258,7 @@ minetest.register_tool("cannabis:sword_hemp_bronze", {
}
})
minetest.register_tool("cannabis:sword_hemp_mese", {
description = "HMese Sword",
description = S("Hemp Mese Sword"),
inventory_image = "cannabis_tool_mesesword.png",
tool_capabilities = {
full_punch_interval = 0.7,
@ -284,7 +270,7 @@ minetest.register_tool("cannabis:sword_hemp_mese", {
}
})
minetest.register_tool("cannabis:sword_hemp_diamond", {
description = "HDiamond Sword",
description = S("Hemp Diamond Sword"),
inventory_image = "cannabis_tool_diamondsword.png",
tool_capabilities = {
full_punch_interval = 0.7,
@ -296,7 +282,7 @@ minetest.register_tool("cannabis:sword_hemp_diamond", {
}
})
minetest.register_tool("cannabis:sword_hemp_high", {
description = "Hemp_high Sword",
description = S("Hemp High Performance Sword"),
inventory_image = "cannabis_tool_highsword.png",
tool_capabilities = {
full_punch_interval = 0.7,
@ -309,47 +295,8 @@ minetest.register_tool("cannabis:sword_hemp_high", {
})
---
--minetest.register_tool("cannabis:sword_hemp_adminh", {
--description = "Hemp_adminh Sword",
--inventory_image = "cannabis_tool_adminhsword.png",
--tool_capabilities = {
--full_punch_interval = 0.5,
--max_drop_level=1,
--groupcaps={
--unbreakable = {times={[1] = 0.1, [2] = 0.1, [3] = 0.1}, uses = 0, maxlevel = 30},
--snappy={times={[1]=0.1, [2]=0.1, [3]=0.1}, uses=99, maxlevel=30},
--},
--damage_groups = {fleshy=100000},
--}
--})
--CRAFT RECIPE
minetest.register_tool("cannabis:pick_hemp_adminh", {
description = "Hemp_adminh Sword",
inventory_image = "cannabis_tool_adminhsword.png",
tool_capabilities = {
full_punch_interval = 0.35,
max_drop_level=3,
groupcaps= {
unbreakable = {times={[1] = 0, [2] = 0, [3] = 0}, uses = 0, maxlevel = 3},
fleshy = {times={[1] = 0, [2] = 0, [3] = 0}, uses = 0, maxlevel = 3},
choppy = {times={[1] = 0, [2] = 0, [3] = 0}, uses = 0, maxlevel = 3},
--bendy = {times={[1] = 0, [2] = 0, [3] = 0}, uses = 0, maxlevel = 3},
--cracky = {times={[1] = 0, [2] = 0, [3] = 0}, uses = 0, maxlevel = 3},
--crumbly = {times={[1] = 0, [2] = 0, [3] = 0}, uses = 0, maxlevel = 3},
snappy = {times={[1] = 0, [2] = 0, [3] = 0}, uses = 0, maxlevel = 3},
},
damage_groups = {fleshy=10000},
},
})
minetest.register_on_punchnode(function(pos, node, puncher)
if puncher:get_wielded_item():get_name() == "cannabis:sword_hemp_adminh"
and minetest.get_node(pos).name ~= "air" then
minetest.log("action", puncher:get_player_name() .. " digs " .. minetest.get_node(pos).name .. " at " .. minetest.pos_to_string(pos) .. " using an Admin Pickaxe.")
minetest.remove_node(pos) -- The node is removed directly, which means it even works on non-empty containers and group-less nodes.
minetest.check_for_falling(pos) -- Run node update actions like falling nodes.
end
end)
--pick:___________________________________________________________________