Added : Change stance on DicePicker on initiative roll.

Some minors fixes
This commit is contained in:
Vlyan
2021-01-16 13:26:43 +01:00
parent 27e88be49d
commit 7fbce1500c
3 changed files with 15 additions and 6 deletions

View File

@@ -43,17 +43,19 @@ export class CombatL5r5e extends Combat {
const updatedCombatants = [];
ids.forEach((combatantId) => {
const combatant = game.combat.combatants.find((c) => c._id === combatantId);
if (!combatant || !combatant.actor) {
// Skip if combatant already have a initiative value
if (!messageOptions.rerollInitiative && (!combatant || !combatant.actor)) {
return;
}
// shortcut to data
// Shortcut to data
const data = combatant.actor.data.data;
// A characters initiative value is based on their state of preparedness when the conflict began.
// If the character was ready for the conflict, their base initiative value is their focus attribute.
// If the character was unprepared (such as when surprised), their base initiative value is their vigilance attribute.
let initiative = 0;
let initiative;
if (combatant.actor.data.type === "npc" && combatant.actor.data.data.type === "minion") {
// Minion NPCs can generate initiative value without a check, using their focus or vigilance attribute