Merge branch 'dev' into dev_softlock

This commit is contained in:
Vlyan
2022-01-04 12:24:20 +01:00
3 changed files with 14 additions and 4 deletions

View File

@@ -1,7 +1,8 @@
# Changelog # Changelog
## 1.5.0 - FoundryVTT v9 Compatibility ## 1.5.0 - FoundryVTT v9 Compatibility
- Updated the System to FoundryVTT v9 - Updated the System to FoundryVTT v9.
- Fixed armies in combat tracker.
## 1.4.0 - Armies & French PoW ## 1.4.0 - Armies & French PoW
- Added Army (Actor), Cohort (Item) and Fortification (Item) sheets. - Added Army (Actor), Cohort (Item) and Fortification (Item) sheets.

View File

@@ -41,10 +41,14 @@ export class CombatL5r5e extends Combat {
// Skip non character types (army) // Skip non character types (army)
if (!["character", "npc"].includes(combatant.actor.data.type)) { if (!["character", "npc"].includes(combatant.actor.data.type)) {
updatedCombatants.push({
_id: combatant.id,
initiative: 0,
});
continue; continue;
} }
// Skip if combatant already have a initiative value // Skip if combatant already have an initiative value
if (!messageOptions.rerollInitiative && (!combatant || !combatant.actor)) { if (!messageOptions.rerollInitiative && (!combatant || !combatant.actor)) {
return; return;
} }
@@ -103,7 +107,7 @@ export class CombatL5r5e extends Combat {
roll.l5r5e.voidPointUsed = !!messageOptions.useVoidPoint; roll.l5r5e.voidPointUsed = !!messageOptions.useVoidPoint;
roll.l5r5e.skillAssistance = messageOptions.skillAssistance || 0; roll.l5r5e.skillAssistance = messageOptions.skillAssistance || 0;
roll.roll(); await roll.roll();
rnkMessage = await roll.toMessage({ flavor }); rnkMessage = await roll.toMessage({ flavor });
} }
@@ -140,6 +144,11 @@ export class CombatL5r5e extends Combat {
_sortCombatants(a, b) { _sortCombatants(a, b) {
// if tie, sort by honor, less honorable first // if tie, sort by honor, less honorable first
if (a.initiative === b.initiative) { if (a.initiative === b.initiative) {
// skip if armies
if (a.actor.data.type === "army" || b.actor.data.type === "army") {
return 0;
}
// if tie, Character > Adversary > Minion // if tie, Character > Adversary > Minion
if (a.actor.data.data.social.honor === b.actor.data.data.social.honor) { if (a.actor.data.data.social.honor === b.actor.data.data.social.honor) {
return ( return (

View File

@@ -248,7 +248,7 @@ export class RollL5r5e extends Roll {
// Execute the roll, if needed // Execute the roll, if needed
if (!this._evaluated) { if (!this._evaluated) {
this.roll(); await this.roll();
} }
// Define chat data // Define chat data