import { abilities } from '../config/actorConfig.mjs'; export async function dualityRollEnricher(match, _options) { try { const { hope = 'd12', fear = 'd12', attribute, advantage, disadvantage } = JSON.parse(`{${match[1].replace(' ', ',').replace(/(\w+(?==))(=)/g, '"$1":')}}`); const dualityElement = document.createElement('span'); const attributeLabel = attribute && abilities[attribute] ? game.i18n.format('DAGGERHEART.General.Check', { check: game.i18n.localize(abilities[attribute].label) }) : null; const label = attributeLabel ?? game.i18n.localize('DAGGERHEART.General.Duality'); dualityElement.innerHTML = ` `; return dualityElement; } catch (_) { return match[0]; } }