sonic-radiance/sonic-radiance.love/scenes/debug/viewers/choregraphy/mocks/fighter.lua
2020-08-03 17:59:44 +02:00

36 lines
1,001 B
Lua

local FighterMock = Object:extend()
local ActionMock = require "scenes.debug.viewers.choregraphy.mocks.action"
local TargetMock = require "scenes.debug.viewers.choregraphy.mocks.target"
local TurnSystemMock = require "scenes.debug.viewers.choregraphy.mocks.turnSystem"
function FighterMock:new(scene)
self.scene = scene
self.action = nil
self.actor = nil
self.turnSystem = TurnSystemMock()
end
function FighterMock:update(dt)
if (self.action ~= nil) then
self.action:update(dt)
end
end
function FighterMock:playHeroChoregraphy(character, data)
self.name = character
self.abstract = game.characters.list[character]
self.actor = self.scene.world.obj.Hero(self.scene.world, 2, 3, self, 1)
self.action = ActionMock(self, data)
self.action:setTarget(TargetMock(self.scene))
self.action:start()
end
function FighterMock:finishAction()
self.action.target.actor:destroy()
self.actor:destroy()
self.action = nil
self.scene.menusystem:activate()
end
return FighterMock