Fix reset progression roll
All checks were successful
Release Creation / build (release) Successful in 1m12s
All checks were successful
Release Creation / build (release) Successful in 1m12s
This commit is contained in:
@ -12,7 +12,7 @@ export class LethalFantasyCombatTracker extends CombatTracker {
|
||||
console.log("Combat Data", data);
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
activateListeners(html) {
|
||||
super.activateListeners(html);
|
||||
// Display Combat settings
|
||||
@ -23,6 +23,7 @@ export class LethalFantasyCombatTracker extends CombatTracker {
|
||||
c.update({ 'initiative': c.initiative + 1 });
|
||||
console.log("Initiative Plus");
|
||||
});
|
||||
|
||||
html.find(".initiative-minus").click(ev => {
|
||||
ev.preventDefault();
|
||||
let cId = ev.currentTarget.closest(".combatant").dataset.combatantId;
|
||||
@ -131,7 +132,7 @@ export class LethalFantasyCombat extends Combat {
|
||||
let advanceTime = Math.max(this.turns.length - this.turn, 0) * CONFIG.time.turnTime;
|
||||
advanceTime += CONFIG.time.roundTime;
|
||||
let nextRound = this.round + 1;
|
||||
|
||||
|
||||
let initOK = true;
|
||||
for (let c of this.combatants) {
|
||||
if (c.initiative === null) {
|
||||
@ -140,10 +141,10 @@ export class LethalFantasyCombat extends Combat {
|
||||
}
|
||||
}
|
||||
if (!initOK) {
|
||||
ui.notifications.error("All combatants must have initiative rolled before the round can advance.");
|
||||
ui.notifications.error("All combatants must have initiative rolled before the round can advance.");
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
for (let c of this.combatants) {
|
||||
if ( nextRound >= c.initiative) {
|
||||
c.update({ 'system.progressionCount': c.system.progressionCount + 1 });
|
||||
@ -153,7 +154,7 @@ export class LethalFantasyCombat extends Combat {
|
||||
} else {
|
||||
user = game.users.find(u => u.active && u.isGM);
|
||||
c.actor.system.rollProgressionDice(this.id, c.id, c.system.progressionCount+1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -169,4 +170,3 @@ export class LethalFantasyCombat extends Combat {
|
||||
return a.initiative - b.initiative;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user