diff --git a/packs-source/macros/Korrumpierungstest_k8NFrPLMTrMKIfrx.json b/packs-source/macros/Korrumpierungstest_k8NFrPLMTrMKIfrx.json index 95293af..318e8ab 100644 --- a/packs-source/macros/Korrumpierungstest_k8NFrPLMTrMKIfrx.json +++ b/packs-source/macros/Korrumpierungstest_k8NFrPLMTrMKIfrx.json @@ -3,7 +3,7 @@ "type": "script", "flags": {}, "scope": "global", - "command": "/* GM-Makro: Korrumpierungstest auslösen\n * Fragt Schwere (Leicht/Mittel/Schwer) und Art des Kontakts (Ausdauer = körperlich,\n * Besonnenheit = geistig) ab und wendet den Test auf alle aktuell ausgewählten\n * Token an (Fallback: eigener zugewiesener Charakter, falls nichts ausgewählt ist).\n */\n\nlet actors = canvas.tokens.controlled.map(t => t.actor).filter(a => a);\nif (actors.length === 0 && game.user.character) actors = [game.user.character];\nif (actors.length === 0) {\n ui.notifications.warn(\"Bitte zuerst einen oder mehrere Token auswählen.\");\n return;\n}\n\nlet strength = await foundry.applications.api.DialogV2.wait({\n window: { title: \"Korrumpierungstest: Schwere\" },\n content: `
Wie schwer ist der Kontakt mit Verderbnis?
`,\n buttons: [\n { action: \"minor\", label: game.i18n.localize(\"CORRUPTION.Minor\") },\n { action: \"moderate\", label: game.i18n.localize(\"CORRUPTION.Moderate\") },\n { action: \"major\", label: game.i18n.localize(\"CORRUPTION.Major\") }\n ]\n});\nif (!strength) return;\n\n// actor.corruptionDialog(strength, skill) compares `skill` against the LOCALIZED\n// skill names (game.i18n.localize(\"NAME.Endurance\"/\"NAME.Cool\"), lowercased) - not\n// against the English \"endurance\"/\"cool\" literals. Passing the raw English action\n// value here made corruptionDialog think no skill was chosen yet, so it popped up\n// its own redundant Ausdauer/Besonnenheit dialog on top of ours. Using the\n// localized name as the action value makes corruptionDialog recognize the choice\n// and go straight to the roll dialog, as intended.\nlet skill = await foundry.applications.api.DialogV2.wait({\n window: { title: \"Korrumpierungstest: Art\" },\n content: `Handelt es sich um körperlichen oder geistigen Kontakt?
`,\n buttons: [\n { action: game.i18n.localize(\"NAME.Endurance\"), label: `${game.i18n.localize(\"NAME.Endurance\")} (körperlich)` },\n { action: game.i18n.localize(\"NAME.Cool\"), label: `${game.i18n.localize(\"NAME.Cool\")} (geistig)` }\n ]\n});\nif (!skill) return;\n\nfor (let actor of actors) {\n await actor.corruptionDialog(strength, skill);\n}\n", + "command": "/* GM-Makro: Korrumpierungstest auslösen\n * Fragt Schwere (Leicht/Mittel/Schwer) und Art des Kontakts (Ausdauer = körperlich,\n * Besonnenheit = geistig) ab. Für jeden aktuell ausgewählten Token wird geprüft, ob\n * ein aktiver Spieler den zugehörigen Charakter besitzt: falls ja, bekommt NUR dieser\n * Spieler eine Chat-Nachricht mit \"Widerstehen\"-Knopf zugeflüstert und würfelt selbst\n * (auf seinem eigenen Client, für seinen zugewiesenen Charakter). Gibt es keinen\n * aktiven Spielerbesitzer (z.B. bei NSCs), würfelt der GM direkt.\n */\n\nlet actors = canvas.tokens.controlled.map(t => t.actor).filter(a => a);\nif (actors.length === 0 && game.user.character) actors = [game.user.character];\nif (actors.length === 0) {\n ui.notifications.warn(\"Bitte zuerst einen oder mehrere Token auswählen.\");\n return;\n}\n\nlet strength = await foundry.applications.api.DialogV2.wait({\n window: { title: \"Korrumpierungstest: Schwere\" },\n content: `Wie schwer ist der Kontakt mit Verderbnis?
`,\n buttons: [\n { action: \"minor\", label: game.i18n.localize(\"CORRUPTION.Minor\") },\n { action: \"moderate\", label: game.i18n.localize(\"CORRUPTION.Moderate\") },\n { action: \"major\", label: game.i18n.localize(\"CORRUPTION.Major\") }\n ]\n});\nif (!strength) return;\n\n// actor.corruptionDialog(strength, skill) compares `skill` against the LOCALIZED\n// skill names (game.i18n.localize(\"NAME.Endurance\"/\"NAME.Cool\"), lowercased) - not\n// against the English \"endurance\"/\"cool\" literals. Using the localized name as the\n// action value makes corruptionDialog recognize the choice directly.\nlet skill = await foundry.applications.api.DialogV2.wait({\n window: { title: \"Korrumpierungstest: Art\" },\n content: `Handelt es sich um körperlichen oder geistigen Kontakt?
`,\n buttons: [\n { action: game.i18n.localize(\"NAME.Endurance\"), label: `${game.i18n.localize(\"NAME.Endurance\")} (körperlich)` },\n { action: game.i18n.localize(\"NAME.Cool\"), label: `${game.i18n.localize(\"NAME.Cool\")} (geistig)` }\n ]\n});\nif (!skill) return;\n\n// actor.corruptionDialog() rolls on whichever client calls it - calling it directly\n// here would make the GM roll, not the player. The system's own corruption chat\n// card (CorruptionMessageModel) exists exactly for this: it posts a \"Widerstehen\"\n// button whose click handler runs corruptionDialog() on the CLICKING user's own\n// client. Whisper it only to the actor's active player owner (+ GM), so just that\n// player is prompted and rolls for their own assigned character.\nconst CorruptionMessageModel = CONFIG.ChatMessage.dataModels?.[\"corruption\"];\nconst gmIds = game.users.contents.filter(u => u.isGM).map(u => u.id);\n\nfor (let actor of actors) {\n const ownerIds = game.users.contents\n .filter(u => !u.isGM && u.active && actor.testUserPermission(u, \"OWNER\"))\n .map(u => u.id);\n\n if (ownerIds.length && CorruptionMessageModel) {\n CorruptionMessageModel.createCorruptionMessage(strength, { skill, source: actor.name }, {\n whisper: [...new Set([...ownerIds, ...gmIds])],\n speaker: { alias: actor.name }\n });\n } else {\n // Kein aktiver Spielerbesitzer gefunden (z.B. NSC) - GM würfelt direkt.\n await actor.corruptionDialog(strength, skill);\n }\n}\n", "author": "mC699Qr7Z5o6lRTF", "img": "icons/magic/unholy/silhouette-robe-evil-power.webp", "_stats": { @@ -13,7 +13,7 @@ "systemId": "wfrp4e", "systemVersion": "10.0.3", "createdTime": 1759071600000, - "modifiedTime": 1759158000000, + "modifiedTime": 1759161600000, "lastModifiedBy": "mC699Qr7Z5o6lRTF" }, "folder": null, diff --git a/packs/macros/000034.ldb b/packs/macros/000034.ldb new file mode 100644 index 0000000..3ea6ada Binary files /dev/null and b/packs/macros/000034.ldb differ diff --git a/packs/macros/CURRENT b/packs/macros/CURRENT index 5d0fffb..a56825e 100644 --- a/packs/macros/CURRENT +++ b/packs/macros/CURRENT @@ -1 +1 @@ -MANIFEST-000028 +MANIFEST-000033 diff --git a/packs/macros/LOG b/packs/macros/LOG index e92c69f..13dbdbf 100644 --- a/packs/macros/LOG +++ b/packs/macros/LOG @@ -1,5 +1,5 @@ -2026/09/28-20:33:34.418376 70000a8ff000 Recovering log #27 -2026/09/28-20:33:34.419367 70000a8ff000 Level-0 table #29: started -2026/09/28-20:33:34.420174 70000a8ff000 Level-0 table #29: 1885 bytes OK -2026/09/28-20:33:34.421252 70000a8ff000 Delete type=3 #26 -2026/09/28-20:33:34.421375 70000a8ff000 Delete type=0 #27 +2026/09/28-20:38:19.626146 70000c54f000 Recovering log #32 +2026/09/28-20:38:19.626873 70000c54f000 Level-0 table #34: started +2026/09/28-20:38:19.627431 70000c54f000 Level-0 table #34: 2658 bytes OK +2026/09/28-20:38:19.628566 70000c54f000 Delete type=3 #31 +2026/09/28-20:38:19.628803 70000c54f000 Delete type=0 #32 diff --git a/packs/macros/LOG.old b/packs/macros/LOG.old index fa8686c..cdf3876 100644 --- a/packs/macros/LOG.old +++ b/packs/macros/LOG.old @@ -1,3 +1,3 @@ -2026/09/28-20:33:23.548180 700013eab000 Recovering log #25 -2026/09/28-20:33:23.552091 700013eab000 Delete type=3 #24 -2026/09/28-20:33:23.552252 700013eab000 Delete type=0 #25 +2026/09/28-20:38:11.854045 7000057f2000 Recovering log #30 +2026/09/28-20:38:11.856164 7000057f2000 Delete type=3 #28 +2026/09/28-20:38:11.856384 7000057f2000 Delete type=0 #30 diff --git a/packs/macros/MANIFEST-000028 b/packs/macros/MANIFEST-000028 deleted file mode 100644 index bfc4b28..0000000 Binary files a/packs/macros/MANIFEST-000028 and /dev/null differ diff --git a/packs/macros/MANIFEST-000033 b/packs/macros/MANIFEST-000033 new file mode 100644 index 0000000..f9795f1 Binary files /dev/null and b/packs/macros/MANIFEST-000033 differ