Import 0.6.1.stable.gk.zip do wg-greyknights (2025-08-22T17:44:46Z)

This commit is contained in:
2025-08-22 17:44:46 +00:00
parent 45b2d0d3b7
commit e29930d0b7
3 changed files with 76 additions and 26 deletions
+10 -10
View File
@@ -1,15 +1,14 @@
{ {
"id": "wng-daemonhunters", "id": "gk-greyknight",
"title": "Wrath & Glory: Daemonhunters (Grey Knights)", "title": "Grey Knights — Compendium (Wrath & Glory)",
"description": "Grey Knights add-on for Wrath & Glory. Restored GK Archetype in compendium; GK items; Aegis/Brotherhood abilities; Sanctic powers; single-dialog autoload.", "version": "0.6.1",
"version": "0.6.4.2",
"compatibility": { "compatibility": {
"minimum": "11", "minimum": "11",
"verified": "13" "verified": "13"
}, },
"authors": [ "authors": [
{ {
"name": "Grey Knights Add-on" "name": "User & Assistant"
} }
], ],
"systems": [ "systems": [
@@ -17,15 +16,16 @@
], ],
"packs": [ "packs": [
{ {
"name": "daemonhunters", "name": "gk-items",
"label": "Daemonhunters (Grey Knights)", "label": "Grey Knights — Items",
"path": "packs/daemonhunters.db", "path": "packs/gk-items",
"type": "Item", "type": "Item",
"system": "wrath-and-glory", "system": "wrath-and-glory",
"private": false "private": false
} }
], ],
"esmodules": [ "esmodules": [
"scripts/auto-gk-archetype.js" "scripts/auto-loadout.js"
] ],
"readme": "README.txt"
} }
File diff suppressed because one or more lines are too long
+54
View File
@@ -0,0 +1,54 @@
// gk-greyknight — helpers v0.6.4 (Brotherhood discipline prompt)
Hooks.once("ready", () => {
const PACK_KEY = "gk-greyknight.gk-items";
const PACK_SRC_PREFIX = `Compendium.${PACK_KEY}.`;
const FLAG_SCOPE = "gk-greyknight";
async function promptDiscipline(actor) {
const existing = await actor.getFlag(FLAG_SCOPE, "discipline");
if (existing) return existing;
return await new Promise(resolve => {
new Dialog({
title: "Brotherhood of Psykers — Discipline",
content: `<p>Choose a psychic discipline for this character:</p>
<div style="display:flex; gap:.75rem; margin-top:.5rem;">
<label><input type="radio" name="disc" value="librarius" checked> Librarius</label>
<label><input type="radio" name="disc" value="sanctic"> Sanctic</label>
</div>
<p style="margin:.5rem 0 0; font-size:.9em; opacity:.8;">(You can change this later in Actor → Flags → gk-greyknight → discipline.)</p>`,
buttons: {
ok: { label: "Confirm", icon: "<i class='fas fa-check'></i>", callback: html => resolve(html.find('input[name=\"disc\"]:checked').val() || "librarius") },
cancel: { label: "Cancel", callback: () => resolve(null) }
},
default: "ok"
}).render(true);
});
}
if (window._gkBroHookId) { Hooks.off("createItem", window._gkBroHookId); window._gkBroHookId = null; }
window._gkBroHookId = Hooks.on("createItem", async (item, opts, userId) => {
try {
if (game.userId !== userId) return;
if (item?.type !== "ability") return;
const name = item?.name || "";
if (name !== "Brotherhood of Psykers") return;
const src = item?.flags?.core?.sourceId || "";
const isFromOurPack = src.startsWith(PACK_SRC_PREFIX);
if (!isFromOurPack && name !== "Brotherhood of Psykers") return;
const actor = item.parent; if (!actor) return;
const chosen = await promptDiscipline(actor);
if (!chosen) return;
await actor.setFlag(FLAG_SCOPE, "discipline", chosen);
if (chosen === "sanctic") {
ui.notifications.info("Discipline set to SANCTIC. Open the GK compendium and pick one Sanctic power as your starter.");
} else {
ui.notifications.info("Discipline set to LIBRARIUS. Use core Librarius powers from wng-core.");
}
} catch (e) { console.error("gk-greyknight brotherhood helper:", e); }
});
console.log("gk-greyknight helpers active (v0.6.4): Brotherhood discipline prompt enabled.");
});