diff --git a/source/module/rolls/M5Roll.ts b/source/module/rolls/M5Roll.ts index 9a5f316..a7ad922 100644 --- a/source/module/rolls/M5Roll.ts +++ b/source/module/rolls/M5Roll.ts @@ -212,6 +212,23 @@ export class M5Roll { return new M5Roll(rollData, actor, (game as Game).i18n.localize("midgard5.perception")); } + static cleanSpell(actor: any) { + const rollData = actor.getRollData() as M5RollData; + + rollData.rolls["0"] = { + formula: "1d20 + @c.calc.stats.spellCasting.value", + enabled: true, + label: (game as Game).i18n.localize("midgard5.spellCasting"), + result: "", + total: 0, + totalStr: "", + dice: {}, + css: "", + } as M5RollResult; + + return new M5Roll(rollData, actor, (game as Game).i18n.localize("midgard5.spellCasting")); + } + static drinking(actor: any) { const rollData = actor.getRollData() as M5RollData; diff --git a/source/module/sheets/M5CharacterSheet.ts b/source/module/sheets/M5CharacterSheet.ts index 7cbc2ff..d34d69c 100644 --- a/source/module/sheets/M5CharacterSheet.ts +++ b/source/module/sheets/M5CharacterSheet.ts @@ -247,6 +247,11 @@ export default class M5CharacterSheet extends ActorSheet { await roll.toMessage(); }); + html.find(".roll-cleanSpell-button").on("click", async (event) => { + const roll = M5Roll.cleanSpell(this.actor); + await roll.toMessage(); + }); + html.find(".roll-perception-button").on("click", async (event) => { const roll = M5Roll.perception(this.actor); await roll.toMessage(); diff --git a/templates/sheets/character/spells.hbs b/templates/sheets/character/spells.hbs index df236c5..9fbd500 100644 --- a/templates/sheets/character/spells.hbs +++ b/templates/sheets/character/spells.hbs @@ -8,7 +8,7 @@