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:
Dapoulp 2025-06-29 23:00:11 +02:00 committed by GitHub
parent 22bf348c12
commit 19cc10a3c9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 283 additions and 156 deletions

View file

@ -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 });
};