Hide formula display; code removal; start to add Fear die as a choice for Fate roll

This commit is contained in:
Chris Ryan 2025-11-27 23:31:55 +10:00
parent 96224cf234
commit adfb0e7213
4 changed files with 29 additions and 57 deletions

View file

@ -1,15 +1,15 @@
import { abilities } from '../config/actorConfig.mjs';
import { getCommandTarget, rollCommandToJSON } from '../helpers/utils.mjs';
export default function DhFateRollEnricher(match, _options) {
const roll = rollCommandToJSON(match[1], match[0]);
if (!roll) return match[0];
return getFateMessage(roll.result, roll.flavor ?? 'FLAVOR');
return getFateMessage(roll.result, roll?.flavor);
}
function getFateMessage(roll, flavor) {
const label = flavor ?? 'fate';
const label = flavor ?? 'Fate';
console.log("ROLL", roll);
const dataLabel = game.i18n.localize('DAGGERHEART.GENERAL.fate');
@ -19,6 +19,7 @@ function getFateMessage(roll, flavor) {
data-title="${label}"
data-label="${dataLabel}"
data-hope="${roll?.hope ?? 'd12'}"
data-fear="${roll?.fear ?? 'd12'}"
${label}
</button>
`;