feat: implement core Foundry VTT system framework, including actor/item data models, spellcasting logic, dice mechanics, and automation scripts
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
// HbM Attribute Check — pick attribute on selected token's actor, roll d6 pool.
|
||||
// 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) => `<option value="${a}">${labels[a]} (${actor.system.attributes[a]?.value ?? 0})</option>`).join('');
|
||||
const result = await Dialog.prompt({
|
||||
title: `Test atrybutu — ${actor.name}`,
|
||||
title: `Test atrybutu - ${actor.name}`,
|
||||
content: `
|
||||
<form>
|
||||
<div class="form-group">
|
||||
@@ -27,4 +27,4 @@ const result = await Dialog.prompt({
|
||||
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 }) });
|
||||
await roll.toMessage({ flavor: `${actor.name} - test ${labels[result.attr]} (TS ${result.threshold})`, speaker: ChatMessage.getSpeaker({ actor }) });
|
||||
|
||||
Reference in New Issue
Block a user