+ {{#unless (or (ne actor.system.computed.num_waffen 0) (ne actor.system.computed.num_fernkampf_waffen 0))}}
+
+ {{/unless}}
+
{{#each actor.system.computed.kampf.waffen}}
@@ -445,6 +476,10 @@
{{localize (concat "DSA41.sonderfertigkeiten.label_kampf")}}
+ {{#unless (ne actor.system.computed.num_kampf_sonderfertigkeiten 0)}}
+
{{localize "DSA41.list_empty"}}
+ {{/unless}}
+
{{#each actor.itemTypes.Sonderfertigkeit}}
{{#if (eq this.system.kategorie "kampf")}}
diff --git a/src/lang/de.json b/src/lang/de.json
index d92c75e..4b641ed 100644
--- a/src/lang/de.json
+++ b/src/lang/de.json
@@ -24,6 +24,8 @@
"weight": "Gewicht",
"price": "Preis",
+ "list_empty": "Keine",
+
"chat": {
"result": "Ergebnis",
"success": "Geschafft",
diff --git a/src/main.mjs b/src/main.mjs
index a07b5f8..ae2567d 100644
--- a/src/main.mjs
+++ b/src/main.mjs
@@ -255,6 +255,13 @@ class DSA41_CharacterData extends TypeDataModel {
attributes: {},
attributes_without_modifiers: {},
+ num_vorteile: 0,
+ num_nachteile: 0,
+ num_allgemeine_sonderfertigkeiten: 0,
+ num_kampf_sonderfertigkeiten: 0,
+ num_waffen: 0,
+ num_fernkampf_waffen: 0,
+
kampf: {
talente: {},
waffen: {},
@@ -354,6 +361,7 @@ class DSA41_CharacterData extends TypeDataModel {
for(const item of equipped_nahkampfwaffen) {
if (item.system.nahkampfwaffe.aktiv) {
+ this.computed.num_waffen += 1;
let computed = this.computed.kampf.waffen[item._id] = {
item: item,
attacke: 0,
@@ -417,6 +425,7 @@ class DSA41_CharacterData extends TypeDataModel {
}
for (const item of equipped_fernkampfwaffen) {
+ this.computed.num_fernkampf_waffen += 1;
let computed = this.computed.kampf.fernkampf_waffen[item._id] = {
item: item,
attacke: 0,
@@ -446,6 +455,11 @@ class DSA41_CharacterData extends TypeDataModel {
wissens: talente.filter((x) => x.system.kategorie === "wissens"),
handwerks: talente.filter((x) => x.system.kategorie === "handwerks"),
};
+
+ this.computed.num_allgemeine_sonderfertigkeiten = this.parent.items.filter((x) => x.type === "Sonderfertigkeit" && x.system.kategorie === "allgemein").length;
+ this.computed.num_kampf_sonderfertigkeiten = this.parent.items.filter((x) => x.type === "Sonderfertigkeit" && x.system.kategorie === "kampf").length;
+ this.computed.num_vorteile = this.parent.items.filter((x) => x.type === "VorNachteil" && x.system.kategorie === "vorteil").length;
+ this.computed.num_nachteile = this.parent.items.filter((x) => x.type === "VorNachteil" && x.system.kategorie === "nachteil").length;
}
}