Sync effetcts + initiative
This commit is contained in:
@@ -6,14 +6,25 @@ export class PegasusCombat extends Combat {
|
||||
/* -------------------------------------------- */
|
||||
async rollInitiative(ids, formula = undefined, messageOptions = {} ) {
|
||||
ids = typeof ids === "string" ? [ids] : ids;
|
||||
const currentId = this.combatant._id;
|
||||
for (let cId = 0; cId < ids.length; cId++) {
|
||||
const c = this.combatants.get(ids[cId]);
|
||||
let initBonus = c.actor ? c.actor.getInitiativeScore() : 0;
|
||||
let id = c._id || c.id;
|
||||
await this.updateEmbeddedDocuments("Combatant", { _id: id, initiative: initBonus });
|
||||
let initBonus = c.actor ? c.actor.getInitiativeScore( this.id, id ) : -1;
|
||||
await this.updateEmbeddedDocuments("Combatant", [ { _id: id, initiative: initBonus } ]);
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
_onUpdate(changed, options, userId) {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static decInitBy10( combatantId, value) {
|
||||
const combatant = game.combat.combatants.get(combatantId)
|
||||
let initValue = combatant.initiative + value
|
||||
game.combat.setInitiative(combatantId, initValue)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user