mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-07-21 18:09:54 +02:00
Some checks are pending
Project CI / build (24.x) (push) Waiting to run
* Initial rework * Removed unneeded method * Removed outcommented code * Added migration * Fixed DamageActions * Semi-corrected reroll of one of multiple results on a die * Code improvement * Added aseDie.rerollResult method to specifically reroll a specific result die in a grouping * TagTeamDialog somewhat working * Added migration for TagTeamData * Fix for mean tagTeamDialog.finish * . * Improved migration * Internalised ChatDamageData.prepareRolls to its own constructor * Moved DamageTypes to roll.options * TagTeamDialog fixes to accomodate new flat damage.types structure * Changed so all default rolls become BaseRolls to access convenience functions and getters * . * Fixed so that party.tagTeam now uses a declared damageRollData(ChatDamageData) field. rollData.options.damage is retired. * Critical damage fixes * Corrected TagTeamDialog rerender logic when selecting a roll * Fixed so that DamageTypes are retained and joined together throughout TagTeamDialog * Removed some remaining types.<>.roll references * [Rework] Damage and Damage Resource split (#2094) * Changed the label of ActionSheet damage.resources to Mark Resources * Fix assigning includeBase * Localize add resource * Maybe simplify API * Fix onRollSimple * Handle erroring action update differently --------- Co-authored-by: Carlos Fernandez <cfern1990@gmail.com>
39 lines
No EOL
1.3 KiB
JavaScript
39 lines
No EOL
1.3 KiB
JavaScript
import { MigrationHandlerBase } from './base.mjs';
|
|
|
|
export class Migration_2_5_2 extends MigrationHandlerBase {
|
|
version = '2.5.2';
|
|
|
|
/** @inheritdoc */
|
|
async updateActiveEffectSource(effectSource, item) {
|
|
let shouldUpdate = false;
|
|
const newChanges = [];
|
|
|
|
const srdItem = item?._stats?.compendiumSource ?
|
|
await foundry.utils.fromUuid(item?._stats.compendiumSource) :
|
|
null;
|
|
for (let i = 0; i < effectSource.system.changes.length; i++) {
|
|
const change = effectSource.system.changes[i];
|
|
const srdEffect = srdItem?.effects.find(x => x.name === effectSource.name);
|
|
if (change.type === 'custom') {
|
|
const srdChange = srdEffect ? srdEffect.system.changes[i] : null;
|
|
if (srdChange &&
|
|
change.key === srdChange.key &&
|
|
change.value === srdChange.value &&
|
|
change.type !== srdChange.type
|
|
) {
|
|
shouldUpdate = true;
|
|
newChanges.push(srdChange);
|
|
}
|
|
} else {
|
|
newChanges.push(change);
|
|
}
|
|
}
|
|
|
|
if (shouldUpdate) {
|
|
return {
|
|
_id: effectSource._id,
|
|
system: { changes: newChanges }
|
|
}
|
|
}
|
|
}
|
|
} |