function defense_mob_api.library.set_animation(self, name, inhibit)
	if self.current_animation == name
	then
		return
	end
	if inhibit
	then
		for _, p in ipairs(inhibit)
		do
			if self.current_animation == p and self.timer < self.current_animation_end
			then
				return
			end
		end
	end

	local anim_prop = self.animation[name]
	if anim_prop
	then
		self.current_animation = name
		self.current_animation_end =
			self.timer + (anim_prop.b - anim_prop.a - 1) / anim_prop.rate
		self.object:set_animation(
			{x = anim_prop.a, y = anim_prop.b},
			anim_prop.rate,
			0)
	end
end
