let SL = 1; do { const signedSL = SL >= 0 ? `+${SL}` : "SL"; const content = `

Vous avez augmenté ${signedSL} ${SL > 1 ? "DRs" : "SL"}. Voulez-vous lancer un d10 ?

1–6: ajoutez +1 DR

7–10: perdez tous les DR accumulés et effectuez le test suivant à –1 DR

`; 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);