Initial import

This commit is contained in:
2022-12-26 00:33:13 +01:00
commit 9686b6bd35
50 changed files with 14432 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
import { HeritiersUtility } from "./heritiers-utility.js";
/* -------------------------------------------- */
export class HeritiersCombat 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]);
//console.log("Init for combattant", c )
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) {
}
}