mirror of
https://github.com/cultom/hammermod.git
synced 2024-08-20 04:54:09 +02:00
make it work with mineclone2
This commit is contained in:
parent
ec7b93a00e
commit
07b9a5e68b
191
init.lua
191
init.lua
@ -1,131 +1,136 @@
|
|||||||
minetest.register_tool("hammermod:steel_hammer", {
|
minetest.register_tool("hammermod:steel_hammer", {
|
||||||
description = "Steel Hammer",
|
description = "Steel Hammer",
|
||||||
short_description = "Steel Hammer",
|
short_description = "Steel Hammer",
|
||||||
groups={hard=1, metal=1},
|
groups={hard=1, metal=1, tool=1, pickaxe=1, dig_speed_class=4, enchantability=14 },
|
||||||
inventory_image="steel_hammer.png",
|
inventory_image="steel_hammer.png",
|
||||||
range=8,
|
range=8,
|
||||||
liquids_pointable = false,
|
liquids_pointable = false,
|
||||||
light_source = 3,
|
light_source = 3,
|
||||||
tool_capabilities = {
|
tool_capabilities = {
|
||||||
full_punch_interval = 1.0,
|
full_punch_interval = 1.0,
|
||||||
max_drop_level = 999,
|
max_drop_level = 4,
|
||||||
groupcaps = {
|
groupcaps = {
|
||||||
choppy = {times = {[1] = 2.50, [2] = 1.40, [3] = 1.00},uses = 20, maxlevel = 2},
|
choppy = {times = {[1] = 2.50, [2] = 1.40, [3] = 1.00},uses = 250, maxlevel = 2},
|
||||||
cracky={times={[1]=4.00, [2]=1.50, [3]=1.00}, uses=70, maxlevel=1},
|
cracky={times = {[1] = 2.50, [2] = 1.40, [3] = 1.00},uses = 250, maxlevel = 2},
|
||||||
crumbly = {times={[2]=3.00, [3]=0.70}, uses=0, maxlevel=1},
|
crumbly = {times = {[1] = 2.50, [2] = 1.40, [3] = 1.00},uses = 250, maxlevel = 2},
|
||||||
snappy = {times={[3]=0.40}, uses=0, maxlevel=1},
|
snappy = {times = {[1] = 2.50, [2] = 1.40, [3] = 1.00},uses = 250, maxlevel = 2},
|
||||||
oddly_breakable_by_hand = {times={[1]=3.50,[2]=2.00,[3]=0.70}, uses=0}
|
oddly_breakable_by_hand = {times = {[1] = 2.50, [2] = 1.40, [3] = 1.00},uses = 250, maxlevel = 2},
|
||||||
},
|
pickaxey = {times = {[1] = 2.50, [2] = 1.40, [3] = 1.00},uses = 250, maxlevel = 2},
|
||||||
damage_groups = {fleshy=1},
|
axey={times = {[1] = 2.50, [2] = 1.40, [3] = 1.00},uses = 250, maxlevel = 2},
|
||||||
|
shovely={times = {[1] = 2.50, [2] = 1.40, [3] = 1.00},uses = 250, maxlevel = 2},
|
||||||
|
pickaxey_dig_iron = {times={[1] = 2.50, [2] = 1.40, [3] = 1.00},uses = 250, maxlevel=2}
|
||||||
|
},
|
||||||
|
damage_groups = {fleshy=1},
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
thomas_dig_none = "tupeuxyaller"
|
thomas_dig_none = "tupeuxyaller"
|
||||||
|
|
||||||
function thom_dig(pos, digger)
|
function thom_dig(pos, digger)
|
||||||
minetest.dig_node(pos)
|
--minetest.dig_node(pos)
|
||||||
--minetest.node_dig(pos, minetest.get_node(pos), digger)
|
minetest.node_dig(pos, minetest.get_node(pos), digger)
|
||||||
|
--minetest.spawn_falling_node(pos)
|
||||||
end
|
end
|
||||||
|
|
||||||
minetest.register_on_dignode(
|
minetest.register_on_dignode(
|
||||||
function(pos, oldnode, digger)
|
function(pos, oldnode, digger)
|
||||||
|
|
||||||
--TODO thomas_dig_none per player
|
--TODO thomas_dig_none per player
|
||||||
if digger == nil or digger:get_wielded_item():get_name() ~= "hammermod:steel_hammer" then
|
if digger == nil or digger:get_wielded_item():get_name() ~= "hammermod:steel_hammer" then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
if thomas_dig_none ~= "tupeuxyaller" then
|
if thomas_dig_none ~= "tupeuxyaller" then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
thomas_dig_none = "kesketufousla"
|
thomas_dig_none = "kesketufousla"
|
||||||
|
|
||||||
local posDiff = pos.y - digger:get_pos().y
|
local posDiff = pos.y - digger:get_pos().y
|
||||||
if(posDiff < 2 and posDiff > 1) then
|
if(posDiff < 2 and posDiff > 1) then
|
||||||
if
|
if
|
||||||
digger:get_look_horizontal() > math.pi / 4 and digger:get_look_horizontal() < 3 * math.pi / 4 or
|
digger:get_look_horizontal() > math.pi / 4 and digger:get_look_horizontal() < 3 * math.pi / 4 or
|
||||||
digger:get_look_horizontal() > 5 * math.pi / 4 and digger:get_look_horizontal() < 7 * math.pi / 4
|
digger:get_look_horizontal() > 5 * math.pi / 4 and digger:get_look_horizontal() < 7 * math.pi / 4
|
||||||
then
|
then
|
||||||
pos.y = pos.y -1
|
pos.y = pos.y -1
|
||||||
pos.z = pos.z -1
|
pos.z = pos.z -1
|
||||||
thom_dig(pos, digger)
|
thom_dig(pos, digger)
|
||||||
|
|
||||||
pos.y = pos.y +1
|
pos.y = pos.y +1
|
||||||
thom_dig(pos, digger)
|
thom_dig(pos, digger)
|
||||||
|
|
||||||
pos.y = pos.y +1
|
pos.y = pos.y +1
|
||||||
thom_dig(pos, digger)
|
thom_dig(pos, digger)
|
||||||
|
|
||||||
pos.z = pos.z +1
|
pos.z = pos.z +1
|
||||||
thom_dig(pos, digger)
|
thom_dig(pos, digger)
|
||||||
|
|
||||||
pos.z = pos.z +1
|
pos.z = pos.z +1
|
||||||
thom_dig(pos, digger)
|
thom_dig(pos, digger)
|
||||||
|
|
||||||
pos.y = pos.y -1
|
pos.y = pos.y -1
|
||||||
thom_dig(pos, digger)
|
thom_dig(pos, digger)
|
||||||
|
|
||||||
pos.y = pos.y -1
|
pos.y = pos.y -1
|
||||||
thom_dig(pos, digger)
|
thom_dig(pos, digger)
|
||||||
|
|
||||||
pos.z = pos.z -1
|
pos.z = pos.z -1
|
||||||
thom_dig(pos, digger)
|
thom_dig(pos, digger)
|
||||||
else
|
else
|
||||||
pos.y = pos.y -1
|
pos.y = pos.y -1
|
||||||
pos.x = pos.x -1
|
pos.x = pos.x -1
|
||||||
thom_dig(pos, digger)
|
thom_dig(pos, digger)
|
||||||
|
|
||||||
pos.y = pos.y +1
|
pos.y = pos.y +1
|
||||||
thom_dig(pos, digger)
|
thom_dig(pos, digger)
|
||||||
|
|
||||||
pos.y = pos.y +1
|
pos.y = pos.y +1
|
||||||
thom_dig(pos, digger)
|
thom_dig(pos, digger)
|
||||||
|
|
||||||
pos.x = pos.x +1
|
pos.x = pos.x +1
|
||||||
thom_dig(pos, digger)
|
thom_dig(pos, digger)
|
||||||
|
|
||||||
pos.x = pos.x +1
|
pos.x = pos.x +1
|
||||||
thom_dig(pos, digger)
|
thom_dig(pos, digger)
|
||||||
|
|
||||||
pos.y = pos.y -1
|
pos.y = pos.y -1
|
||||||
thom_dig(pos, digger)
|
thom_dig(pos, digger)
|
||||||
|
|
||||||
pos.y = pos.y -1
|
pos.y = pos.y -1
|
||||||
thom_dig(pos, digger)
|
thom_dig(pos, digger)
|
||||||
|
|
||||||
pos.x = pos.x -1
|
pos.x = pos.x -1
|
||||||
thom_dig(pos, digger)
|
thom_dig(pos, digger)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
pos.x = pos.x -1
|
pos.x = pos.x -1
|
||||||
pos.z = pos.z -1
|
pos.z = pos.z -1
|
||||||
thom_dig(pos, digger)
|
thom_dig(pos, digger)
|
||||||
|
|
||||||
pos.x = pos.x +1
|
pos.x = pos.x +1
|
||||||
thom_dig(pos, digger)
|
thom_dig(pos, digger)
|
||||||
|
|
||||||
pos.x = pos.x +1
|
pos.x = pos.x +1
|
||||||
thom_dig(pos, digger)
|
thom_dig(pos, digger)
|
||||||
|
|
||||||
pos.z = pos.z +1
|
pos.z = pos.z +1
|
||||||
thom_dig(pos, digger)
|
thom_dig(pos, digger)
|
||||||
|
|
||||||
pos.z = pos.z +1
|
pos.z = pos.z +1
|
||||||
thom_dig(pos, digger)
|
thom_dig(pos, digger)
|
||||||
|
|
||||||
pos.x = pos.x -1
|
pos.x = pos.x -1
|
||||||
thom_dig(pos, digger)
|
thom_dig(pos, digger)
|
||||||
|
|
||||||
pos.x = pos.x -1
|
pos.x = pos.x -1
|
||||||
thom_dig(pos, digger)
|
thom_dig(pos, digger)
|
||||||
|
|
||||||
pos.z = pos.z -1
|
pos.z = pos.z -1
|
||||||
thom_dig(pos, digger)
|
thom_dig(pos, digger)
|
||||||
|
|
||||||
end
|
end
|
||||||
thomas_dig_none = "tupeuxyaller"
|
thomas_dig_none = "tupeuxyaller"
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user