feat: add conditions for finished actions

This commit is contained in:
Kazhnuz 2021-07-17 21:53:10 +02:00
parent deda8a7a76
commit d7a15d4d91
2 changed files with 11 additions and 2 deletions

View file

@ -11,8 +11,17 @@ end
function Conditions.qteFailure(cond, predicate, asker) function Conditions.qteFailure(cond, predicate, asker)
return (Conditions.isQteSuccess(cond, predicate, asker) == false) return (Conditions.isQteSuccess(cond, predicate, asker) == false)
end end
function Conditions.none(cond, predicate, asker) function Conditions.none(cond, predicate, asker)
return true return true
end end
function Conditions.actionFinished(cond, predicate, asker)
return asker:testTagAction(cond[2], 2)
end
function Conditions.actionStarted(cond, predicate, asker)
return asker:testTagAction(cond[2], 1)
end
return Conditions return Conditions

View file

@ -103,12 +103,12 @@ function ChoregraphySystem:testTagAction(tag, statut)
end end
function ChoregraphySystem:startTagAction(tag) function ChoregraphySystem:startTagAction(tag)
self.finishedTagActions[tag] = ACTION_FINISHED self.finishedTagActions[tag] = ACTION_STARTED
end end
function ChoregraphySystem:finishTagAction(tag) function ChoregraphySystem:finishTagAction(tag)
core.debug:print("choregraphy/step", "Tag action " .. tag .. " finished.") core.debug:print("choregraphy/step", "Tag action " .. tag .. " finished.")
self.finishedTagActions[tag] = ACTION_STARTED self.finishedTagActions[tag] = ACTION_FINISHED
end end
function ChoregraphySystem:sendDamage(power, type, element, isSpecial) function ChoregraphySystem:sendDamage(power, type, element, isSpecial)