Fix AP Abzug bei Zauber

und ein bisschen linter
This commit is contained in:
2024-05-06 14:12:17 +02:00
parent 6978a4df86
commit 83014281a5
2 changed files with 18 additions and 19 deletions
+11 -11
View File
@@ -341,20 +341,20 @@ export class M5Item extends Item {
}
});
if (item.type === "spell" || item.type === "kampfkunst") {
if (this.actor["system"].ap.value >= item.system.ap) {
this.actor["update"]({
data: {
ap: {
value: this.actor["system"].ap.value - item.system.ap,
const roll = new M5Roll(rollData, this.actor, item.name, item.id);
if (await roll.toMessage(toggleAutomatedRoll)) {
if (item.type === "spell" || item.type === "kampfkunst") {
if (this.actor["system"].ap.value >= item.system.ap) {
this.actor["update"]({
data: {
ap: {
value: this.actor["system"].ap.value - item.system.ap,
},
},
},
});
});
}
}
}
const roll = new M5Roll(rollData, this.actor, item.name, item.id);
return roll.toMessage(toggleAutomatedRoll);
} else {
ChatMessage.create({
speaker: speaker,