2020-08-03 17:59:44 +02:00
|
|
|
local FighterMock = Object:extend()
|
|
|
|
|
2021-08-15 16:26:05 +02:00
|
|
|
local ActionMock = require "scenes.menus.debugmenus.choregraphy.mocks.action"
|
|
|
|
local TargetMock = require "scenes.menus.debugmenus.choregraphy.mocks.target"
|
|
|
|
local TurnSystemMock = require "scenes.menus.debugmenus.choregraphy.mocks.turnSystem"
|
2020-08-03 17:59:44 +02:00
|
|
|
|
|
|
|
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]
|
2020-08-04 12:27:33 +02:00
|
|
|
self.actor = self.scene.world.obj.Hero(self.scene.world, 11, 3, self, 1)
|
2020-08-03 17:59:44 +02:00
|
|
|
self.action = ActionMock(self, data)
|
|
|
|
self.action:setTarget(TargetMock(self.scene))
|
|
|
|
self.action:start()
|
|
|
|
end
|
|
|
|
|
2020-08-04 23:21:45 +02:00
|
|
|
function FighterMock:playEnnemyChoregraphy(category, ennemy, data)
|
|
|
|
self.name = ennemy
|
|
|
|
self.category = category
|
|
|
|
self.abstract = game.ennemies:getEnnemyData(category, ennemy)
|
|
|
|
self.actor = self.scene.world.obj.Ennemy(self.scene.world, 11, 3, self, 1)
|
|
|
|
self.action = ActionMock(self, data)
|
|
|
|
self.action:setTarget(TargetMock(self.scene))
|
|
|
|
self.action:start()
|
|
|
|
end
|
|
|
|
|
2020-08-03 17:59:44 +02:00
|
|
|
function FighterMock:finishAction()
|
|
|
|
self.action.target.actor:destroy()
|
|
|
|
self.actor:destroy()
|
|
|
|
self.action = nil
|
|
|
|
self.scene.menusystem:activate()
|
|
|
|
end
|
|
|
|
|
2020-08-04 23:21:45 +02:00
|
|
|
function FighterMock:drawHUD()
|
|
|
|
|
|
|
|
end
|
|
|
|
|
2020-08-03 17:59:44 +02:00
|
|
|
return FighterMock
|