2021-12-02 07:38:59 +01:00
|
|
|
import { PegasusUtility } from "./pegasus-utility.js";
|
|
|
|
|
|
|
|
/* -------------------------------------------- */
|
|
|
|
export class PegasusCombat extends Combat {
|
|
|
|
|
|
|
|
/* -------------------------------------------- */
|
|
|
|
async rollInitiative(ids, formula = undefined, messageOptions = {} ) {
|
|
|
|
ids = typeof ids === "string" ? [ids] : ids;
|
|
|
|
const currentId = this.combatant._id;
|
|
|
|
for (let cId = 0; cId < ids.length; cId++) {
|
2021-12-20 11:54:19 +01:00
|
|
|
const c = this.combatants.get(ids[cId]);
|
2021-12-02 07:38:59 +01:00
|
|
|
let initBonus = c.actor ? c.actor.getInitiativeScore() : 0;
|
2021-12-20 11:54:19 +01:00
|
|
|
let id = c._id || c.id;
|
|
|
|
await this.updateEmbeddedDocuments("Combatant", { _id: id, initiative: initBonus });
|
2021-12-02 07:38:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
}
|