mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-03-07 14:36:13 +01:00
Reworked ActionConfig damage ui
This commit is contained in:
parent
9bda624112
commit
fc7b9a4828
5 changed files with 76 additions and 24 deletions
|
|
@ -558,11 +558,15 @@ export function calculateExpectedValue(formulaOrTerms) {
|
|||
return terms.reduce((r, t) => r + (t.bonus ?? 0) + (t.diceQuantity ? (t.diceQuantity * (t.faces + 1)) / 2 : 0), 0);
|
||||
}
|
||||
|
||||
export function getNextUnusedDamageType(parts) {
|
||||
export function getUnusedDamageTypes(parts) {
|
||||
const usedKeys = Object.keys(parts);
|
||||
for (const key of Object.keys(CONFIG.DH.GENERAL.healingTypes)) {
|
||||
if (!usedKeys.includes(key)) return key;
|
||||
}
|
||||
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 null;
|
||||
return acc;
|
||||
}, []);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue