Ajout des derniers développement #1

Merged
kazhnuz merged 68 commits from chronicles-cbs into master 2020-08-02 11:14:18 +02:00
2 changed files with 16 additions and 2 deletions
Showing only changes of commit 1acada1b51 - Show all commits

View file

@ -36,7 +36,7 @@ function TurnController:startBattle()
end
function TurnController:finishBattle()
self.isBattleActive = false
self.isActive = false
self.actionlist = {}
self.hud:movePlayerHUD(false)
self.scene:finishBattle()
@ -90,7 +90,10 @@ function TurnController:removeAllActionsFromFighter(fighterToRemove)
end
function TurnController:applyDeath()
self.ennemies:applyDeath()
local ennemiesAlive = self.ennemies:applyDeath()
if (ennemiesAlive == 0) then
self:finishBattle()
end
self.player:applyDeath()
end

View file

@ -18,6 +18,16 @@ function FighterControllerParent:count()
return #self.list
end
function FighterControllerParent:countAlive()
local aliveCount = 0
for i, fighter in ipairs(self.list) do
if (fighter:canFight()) then
aliveCount = aliveCount + 1
end
end
return aliveCount
end
function FighterControllerParent:getTargets(onlyAlive)
local targetList = {}
for i, fighter in ipairs(self.list) do
@ -32,6 +42,7 @@ function FighterControllerParent:applyDeath()
for i, fighter in ipairs(self.list) do
fighter:applyDeath()
end
return self:countAlive()
end
function FighterControllerParent:setActive(activeActor)