From 78776ec0ddeaa038d6345e3c29b96bf330f8ba16 Mon Sep 17 00:00:00 2001 From: PeaAshMeter Date: Sun, 8 Feb 2026 06:28:24 +0300 Subject: [PATCH] Refactor mana regeneration to add flash effect callback --- lib/spellbook.lua | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/spellbook.lua b/lib/spellbook.lua index 0843174..7c95ea5 100644 --- a/lib/spellbook.lua +++ b/lib/spellbook.lua @@ -99,8 +99,17 @@ function regenerateMana:cast(caster, target) 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 { - light:has(Tree.behaviors.light):animateColor(Vec3 {}), + flash, sprite:animate("hurt") } end