{ "name": "Korrumpierungstest", "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", "author": "mC699Qr7Z5o6lRTF", "img": "icons/magic/unholy/silhouette-robe-evil-power.webp", "_stats": { "compendiumSource": null, "duplicateSource": null, "coreVersion": "14.368", "systemId": "wfrp4e", "systemVersion": "10.0.3", "createdTime": 1759071600000, "modifiedTime": 1759158000000, "lastModifiedBy": "mC699Qr7Z5o6lRTF" }, "folder": null, "_id": "k8NFrPLMTrMKIfrx", "sort": 0, "ownership": { "default": 0, "mC699Qr7Z5o6lRTF": 3 }, "_key": "!macros!k8NFrPLMTrMKIfrx" }