Refactor mana regeneration to add flash effect callback
This commit is contained in:
parent
163906c289
commit
78776ec0dd
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user