diff --git a/lib/spellbook.lua b/lib/spellbook.lua index 8e7834e..30e62a6 100644 --- a/lib/spellbook.lua +++ b/lib/spellbook.lua @@ -86,13 +86,13 @@ local regenerateMana = spell.new { local light = require "lib/character/character".spawn("Light Effect") light:addBehavior { - Tree.behaviors.light.new { color = Vec3 { 0.6, 0.3, 0.3 }, intensity = 4 }, + Tree.behaviors.light.new { color = Vec3 { 0.3, 0.3, 0.6 }, intensity = 4 }, Tree.behaviors.positioned.new(caster:has(Tree.behaviors.positioned).position + Vec3 { 0.5, 0.5 }), } return task.wait { task.chain(task.tween(light:has(Tree.behaviors.light) --[[@as LightBehavior]], - { intensity = 1, color = Vec3 {} }, 1000, easing.easeInCubic), function() + { intensity = 1, color = Vec3 {} }, 800, easing.easeInCubic), function() light:die() return task.fromValue() end), @@ -125,9 +125,25 @@ local attack = spell.new { task.wait { sprite:animate("attack"), task.wait { - task.chain(targetCharacter:has(Tree.behaviors.residentsleeper):sleep(200), - function() return targetSprite:animate("hurt") end + task.chain(targetCharacter:has(Tree.behaviors.residentsleeper):sleep(500), + function() + local light = require "lib/character/character".spawn("Light Effect") + light:addBehavior { + Tree.behaviors.light.new { color = Vec3 { 0.6, 0.3, 0.3 }, intensity = 4 }, + Tree.behaviors.positioned.new(targetCharacter:has(Tree.behaviors.positioned).position + Vec3 { 0.5, 0.5 }), + } + return + task.wait { + 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), + targetSprite:animate("hurt") + } + end ), + Tree.audio:play(Tree.assets.files.audio.sounds.hurt) } }