2019-03-10 13:11:26 +01:00
|
|
|
local Entity = require("scenes.battlesystem.entities.base")
|
|
|
|
local Actor = Entity:extend()
|
|
|
|
|
|
|
|
function Actor:new(controller, x, y, z)
|
|
|
|
Actor.super.new(self, controller, x, y, z)
|
|
|
|
|
|
|
|
self.isActor = true
|
|
|
|
self.speed = 3
|
|
|
|
self.isActive = false
|
|
|
|
self.debugActiveTimer = 0
|
|
|
|
end
|
|
|
|
|
|
|
|
function Actor:setActive()
|
2019-08-13 22:28:05 +02:00
|
|
|
core.debug:print("cbs/actor","actor " .. self.id .. " is active")
|
2019-03-10 13:11:26 +01:00
|
|
|
self.isActive = true
|
|
|
|
self.debugActiveTimer = 0
|
|
|
|
end
|
|
|
|
|
|
|
|
function Actor:update(dt)
|
|
|
|
if (self.isActive) then
|
|
|
|
self.debugActiveTimer = self.debugActiveTimer + dt
|
2019-08-13 22:28:05 +02:00
|
|
|
if self.debugActiveTimer >= 0.5 then
|
2019-03-10 13:11:26 +01:00
|
|
|
self.controller.actormanager:switchActiveActor()
|
|
|
|
--self.controller.actormanager.turns.changeActor = false
|
|
|
|
self.isActive = false
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
function Actor:validateAction()
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
return Actor
|