Files
wfrp-4e-de/scripts/lmBAZCtofsC8hHHG.js
alzer a7f30267fd Sync 621 missing item-effect scripts from FR and translate to German
scripts/ was missing 621 of FR's 2114 effect scripts (referenced via
game.wfrp4e.config.effectScripts by Foundry item id). Copied them all
over so the registry is complete, then translated the 129 that still
contained French user-facing text: skill/talent/trapping name arrays
in NPC-statblock-building scripts, chat/notification messages, and
dialog prompts. Skill/talent/trait names were cross-checked against
the already-translated core compendium rather than translated ad hoc,
since Foundry looks these up by exact document name.

Also fixed real bugs found along the way (present in FR's originals
too, just inherited via the copy):
- Two "let x / let x" duplicate-declaration scripts (SyntaxError)
- A "0rgs.actor" typo (ReferenceError) for "args.actor"
- Two "effet.update(...)" typos for "effect.update(...)"
- A corrupted ui.notifications.warn(...) template literal in 3 of the
  NPC-statblock scripts, mangled into stray leftover code text
- 19 scripts across the whole scripts/ folder (not just the 621) using
  the wrong game.i18n.localize() key (NAME.Résistance/Démoniaque/
  Mort-vivant instead of the actual English key names NAME.Endurance/
  Daemonic/Undead), which silently failed to resolve in any language

Rebuilt modules/loadScripts.js via `npm run build` (2114 scripts).

Known follow-up (out of scope here, pre-existing in the scripts DE
already had before this sync): 7 scripts elsewhere in scripts/ have
unrelated syntax bugs, and one has a lingering French accent.
2026-07-20 23:43:47 +02:00

31 lines
796 B
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
let SL = 1;
do {
const signedSL = SL >= 0 ? `+${SL}` : "SL";
const content = `
<div>
<p style="font-weight: bold;">Du hast ${signedSL} ${SL > 1 ? "EGs" : "EG"} erzielt. Möchtest du einen W10 würfeln?</p>
<p>16: +1 EG hinzufügen</p>
<p>710: alle angesammelten EG verlieren und den nächsten Test mit 1 EG durchführen</p>
</div>
`;
const choice = await foundry.applications.api.DialogV2.confirm({
yes: {label: "Würfeln", icon: "fas fa-dice"},
no: {label: `${signedSL} EG behalten`, icon: "fas fa-check"},
content,
});
if (!choice) break;
const roll = new Roll("1d10");
await roll.toMessage({flavor: this.effect.name});
if (roll.total >= 7) {
SL = -1;
break;
}
SL++;
} while (true);
this.effect.setFlag("wfrp4e", "SL", SL);