HERO6 - First import

This commit is contained in:
2022-12-15 21:44:23 +01:00
commit ecef402160
104 changed files with 6473 additions and 0 deletions

30
modules/hero6-combat.js Normal file
View File

@ -0,0 +1,30 @@
import { Hero6Utility } from "./hero6-utility.js";
/* -------------------------------------------- */
export class Hero6Combat extends Combat {
/* -------------------------------------------- */
async rollInitiative(ids, formula = undefined, messageOptions = {} ) {
ids = typeof ids === "string" ? [ids] : ids;
for (let cId = 0; cId < ids.length; cId++) {
const c = this.combatants.get(ids[cId]);
let id = c._id || c.id;
let initBonus = c.actor ? c.actor.getInitiativeScore( this.id, id ) : -1;
await this.updateEmbeddedDocuments("Combatant", [ { _id: id, initiative: initBonus } ]);
}
return this;
}
/* -------------------------------------------- */
_onUpdate(changed, options, userId) {
}
/* -------------------------------------------- */
static async checkTurnPosition() {
while (game.combat.turn > 0) {
await game.combat.previousTurn()
}
}
}