feature/spell-constraints #32
@ -86,13 +86,13 @@ local regenerateMana = spell.new {
|
|||||||
|
|
||||||
local light = require "lib/character/character".spawn("Light Effect")
|
local light = require "lib/character/character".spawn("Light Effect")
|
||||||
light:addBehavior {
|
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 }),
|
Tree.behaviors.positioned.new(caster:has(Tree.behaviors.positioned).position + Vec3 { 0.5, 0.5 }),
|
||||||
}
|
}
|
||||||
|
|
||||||
return task.wait {
|
return task.wait {
|
||||||
task.chain(task.tween(light:has(Tree.behaviors.light) --[[@as LightBehavior]],
|
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()
|
light:die()
|
||||||
return task.fromValue()
|
return task.fromValue()
|
||||||
end),
|
end),
|
||||||
@ -125,9 +125,25 @@ local attack = spell.new {
|
|||||||
task.wait {
|
task.wait {
|
||||||
sprite:animate("attack"),
|
sprite:animate("attack"),
|
||||||
task.wait {
|
task.wait {
|
||||||
task.chain(targetCharacter:has(Tree.behaviors.residentsleeper):sleep(200),
|
task.chain(targetCharacter:has(Tree.behaviors.residentsleeper):sleep(500),
|
||||||
function() return targetSprite:animate("hurt") end
|
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)
|
Tree.audio:play(Tree.assets.files.audio.sounds.hurt)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user