diff --git a/module/roll/roll.js b/module/roll/roll.js index 58d6f46..a81ce71 100644 --- a/module/roll/roll.js +++ b/module/roll/roll.js @@ -234,9 +234,14 @@ export class DGPercentileRoll extends DGRoll { html += `
` html += `
` html += `
` - html += `

` - html += ` ${this.formula}` - html += `

` + html += `
` + html += ` ` + html += ` ${this.formula}` + html += ` ` + html += ` ` + html += ` ${this.total}` + html += ` ` + html += `
` html += `
    ` html += `
  1. ${this.total}
  2. ` html += `
` @@ -359,16 +364,26 @@ export class DGLethalityRoll extends DGPercentileRoll { html += `
`; html += `
`; html += `
`; - html += `

`; - html += ` d100`; - html += `

`; + html += `
`; + html += ` `; + html += ` d100`; + html += ` `; + html += ` `; + html += ` ${this.total}`; + html += ` `; + html += `
`; html += `
    `; html += `
  1. ${this.total}`; html += `
`; html += `
`; - html += `

`; - html += ` 2d10 (d10 + d10)`; - html += `

`; + html += `
`; + html += ` `; + html += ` 2d10 (d10 + d10)`; + html += ` `; + html += ` `; + html += ` ${nonLethalDamage.total}`; + html += ` `; + html += `
`; html += `
    `; html += `
  1. ${nonLethalDamage.die1}
  2. `; html += `
  3. ${nonLethalDamage.die2}
  4. `; @@ -507,23 +522,50 @@ export class DGSanityDamageRoll extends DGRoll { async toChat() { const rollMode = this.options.rollMode || game.settings.get("core", "rollMode"); - const [lowFormula, highFormula] = this.damageFormulas; - const flavor = `

    Rolling ${localizeWithFallback('DG.Generic.SanDamage', 'SAN DAMAGE')} (${lowFormula}/${highFormula})

    `; - - const [lowResult, highResult] = this.damageResults; - - const html = `

    ${lowResult} / ${highResult}

    `; - return this.createMessage(html, flavor, rollMode); - } + const [lowDie, highDie] = this.terms[0].terms.map((formula) => { + return Roll.parse(formula)[0] || { faces: parseInt(formula), number: 1 }; + }); - /** - * Returns the two formulas for a sanity damage roll. - * - * @returns {Array} - Array of formula strings - */ - get damageFormulas() { - const [lowFormula, highFormula] = this.terms[0].terms; - return [lowFormula, highFormula]; + const [lowResult, highResult] = this.damageResults; + + const flavor = `Rolling ${localizeWithFallback('DG.Generic.SanDamage', 'SAN DAMAGE')} For ${lowDie.formula} / ${highDie.formula}`; + + let html = ''; + html += `
    `; + html += `
    `; + html += `
    ${lowDie.formula} / ${highDie.formula}
    `; + html += `
    `; + html += `
    `; + html += `
    `; + html += `
    `; + html += ` `; + html += ` ${lowDie.formula}`; + html += ` `; + html += ` `; + html += ` ${lowResult}`; + html += ` `; + html += `
    `; + html += `
      `; + html += `
    1. ${lowResult}`; + html += `
    `; + html += `
    `; + html += `
    `; + html += ` `; + html += ` ${highDie.formula}`; + html += ` `; + html += ` `; + html += ` ${highResult}`; + html += ` `; + html += `
    `; + html += `
      `; + html += `
    1. ${highResult}
    2. `; + html += `
    `; + html += `
    `; + html += `
    `; + html += `
    `; + html += `

    ${lowResult} / ${highResult}

    ` + html += `
    `; + return this.createMessage(html, flavor, rollMode); } /**