Fix several issues with inline damage

This commit is contained in:
Carlos Fernandez 2026-06-05 02:42:36 -04:00
parent c0c9095847
commit ea7fdd0bca
4 changed files with 7 additions and 5 deletions

View file

@ -1,7 +1,7 @@
import { parseInlineParams } from './parser.mjs';
export default function DhDamageEnricher(match, _options) {
const { value, type, inline } = parseInlineParams(match[1]);
const { value, type, inline } = parseInlineParams(match[1], { first: 'value' });
if (!value || !type) return match[0];
return getDamageMessage(value, type, inline, match[0]);
}
@ -59,7 +59,7 @@ export const renderDamageButton = async event => {
{
formula: value,
applyTo: CONFIG.DH.GENERAL.healingTypes.hitPoints.id,
type: type
damageTypes: type
}
]
};

View file

@ -8,7 +8,7 @@ export function parseInlineParams(paramString, { first } = {}) {
const parts = paramString.split('|').map(x => x.trim());
const params = {};
for (const [idx, param] of parts.entries()) {
if (first && idx === 0) {
if (first && idx === 0 && !param.includes(':')) {
params[first] = param;
} else {
const parts = param.split(':');