Fix AP Abzug bei Zauber

und ein bisschen linter
This commit is contained in:
Byroks 2024-05-06 14:12:17 +02:00
parent 6978a4df86
commit 83014281a5
2 changed files with 18 additions and 19 deletions

View File

@ -341,6 +341,8 @@ export class M5Item extends Item {
} }
}); });
const roll = new M5Roll(rollData, this.actor, item.name, item.id);
if (await roll.toMessage(toggleAutomatedRoll)) {
if (item.type === "spell" || item.type === "kampfkunst") { if (item.type === "spell" || item.type === "kampfkunst") {
if (this.actor["system"].ap.value >= item.system.ap) { if (this.actor["system"].ap.value >= item.system.ap) {
this.actor["update"]({ this.actor["update"]({
@ -352,9 +354,7 @@ export class M5Item extends Item {
}); });
} }
} }
}
const roll = new M5Roll(rollData, this.actor, item.name, item.id);
return roll.toMessage(toggleAutomatedRoll);
} else { } else {
ChatMessage.create({ ChatMessage.create({
speaker: speaker, speaker: speaker,

View File

@ -162,7 +162,6 @@ export class M5Roll {
if (!this._evaluated) await this.evaluate(); if (!this._evaluated) await this.evaluate();
const faces = this.pool.dice.map((x) => x.faces); const faces = this.pool.dice.map((x) => x.faces);
const chatData = { const chatData = {
type: CONST.CHAT_MESSAGE_TYPES.ROLL, type: CONST.CHAT_MESSAGE_TYPES.ROLL,
content: await this.render(), content: await this.render(),