mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-03-09 20:51:21 +01:00
[Feature] Damage Iterrable Rework (#1685)
* Initial * More * Fixed current actionConfig damage * Reworked ActionConfig damage ui * . * Updated all Adversary compendium damage entries * more * The rest * Fixed misses * . * . * Also migrate sub fields of MappingField * Removed MappingField * Fix regression with re-tiering adversaries when dealing non-hp damage * Allow iterable object to be detected as an object by foundry --------- Co-authored-by: Carlos Fernandez <cfern1990@gmail.com>
This commit is contained in:
parent
d3ebd30e59
commit
5a4bbc91f5
536 changed files with 2476 additions and 2368 deletions
|
|
@ -352,11 +352,11 @@ export default class DHBaseAction extends ActionMixin(foundry.abstract.DataModel
|
|||
}
|
||||
|
||||
get hasDamage() {
|
||||
return this.damage?.parts?.length && this.type !== 'healing';
|
||||
return !foundry.utils.isEmpty(this.damage.parts) && this.type !== 'healing';
|
||||
}
|
||||
|
||||
get hasHealing() {
|
||||
return this.damage?.parts?.length && this.type === 'healing';
|
||||
return !foundry.utils.isEmpty(this.damage.parts) && this.type === 'healing';
|
||||
}
|
||||
|
||||
get hasSave() {
|
||||
|
|
@ -376,6 +376,15 @@ export default class DHBaseAction extends ActionMixin(foundry.abstract.DataModel
|
|||
|
||||
return tags;
|
||||
}
|
||||
|
||||
static migrateData(source) {
|
||||
if (source.damage?.parts && Array.isArray(source.damage.parts)) {
|
||||
source.damage.parts = source.damage.parts.reduce((acc, part) => {
|
||||
acc[part.applyTo] = part;
|
||||
return acc;
|
||||
}, {});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export class ResourceUpdateMap extends Map {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue