mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
Feature/201 new roll type (#218)
* Action Roll DiceSet type * Fix * Remove console log * Tmp fix for non consistent resource * fix
This commit is contained in:
parent
22bf348c12
commit
19cc10a3c9
19 changed files with 283 additions and 156 deletions
|
|
@ -225,11 +225,10 @@ export const getDeleteKeys = (property, innerProperty, innerPropertyDefaultValue
|
|||
|
||||
// Fix on Foundry native formula replacement for DH
|
||||
const nativeReplaceFormulaData = Roll.replaceFormulaData;
|
||||
Roll.replaceFormulaData = function (formula, data, { missing, warn = false } = {}) {
|
||||
const terms = [
|
||||
{ term: 'prof', default: 1 },
|
||||
{ term: 'cast', default: 1 }
|
||||
];
|
||||
Roll.replaceFormulaData = function (formula, data={}, { missing, warn = false } = {}) {
|
||||
const terms = Object.keys(SYSTEM.GENERAL.multiplierTypes).map(type => {
|
||||
return { term: type, default: 1}
|
||||
})
|
||||
formula = terms.reduce((a, c) => a.replaceAll(`@${c.term}`, data[c.term] ?? c.default), formula);
|
||||
return nativeReplaceFormulaData(formula, data, { missing, warn });
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue