mirror of
https://github.com/migatu/vtt_work.git
synced 2026-07-19 16:22:11 +00:00
Import gk-greyknight-0.4.6-patch.zip do wg-greyknights (2025-08-21T22:23:55Z)
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
{"name": "Aegis of Titan (Ability)", "type": "ability", "img": "icons/svg/aura.svg", "_id": "DaEMUDPe8wmrWz70", "effects": [{"_id": "WD4ApIMZ3pnaPDtl", "name": "Aegis of Titan — Innate Purity", "icon": "icons/svg/aura.svg", "origin": "", "disabled": false, "duration": {"startTime": null}, "changes": [{"key": "system.combat.resolve.bonus", "mode": 2, "value": 1, "priority": 20}], "transfer": true, "flags": {}}, {"_id": "OybEJ8Tl1hRkI5zJ", "name": "Aegis of Titan — Aegis Synergy", "icon": "icons/svg/upgrade.svg", "origin": "", "disabled": true, "duration": {"startTime": null}, "changes": [{"key": "system.combat.resolve.bonus", "mode": 2, "value": 1, "priority": 20}], "transfer": true, "flags": {}}], "flags": {"core": {}}, "folder": null, "system": {"description": "Innate purity (+1 vs Corruption). While equipped with Aegis armour, enable Synergy for an additional +1 vs Corruption.", "keywords": "IMPERIUM, ADEPTUS ASTARTES, GREY KNIGHTS, INQUISITION, DAEMONHUNTERS, ORDO MALLEUS"}, "_stats": {"coreVersion": "13.347", "systemId": "wrath-and-glory", "systemVersion": "7.1.1"}}
|
||||
{"name": "Grey Knight (Archetype)", "type": "archetype", "img": "icons/svg/book.svg", "effects": [{"_id": "uMkkBfS2rRXluXA6", "name": "Aegis of Titan — Innate Purity", "icon": "icons/svg/aura.svg", "origin": "", "disabled": false, "duration": {"startTime": null}, "changes": [{"key": "system.combat.resolve.bonus", "mode": 2, "value": 1, "priority": 20}], "transfer": true, "flags": {}}], "flags": {"wng-forsaken": {"initialization-folder": "Archetypes", "sort": 0}, "core": {}}, "system": {"tier": 4, "journal": "DMmW708Q5AQvQfuy", "species": {"name": "Adeptus Astartes", "id": "KpwHo0A92bR7iVMB"}, "faction": {"name": "Adeptus Astartes", "id": "CN5E9Z5GqfiR1MDn"}, "influence": 2, "cost": 359, "keywords": ["IMPERIUM", "ADEPTUS ASTARTES", "GREY KNIGHTS", "INQUISITION", "DAEMONHUNTERS", "ORDO MALLEUS"], "attributes": {"strength": 5, "toughness": 5, "agility": 5, "initiative": 5, "willpower": 6, "intellect": 3, "fellowship": null}, "skills": {"athletics": 3, "awareness": 3, "ballisticSkill": 5, "cunning": null, "deception": null, "insight": null, "intimidation": null, "investigation": null, "leadership": null, "medicae": null, "persuasion": null, "pilot": null, "psychicMastery": 4, "scholar": 2, "stealth": 3, "survival": 1, "tech": null, "weaponSkill": 5}, "ability": {"id": "DaEMUDPe8wmrWz70", "name": "Aegis of Titan"}, "wargear": {"freeItems": []}, "suggested": {"attributes": {"strength": null, "toughness": null, "agility": null, "initiative": null, "willpower": null, "intellect": null, "fellowship": null}, "skills": {"athletics": null, "awareness": null, "ballisticSkill": null, "cunning": null, "deception": null, "insight": null, "intimidation": null, "investigation": null, "leadership": null, "medicae": null, "persuasion": null, "pilot": null, "psychicMastery": null, "scholar": null, "stealth": null, "survival": null, "tech": null, "weaponSkill": null}, "talents": {"list": []}}}, "_stats": {"coreVersion": "13.347", "systemId": "wrath-and-glory", "systemVersion": "7.1.1", "createdTime": 1755771384639, "modifiedTime": 1755771384639, "lastModifiedBy": "8fThFXcxV83JCCcX", "exportSource": {"worldId": "gilead-wandg", "uuid": "Item.TCmE7YmUDUVQ3xoz", "coreVersion": "13.347", "systemId": "wrath-and-glory", "systemVersion": "7.1.1"}}, "folder": "DEb55m6iVZ0NUOxA", "_id": "qSv5JzFRjTYdw1zI"}
|
||||
{"name": "Nemesis Force Halberd", "type": "weapon", "img": "icons/svg/sword.svg", "effects": [], "flags": {"wng-core": {"initialization-folder": "Weapons", "sort": 0}, "core": {}}, "system": {"quantity": 1, "rarity": "uncommon", "description": "Force Staves are laced with a complex psy-matrix that allows them to act as a psychic battery, storing psychic energy that can be released with brutal efficiency.<p><em>Nemesis:</em> vs DAEMON/PSYKER: +1 ED (homebrew). Two‑Handed.</p>", "value": 2, "keywords": "IMPERIUM, ADEPTUS ASTARTES, GREY KNIGHTS, INQUISITION, DAEMONHUNTERS, ORDO MALLEUS, MELEE, FORCE", "equipped": false, "attack": {"base": 0, "bonus": 0, "rank": "none"}, "damage": {"base": 4, "bonus": 0, "rank": 0, "ap": {"base": -1, "bonus": 0, "rank": 0}, "ed": {"base": 2, "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": "melee", "range": {"short": 0, "medium": 0, "long": 0, "melee": 2, "thrown": null}, "ammo": {"id": ""}, "salvo": 0, "traits": {"list": [{"name": "brutal"}, {"name": "force"}, {"name": "twoHanded"}]}, "upgrades": [], "otherDamage": {}, "combi": {}, "twinned": false}, "_stats": {"coreVersion": "13.347", "systemId": "wrath-and-glory", "systemVersion": "7.1.1", "createdTime": 1755779931196, "modifiedTime": 1755779931196, "lastModifiedBy": "8fThFXcxV83JCCcX", "exportSource": {"worldId": "gilead-wandg", "uuid": "Item.9vfkaU0vc61t7hKO", "coreVersion": "13.347", "systemId": "wrath-and-glory", "systemVersion": "7.1.1"}}, "folder": "85dkcvhBYli5TJrZ", "_id": "NX6bWADcIa03iGCK"}
|
||||
{"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": "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"}
|
||||
@@ -0,0 +1,125 @@
|
||||
// gk-greyknight — auto-attach loadout (dedupe + legacy scrub) v0.4.6
|
||||
Hooks.once("ready", () => {
|
||||
const PACK_KEY = "gk-greyknight.gk-items"; // moduleId.packName
|
||||
const ITEMS = {
|
||||
ability: "Aegis of Titan (Ability)",
|
||||
nemesis: "Nemesis Force Halberd",
|
||||
storm: "Grey Knight Armour Integrated Storm Bolter",
|
||||
aegisPA: "Aegis Power Armour",
|
||||
aegisTerm: "Terminator Aegis (Grey Knights)"
|
||||
};
|
||||
const FLAG_SCOPE = "gk-greyknight"; const FLAG_DONE = "autoLoadoutDone";
|
||||
|
||||
// --- REMOVE legacy createItem handlers that emit 'Choice 1/2' or 'ORDO MALLEUS' dialogs ---
|
||||
const removeLegacy = () => {
|
||||
const list = (Hooks.events && Hooks.events.createItem) || Hooks._hooks?.createItem || [];
|
||||
// copy to avoid mutating while iterating
|
||||
const arr = Array.from(list);
|
||||
for (const cb of arr) {
|
||||
const src = (cb && cb.toString && cb.toString()) || "";
|
||||
if (/ORDO\s+MALLEUS/i.test(src) || /Choice\s*1/i.test(src) || /macro-gk-auto-loadout-on-archetype/i.test(src)) {
|
||||
try { Hooks.off("createItem", cb); console.warn("gk-greyknight: removed legacy createItem hook"); } catch(e){}
|
||||
}
|
||||
}
|
||||
};
|
||||
removeLegacy();
|
||||
|
||||
async function fetchFromCompendium(name) {
|
||||
const pack = game.packs.get(PACK_KEY);
|
||||
if (!pack) return null;
|
||||
const index = await pack.getIndex();
|
||||
const hit = index.find(e => e.name === name);
|
||||
if (!hit) return null;
|
||||
const doc = await pack.getDocument(hit._id);
|
||||
return doc?.toObject();
|
||||
}
|
||||
async function ensureOnActor(actor, name, equip=false) {
|
||||
let have = actor.items.getName(name);
|
||||
if (have) {
|
||||
if (typeof have.system?.equipped !== "undefined") await have.update({"system.equipped": !!equip});
|
||||
return have;
|
||||
}
|
||||
let src = await fetchFromCompendium(name);
|
||||
if (!src) { const world = game.items.getName(name); if (world) src = world.toObject(); }
|
||||
if (!src) return null;
|
||||
if (equip && src.system && typeof src.system.equipped !== "undefined") src.system.equipped = true;
|
||||
const [created] = await actor.createEmbeddedDocuments("Item", [src]);
|
||||
return created;
|
||||
}
|
||||
async function setEquipped(actor, name, on) {
|
||||
const it = actor.items.getName(name);
|
||||
if (it && typeof it.system?.equipped !== "undefined") await it.update({"system.equipped": !!on});
|
||||
}
|
||||
|
||||
if (window._gkAutoLoadoutHookId) { Hooks.off("createItem", window._gkAutoLoadoutHookId); window._gkAutoLoadoutHookId = null; }
|
||||
|
||||
window._gkAutoLoadoutHookId = Hooks.on("createItem", async (item, opts, userId) => {
|
||||
try {
|
||||
if (item?.type !== "archetype") return;
|
||||
if (item?.name !== "Grey Knight (Archetype)") return;
|
||||
if (game.userId !== userId) return; // only the originating client
|
||||
const actor = item.parent; if (!actor) return;
|
||||
|
||||
// If a legacy dialog already fired very early, bail out to avoid double prompts
|
||||
if (actor.getFlag(FLAG_SCOPE, FLAG_DONE)) return;
|
||||
await actor.setFlag(FLAG_SCOPE, FLAG_DONE, true);
|
||||
|
||||
const content = `
|
||||
<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 label{font-weight:600}
|
||||
.gk-choices .hint{font-size:.9em;opacity:.85;margin-left:1.7rem}
|
||||
</style>
|
||||
<div class="gk-choices">
|
||||
<div class="opt">
|
||||
<input type="radio" name="mode" value="incog" id="gk-incog">
|
||||
<label for="gk-incog">Incognito (bez Aegis)</label>
|
||||
</div>
|
||||
<div class="hint">Brak Aegis na starcie; dodam Ability i broń, ale nie będą <i>equipped</i>.</div>
|
||||
|
||||
<div class="opt">
|
||||
<input type="radio" name="mode" value="war" id="gk-war" checked>
|
||||
<label for="gk-war">War‑Plate — Aegis Power Armour</label>
|
||||
</div>
|
||||
<div class="hint">Wyposaża: Aegis Power Armour + Nemesis + Integrated Storm Bolter. Włącza synergię Aegis.</div>
|
||||
|
||||
<div class="opt">
|
||||
<input type="radio" name="mode" value="term" id="gk-term">
|
||||
<label for="gk-term">Terminator — Terminator Aegis</label>
|
||||
</div>
|
||||
<div class="hint">Wyposaża: Terminator Aegis + Nemesis + Integrated Storm Bolter. Włącza synergię Aegis.</div>
|
||||
</div>`;
|
||||
|
||||
const choice = await new Promise(resolve => {
|
||||
new Dialog({
|
||||
title: "Grey Knight — Wybierz Loadout",
|
||||
content,
|
||||
buttons: {
|
||||
ok: {label: "Zastosuj", icon:"<i class='fas fa-check'></i>", callback: html => resolve(html.find('input[name=\"mode\"]:checked').val() || "war")},
|
||||
cancel: {label:"Anuluj", callback: ()=>resolve(null)}
|
||||
},
|
||||
default: "ok"
|
||||
}).render(true);
|
||||
});
|
||||
if (!choice) return;
|
||||
|
||||
await ensureOnActor(actor, ITEMS.ability, false);
|
||||
await ensureOnActor(actor, ITEMS.nemesis, choice!=="incog");
|
||||
await ensureOnActor(actor, ITEMS.storm, choice!=="incog");
|
||||
|
||||
await setEquipped(actor, ITEMS.aegisPA, false);
|
||||
await setEquipped(actor, ITEMS.aegisTerm, false);
|
||||
|
||||
if (choice === "war") await ensureOnActor(actor, ITEMS.aegisPA, true);
|
||||
else if (choice === "term") await ensureOnActor(actor, ITEMS.aegisTerm, true);
|
||||
|
||||
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);
|
||||
if (abil?.effects?.length) for (const ef of abil.effects) if (ef.name?.toLowerCase().includes("synergy")) await ef.update({disabled: !anyAegisOn});
|
||||
|
||||
ui.notifications.info(`GK loadout: ${choice.toUpperCase()} ustawiony.`);
|
||||
} 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