diff --git a/slazero2.mjs b/slazero2.mjs index 96a0a34..ca8e7c5 100644 --- a/slazero2.mjs +++ b/slazero2.mjs @@ -10805,18 +10805,36 @@ Hooks.once("ready", async () => { for (const key of Object.keys(data)) { const t = data[key]; if (!t?.name || game.tables.getName(t.name)) continue; - await RollTable.create({ - name: t.name, - description: t.description || "", - formula: (t.formula || "1d6").replace("@stress", "0"), - replacement: true, - displayRoll: true, - results: (t.results || []).map(r => ({ + const isD66 = (t.results || []).some(r => typeof r.key === "string"); + const results = (t.results || []).map(r => { + if (typeof r.key === "string") { + // d66 shape: key "t.o" → numeric to*1 range; compose display text + const [tens, ones] = r.key.split(".").map(Number); + const val = tens * 10 + ones; + const tail = [r.effects, r.healing ? `Healing: ${r.healing}` : "", + r.recovery ? `Recovery: ${r.recovery}` : "", + r.timeLimit ? `⏱ ${r.timeLimit}` : ""].filter(Boolean).join(" — "); + return { + type: CONST.TABLE_RESULT_TYPES?.TEXT ?? 0, + text: `${r.name}${r.lethal ? " ☠" : ""}: ${tail}`, + range: [val, val], + weight: 1 + }; + } + return { type: CONST.TABLE_RESULT_TYPES?.TEXT ?? 0, text: r.text, range: r.range, weight: 1 - })) + }; + }); + await RollTable.create({ + name: t.name, + description: t.description || "", + formula: isD66 ? "1d6 * 10 + 1d6" : (t.formula || "1d6").replace("@stress", "0"), + replacement: true, + displayRoll: true, + results }); created++; }