Fixes from 29th of june

This commit is contained in:
2023-06-30 21:11:29 +02:00
parent b535a86116
commit 297c94adb7
8 changed files with 109 additions and 41 deletions

View File

@@ -385,11 +385,39 @@ export class Hero6Actor extends Actor {
await this.updateEmbeddedDocuments('Item', [update]); // Updates one EmbeddedEntity
}
}
/* -------------------------------------------- */
async cleanCombat() {
await this.setFlag("world", "hold-action", false)
await this.setFlag("world", "abort-action", false)
}
async holdAction() {
if (this.getFlag("world", "hold-action")) {
await this.setFlag("world", "hold-action", false)
} else {
await this.setFlag("world", "hold-action", true)
}
game.combat.rebuildInitiative()
}
async abortAction() {
if (this.getFlag("world", "abort-action")) {
await this.setFlag("world", "abort-action", false)
} else {
await this.setFlag("world", "abort-action", true)
}
game.combat.rebuildInitiative()
}
getHoldAction() {
return this.getFlag("world", "hold-action")
}
getAbortAction() {
return this.getFlag("world", "abort-action")
}
/* -------------------------------------------- */
hasPhase(segmentNumber) {
let index = Math.min(Math.max(this.system.characteristics.spd.value, 1), 12) // Security bounds
let phases = __speed2Segments[index]
console.log("index", segmentNumber, index, phases, phases.includes(segmentNumber))
return phases.includes(segmentNumber)
}
/* -------------------------------------------- */