Initial import
This commit is contained in:
20
modules/pegasus-combat.js
Normal file
20
modules/pegasus-combat.js
Normal file
@@ -0,0 +1,20 @@
|
||||
import { PegasusUtility } from "./pegasus-utility.js";
|
||||
|
||||
/* -------------------------------------------- */
|
||||
export class PegasusCombat extends Combat {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async rollInitiative(ids, formula = undefined, messageOptions = {} ) {
|
||||
console.log("Initiative is requested !!!");
|
||||
|
||||
ids = typeof ids === "string" ? [ids] : ids;
|
||||
const currentId = this.combatant._id;
|
||||
for (let cId = 0; cId < ids.length; cId++) {
|
||||
const c = this.getCombatant(ids[cId]);
|
||||
let initBonus = c.actor ? c.actor.getInitiativeScore() : 0;
|
||||
await this.updateEmbeddedEntity("Combatant", { _id: c._id, initiative: initBonus });
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user