This commit is contained in:
2022-02-23 22:31:53 +01:00
parent 3d8054c632
commit 5c6f9bc9a5
12 changed files with 3293 additions and 0 deletions

View File

@ -0,0 +1,24 @@
import { MournbladeUtility } from "./mournblade-utility.js";
/* -------------------------------------------- */
export class MournbladeCombat 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) {
}
}