2022-10-22 11:09:48 +02:00
|
|
|
import { HawkmoonUtility } from "./hawkmoon-utility.js";
|
|
|
|
|
|
|
|
/* -------------------------------------------- */
|
|
|
|
export class HawkmoonCombat extends Combat {
|
|
|
|
|
|
|
|
/* -------------------------------------------- */
|
|
|
|
async rollInitiative(ids, formula = undefined, messageOptions = {} ) {
|
|
|
|
ids = typeof ids === "string" ? [ids] : ids;
|
2024-02-24 15:54:47 +01:00
|
|
|
for (let cId of ids) {
|
2024-05-31 14:03:36 +02:00
|
|
|
const c = this.combatants.get(cId);
|
|
|
|
console.log("Init for combattant", c, ids)
|
2022-11-29 10:54:56 +01:00
|
|
|
let id = c._id || c.id
|
2022-11-13 23:01:41 +01:00
|
|
|
let initValue = c.actor ? c.actor.getInitiativeScore() : 0
|
|
|
|
await this.updateEmbeddedDocuments("Combatant", [ { _id: id, initiative: initValue } ]);
|
2022-10-22 11:09:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* -------------------------------------------- */
|
|
|
|
_onUpdate(changed, options, userId) {
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|