#90 Clean Spell Button funktioniert nicht (#94)

Changes:
 + hinzufügen von roll funktion für Zauberwert
Reviewed-on: #94
Reviewed-by: Le-Frique <lefrique@live.de>
This commit was merged in pull request #94.
This commit is contained in:
2024-03-24 15:06:30 +01:00
parent 12e6412a9f
commit 3a58485d27
3 changed files with 23 additions and 1 deletions
+17
View File
@@ -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;
+5
View File
@@ -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();