// HbM Attribute Check - pick attribute on selected token's actor, roll d6 pool. const actor = canvas.tokens.controlled[0]?.actor ?? game.user.character; if (!actor) return ui.notifications.warn('Wybierz token postaci.'); const attrs = ['body', 'mind', 'soul', 'magic']; const labels = { body: 'Ciało', mind: 'Umysł', soul: 'Dusza', magic: 'Magia' }; const opts = attrs.map((a) => ``).join(''); const result = await Dialog.prompt({ title: `Test atrybutu - ${actor.name}`, content: `
`, label: 'Rzuć', callback: (html) => { const fd = new foundry.applications.ux.FormDataExtended(html.querySelector('form')).object; return { attr: String(fd.attr), threshold: Number(fd.threshold) }; }, }); if (!result) return; const pool = actor.system.attributes[result.attr]?.value ?? 1; const roll = await new Roll(`${pool}d6cs>=${result.threshold}`).evaluate(); await roll.toMessage({ flavor: `${actor.name} - test ${labels[result.attr]} (TS ${result.threshold})`, speaker: ChatMessage.getSpeaker({ actor }) });