Delay custom actions.

This commit is contained in:
Duane Robertson 2016-05-26 01:12:06 -05:00
parent f8678a3d44
commit 234b71064c
12 changed files with 83 additions and 15 deletions

View file

@ -70,8 +70,15 @@ mobs:register_mob("fun_caves:dangler", {
--replace_with = "air",
--replace_offset = -1,
do_custom = function(self)
if not self.custom_time or self.custom_time % fun_caves.custom_delay == 0 then
self.custom_time = fun_caves.custom_delay - 1
else
self.custom_time = self.custom_time - 1
return
end
fun_caves.climb(self)
fun_caves.search_replace(self.object:getpos(), 200, {"air"}, "mobs:cobweb")
fun_caves.search_replace(self.object:getpos(), 100, {"air"}, "mobs:cobweb")
fun_caves.surface_damage(self)
end,