Combat tracker fixes

This commit is contained in:
2023-07-24 13:35:35 +02:00
parent a943e6defa
commit b798cde48d
7 changed files with 36 additions and 25 deletions

View File

@@ -388,7 +388,7 @@ export class Hero6Actor extends Actor {
/* -------------------------------------------- */
async cleanCombat() {
await this.setFlag("world", "hold-action", false)
await this.setFlag("world", "abort-action", false)
await this.setFlag("world", "abort-action", { state: false, count: 0 } )
}
async holdAction() {
await this.disableAbortAction()
@@ -423,6 +423,17 @@ export class Hero6Actor extends Actor {
//game.combat.abortAction(this.id, true)
}
}
async incAbortActionCount() {
let abort = this.getFlag("world", "abort-action")
if (abort.state) {
abort.count++
await this.setFlag("world", "abort-action", abort)
if (abort.count == 2) {
return true
}
}
return false
}
getHoldAction() {
return this.getFlag("world", "hold-action")
}