mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-04-21 23:13:39 +02: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
|
|
@ -49,9 +49,7 @@ export default class RegisterHandlebarsHelpers {
|
|||
}
|
||||
|
||||
static damageSymbols(damageParts) {
|
||||
const symbols = [...new Set(damageParts.reduce((a, c) => a.concat([...c.type]), []))].map(
|
||||
p => CONFIG.DH.GENERAL.damageTypes[p].icon
|
||||
);
|
||||
const symbols = [...new Set(damageParts.map(x => x.type))].map(p => CONFIG.DH.GENERAL.damageTypes[p].icon);
|
||||
return new Handlebars.SafeString(Array.from(symbols).map(symbol => `<i class="fa-solid ${symbol}"></i>`));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -722,3 +722,16 @@ export async function RefreshFeatures(
|
|||
|
||||
return refreshedActors;
|
||||
}
|
||||
|
||||
export function getUnusedDamageTypes(parts) {
|
||||
const usedKeys = Object.keys(parts);
|
||||
return Object.keys(CONFIG.DH.GENERAL.healingTypes).reduce((acc, key) => {
|
||||
if (!usedKeys.includes(key))
|
||||
acc.push({
|
||||
value: key,
|
||||
label: game.i18n.localize(CONFIG.DH.GENERAL.healingTypes[key].label)
|
||||
});
|
||||
|
||||
return acc;
|
||||
}, []);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue