add timers on owl and nyan

This commit is contained in:
tenplus1 2022-08-26 10:55:25 +01:00
parent 23e608eda7
commit 232e59a2f9
2 changed files with 14 additions and 2 deletions

View File

@ -43,7 +43,13 @@ mobs:register_mob("dmobs:nyan", {
run_end = 7,
},
do_custom = function(self)
do_custom = function(self, dtime)
self.rb_count = (self.rb_count or 0) + dtime
if self.rb_count < .2 then
return
end
self.rb_count = 0
local apos = self.object:get_pos() ; if not apos then return end
local vec = self.object:get_velocity()

View File

@ -30,7 +30,13 @@ mobs:register_mob("dmobs:owl", {
walk_end = 50
},
do_custom = function(self)
do_custom = function(self, dtime)
self.tod_count = (self.tod_count or 0) + dtime
if self.tod_count < 5 then
return
end
self.tod_count = 0
local daytime = minetest.get_timeofday() * 24000