This commit is contained in:
@@ -143,10 +143,27 @@ export class LethalFantasyCombat extends Combat {
|
||||
/** Roll progression dice for all eligible monster combatants this round. Called manually by the GM. */
|
||||
async rollMonsterProgression() {
|
||||
const currentRound = this.round;
|
||||
for (let c of this.combatants) {
|
||||
if (c.actor.type !== "monster") continue;
|
||||
const monsters = this.combatants.filter(c => c.actor?.type === "monster" && !c.isDefeated);
|
||||
|
||||
if (monsters.length === 0) {
|
||||
ui.notifications.warn("No monsters in combat.");
|
||||
return;
|
||||
}
|
||||
|
||||
let rolled = 0;
|
||||
for (let c of monsters) {
|
||||
if (c.initiative !== null && currentRound >= c.initiative) {
|
||||
await c.actor.system.rollProgressionDice(this.id, c.id);
|
||||
rolled++;
|
||||
}
|
||||
}
|
||||
|
||||
if (rolled === 0) {
|
||||
const earliest = monsters.reduce((min, c) => (c.initiative !== null && c.initiative < min) ? c.initiative : min, Infinity);
|
||||
if (earliest === Infinity) {
|
||||
ui.notifications.warn("Monsters have no initiative set. Roll initiative first.");
|
||||
} else {
|
||||
ui.notifications.info(`No monsters act yet — earliest monster initiative is ${earliest} (current round: ${currentRound}).`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user