Combat tracker fixes

This commit is contained in:
2023-07-16 14:33:26 +02:00
parent 6d6b7075df
commit 9099e812d5
3 changed files with 58 additions and 25 deletions

View File

@@ -391,11 +391,16 @@ export class Hero6Actor extends Actor {
await this.setFlag("world", "abort-action", false)
}
async holdAction() {
await this.disableAbortAction()
if (this.getFlag("world", "hold-action")) {
await this.setFlag("world", "hold-action", false)
//game.combat.holdAction(this.id, false)
game.combat.forceHold(this, false)
return false
} else {
await this.setFlag("world", "hold-action", true)
//game.combat.holdAction(this.id, false)
game.combat.forceHold(this, true)
return true
}
}
@@ -406,13 +411,16 @@ export class Hero6Actor extends Actor {
await this.setFlag("world", "abort-action", { state: false, count: 0 })
}
async abortAction() {
await this.disableHoldAction()
let abort = this.getFlag("world", "abort-action")
if (abort.state) {
await this.setFlag("world", "abort-action", { state: false, count: 0 })
game.combat.abortAction(this.id, false)
game.combat.forceAbort(this, false)
//game.combat.abortAction(this.id, false)
} else {
await this.setFlag("world", "abort-action", { state: true, count: 0 })
game.combat.abortAction(this.id, true)
game.combat.forceAbort(this, true)
//game.combat.abortAction(this.id, true)
}
}
getHoldAction() {
@@ -441,10 +449,13 @@ export class Hero6Actor extends Actor {
return __speed2Segments[index].toString()
}
/* -------------------------------------------- */
getBaseInit() {
let r = new Roll("1d6").roll({ async: false })
let base = this.system.characteristics.dex.value + (r.total / 10)
return base
getBaseInit(turn) {
if ( turn != this.turn) {
let r = new Roll("1d6").roll({ async: false })
this.currentInit = this.system.characteristics.dex.value + (r.total / 10)
this.turn = turn
}
return this.currentInit
}
/* -------------------------------------------- */