function imp:choose_mood() if self.mood==self.moods.stop then return end if self.timers.mood<=0 then self.mood=self.moods[math.random(2)+1] -- chase o avoid self:reset_mood_timer() end end function imp:reset_mood_timer( value ) -- OK if DEBUG_FN_NAME then print("reset_mood_timer") end value = value or 150 self.timers.mood = value return value end