Fix PP anzeige von Zaubern (#115)

Changes:
 + PP werden wieder angezeigt
 + Es werden nur PP Angezeigt von Zauberschulen wo die lernkosten ungleich 0 sind
Reviewed-on: #115
This commit was merged in pull request #115.
This commit is contained in:
2024-05-27 10:04:26 +02:00
parent 38f1c90c09
commit 32bf1ba747
2 changed files with 7 additions and 2 deletions
+5
View File
@@ -95,6 +95,7 @@ export class M5Roll {
this.data.res.label = this.label;
if ((game as Game).settings.get("midgard5", "automatedPP") && this.data.iType !== null) {
if ((this.data.i.type === "language" || this.data.i.type === "general") && this.data.rolls[0].dice[0] >= 16) {
ui.notifications.notify(`Praxispunkt eingetragen für ${this.actor.items.get(this.id).name}`);
this.actor.items.get(this.id).update({
system: {
pp: this.data.i.pp + 1,
@@ -102,6 +103,7 @@ export class M5Roll {
});
} else if (this.data.rolls[0].dice[0] === 20) {
if (this.data.i.type === "combat") {
ui.notifications.notify(`Praxispunkt eingetragen für ${this.actor.items.get(this.id).name}`);
// Rolling through skill
this.actor.items.get(this.id).update({
system: {
@@ -109,6 +111,7 @@ export class M5Roll {
},
});
} else if (this.data.iType === "weapon") {
ui.notifications.notify(`Praxispunkt eingetragen für ${this.actor.items.get(this.id).name}`);
// Rolling through Weapon Item
const skill = this.actor.items.get(this.data.i.skillId);
skill.update({
@@ -117,6 +120,7 @@ export class M5Roll {
},
});
} else if (this.data.iType === "defensiveWeapon") {
ui.notifications.notify(`Praxispunkt eingetragen für ${this.actor.items.get(this.id).name}`);
// Rolling through defensiveWeapon Item
const skill = this.actor.items.get(this.data.i.skillId);
skill.update({
@@ -125,6 +129,7 @@ export class M5Roll {
},
});
} else if (this.data.iType === "spell") {
ui.notifications.notify(`Praxispunkt eingetragen für ${this.data.i.process}`);
// Rolling through Spell Item
const klasse = this.actor.items.find((x) => x.type === "class" && x.system.equipped);
klasse.update({