Review initiative
This commit is contained in:
@ -20,12 +20,15 @@ export class BoLCombatManager extends Combat {
|
||||
console.log(`${game.system.title} | Combat.rollInitiative()`, ids, formula, messageOptions);
|
||||
// Structure input data
|
||||
ids = typeof ids === "string" ? [ids] : ids;
|
||||
//const currentId = this.combatant.id;
|
||||
|
||||
// Get initiative malus from tough/adversary
|
||||
let malusInit = 0
|
||||
for (let combatant of this.combatants) {
|
||||
malusInit = Math.max(malusInit, combatant.actor.getInitiativeMalus())
|
||||
}
|
||||
// calculate initiative
|
||||
for (let cId = 0; cId < ids.length; cId++) {
|
||||
for (let cId = 0; cId < ids.length; cId++) {
|
||||
const combatant = this.combatants.get(ids[cId])
|
||||
let fvttInit = combatant.actor.getInitiativeRank(false, true, { combatId: this.id, combatantId: combatant.id })
|
||||
let fvttInit = combatant.actor.getInitiativeRank(false, true, { combatId: this.id, combatantId: combatant.id, malusInit })
|
||||
fvttInit += (cId / 100)
|
||||
await this.updateEmbeddedDocuments("Combatant", [{ _id: ids[cId], initiative: fvttInit }]);
|
||||
}
|
||||
@ -64,7 +67,7 @@ export class BoLCombatManager extends Combat {
|
||||
return super.startCombat()
|
||||
}
|
||||
|
||||
/************************************************************************************/
|
||||
/*-***********************************************************************************/
|
||||
_onDelete() {
|
||||
if (game.user.isGM) {
|
||||
let combatants = this.combatants.contents
|
||||
|
Reference in New Issue
Block a user