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 is contained in:
Byroks 2024-05-27 10:04:26 +02:00
parent 38f1c90c09
commit 32bf1ba747
2 changed files with 7 additions and 2 deletions

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({

View File

@ -77,7 +77,6 @@
</div>
</div>
{{#if (eq data.types.actor)}}
<div class="flexcolumn-1">
<div class="flexpart">
<div class="flexpart-header">{{localize "midgard5.pp"}} {{localize "midgard5.spells"}}</div>
@ -88,6 +87,7 @@
<div class="flexrow">
{{#each data.lernKostenZauber as |group name|}}
{{#unless (eq group.kosten 0)}}
<span data-pp-name="{{name}}" class="pp-listing">
<label for="data.lernKostenZauber.{{name}}">{{localize (m5concat "midgard5.spell-process-" name)}}</label>
<span >
@ -96,6 +96,7 @@
<i class="fa fa-plus-circle pp-increase" style="cursor: pointer"></i>
</span>
</span>
{{/unless}}
{{/each}}
</div>
</td>
@ -104,5 +105,4 @@
</table>
</div>
</div>
{{/if}}
</div>