// 💥 Quick Damage — supports Tearing, Proven(X), Primitive(X), flat mod new Dialog({ title:"💥 Damage Roller", content: `
`, buttons:{ go:{label:"Roll", callback: async html=>{ const mod = Number(html.find('[name="mod"]').val()); const tearing = html.find('[name="tear"]')[0].checked; const proven = html.find('[name="prov"]')[0].checked ? Number(html.find('[name="provV"]').val()) : 0; const primitive = html.find('[name="prim"]')[0].checked ? Number(html.find('[name="primV"]').val()) : 0; // base die (d10) with tearing (best of 2) const r1 = await (new Roll("1d10")).roll({async:true}); const r2 = tearing ? await (new Roll("1d10")).roll({async:true}) : null; let die = tearing ? Math.max(r1.total, r2.total) : r1.total; // apply Proven/Primitive if (proven>0) die = Math.max(die, proven); if (primitive>0) die = Math.min(die, primitive); const rf = (die===10); // potential Zealous Hatred trigger const total = die + mod; let flavor = `💥 Damage