Combat initiativ
This commit is contained in:
@ -7,6 +7,7 @@ export class LethalFantasyCombatTracker extends CombatTracker {
|
||||
for (let u of data.turns) {
|
||||
let c = game.combat.combatants.get(u.id);
|
||||
u.progressionCount = c.system.progressionCount
|
||||
u.isMonster = c.actor.type === "monster"
|
||||
}
|
||||
console.log("Combat Data", data);
|
||||
return data;
|
||||
@ -107,7 +108,19 @@ 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) {
|
||||
initOK = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!initOK) {
|
||||
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 });
|
||||
|
Reference in New Issue
Block a user