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 21 additions and 0 deletions
Showing only changes of commit 5e1ee752ac - Show all commits

View file

@ -82,6 +82,14 @@ function TurnController:calculateTurn()
table.sort(self.actionList, maputils.sortBattlers)
end
function TurnController:removeAllActionsFromFighter(fighterToRemove)
for i, action in ipairs(self.actionlist) do
if action.fighter == fighterToRemove then
table.remove(self.actionlist, i)
end
end
end
function TurnController:startAction()
core.debug:print("cbs/turns", "Starting action " .. self.turns.current)
local nextAction = self.actionList[self.turns.current]

View file

@ -48,5 +48,18 @@ function FighterControllerParent:draw()
--Aucun dessin par defaut, ils sont géré différements
end
function FighterControllerParent:removeFighter(fighterToRemove)
-- remove the actor from the battler liste
for i, fighter in ipairs(self.list) do
if fighter == fighterToRemove then
table.remove(self.list, i)
end
end
-- Also remove all actions related to the actor
self.turnSystem:removeAllActionsFromFighter(fighterToRemove)
end
return FighterControllerParent