Added the digging_attack to stone_eater and sandworm

master
npx 2016-11-14 14:36:08 +01:00
parent d8be8e7840
commit 1878c93339
3 changed files with 4 additions and 4 deletions

View File

@ -55,6 +55,6 @@ mobs:register_mob("nssm:sandworm", {
punch_end = 180,
},
do_custom = function(self)
digging_ability(self, "sand", self.run_velocity, {x=0, y=2, z=0})
digging_attack(self, "sand", self.run_velocity, {x=0, y=3, z=0})
end,
})

View File

@ -56,6 +56,7 @@ mobs:register_mob("nssm:stone_eater", {
punch_end = 185,
},
do_custom = function(self)
digging_ability(self, "stone", self.run_velocity, {x=0, y=2, z=0})
--digging_ability(self, "stone", self.run_velocity, {x=0, y=2, z=0})
digging_attack(self, "stone", self.run_velocity, {x=0, y=1, z=0})
end,
})

View File

@ -362,7 +362,6 @@ function digging_attack(
for i = 0,dim.y do
--minetest.chat_send_all("pos2:"..minetest.pos_to_string(posp).." per.y= "..per.y)
local n = minetest.env:get_node(pos1).name
@ -374,7 +373,7 @@ function digging_attack(
minetest.remove_node(pos1)
end
else
if (minetest.get_item_group(n, group)==1) and (minetest.get_item_group(n, "unbreakable") ~= 1) and (n == "bones:bones" and not (minetest.is_protected(pos1, "")) ) then
if ((minetest.get_item_group(n, group)==1) and (minetest.get_item_group(n, "unbreakable") ~= 1) and (n ~= "bones:bones") and not (minetest.is_protected(pos1, "")) ) then
--minetest.env:set_node(p, {name="air"})
minetest.remove_node(pos1)
end