Initial import
This commit is contained in:
24
modules/mournblade-cyd2-combat.js
Normal file
24
modules/mournblade-cyd2-combat.js
Normal file
@@ -0,0 +1,24 @@
|
||||
import { MournbladeCYD2Utility } from "./mournblade-cyd2-utility.js";
|
||||
|
||||
/* -------------------------------------------- */
|
||||
export class MournbladeCYD2Combat extends Combat {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async rollInitiative(ids, formula = undefined, messageOptions = {} ) {
|
||||
ids = typeof ids === "string" ? [ids] : ids;
|
||||
for (let cId of ids) {
|
||||
const c = this.combatants.get(cId);
|
||||
console.log("Init for combattant", c, ids)
|
||||
let id = c._id || c.id
|
||||
let initValue = c.actor ? c.actor.getInitiativeScore() : 0
|
||||
await this.updateEmbeddedDocuments("Combatant", [ { _id: id, initiative: initValue } ]);
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
_onUpdate(changed, options, userId) {
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user