mirror of
https://github.com/migatu/vtt_work.git
synced 2026-07-14 21:38:39 +00:00
Import gk-greyknight-0.6.4.2.zip do wg-greyknights (2025-08-23T19:35:08Z)
This commit is contained in:
@@ -53,29 +53,20 @@ Hooks.once("ready", () => {
|
||||
console.log("gk-greyknight helpers active (v0.6.4): Brotherhood discipline prompt enabled.");
|
||||
});
|
||||
|
||||
/* gk-greyknight 0.6.4.1 — house-rule reminder (non-blocking):
|
||||
If multiple Actors with 'Brotherhood of Psykers' attempt to use a Psychic Power as their Action in the same round,
|
||||
show a notification that only one should do so (GM adjudication). */
|
||||
/* gk-greyknight 0.6.4.1 — house-rule reminder (non-blocking) */
|
||||
Hooks.on("preCreateChatMessage", (doc, data, options, userId) => {
|
||||
try {
|
||||
// Quick heuristic: message flavor mentions a psychic power roll
|
||||
const flavor = (data.flavor || "").toLowerCase();
|
||||
const isPsychic = flavor.includes("psychic") || flavor.includes("power");
|
||||
if (!isPsychic) return;
|
||||
// Find speaker's actor
|
||||
const speaker = data.speaker || {}; const actor = game.actors?.get(speaker.actor);
|
||||
if (!actor) return;
|
||||
const hasBrotherhood = actor.items?.some(i => i.type === "ability" && i.name === "Brotherhood of Psykers");
|
||||
if (!hasBrotherhood) return;
|
||||
// Count other GK-brotherhood casters who already posted an action this round
|
||||
const combat = game.combat;
|
||||
if (!combat) return;
|
||||
const combat = game.combat; if (!combat) return;
|
||||
const key = `gk-greyknight.usedPsychicAction.r${combat.round}`;
|
||||
const prev = combat.getFlag("gk-greyknight", key) || null;
|
||||
if (prev && prev !== actor.id) {
|
||||
ui.notifications?.warn("House rule (Brotherhood Focus): only one Grey Knight should use a psychic power as their Action this round.");
|
||||
} else if (!prev) {
|
||||
combat.setFlag("gk-greyknight", key, actor.id);
|
||||
}
|
||||
if (prev && prev !== actor.id) ui.notifications?.warn("House rule (Brotherhood Focus): only one Grey Knight should use a psychic power as their Action this round.");
|
||||
else if (!prev) combat.setFlag("gk-greyknight", key, actor.id);
|
||||
} catch (e) { console.error("gk-greyknight helpers (house-rule reminder):", e); }
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user