Files
foundryvtt-wh4-lang-fr-fr/scripts/lmBAZCtofsC8hHHG.js

31 lines
774 B
JavaScript
Raw 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;">Vous avez augmenté ${signedSL} ${SL > 1 ? "DRs" : "SL"}. Voulez-vous lancer un d10 ?</p>
<p>16: ajoutez +1 DR</p>
<p>710: perdez tous les DR accumulés et effectuez le test suivant à 1 DR</p>
</div>
`;
const choice = await foundry.applications.api.DialogV2.confirm({
yes: {label: "Lancer", icon: "fas fa-dice"},
no: {label: `Keep ${signedSL} DR`, icon: "fas fa-check"},
content,
});
if (!choice) break;
const roll = new Roll("1d10");
await roll.toMessage({flavor: this.effet.name});
if (roll.total >= 7) {
SL = -1;
break;
}
SL++;
} while (true);
this.effet.setFlag("wfrp4e", "SL", SL);