mirror of
https://github.com/migatu/vtt_work.git
synced 2026-07-14 21:38:39 +00:00
Import gk-greyknight-0.6.4.4.zip do wg-greyknights (2025-08-23T20:15:27Z)
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"id": "gk-greyknight",
|
"id": "gk-greyknight",
|
||||||
"title": "Grey Knights — Compendium (Wrath & Glory)",
|
"title": "Grey Knights — Compendium (Wrath & Glory)",
|
||||||
"version": "0.6.4.3",
|
"version": "0.6.4.4",
|
||||||
"compatibility": {
|
"compatibility": {
|
||||||
"minimum": "11",
|
"minimum": "11",
|
||||||
"verified": "13"
|
"verified": "13"
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -142,3 +142,29 @@ Hooks.once("ready", () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// gk-greyknight 0.6.4.4 — QoL: Brotherhood Focus summary on sheet open
|
||||||
|
Hooks.on("renderActorSheet", async (sheet, htmlEl, data) => {
|
||||||
|
try {
|
||||||
|
const actor = sheet.actor; if (!actor) return;
|
||||||
|
const hasBro = actor.items?.some(i => i.type === "ability" && i.name === "Brotherhood of Psykers");
|
||||||
|
if (!hasBro) return;
|
||||||
|
const tokens = canvas?.tokens?.placeables || [];
|
||||||
|
const allied = new Set();
|
||||||
|
for (const t of tokens) {
|
||||||
|
const a = t.actor; if (!a) continue;
|
||||||
|
const ok = a.items?.some(i => i.type === "ability" && i.name === "Brotherhood of Psykers");
|
||||||
|
if (ok) allied.add(a.id);
|
||||||
|
}
|
||||||
|
const total = allied.size;
|
||||||
|
const bonus = allied.has(actor.id) ? Math.max(0, total - 1) : total;
|
||||||
|
const owners = Object.keys(actor.ownership || {}).filter(uid => actor.ownership[uid] >= CONST.DOCUMENT_OWNERSHIP_LEVELS.OWNER);
|
||||||
|
const content = `<div class="gk-brotherhood-summary">
|
||||||
|
<h3 style="margin:0 0 .25rem 0;">Brotherhood Focus — Summary</h3>
|
||||||
|
<p style="margin:0;">Allies with Brotherhood in scene: <b>${total}</b> (excluding self: <b>${bonus}</b> bonus die to <em>Psychic Mastery</em>).</p>
|
||||||
|
<p style="margin:.25rem 0 0;font-size:.9em;opacity:.85;">Reminder: each subsequent power cast this round using the shared focus adds one extra <em>Wrath die</em>. Only one linked character should use a psychic power as their <em>Action</em> per round.</p>
|
||||||
|
</div>`;
|
||||||
|
ChatMessage.create({content, whisper: owners, speaker: {actor: actor.id}});
|
||||||
|
} catch (e) { console.error("gk-greyknight QoL summary:", e); }
|
||||||
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user