Initial commit

This commit is contained in:
Octoturge
2026-06-09 22:06:56 +02:00
commit fb42c6e8cc
121 changed files with 14976 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
// HbM Apply Condition — pick a status effect and toggle it on targeted/selected tokens.
const targets = game.user.targets.size > 0 ? Array.from(game.user.targets) : canvas.tokens.controlled;
if (targets.length === 0) return ui.notifications.warn('Zaznacz lub naceluj token(y).');
const effects = CONFIG.statusEffects.filter((e) => e.id?.startsWith('hbm.'));
const opts = effects.map((e) => `<option value="${e.id}">${game.i18n.localize(e.name ?? e.label ?? e.id)}</option>`).join('');
const result = await Dialog.prompt({
title: 'Nałóż przypadłość',
content: `<form><div class="form-group"><label>Przypadłość:</label><select name="effect">${opts}</select></div></form>`,
label: 'Nałóż',
callback: (html) => String(new foundry.applications.ux.FormDataExtended(html.querySelector('form')).object.effect),
});
if (!result) return;
for (const t of targets) {
if (t.actor) await t.actor.toggleStatusEffect(result, { active: true });
}
ui.notifications.info(`Nałożono ${result} na ${targets.length} cel(e).`);
+30
View File
@@ -0,0 +1,30 @@
// 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}`,
content: `
<form>
<div class="form-group">
<label>Atrybut:</label>
<select name="attr">${opts}</select>
</div>
<div class="form-group">
<label>Próg sukcesu (TS):</label>
<input type="number" name="threshold" value="4" min="2" max="6"/>
</div>
</form>
`,
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 }) });
+24
View File
@@ -0,0 +1,24 @@
// HbM Group Cast Helper — sum mana of controlled token actors (potential co-casters).
const tokens = canvas.tokens.controlled;
if (tokens.length < 2) return ui.notifications.warn('Zaznacz co najmniej 2 tokeny współrzucających.');
const lines = [];
let totalMana = 0;
let totalPool = 0;
for (const t of tokens) {
const a = t.actor;
if (!a) continue;
const mana = a.system.attributes?.mana?.value ?? 0;
const magic = a.system.attributes?.magic?.value ?? 0;
totalMana += mana;
totalPool += magic;
lines.push(`<li><strong>${a.name}</strong> — Mana ${mana}, Magia ${magic}</li>`);
}
const html = `
<div class="hbm-group-cast">
<p>Współrzucający (${tokens.length}):</p>
<ul>${lines.join('')}</ul>
<p><strong>Łączna mana: ${totalMana}</strong></p>
<p><strong>Łączna pula d6: ${totalPool}</strong></p>
</div>
`;
await ChatMessage.create({ content: html, speaker: ChatMessage.getSpeaker() });
+6
View File
@@ -0,0 +1,6 @@
// HbM Long Rest — invoke game.hbm.rest(actor, 'long') on selected token's actor.
const actor = canvas.tokens.controlled[0]?.actor ?? game.user.character;
if (!actor) return ui.notifications.warn('Wybierz token postaci.');
if (!game.hbm?.rest) return ui.notifications.error('Brak game.hbm.rest — system niezainicjowany.');
const result = await game.hbm.rest(actor, 'long');
ui.notifications.info(`${actor.name}: długi odpoczynek — pełna regeneracja zasobów.`);
+25
View File
@@ -0,0 +1,25 @@
// HbM Pool Roll — prompts for pool size and threshold, then rolls a d6 pool.
const result = await Dialog.prompt({
title: 'Rzut puli d6',
content: `
<form>
<div class="form-group">
<label>Pula (liczba kości):</label>
<input type="number" name="pool" value="3" min="1" max="20"/>
</div>
<div class="form-group">
<label>Próg sukcesu (TS):</label>
<input type="number" name="threshold" value="4" min="2" max="6"/>
</div>
</form>
`,
label: 'Rzuć',
callback: (html) => {
const fd = new foundry.applications.ux.FormDataExtended(html.querySelector('form')).object;
return { pool: Number(fd.pool), threshold: Number(fd.threshold) };
},
});
if (!result) return;
const formula = `${result.pool}d6cs>=${result.threshold}`;
const roll = await new Roll(formula).evaluate();
await roll.toMessage({ flavor: `Pula d6 (TS ${result.threshold})` });
+8
View File
@@ -0,0 +1,8 @@
// HbM Refill Zeal — bumps zeal by 1 on selected token's actor (debug helper).
const actor = canvas.tokens.controlled[0]?.actor ?? game.user.character;
if (!actor) return ui.notifications.warn('Wybierz token postaci.');
const cur = actor.system.attributes?.zeal?.value ?? 0;
const max = actor.system.attributes?.zeal?.max ?? 0;
const next = Math.min(max, cur + 1);
await actor.update({ 'system.attributes.zeal.value': next });
ui.notifications.info(`${actor.name}: Zapał ${cur}${next}/${max}.`);
+6
View File
@@ -0,0 +1,6 @@
// HbM Short Rest — invoke game.hbm.rest(actor, 'short') on selected token's actor.
const actor = canvas.tokens.controlled[0]?.actor ?? game.user.character;
if (!actor) return ui.notifications.warn('Wybierz token postaci.');
if (!game.hbm?.rest) return ui.notifications.error('Brak game.hbm.rest — system niezainicjowany.');
const result = await game.hbm.rest(actor, 'short');
ui.notifications.info(`${actor.name}: krótki odpoczynek — przywrócono ${result?.healed ?? 0} PW.`);