mirror of
https://github.com/migatu/vtt_work.git
synced 2026-07-14 13:34:42 +00:00
Import gk-greyknight-0.4.5-patch.zip do wg-greyknights (2025-08-21T22:05:46Z)
This commit is contained in:
+1
@@ -4,3 +4,4 @@
|
|||||||
{"name": "Grey Knight Armour Integrated Storm Bolter", "type": "weapon", "img": "icons/svg/dice-target.svg", "effects": [], "flags": {"wng-core": {"initialization-folder": "Weapons", "sort": 0}, "core": {}}, "system": {"quantity": 1, "rarity": "rare", "description": "<p>Integrated forearm storm bolter. <b>Integrated:</b> does not occupy hands; may fire while wielding two‑handed melee. Treat as Pistol for firing in melee.</p>", "value": 4, "keywords": "BOLT, INTEGRATED, IMPERIUM, ADEPTUS ASTARTES, GREY KNIGHTS, INQUISITION, DAEMONHUNTERS, ORDO MALLEUS", "equipped": false, "attack": {"base": 0, "bonus": 0, "rank": "none"}, "damage": {"base": 10, "bonus": 0, "rank": 0, "ed": {"base": 2, "bonus": 0, "rank": 0}, "ap": {"base": 0, "bonus": 0, "rank": 0}, "enabled": false, "otherDamage": {"mortal": "0", "wounds": "0", "shock": "0"}}, "ed": {"base": 0, "bonus": 0, "rank": 0}, "ap": {"base": 0, "bonus": 0, "rank": 0}, "category": "ranged", "range": {"short": 12, "medium": 24, "long": 36, "melee": 1, "thrown": null}, "ammo": {"id": ""}, "salvo": 1, "traits": {"list": [{"name": "brutal"}, {"name": "pistol"}, {"name": "rapidFire", "rating": "2"}]}, "upgrades": [], "otherDamage": {}, "combi": {}, "twinned": false}, "_stats": {"coreVersion": "13.347", "systemId": "wrath-and-glory", "systemVersion": "7.1.1", "createdTime": 1755779945407, "modifiedTime": 1755779945407, "lastModifiedBy": "8fThFXcxV83JCCcX", "exportSource": {"worldId": "gilead-wandg", "uuid": "Item.Seza6hxnXhHInk8m", "coreVersion": "13.347", "systemId": "wrath-and-glory", "systemVersion": "7.1.1"}}, "folder": "85dkcvhBYli5TJrZ", "_id": "SDFwequVtp6WsCFj"}
|
{"name": "Grey Knight Armour Integrated Storm Bolter", "type": "weapon", "img": "icons/svg/dice-target.svg", "effects": [], "flags": {"wng-core": {"initialization-folder": "Weapons", "sort": 0}, "core": {}}, "system": {"quantity": 1, "rarity": "rare", "description": "<p>Integrated forearm storm bolter. <b>Integrated:</b> does not occupy hands; may fire while wielding two‑handed melee. Treat as Pistol for firing in melee.</p>", "value": 4, "keywords": "BOLT, INTEGRATED, IMPERIUM, ADEPTUS ASTARTES, GREY KNIGHTS, INQUISITION, DAEMONHUNTERS, ORDO MALLEUS", "equipped": false, "attack": {"base": 0, "bonus": 0, "rank": "none"}, "damage": {"base": 10, "bonus": 0, "rank": 0, "ed": {"base": 2, "bonus": 0, "rank": 0}, "ap": {"base": 0, "bonus": 0, "rank": 0}, "enabled": false, "otherDamage": {"mortal": "0", "wounds": "0", "shock": "0"}}, "ed": {"base": 0, "bonus": 0, "rank": 0}, "ap": {"base": 0, "bonus": 0, "rank": 0}, "category": "ranged", "range": {"short": 12, "medium": 24, "long": 36, "melee": 1, "thrown": null}, "ammo": {"id": ""}, "salvo": 1, "traits": {"list": [{"name": "brutal"}, {"name": "pistol"}, {"name": "rapidFire", "rating": "2"}]}, "upgrades": [], "otherDamage": {}, "combi": {}, "twinned": false}, "_stats": {"coreVersion": "13.347", "systemId": "wrath-and-glory", "systemVersion": "7.1.1", "createdTime": 1755779945407, "modifiedTime": 1755779945407, "lastModifiedBy": "8fThFXcxV83JCCcX", "exportSource": {"worldId": "gilead-wandg", "uuid": "Item.Seza6hxnXhHInk8m", "coreVersion": "13.347", "systemId": "wrath-and-glory", "systemVersion": "7.1.1"}}, "folder": "85dkcvhBYli5TJrZ", "_id": "SDFwequVtp6WsCFj"}
|
||||||
{"name": "Aegis Power Armour", "type": "armour", "img": "icons/svg/shield.svg", "effects": [{"_id": "25aqxUBwyQtSAdxb", "name": "Aegis Wards (Constant)", "icon": "icons/svg/aura.svg", "origin": "", "disabled": false, "duration": {"startTime": null}, "changes": [{"key": "system.skills.psychicMastery.bonus", "mode": 2, "value": 1, "priority": 20}, {"key": "system.combat.resolve.bonus", "mode": 2, "value": 1, "priority": 20}], "tint": null, "transfer": true, "flags": {}}, {"_id": "LfRNsXknme6JLgSC", "name": "Aegis Warding Runes (Toggle)", "icon": "icons/svg/explosion.svg", "origin": "", "disabled": true, "duration": {"startTime": null}, "changes": [{"key": "system.combat.resilience.bonus", "mode": 2, "value": 1, "priority": 20}, {"key": "system.combat.defence.bonus", "mode": 2, "value": -1, "priority": 20}], "tint": null, "transfer": true, "flags": {}}], "flags": {"wng-core": {"initialization-folder": "Armour", "sort": 0}, "core": {}}, "system": {"quantity": 1, "rarity": "veryRare", "description": "<p>Grey Knights sanctified power armour with hexagrammic wards and storm bolter forearm mount.</p><ul><li><b>AR 5</b>; <b>Powered (3)</b>.</li><li><b>Aegis (integrated):</b> Constant: +1 die to Deny the Witch and +1 die to resist Corruption.</li><li><b>Toggle (Action):</b> Aegis Warding Runes — runes glow; +1 Resilience, −1 Defence (vs ranged).</li></ul>", "value": 9, "keywords": "POWERED, IMPERIUM, ADEPTUS ASTARTES, GREY KNIGHTS, INQUISITION, DAEMONHUNTERS, ORDO MALLEUS", "equipped": false, "rating": 5, "base": 0, "traits": {"list": [{"name": "powered", "rating": "3"}]}, "invulnerable": false}, "_stats": {"coreVersion": "13.347", "systemId": "wrath-and-glory", "systemVersion": "7.1.1", "createdTime": 1755779886550, "modifiedTime": 1755779886550, "lastModifiedBy": "8fThFXcxV83JCCcX", "exportSource": {"worldId": "gilead-wandg", "uuid": "Item.sTGTpOfbIveLcFul", "coreVersion": "13.347", "systemId": "wrath-and-glory", "systemVersion": "7.1.1"}}, "folder": "K59Lb8PvaCmIrviu", "_id": "11NZTwYXPlHBlnXC"}
|
{"name": "Aegis Power Armour", "type": "armour", "img": "icons/svg/shield.svg", "effects": [{"_id": "25aqxUBwyQtSAdxb", "name": "Aegis Wards (Constant)", "icon": "icons/svg/aura.svg", "origin": "", "disabled": false, "duration": {"startTime": null}, "changes": [{"key": "system.skills.psychicMastery.bonus", "mode": 2, "value": 1, "priority": 20}, {"key": "system.combat.resolve.bonus", "mode": 2, "value": 1, "priority": 20}], "tint": null, "transfer": true, "flags": {}}, {"_id": "LfRNsXknme6JLgSC", "name": "Aegis Warding Runes (Toggle)", "icon": "icons/svg/explosion.svg", "origin": "", "disabled": true, "duration": {"startTime": null}, "changes": [{"key": "system.combat.resilience.bonus", "mode": 2, "value": 1, "priority": 20}, {"key": "system.combat.defence.bonus", "mode": 2, "value": -1, "priority": 20}], "tint": null, "transfer": true, "flags": {}}], "flags": {"wng-core": {"initialization-folder": "Armour", "sort": 0}, "core": {}}, "system": {"quantity": 1, "rarity": "veryRare", "description": "<p>Grey Knights sanctified power armour with hexagrammic wards and storm bolter forearm mount.</p><ul><li><b>AR 5</b>; <b>Powered (3)</b>.</li><li><b>Aegis (integrated):</b> Constant: +1 die to Deny the Witch and +1 die to resist Corruption.</li><li><b>Toggle (Action):</b> Aegis Warding Runes — runes glow; +1 Resilience, −1 Defence (vs ranged).</li></ul>", "value": 9, "keywords": "POWERED, IMPERIUM, ADEPTUS ASTARTES, GREY KNIGHTS, INQUISITION, DAEMONHUNTERS, ORDO MALLEUS", "equipped": false, "rating": 5, "base": 0, "traits": {"list": [{"name": "powered", "rating": "3"}]}, "invulnerable": false}, "_stats": {"coreVersion": "13.347", "systemId": "wrath-and-glory", "systemVersion": "7.1.1", "createdTime": 1755779886550, "modifiedTime": 1755779886550, "lastModifiedBy": "8fThFXcxV83JCCcX", "exportSource": {"worldId": "gilead-wandg", "uuid": "Item.sTGTpOfbIveLcFul", "coreVersion": "13.347", "systemId": "wrath-and-glory", "systemVersion": "7.1.1"}}, "folder": "K59Lb8PvaCmIrviu", "_id": "11NZTwYXPlHBlnXC"}
|
||||||
{"name": "Terminator Aegis (Grey Knights)", "type": "armour", "img": "icons/svg/tower.svg", "effects": [{"_id": "OvE7cPAtNLDdEj6j", "name": "Aegis Wards (Constant)", "icon": "icons/svg/aura.svg", "origin": "", "disabled": false, "duration": {"startTime": null}, "changes": [{"key": "system.skills.psychicMastery.bonus", "mode": 2, "value": 1, "priority": 20}, {"key": "system.combat.resolve.bonus", "mode": 2, "value": 1, "priority": 20}], "tint": null, "transfer": true, "flags": {}}, {"_id": "RXHERg7YjunnEQ8h", "name": "Aegis Warding Runes (Toggle)", "icon": "icons/svg/explosion.svg", "origin": "", "disabled": true, "duration": {"startTime": null}, "changes": [{"key": "system.combat.resilience.bonus", "mode": 2, "value": 1, "priority": 20}, {"key": "system.combat.defence.bonus", "mode": 2, "value": -1, "priority": 20}], "tint": null, "transfer": true, "flags": {}}], "flags": {"wng-core": {"initialization-folder": "Armour", "sort": 0}, "core": {}}, "system": {"quantity": 1, "rarity": "artifact", "description": "<p>Grey Knights Tactical Dreadnought armour with Aegis wards and storm bolter hard‑mount.</p><ul><li><b>AR 7</b>; <b>Powered (4)</b>; <b>Cumbersome</b>; counts as Large while worn.</li><li><b>Aegis (integrated):</b> Constant: +1 die to Deny the Witch and +1 die to resist Corruption.</li><li><b>Toggle (Action):</b> Aegis Warding Runes — +1 Resilience, −1 Defence (vs ranged).</li></ul>", "value": 10, "keywords": "POWERED, IMPERIUM, ADEPTUS ASTARTES, GREY KNIGHTS, INQUISITION, DAEMONHUNTERS, ORDO MALLEUS", "equipped": false, "rating": 7, "base": 0, "traits": {"list": [{"name": "cumbersome"}, {"name": "powered", "rating": "4"}]}, "invulnerable": false}, "_stats": {"coreVersion": "13.347", "systemId": "wrath-and-glory", "systemVersion": "7.1.1", "createdTime": 1755779886550, "modifiedTime": 1755779886550, "lastModifiedBy": "8fThFXcxV83JCCcX", "exportSource": {"worldId": "gilead-wandg", "uuid": "Item.sTGTpOfbIveLcFul", "coreVersion": "13.347", "systemId": "wrath-and-glory", "systemVersion": "7.1.1"}}, "folder": "K59Lb8PvaCmIrviu", "_id": "9XTvCiJElW4LJij9"}
|
{"name": "Terminator Aegis (Grey Knights)", "type": "armour", "img": "icons/svg/tower.svg", "effects": [{"_id": "OvE7cPAtNLDdEj6j", "name": "Aegis Wards (Constant)", "icon": "icons/svg/aura.svg", "origin": "", "disabled": false, "duration": {"startTime": null}, "changes": [{"key": "system.skills.psychicMastery.bonus", "mode": 2, "value": 1, "priority": 20}, {"key": "system.combat.resolve.bonus", "mode": 2, "value": 1, "priority": 20}], "tint": null, "transfer": true, "flags": {}}, {"_id": "RXHERg7YjunnEQ8h", "name": "Aegis Warding Runes (Toggle)", "icon": "icons/svg/explosion.svg", "origin": "", "disabled": true, "duration": {"startTime": null}, "changes": [{"key": "system.combat.resilience.bonus", "mode": 2, "value": 1, "priority": 20}, {"key": "system.combat.defence.bonus", "mode": 2, "value": -1, "priority": 20}], "tint": null, "transfer": true, "flags": {}}], "flags": {"wng-core": {"initialization-folder": "Armour", "sort": 0}, "core": {}}, "system": {"quantity": 1, "rarity": "artifact", "description": "<p>Grey Knights Tactical Dreadnought armour with Aegis wards and storm bolter hard‑mount.</p><ul><li><b>AR 7</b>; <b>Powered (4)</b>; <b>Cumbersome</b>; counts as Large while worn.</li><li><b>Aegis (integrated):</b> Constant: +1 die to Deny the Witch and +1 die to resist Corruption.</li><li><b>Toggle (Action):</b> Aegis Warding Runes — +1 Resilience, −1 Defence (vs ranged).</li></ul>", "value": 10, "keywords": "POWERED, IMPERIUM, ADEPTUS ASTARTES, GREY KNIGHTS, INQUISITION, DAEMONHUNTERS, ORDO MALLEUS", "equipped": false, "rating": 7, "base": 0, "traits": {"list": [{"name": "cumbersome"}, {"name": "powered", "rating": "4"}]}, "invulnerable": false}, "_stats": {"coreVersion": "13.347", "systemId": "wrath-and-glory", "systemVersion": "7.1.1", "createdTime": 1755779886550, "modifiedTime": 1755779886550, "lastModifiedBy": "8fThFXcxV83JCCcX", "exportSource": {"worldId": "gilead-wandg", "uuid": "Item.sTGTpOfbIveLcFul", "coreVersion": "13.347", "systemId": "wrath-and-glory", "systemVersion": "7.1.1"}}, "folder": "K59Lb8PvaCmIrviu", "_id": "9XTvCiJElW4LJij9"}
|
||||||
|
{"name": "Pilgrim Astartes Power Armor", "type": "armour", "img": "modules/wng-core/assets/icons/armour/terminator-armour.webp", "effects": [{"_id": "44rACWx99MiXXe4E", "name": "Pilgrim Disguise Penalties", "icon": "icons/svg/downgrade.svg", "origin": "", "disabled": false, "duration": {"startTime": null, "seconds": null, "turns": null, "startRound": null, "startTurn": null}, "changes": [{"key": "system.attributes.agility.bonus", "mode": 2, "value": -1, "priority": 20}, {"key": "system.skills.stealth.bonus", "mode": 2, "value": -1, "priority": 20}, {"key": "system.combat.speed", "mode": 2, "value": -1, "priority": 20}], "tint": null, "transfer": true, "flags": {}}], "flags": {"wng-core": {"initialization-folder": "Armour", "sort": 0}, "core": {}}, "system": {"quantity": 1, "rarity": "rare", "description": "<p>Scavenged Black Templars plate, patched & lightened. Designed for incognito operations.</p><ul><li><b>AR 4</b>; <b>Powered (1)</b>; <b>Cumbersome</b>.</li><li><b>Penalty (Active Effect):</b> −1 die to Agility- and Stealth-based Tests while worn; −1 Speed (homebrew).</li><li>Appears as Templar armour at a glance; close inspection may reveal inconsistencies.</li></ul>", "value": 6, "keywords": "POWERED, IMPERIUM, ADEPTUS ASTARTES, BLACK TEMPLARS (DISGUISE)", "equipped": true, "rating": 4, "base": 0, "traits": {"list": [{"name": "cumbersome"}, {"name": "powered", "rating": "1"}]}, "invulnerable": false}, "_stats": {"coreVersion": "13.347", "systemId": "wrath-and-glory", "systemVersion": "7.1.1", "createdTime": 1755779886550, "modifiedTime": 1755779886550, "lastModifiedBy": "8fThFXcxV83JCCcX", "exportSource": {"worldId": "gilead-wandg", "uuid": "Item.sTGTpOfbIveLcFul", "coreVersion": "13.347", "systemId": "wrath-and-glory", "systemVersion": "7.1.1"}}, "folder": "K59Lb8PvaCmIrviu", "_id": "2P2HioialQdFUCv6"}
|
||||||
+22
-10
@@ -1,4 +1,4 @@
|
|||||||
// gk-greyknight — auto-attach loadout with clear choices
|
// gk-greyknight — auto-attach loadout (deduped) v0.4.5
|
||||||
Hooks.once("ready", () => {
|
Hooks.once("ready", () => {
|
||||||
const PACK_KEY = "gk-greyknight.gk-items"; // moduleId.packName
|
const PACK_KEY = "gk-greyknight.gk-items"; // moduleId.packName
|
||||||
const ITEMS = {
|
const ITEMS = {
|
||||||
@@ -8,6 +8,7 @@ Hooks.once("ready", () => {
|
|||||||
aegisPA: "Aegis Power Armour",
|
aegisPA: "Aegis Power Armour",
|
||||||
aegisTerm: "Terminator Aegis (Grey Knights)"
|
aegisTerm: "Terminator Aegis (Grey Knights)"
|
||||||
};
|
};
|
||||||
|
const FLAG_SCOPE = "gk-greyknight"; const FLAG_DONE = "autoLoadoutDone";
|
||||||
|
|
||||||
async function fetchFromCompendium(name) {
|
async function fetchFromCompendium(name) {
|
||||||
const pack = game.packs.get(PACK_KEY);
|
const pack = game.packs.get(PACK_KEY);
|
||||||
@@ -36,14 +37,25 @@ Hooks.once("ready", () => {
|
|||||||
if (it && typeof it.system?.equipped !== "undefined") await it.update({"system.equipped": !!on});
|
if (it && typeof it.system?.equipped !== "undefined") await it.update({"system.equipped": !!on});
|
||||||
}
|
}
|
||||||
|
|
||||||
Hooks.on("createItem", async (item, opts, userId) => {
|
// De-register old hook if present to avoid double dialogs
|
||||||
|
if (window._gkAutoLoadoutHookId) {
|
||||||
|
Hooks.off("createItem", window._gkAutoLoadoutHookId);
|
||||||
|
window._gkAutoLoadoutHookId = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
window._gkAutoLoadoutHookId = Hooks.on("createItem", async (item, opts, userId) => {
|
||||||
try {
|
try {
|
||||||
if (item?.type !== "archetype") return;
|
if (item?.type !== "archetype") return;
|
||||||
if (item?.name !== "Grey Knight (Archetype)") return;
|
if (item?.name !== "Grey Knight (Archetype)") return;
|
||||||
const actor = item.parent;
|
// Only the client that performed the creation
|
||||||
if (!actor || game.userId !== userId) return;
|
if (game.userId !== userId) return;
|
||||||
|
|
||||||
|
const actor = item.parent;
|
||||||
|
if (!actor) return;
|
||||||
|
// Avoid duplicate prompts per actor
|
||||||
|
if (actor.getFlag(FLAG_SCOPE, FLAG_DONE)) return;
|
||||||
|
await actor.setFlag(FLAG_SCOPE, FLAG_DONE, true);
|
||||||
|
|
||||||
// Build labeled dialog (no more "Choice1 / Choice2")
|
|
||||||
const content = `
|
const content = `
|
||||||
<style>
|
<style>
|
||||||
.gk-choices .opt{display:flex;gap:.6rem;align-items:flex-start;padding:.35rem .5rem;border:1px solid #6663;border-radius:6px;margin:.35rem 0}
|
.gk-choices .opt{display:flex;gap:.6rem;align-items:flex-start;padding:.35rem .5rem;border:1px solid #6663;border-radius:6px;margin:.35rem 0}
|
||||||
@@ -83,11 +95,9 @@ Hooks.once("ready", () => {
|
|||||||
});
|
});
|
||||||
if (!choice) return;
|
if (!choice) return;
|
||||||
|
|
||||||
// Always add Ability
|
|
||||||
await ensureOnActor(actor, ITEMS.ability, false);
|
await ensureOnActor(actor, ITEMS.ability, false);
|
||||||
// Add base weapons
|
await ensureOnActor(actor, ITEMS.nemesis, choice!=="incog");
|
||||||
const n = await ensureOnActor(actor, ITEMS.nemesis, choice!=="incog");
|
await ensureOnActor(actor, ITEMS.storm, choice!=="incog");
|
||||||
const s = await ensureOnActor(actor, ITEMS.storm, choice!=="incog");
|
|
||||||
|
|
||||||
// Clear both armours equipped
|
// Clear both armours equipped
|
||||||
await setEquipped(actor, ITEMS.aegisPA, false);
|
await setEquipped(actor, ITEMS.aegisPA, false);
|
||||||
@@ -99,7 +109,7 @@ Hooks.once("ready", () => {
|
|||||||
await ensureOnActor(actor, ITEMS.aegisTerm, true);
|
await ensureOnActor(actor, ITEMS.aegisTerm, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Synergy toggle in Aegis of Titan
|
// Synergy toggle
|
||||||
const abil = actor.items.getName(ITEMS.ability);
|
const abil = actor.items.getName(ITEMS.ability);
|
||||||
const anyAegisOn = !!actor.items.find(i => ["armour","armor"].includes(i.type) && /Aegis/.test(i.name) && i.system?.equipped);
|
const anyAegisOn = !!actor.items.find(i => ["armour","armor"].includes(i.type) && /Aegis/.test(i.name) && i.system?.equipped);
|
||||||
if (abil?.effects?.length) {
|
if (abil?.effects?.length) {
|
||||||
@@ -109,4 +119,6 @@ Hooks.once("ready", () => {
|
|||||||
ui.notifications.info(`GK loadout: ${choice.toUpperCase()} ustawiony.`);
|
ui.notifications.info(`GK loadout: ${choice.toUpperCase()} ustawiony.`);
|
||||||
} catch (e) { console.error("gk-greyknight auto-loadout error:", e); }
|
} catch (e) { console.error("gk-greyknight auto-loadout error:", e); }
|
||||||
});
|
});
|
||||||
|
|
||||||
|
console.log("gk-greyknight: auto-loadout hook active (id=", window._gkAutoLoadoutHookId, ")");
|
||||||
});
|
});
|
||||||
Reference in New Issue
Block a user