SussyCraft/mods/amogus_items/init.lua
Kacper Kostka 20c937f1e4 yas Sus
2023-01-30 07:24:03 +01:00

331 lines
11 KiB
Lua

minetest.register_item(":", { -- Hand
type = "none",
wield_image = "coke.png",
wield_scale = {x=.3,y=2,z=2.5},
range = 5,
tool_capabilities = {
max_drop_level = 0,
full_punch_interval = 0.4,
groupcaps = {
choppy = {times = {[1] = 2, [2] = 1.5, [3] = 1.3}, uses = 20, maxlevel = 1},
crumbly = {times = {[1] = 1.0, [2] = 0.9, [3] = 0.8}, uses = 20, maxlevel = 1},
cracky = {times = {[1] = 1.0, [2] = 0.7, [3] = 0.5}, uses = 20, maxlevel = 1},
flower = {times={[1] = 0, [2] = 0, [3] = 0}, uses = 10, maxlevel=3},
},
damage_groups = {fleshy = 1, snappy = 1, cracky=1},
}
})
minetest.register_craftitem("amogus_items:amogus", {
description = "Mini Amogus friend",
inventory_image = "amogus_item.png",
--on_use = function(itemstack, user)
-- minetest.sound_play("amogus_sound", {
-- pos = user:get_pos(),
-- gain = 1.0,
-- max_hear_distance = 5
-- })
--end,
--on_place = function(itemstack, placer, pointed_thing)
-- local pos = pointed_thing.above
-- local dir = placer:get_look_dir()
-- local yaw = math.atan(dir.x/dir.z)
-- if dir.z > 0 then
-- yaw = yaw + math.pi
-- end
-- minetest.add_entity(pos, "amogus_entities:amogus", yaw)
--end
on_place = function(itemstack, placer, pointed_thing)
if pointed_thing.type == "node" then
local pos = pointed_thing.above
minetest.add_entity(pos, "amogus_entities:mini_crewmate")
minetest.sound_play("amogus_sound", {
pos = pos,
gain = 1.0,
max_hear_distance = 5
})
end
return itemstack
end
})
minetest.register_craftitem("amogus_items:sprite", {
description = "Sprite",
inventory_image = "sprite.png",
on_use = minetest.item_eat(10),
})
minetest.register_craftitem("amogus_items:coke", {
description = "Coke",
inventory_image = "coke.png",
on_use = minetest.item_eat(10),
})
minetest.register_craftitem("amogus_items:fanta", {
description = "Fanta",
inventory_image = "fanta.png",
on_use = minetest.item_eat(10),
})
minetest.register_craftitem("amogus_items:tomato", {
description = "Tomato",
inventory_image = "tomato.png",
on_use = minetest.item_eat(10),
})
minetest.register_craftitem("amogus_items:water", {
inventory_image = "water.png",
on_use = minetest.item_eat(10),
})
minetest.register_tool("amogus_items:lightsaber_blue", {
description = "Blue Lightsaber",
inventory_image = "lightsaber_blue.png",
tool_capabilities = {
full_punch_interval = 0.1,
max_drop_level=3,
groupcaps={
snappy={times={[1]=0.1, [2]=0.1, [3]=0.1}, uses=0, maxlevel=3},
},
damage_groups = {fleshy=10},
},
sound = {breaks = "amogus_sound"},
})
minetest.register_tool("amogus_items:lightsaber_red", {
description = "Red Lightsaber",
inventory_image = "lightsaber_red.png",
tool_capabilities = {
full_punch_interval = 0.1,
max_drop_level=3,
groupcaps={
snappy={times={[1]=0.1, [2]=0.1, [3]=0.1}, uses=0, maxlevel=3},
},
damage_groups = {fleshy=10},
},
sound = {breaks = "amogus_sound"},
})
minetest.register_tool("amogus_items:lightsaber_green", {
description = "Green Lightsaber",
inventory_image = "lightsaber_green.png",
tool_capabilities = {
full_punch_interval = 0.1,
max_drop_level=3,
groupcaps={
snappy={times={[1]=0.1, [2]=0.1, [3]=0.1}, uses=0, maxlevel=3},
},
damage_groups = {fleshy=10},
},
sound = {breaks = "amogus_sound"},
})
-- add theese items : goldenpickaxe, wooden plank, gold_ingot, sussium_ingot
minetest.register_craftitem("amogus_items:wooden_plank", {
description = "Wooden Plank",
inventory_image = "wood.png",
})
minetest.register_craftitem("amogus_items:gold_ingot", {
description = "Gold Ingot",
inventory_image = "gold_ingot.png",
})minetest.register_craftitem("amogus_items:rock", {
description = "Rock",
inventory_image = "rocks.png",
})
minetest.register_craftitem("amogus_items:sussium_ingot", {
description = "Sussium Ingot",
inventory_image = "sussium_ingot.png",
})
--add theese items goldenpickaxe, stonepickaxe and allow them slowly break nodes and destroy it after 30 uses
minetest.register_tool("amogus_items:goldenplumba", {
description = "Golden Plumba",
inventory_image = "goldenplumba.png",
tool_capabilities = {
full_punch_interval = 0.1,
max_drop_level = 3,
groupcaps = {
unbreakable = {times={[1] = 0, [2] = 0, [3] = 0}, uses = 10, maxlevel=3},
crumbly = {times={[1] = 0, [2] = 0, [3] = 0}, uses = 10, maxlevel=3},
snappy = {times={[1] = 0, [2] = 0, [3] = 0}, uses = 10, maxlevel=3},
choppy = {times={[1] = 0, [2] = 0, [3] = 0}, uses = 10, maxlevel=3},
cracky = {times={[1] = 0, [2] = 0, [3] = 0}, uses = 10, maxlevel=3},
crumbly = {times={[1] = 0, [2] = 0, [3] = 0}, uses = 10, maxlevel=3},
cracky = {times={[1] = 0, [2] = 0, [3] = 0}, uses = 10, maxlevel=3},
},
damage_groups = {fleshy = 10},
},
on_use = function(itemstack, user, pointed_thing)
if pointed_thing.type == "node" then
minetest.node_dig(pointed_thing.under, minetest.get_node(pointed_thing.under), user)
end
itemstack:add_wear(65535/10)
return itemstack
end,
sound = {breaks = "default_tool_breaks"},
})
minetest.register_tool("amogus_items:susplumba", {
description = "Sus Plumba",
inventory_image = "plumba.png",
tool_capabilities = {
full_punch_interval = 0.1,
max_drop_level = 3,
groupcaps = {
unbreakable = {times={[1] = 0, [2] = 0, [3] = 0}, uses = 10, maxlevel=3},
crumbly = {times={[1] = 0, [2] = 0, [3] = 0}, uses = 10, maxlevel=3},
snappy = {times={[1] = 0, [2] = 0, [3] = 0}, uses = 10, maxlevel=3},
choppy = {times={[1] = 0, [2] = 0, [3] = 0}, uses = 10, maxlevel=3},
cracky = {times={[1] = 0, [2] = 0, [3] = 0}, uses = 10, maxlevel=3},
crumbly = {times={[1] = 0, [2] = 0, [3] = 0}, uses = 10, maxlevel=3},
cracky = {times={[1] = 0, [2] = 0, [3] = 0}, uses = 10, maxlevel=3},
},
damage_groups = {fleshy = 10},
},
on_use = function(itemstack, user, pointed_thing)
if pointed_thing.type == "node" then
minetest.node_dig(pointed_thing.under, minetest.get_node(pointed_thing.under), user)
end
itemstack:add_wear(65535/40)
return itemstack
end,
sound = {breaks = "default_tool_breaks"},
})
minetest.register_tool("amogus_items:stonepickaxe", {
description = "Stone Pickaxe",
inventory_image = "stone_pick.png",
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=1,
groupcaps={
stone={times={[1]=2.5, [2]=1.0, [3]=0.50}, uses=30, maxlevel=1},
},
damage_groups = {fleshy=2},
},
sound = {breaks = "default_tool_breaks"},
})
minetest.register_tool("amogus_items:goldenpickaxe", {
description = "Golden Pickaxe",
inventory_image = "golden_pick.png",
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=1,
groupcaps={
stone={times={[1]=1.3, [2]=0.60, [3]=0.40}, uses=30, maxlevel=1},
},
damage_groups = {fleshy=2},
},
sound = {breaks = "default_tool_breaks"},
})
minetest.register_tool("amogus_items:sussiumpickaxe", {
description = "Sussium Pickaxe",
inventory_image = "sussium_pickaxe.png",
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=1,
groupcaps={
stone={times={[0.5]=2.0,[1]=0.85, [2]=0.40, [3]=0.20}, uses=30, maxlevel=1},
},
damage_groups = {fleshy=2},
},
sound = {breaks = "default_tool_breaks"},
})
minetest.register_tool("amogus_items:goldenaxe", {
description = "Golden Axe",
inventory_image = "goldenaxe.png",
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=1,
groupcaps={
choppy={times={[1]=2.50, [2]=1.40, [3]=0.45}, uses=30, maxlevel=2},
},
damage_groups = {fleshy=4},
},
groups = {flammable = 2}
})
minetest.register_tool("amogus_items:stoneaxe", {
description = "Stone Axe",
inventory_image = "stone_axe.png",
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=1,
groupcaps={
choppy={times={[1]=2.50, [2]=1.40, [3]=0.80}, uses=30, maxlevel=2},
},
damage_groups = {fleshy=4},
},
groups = {flammable = 2}
})
minetest.register_tool("amogus_items:sussiumaxe", {
description = "Sussium Axe",
inventory_image = "sussium_axe.png",
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=1,
groupcaps={
choppy={times={[1]=0.90, [2]=0.80, [3]=0.35}, uses=30, maxlevel=2},
},
damage_groups = {fleshy=4},
},
groups = {flammable = 2}
})
minetest.register_tool("amogus_items:stoneshovel", {
description = "stone shovel",
inventory_image = "stone_shovel.png",
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=1,
groupcaps={
crumbly={times={[1]=1.5, [2]=1.0, [3]=0.9}, uses=30, maxlevel=2},
},
damage_groups = {fleshy=4},
},
groups = {flammable = 2}
})
minetest.register_tool("amogus_items:goldenshovel", {
description = "golden shovel",
inventory_image = "golden_shovel.png",
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=1,
groupcaps={
crumbly={times={[1]=1.0, [2]=0.8, [3]=0.6}, uses=30, maxlevel=2},
},
damage_groups = {fleshy=4},
},
groups = {flammable = 2}
})
minetest.register_tool("amogus_items:sussiumshovel", {
description = "sussium shovel",
inventory_image = "sussium_shovel.png",
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=1,
groupcaps={
crumbly={times={[1]=0.8, [2]=0.6, [3]=0.35}, uses=30, maxlevel=2},
},
damage_groups = {fleshy=4},
},
groups = {flammable = 2}
})
minetest.register_tool("amogus_items:obsussian_hammer", {
description = "obsussian hammer",
inventory_image = "obsusian_hammer.png",
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=1,
groupcaps={
choppy={times={[1]=0.90, [2]=0.40, [3]=0.06}, uses=30, maxlevel=2},
crumbly={times={[1]=0.90, [2]=0.40, [3]=0.06}, uses=30, maxlevel=2},
stone={times={[1]=0.90, [2]=0.40, [3]=0.06}, uses=30, maxlevel=1},
crumbly={times={[1]=0.90, [2]=0.40, [3]=0.06}, uses=30, maxlevel=2},
},
damage_groups = {fleshy=4},
},
groups = {flammable = 2}
})