24 lines
765 B
JavaScript
24 lines
765 B
JavaScript
import { Imperium5Utility } from "./imperium5-utility.js";
|
|
|
|
/* -------------------------------------------- */
|
|
export class Imperium5Combat 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) {
|
|
}
|
|
|
|
}
|