From 0d2ed101d6d754eea528c12f7f485565978907e8 Mon Sep 17 00:00:00 2001 From: PeaAshMeter Date: Wed, 18 Mar 2026 00:56:19 +0300 Subject: [PATCH] Refactor light animation in regenerateMana spell using easing --- lib/spellbook.lua | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/lib/spellbook.lua b/lib/spellbook.lua index 302338e..8e7834e 100644 --- a/lib/spellbook.lua +++ b/lib/spellbook.lua @@ -11,6 +11,7 @@ local task = require 'lib.utils.task' local spell = require 'lib.spell.spell' local targetTest = require 'lib.spell.target_test' local Query = require "lib.spell.target_query" +local easing = require "lib.utils.easing" local walk = setmetatable({ --- @type Deque @@ -89,17 +90,12 @@ local regenerateMana = spell.new { Tree.behaviors.positioned.new(caster:has(Tree.behaviors.positioned).position + Vec3 { 0.5, 0.5 }), } - local flash = function(callback) - light:has(Tree.behaviors.light):animateColor(Vec3 {})( - function() - light:die() - callback() - end - ) - end - return task.wait { - flash, + task.chain(task.tween(light:has(Tree.behaviors.light) --[[@as LightBehavior]], + { intensity = 1, color = Vec3 {} }, 1000, easing.easeInCubic), function() + light:die() + return task.fromValue() + end), sprite:animate("hurt") } end