feat(choregraphy): add new 3D-based steps
This commit is contained in:
parent
99380cc74e
commit
c121a35f90
5 changed files with 67 additions and 8 deletions
|
@ -6,8 +6,9 @@ return {
|
|||
["playSFX"] = {"sfx"},
|
||||
["sendDamage"] = {"power", "type", "element", "isSpecial"},
|
||||
["goTo"] = {"origin", "x", "y", "duration", "blockProcess"},
|
||||
["goTo3D"] = {"origin", "x", "y", "z", "duration", "blockProcess"},
|
||||
["setAnimation"] = {"animation", "blockProcess"},
|
||||
["jump"] = {"power", "bounceNumber", "blockProcess"},
|
||||
["jump"] = {"power", "useDefaultAnimation", "blockProcess"},
|
||||
["jumpTo"] = {"origin", "x", "y", "duration", "blockProcess"},
|
||||
["jumpBack"] = {"height", "speed", "blockProcess"},
|
||||
["waitActorFinished"] = {"waitFor"},
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
local StepParent = require "scenes.battlesystem.controllers.fighters.systems.choregraphy.step.parent"
|
||||
local GoTo3DStep = StepParent:extend()
|
||||
|
||||
function GoTo3DStep:new(controller, args)
|
||||
GoTo3DStep.super.new(self, controller, args, true)
|
||||
end
|
||||
|
||||
function GoTo3DStep:start()
|
||||
|
||||
local x, y, z = self:getStepCoordinate()
|
||||
self.choregraphy.actor:goTo3D(x, y, z, self.arguments.duration)
|
||||
|
||||
self.choregraphy.actor:addTaggedAction(self.tag, self.choregraphy, "goTo")
|
||||
if (self.arguments.blockProcess == false) then
|
||||
self:finish()
|
||||
else
|
||||
self.choregraphy.actor:blockChoregraphy(self.arguments.blockProcess, self, "goTo")
|
||||
end
|
||||
end
|
||||
|
||||
function GoTo3DStep:update(dt)
|
||||
|
||||
end
|
||||
|
||||
function GoTo3DStep:getSignal(signal)
|
||||
|
||||
end
|
||||
|
||||
return GoTo3DStep;
|
|
@ -5,7 +5,9 @@ local baseURI = "scenes.battlesystem.controllers.fighters.systems.choregraphy.st
|
|||
actions["addGFX"] = require(baseURI .. "addGFX")
|
||||
actions["addQTE"] = require(baseURI .. "addQTE")
|
||||
actions["goTo"] = require(baseURI .. "goTo")
|
||||
actions["goTo3D"] = require(baseURI .. "goTo3D")
|
||||
actions["jumpBack"] = require(baseURI .. "jumpBack")
|
||||
actions["jump"] = require(baseURI .. "jump")
|
||||
actions["playSFX"] = require(baseURI .. "playSFX")
|
||||
actions["sendDamage"] = require(baseURI .. "sendDamage")
|
||||
actions["setAnimation"] = require(baseURI .. "setAnimation")
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
local StepParent = require "scenes.battlesystem.controllers.fighters.systems.choregraphy.step.parent"
|
||||
local JumpStep = StepParent:extend()
|
||||
|
||||
function JumpStep:new(controller, args)
|
||||
JumpStep.super.new(self, controller, args, true)
|
||||
end
|
||||
|
||||
function JumpStep:start()
|
||||
self.choregraphy.actor:setJump(self.arguments.power, 0, self.arguments.useDefaultAnimation)
|
||||
|
||||
self.choregraphy.actor:addTaggedAction(self.tag, self.choregraphy, "jump")
|
||||
if (self.arguments.blockProcess == false) then
|
||||
self:finish()
|
||||
else
|
||||
self.choregraphy.actor:blockChoregraphy(self.arguments.blockProcess, self, "jump")
|
||||
end
|
||||
end
|
||||
|
||||
function JumpStep:update(dt)
|
||||
|
||||
end
|
||||
|
||||
function JumpStep:getSignal(signal)
|
||||
|
||||
end
|
||||
|
||||
return JumpStep;
|
|
@ -25,18 +25,18 @@ function StepParent:updateStep(dt)
|
|||
end
|
||||
|
||||
function StepParent:getStepCoordinate()
|
||||
local argx, argy = self.arguments.x, self.arguments.y
|
||||
local argx, argy, argz = self.arguments.x, self.arguments.y, self.arguments.z or 0
|
||||
argx = argx * self.choregraphy.actor.start.direction
|
||||
if (self.arguments.origin == "target") then
|
||||
local target = self.choregraphy.action.target
|
||||
local x, y = target.actor:getCoordinate()
|
||||
return x + argx, y + argy
|
||||
local x, y, z = target.actor:getCoordinate()
|
||||
return x + argx, y + argy, z + argz
|
||||
elseif (self.arguments.origin == "start") then
|
||||
local x, y = self.choregraphy.actor.start.x, self.choregraphy.actor.start.y
|
||||
return x + argx, y + argy
|
||||
local x, y, z = self.choregraphy.actor.start.x, self.choregraphy.actor.start.y, self.choregraphy.actor.start.z
|
||||
return x + argx, y + argy, z + argz
|
||||
elseif (self.arguments.origin == "actor") then
|
||||
local x, y = self.choregraphy.actor:getCoordinate()
|
||||
return x + argx, y + argy
|
||||
local x, y, z = self.choregraphy.actor:getCoordinate()
|
||||
return x + argx, y + argy, z + argz
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue