fvtt-hawkmoon-cyd/modules/hawkmoon-combat.js

25 lines
771 B
JavaScript
Raw Normal View History

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) {
2022-10-22 11:09:48 +02:00
const c = this.combatants.get(ids[cId]);
//console.log("Init for combattant", c )
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) {
}
}