fix: take the ennemy z into account for qte

This commit is contained in:
Kazhnuz 2021-05-09 15:06:29 +02:00
parent fe5e1f6d68
commit cc66f86bd1

View file

@ -28,25 +28,27 @@ function QteParent:endQte()
end
function QteParent:setOrigin(origin)
local x, y = 424/2, 240/2
local argy = 24
local x, y, z = 424/2, 240/2, 0
local argy = 16
local battleCoord = false
if (origin == "target") then
local target = self.choregraphy.action.target
x, y = target.actor:getCoordinate()
z = target.actor.z
battleCoord = true
elseif (origin == "start") then
x, y = self.choregraphy.actor.start.x, self.choregraphy.actor.start.y
battleCoord = true
elseif (origin == "actor") then
x, y = self.choregraphy.actor:getCoordinate()
z = self.choregraphy.actor.z
battleCoord = true
end
if (not battleCoord) then
self.x, self.y = x, y
else
x, y = self.choregraphy.world.map:gridToPixel(x, y, true)
self.x, self.y = x, y - argy
self.x, self.y = x, y - argy - z
end
end