14 Commits

Author SHA1 Message Date
Sven Balzer b6b0411473 add anzahl to Gegenstaende 2025-11-09 12:44:37 +01:00
Sven Balzer bf5a3fa06b invert modifikator for talente 2025-10-24 00:39:32 +02:00
Sven Balzer f1fff6b6ba fix BE of some Talente 2025-10-18 20:11:44 +02:00
Sven Balzer 716d5b0413 add Anmerkung field to Attacke and Parade dialogs 2025-10-06 08:35:50 +02:00
Sven Balzer e320c2f9ac fix for zauber that do not take magieresistenz into account 2025-10-05 19:17:33 +02:00
Sven Balzer 80e6e1ad43 layout simplification 2025-09-23 00:18:08 +02:00
Sven Balzer 8c4dca3eed add slight color change for every other list item 2025-09-11 13:49:08 +02:00
Sven Balzer aa3a3e633d add different hover background color for list items 2025-09-11 13:24:54 +02:00
Sven Balzer e14506998f add display for Magische Sonderfertigkeiten 2025-09-11 13:16:48 +02:00
Sven Balzer e4067d46a3 Fix Singen talent in compendium 2025-09-09 13:01:27 +02:00
Sven Balzer 39c3f90240 fix broken sorting for talente 2025-09-07 08:29:44 +02:00
Sven Balzer e338b79d3a add Wunden 2025-08-04 10:05:42 +02:00
Sven Balzer 60036fc37f remove extraneous div in ActorSheet biography tab 2025-07-26 06:00:50 +02:00
Sven Balzer ae3e9a2fb9 Allow Kampftalente to be deleted from ActorSheet 2025-07-26 00:28:03 +02:00
21 changed files with 449 additions and 186 deletions
+72 -4
View File
@@ -92,9 +92,6 @@
</div>
</div>
<div>
</div>
<div>
<div class="center">{{localize "DSA41.allgemein.biografie"}}</div>
{{DSA41_input "system.allgemein.biografie" elementType="prose-mirror"}}
@@ -337,6 +334,7 @@
{{else}}
<div></div>
{{/if}}
<div class="center fas fa-trash" data-action="item-delete"></div>
</div>
{{/each}}
</div>
@@ -359,6 +357,7 @@
<div>{{localize "DSA41.inventar.bewaffnung"}}</div>
<div></div>
<div></div>
<div></div>
<div class="center">{{localize "DSA41.weight.label"}}</div>
<div></div>
</div>
@@ -382,6 +381,7 @@
</div>
</div>
<div></div>
<div></div>
<div class="center fas fa-sword" data-action="toggle_equipped" data-equipped="{{system.angelegt}}"></div>
<div class="center">{{this.system.gewicht.value}} {{localize (concat "DSA41.weight." this.system.gewicht.unit)}}</div>
<div class="center fas fa-trash" data-action="item-delete"></div>
@@ -394,7 +394,9 @@
<div class="row">{{localize "DSA41.inventar.ruestungen"}}</div>
<div></div>
<div></div>
<div></div>
<div class="center">{{localize "DSA41.weight.label"}}</div>
<div></div>
</div>
{{#unless (ne actor.itemTypes.Ruestung.length 0)}}
@@ -408,6 +410,7 @@
<span class="center">{{this.name}}</span>
</div>
<div></div>
<div></div>
<div class="center fas fa-shield-halved" data-action="toggle_equipped" data-equipped="{{system.angelegt}}"></div>
<div class="center">{{this.system.gewicht.value}} {{localize (concat "DSA41.weight." this.system.gewicht.unit)}}</div>
<div class="center fas fa-trash" data-action="item-delete"></div>
@@ -419,8 +422,10 @@
<div class="list-header">
<div>{{localize "DSA41.inventar.gegenstaende"}}</div>
<div></div>
<div class="center">{{localize "DSA41.inventar.anzahl"}}</div>
<div></div>
<div class="center">{{localize "DSA41.weight.label"}}</div>
<div></div>
</div>
{{#unless (ne actor.itemTypes.Gegenstand.length 0)}}
@@ -434,8 +439,9 @@
<span class="center">{{this.name}}</span>
</div>
<div></div>
<div class="center anzahl">{{>editable-input type="number" size=(string-length system.anzahl) data-name="system.anzahl" value=system.anzahl}}</div>
<div></div>
<div class="center">{{this.system.gewicht.value}} {{localize (concat "DSA41.weight." this.system.gewicht.unit)}}</div>
<div class="center">{{mul this.system.gewicht.value this.system.anzahl}} {{localize (concat "DSA41.weight." this.system.gewicht.unit)}}</div>
<div class="center fas fa-trash" data-action="item-delete"></div>
</div>
{{/each}}
@@ -443,6 +449,46 @@
</div>
<div class="tab Kampf {{#if (eq tabGroups.primary 'kampf')}}active{{/if}}" data-group="primary" data-tab="kampf">
<div class="list Wunden">
<div class="list-header">
<div>{{localize "DSA41.kampf.wunden.label"}}</div>
</div>
{{#*inline "wunden"}}
<div class="center" data-location="{{location}}">
<img class="wunde{{#if (gte (lookup @root.actor.system.wunden location) 1)}} active{{/if}}" data-action="toggle-wound">
<img class="wunde{{#if (gte (lookup @root.actor.system.wunden location) 2)}} active{{/if}}" data-action="toggle-wound">
<img class="wunde{{#if (gte (lookup @root.actor.system.wunden location) 3)}} active{{/if}}" data-action="toggle-wound">
</div>
{{/inline}}
<div class="list-item">
<div>{{localize "DSA41.kampf.wunden.kopf"}}</div>
{{>wunden location="kopf"}}
<div>{{localize "DSA41.kampf.wunden.brust"}}</div>
{{>wunden location="brust"}}
</div>
<div class="list-item">
<div>{{localize "DSA41.kampf.wunden.bauch"}}</div>
{{>wunden location="bauch"}}
</div>
<div class="list-item">
<div>{{localize "DSA41.kampf.wunden.linker_arm"}}</div>
{{>wunden location="linker_arm"}}
<div>{{localize "DSA41.kampf.wunden.rechter_arm"}}</div>
{{>wunden location="rechter_arm"}}
</div>
<div class="list-item">
<div>{{localize "DSA41.kampf.wunden.linkes_bein"}}</div>
{{>wunden location="linkes_bein"}}
<div>{{localize "DSA41.kampf.wunden.rechtes_bein"}}</div>
{{>wunden location="rechtes_bein"}}
</div>
</div>
<div class="list Bewaffnung">
<div class="list-header ">
<div>{{localize "DSA41.kampf.bewaffnung"}}</div>
@@ -599,6 +645,28 @@
</div>
{{/each}}
</div>
<div class="list Sonderfertigkeiten">
<div class="list-header">
<div>{{localize (concat "DSA41.sonderfertigkeiten.label_magisch")}}</div>
</div>
{{#unless (ne actor.system.computed.num_magische_sonderfertigkeiten 0)}}
<div class="list-item">{{localize "DSA41.list_empty"}}</div>
{{/unless}}
{{#each actor.itemTypes.Sonderfertigkeit}}
{{#if (eq this.system.kategorie "magisch")}}
<div class="list-item" data-item-id="{{_id}}">
<div>
<div class="fit-content" data-action="item-open" data-tooltip="{{this.system.beschreibung}}">{{maybeLocalize name prefix=(concat "DSA41.sonderfertigkeiten." system.kategorie ".name")}}</div>
</div>
<div></div>
<div class="center fas fa-trash" data-action="item-delete"></div>
</div>
{{/if}}
{{/each}}
</div>
</div>
</div>
</div>
+3
View File
@@ -2,6 +2,9 @@
<span class="colspan2">{{localize "DSA41.kampf.modifikator"}}</span>
<input class="colspan2" type="number" name="modifikator" value="{{lookup formData "modifikator"}}">
<span class="colspan2">{{localize "DSA41.kampf.anmerkung"}}</span>
<input class="colspan2" type="text" name="anmerkung" value="{{lookup formData "anmerkung"}}">
<div class="dsa41-calculation colspan4 center">
<ruby>{{options.item.basis_attacke}}<rt>{{localize "DSA41.bewaffnung.nahkampfwaffe.basis"}}</rt></ruby>
+3
View File
@@ -5,6 +5,9 @@
<span>{{localize "DSA41.kampf.crit"}}</span>
<input class="center" type="checkbox" name="crit" {{checked (lookup formData "crit")}}>
<span>{{localize "DSA41.kampf.anmerkung"}}</span>
<input type="text" name="anmerkung" value="{{lookup formData "anmerkung"}}">
<div class="dsa41-calculation colspan4 center">
{{#if formData.crit}}({{/if}}
<ruby>{{options.item.basis_parade}}<rt>{{localize "DSA41.bewaffnung.nahkampfwaffe.basis"}}</rt></ruby>
+1 -1
View File
@@ -2,7 +2,7 @@
{{#if (eq type "checkbox")}}
<input type="checkbox" name="{{name}}" {{#if data-name}}data-name="{{data-name}}"{{/if}} {{checked value}}>
{{else}}
<input type="{{type}}" name="{{name}}" {{#if data-name}}data-name="{{data-name}}"{{/if}} value="{{value}}" placeholder="{{placeholder}}">
<input type="{{type}}" name="{{name}}" {{#if data-name}}data-name="{{data-name}}"{{/if}} {{#if size}}size="{{size}}"{{/if}} value="{{value}}" placeholder="{{placeholder}}">
{{/if}}
{{#if placeholder}}
+18 -18
View File
@@ -1,4 +1,4 @@
<div class="Bewaffnung {{ cssClass }}">
<div>
<div class="row">
<img class="item-image" src="{{ item.img }}" title="{{ item.name }}" data-action="editImage" data-edit="img">
<div class="col">
@@ -28,6 +28,7 @@
</div>
</nav>
<div>
<div class="tab {{#if (eq tabGroups.primary 'tab1')}}active{{/if}}" data-group="primary" data-tab="tab1">
<span>{{localize "DSA41.bewaffnung.nahkampfwaffe.trefferpunkte"}}</span>
<div class="grid3 center">
@@ -42,33 +43,33 @@
</div>
<span>{{localize "DSA41.bewaffnung.nahkampfwaffe.initiative"}}</span>
<div>{{DSA41_input "system.nahkampfwaffe.initiative"}}</div>
{{DSA41_input "system.nahkampfwaffe.initiative"}}
<span>{{localize "DSA41.bewaffnung.bruchfaktor"}}</span>
<div>{{DSA41_input "system.nahkampfwaffe.bruchfaktor"}}</div>
{{DSA41_input "system.nahkampfwaffe.bruchfaktor"}}
<span>{{localize "DSA41.bewaffnung.nahkampfwaffe.distanzklasse"}}</span>
<div>{{DSA41_input "system.nahkampfwaffe.distanzklasse"}}</div>
{{DSA41_input "system.nahkampfwaffe.distanzklasse"}}
<span>{{localize "DSA41.bewaffnung.nahkampfwaffe.kampftalente"}}</span>
<div>{{DSA41_input "system.nahkampfwaffe.kampftalente"}}</div>
{{DSA41_input "system.nahkampfwaffe.kampftalente"}}
<span>{{localize "DSA41.bewaffnung.nahkampfwaffe.laenge"}}</span>
<div>{{DSA41_input "system.nahkampfwaffe.laenge"}}</div>
{{DSA41_input "system.nahkampfwaffe.laenge"}}
<div class="colspan2"></div>
<span>{{localize "DSA41.bewaffnung.nahkampfwaffe.zweihaendig"}}</span>
<div>{{DSA41_input "system.nahkampfwaffe.zweihaendig"}}</div>
{{DSA41_input "system.nahkampfwaffe.zweihaendig"}}
<span>{{localize "DSA41.bewaffnung.nahkampfwaffe.werfbar"}}</span>
<div>{{DSA41_input "system.nahkampfwaffe.werfbar"}}</div>
{{DSA41_input "system.nahkampfwaffe.werfbar"}}
<span>{{localize "DSA41.bewaffnung.nahkampfwaffe.improvisiert"}}</span>
<div>{{DSA41_input "system.nahkampfwaffe.improvisiert"}}</div>
{{DSA41_input "system.nahkampfwaffe.improvisiert"}}
<span>{{localize "DSA41.bewaffnung.nahkampfwaffe.priviligiert"}}</span>
<div>{{DSA41_input "system.nahkampfwaffe.priviligiert"}}</div>
{{DSA41_input "system.nahkampfwaffe.priviligiert"}}
</div>
<div class="tab {{#if (eq tabGroups.primary 'tab2')}}active{{/if}}" data-group="primary" data-tab="tab2">
<span>{{localize "DSA41.bewaffnung.parierwaffe.initiative"}}</span>
<div>{{DSA41_input "system.parierwaffe.initiative"}}</div>
{{DSA41_input "system.parierwaffe.initiative"}}
<span>{{localize "DSA41.bewaffnung.parierwaffe.modifikator"}}</span>
<div class="grid2">
{{DSA41_input "system.parierwaffe.modifikator_attacke" subtitle="DSA41.bewaffnung.parierwaffe.attacke"}}
@@ -76,7 +77,7 @@
</div>
<span>{{localize "DSA41.bewaffnung.bruchfaktor"}}</span>
<div>{{DSA41_input "system.parierwaffe.bruchfaktor"}}</div>
{{DSA41_input "system.parierwaffe.bruchfaktor"}}
</div>
<div class="tab {{#if (eq tabGroups.primary 'tab3')}}active{{/if}}" data-group="primary" data-tab="tab3">
@@ -89,21 +90,21 @@
</div>
<span>{{localize "DSA41.bewaffnung.schild.initiative"}}</span>
<div>{{DSA41_input "system.schild.initiative"}}</div>
{{DSA41_input "system.schild.initiative"}}
<span>{{localize "DSA41.bewaffnung.bruchfaktor"}}</span>
<div>{{DSA41_input "system.schild.bruchfaktor"}}</div>
{{DSA41_input "system.schild.bruchfaktor"}}
</div>
<div class="tab {{#if (eq tabGroups.primary 'tab4')}}active{{/if}}" data-group="primary" data-tab="tab4">
<span>{{localize "DSA41.bewaffnung.fernkampfwaffe.trefferpunkte"}}</span>
<div class="center">{{DSA41_input "system.fernkampfwaffe.basis"}}</div>
<span>{{localize "DSA41.bewaffnung.fernkampfwaffe.laden"}}</span>
<div>{{DSA41_input "system.fernkampfwaffe.laden"}}</div>
{{DSA41_input "system.fernkampfwaffe.laden"}}
<span>{{localize "DSA41.bewaffnung.fernkampfwaffe.munitionskosten"}}</span>
<div>{{DSA41_input "system.fernkampfwaffe.munitionskosten"}}</div>
{{DSA41_input "system.fernkampfwaffe.munitionskosten"}}
<span>{{localize "DSA41.bewaffnung.fernkampfwaffe.munitionsgewicht"}}</span>
<div>{{DSA41_input "system.fernkampfwaffe.munitionsgewicht"}}</div>
{{DSA41_input "system.fernkampfwaffe.munitionsgewicht"}}
<span>{{localize "DSA41.bewaffnung.fernkampfwaffe.reichweiten"}}</span>
<div class="colspan3 grid5">
@@ -124,7 +125,6 @@
</div>
</div>
<div>
{{DSA41_input "system.beschreibung" elementType="prose-mirror"}}
</div>
</div>
+1 -4
View File
@@ -1,4 +1,4 @@
<div class="item-sheet {{ cssClass }}" autocomplete="off">
<div>
<div class="row">
<img class="item-image" src="{{ item.img }}" title="{{ item.name }}" data-action="editImage" data-edit="img">
<div class="col">
@@ -9,8 +9,5 @@
</div>
</div>
</div>
<div>
{{DSA41_input "system.beschreibung" elementType="prose-mirror"}}
</div>
</div>
+1 -3
View File
@@ -1,4 +1,4 @@
<div class="item-sheet {{ cssClass }}" autocomplete="off">
<div>
<div class="row">
<img class="item-image" src="{{ item.img }}" title="{{ item.name }}" data-action="editImage" data-edit="img">
<div class="col">
@@ -12,7 +12,5 @@
</div>
</div>
</div>
<div>
{{DSA41_input "system.beschreibung" elementType="prose-mirror"}}
</div>
</div>
+12 -14
View File
@@ -1,4 +1,4 @@
<div class="item-sheet {{ cssClass }}" autocomplete="off">
<div>
<div class="row">
<img class="item-image" src="{{ item.img }}" title="{{ item.name }}" data-action="editImage" data-edit="img">
<div class="col">
@@ -12,32 +12,30 @@
<div class="tab active">
<span>{{localize "DSA41.ruestungen.kopf"}}</span>
<div>{{DSA41_input "system.kopf"}}</div>
{{DSA41_input "system.kopf"}}
<span>{{localize "DSA41.ruestungen.brust"}}</span>
<div>{{DSA41_input "system.brust"}}</div>
{{DSA41_input "system.brust"}}
<span>{{localize "DSA41.ruestungen.ruecken"}}</span>
<div>{{DSA41_input "system.ruecken"}}</div>
{{DSA41_input "system.ruecken"}}
<span>{{localize "DSA41.ruestungen.bauch"}}</span>
<div>{{DSA41_input "system.bauch"}}</div>
{{DSA41_input "system.bauch"}}
<span>{{localize "DSA41.ruestungen.linker_arm"}}</span>
<div>{{DSA41_input "system.linker_arm"}}</div>
{{DSA41_input "system.linker_arm"}}
<span>{{localize "DSA41.ruestungen.rechter_arm"}}</span>
<div>{{DSA41_input "system.rechter_arm"}}</div>
{{DSA41_input "system.rechter_arm"}}
<span>{{localize "DSA41.ruestungen.linkes_bein"}}</span>
<div>{{DSA41_input "system.linkes_bein"}}</div>
{{DSA41_input "system.linkes_bein"}}
<span>{{localize "DSA41.ruestungen.rechtes_bein"}}</span>
<div>{{DSA41_input "system.rechtes_bein"}}</div>
{{DSA41_input "system.rechtes_bein"}}
<span>{{localize "DSA41.ruestungen.gesamt_ruestungsschutz"}}</span>
<div>{{DSA41_input "system.gesamt_ruestungsschutz"}}</div>
{{DSA41_input "system.gesamt_ruestungsschutz"}}
<span>{{localize "DSA41.ruestungen.gesamt_behinderung"}}</span>
<div>{{DSA41_input "system.gesamt_behinderung"}}</div>
</div>
{{DSA41_input "system.gesamt_behinderung"}}
<div>
{{DSA41_input "system.beschreibung" elementType="prose-mirror"}}
{{DSA41_input "system.beschreibung" elementType="prose-mirror" classes="colspan-all"}}
</div>
</div>
+1 -3
View File
@@ -1,4 +1,4 @@
<div class="item-sheet {{ cssClass }}" autocomplete="off">
<div>
<div class="row">
<img class="item-image" src="{{ item.img }}" title="{{ item.name }}" data-action="editImage" data-edit="img">
<div class="col">
@@ -12,7 +12,5 @@
</div>
</div>
</div>
<div>
{{DSA41_input "system.beschreibung" elementType="prose-mirror"}}
</div>
</div>
+1 -3
View File
@@ -1,4 +1,4 @@
<div class="item-sheet {{ cssClass }}" autocomplete="off">
<div>
<div class="row">
<img class="item-image" src="{{ item.img }}" title="{{ item.name }}" data-action="editImage" data-edit="img">
<div class="col">
@@ -14,7 +14,5 @@
</div>
</div>
</div>
<div>
{{DSA41_input "system.beschreibung" elementType="prose-mirror"}}
</div>
</div>
+1 -3
View File
@@ -1,4 +1,4 @@
<div class="item-sheet {{ cssClass }}" autocomplete="off">
<div>
<div class="row">
<img class="item-image" src="{{ item.img }}" title="{{ item.name }}" data-action="editImage" data-edit="img">
<div class="col">
@@ -11,7 +11,5 @@
</div>
</div>
</div>
<div>
{{DSA41_input "system.beschreibung" elementType="prose-mirror"}}
</div>
</div>
+2 -5
View File
@@ -1,4 +1,4 @@
<div class="item-sheet {{ cssClass }}" autocomplete="off">
<div>
<div class="row">
<img class="item-image" src="{{ item.img }}" title="{{ item.name }}" data-action="editImage" data-edit="img">
<div class="col">
@@ -28,8 +28,5 @@
<span>{{localize "DSA41.zauber.label_magieresistenz"}}</span>
{{DSA41_input "system.magieresistenz"}}
</div>
<div>
{{DSA41_input "system.beschreibung" elementType="prose-mirror"}}
</div>
{{DSA41_input "system.beschreibung" elementType="prose-mirror" classes="colspan-all"}}
</div>
+15 -1
View File
@@ -479,7 +479,8 @@
"inventar": {
"bewaffnung": "Bewaffnung",
"ruestungen": "Rüstungen",
"gegenstaende": "Gegenstände"
"gegenstaende": "Gegenstände",
"anzahl": "Anzahl"
},
"kampf": {
@@ -491,6 +492,7 @@
"modifikator": "Modifikator",
"crit": "Glückliche Attacke",
"zauber": "Zauber",
"anmerkung": "Anmerkung",
"zielgroesse": {
"label": "Zielgröße",
@@ -537,6 +539,18 @@
"still": "Still",
"seitenwind": "Böiger Seitenwind",
"starker_seitenwind": "Starker Seitenwind"
},
"wunden": {
"label": "Wunden",
"kopf": "Kopf",
"brust": "Brust",
"bauch": "Bauch",
"linker_arm": "Linker Arm",
"rechter_arm": "Rechter Arm",
"linkes_bein": "Linkes Bein",
"rechtes_bein": "Rechtes Bein"
}
},
+51 -2
View File
@@ -424,6 +424,14 @@ html {
border: none;
border-radius: 0px 0px 5px 5px;
}
&:nth-child(odd) {
background: #272b33;
}
&:hover {
background: #3b404d;
}
}
&.Dialog > .window-content {
@@ -575,12 +583,12 @@ html {
}
& .Kampftalente {
grid-template-columns: minmax(0, max-content) repeat(5, minmax(0, 1fr));
grid-template-columns: minmax(0, max-content) repeat(5, minmax(0, 1fr)) min-content;
}
}
&[data-tab="inventar"] {
grid-template-columns: minmax(min-content, max-content) auto min-content minmax(min-content, max-content) min-content;
grid-template-columns: minmax(min-content, max-content) auto max-content min-content minmax(min-content, max-content) min-content;
& > * {
grid-column: 1 / -1;
@@ -589,9 +597,46 @@ html {
& [data-equipped="false"] {
color: #464c5f;
}
& .anzahl input {
background: transparent;
field-sizing: content;
}
}
&[data-tab="kampf"] {
& .Wunden {
grid-template-columns: minmax(0, max-content) minmax(0, 1fr) minmax(0, max-content) minmax(0, 1fr);
& .wunde {
display: inline;
width: 2em;
height: 2em;
margin: 0 .25em 0 .25em;
content: url("/icons/skills/wounds/injury-triple-slash-bleed.webp");
mix-blend-mode: difference;
&.active {
filter: grayscale(0.0);
&:hover, &:hover ~ .wunde.active {
filter: grayscale(0.75);
}
}
&:not(.active) {
filter: grayscale(1.0);
&:hover, &:has( ~ .wunde:hover) {
filter: grayscale(0.25);
}
}
}
}
& .Bewaffnung {
grid-template-columns: minmax(0, max-content) repeat(3, minmax(0, auto));
@@ -616,6 +661,10 @@ html {
& > * {
grid-column: 1 / -1;
}
& .Sonderfertigkeiten {
grid-template-columns: minmax(min-content, max-content) auto min-content;
}
}
}
}
+145 -16
View File
@@ -80,6 +80,18 @@ Hooks.once("init", async function() {
]
});
Handlebars.registerHelper({
"string-length": (value, options) => {
return value.toString().length;
}
});
Handlebars.registerHelper({
"mul": (a, b, options) => {
return a * b;
}
});
Handlebars.registerHelper({
maybeLocalize: (value, options) => {
const prefix = options.hash.prefix ? options.hash.prefix.string : null;
@@ -151,6 +163,10 @@ Hooks.once("init", async function() {
});
});
function string_compare(a, b) {
return a > b ? 1 : a < b ? -1 : 0;
}
function get_targeted_actors() {
const targets = [];
@@ -598,6 +614,16 @@ class DSA41_CharacterData extends TypeDataModel {
modifikator_attacke: new NumberField({integer: true, initial: 0}),
modifikator_parade: new NumberField({integer: true, initial: 0}),
modifikator_fernkampf: new NumberField({integer: true, initial: 0}),
wunden: new SchemaField({
kopf: new NumberField({integer: true, initial: 0, min: 0, max: 3 }),
brust: new NumberField({integer: true, initial: 0, min: 0, max: 3 }),
bauch: new NumberField({integer: true, initial: 0, min: 0, max: 3 }),
linker_arm: new NumberField({integer: true, initial: 0, min: 0, max: 3 }),
rechter_arm: new NumberField({integer: true, initial: 0, min: 0, max: 3 }),
linkes_bein: new NumberField({integer: true, initial: 0, min: 0, max: 3 }),
rechtes_bein: new NumberField({integer: true, initial: 0, min: 0, max: 3 }),
}),
}
}
@@ -612,6 +638,7 @@ class DSA41_CharacterData extends TypeDataModel {
num_nachteile: 0,
num_allgemeine_sonderfertigkeiten: 0,
num_kampf_sonderfertigkeiten: 0,
num_magische_sonderfertigkeiten: 0,
num_waffen: 0,
num_fernkampf_waffen: 0,
@@ -634,14 +661,97 @@ class DSA41_CharacterData extends TypeDataModel {
gesamt_behinderung: 0.0,
},
},
wunden_modifiers: {
courage: 0,
cleverness: 0,
intuition: 0,
dexterity: 0,
agility: 0,
constitution: 0,
strength: 0,
initiative_basis: 0,
initiative: "",
attacke: 0,
parade: 0,
schaden: "",
},
};
if (this.wunden.kopf >= 1) {
this.computed.wunden_modifiers.courage += -2 * this.wunden.kopf;
this.computed.wunden_modifiers.cleverness += -2 * this.wunden.kopf;
this.computed.wunden_modifiers.intuition += -2 * this.wunden.kopf;
this.computed.wunden_modifiers.initiative_basis += -2 * this.wunden.kopf;
this.computed.wunden_modifiers.initiative += (-2 * this.wunden.kopf) + "d6";
if (this.wunden.kopf >= 3) this.computed.wunden_modifiers.schaden += "+ 2d6";
}
if (this.wunden.brust >= 1) {
this.computed.wunden_modifiers.attacke += -this.wunden.brust;
this.computed.wunden_modifiers.parade += -this.wunden.brust;
this.computed.wunden_modifiers.constitution += -this.wunden.brust;
this.computed.wunden_modifiers.strength += -this.wunden.brust;
this.computed.wunden_modifiers.schaden += "+" + this.wunden.brust + "d6";
}
if (this.wunden.bauch >= 1) {
this.computed.wunden_modifiers.attacke += -this.wunden.bauch;
this.computed.wunden_modifiers.parade += -this.wunden.bauch;
this.computed.wunden_modifiers.constitution += -this.wunden.bauch;
this.computed.wunden_modifiers.strength += -this.wunden.bauch;
this.computed.wunden_modifiers.initiative_basis += -this.wunden.bauch;
this.computed.wunden_modifiers.schaden += "+" + this.wunden.bauch + "d6";
}
if (this.wunden.linker_arm >= 1) {
this.computed.wunden_modifiers.attacke += -2 * this.wunden.linker_arm;
this.computed.wunden_modifiers.parade += -2 * this.wunden.linker_arm;
this.computed.wunden_modifiers.strength += -2 * this.wunden.linker_arm;
this.computed.wunden_modifiers.dexterity += -2 * this.wunden.linker_arm;
}
if (this.wunden.rechter_arm >= 1) {
this.computed.wunden_modifiers.attacke += -2 * this.wunden.rechter_arm;
this.computed.wunden_modifiers.parade += -2 * this.wunden.rechter_arm;
this.computed.wunden_modifiers.strength += -2 * this.wunden.rechter_arm;
this.computed.wunden_modifiers.dexterity += -2 * this.wunden.rechter_arm;
}
if (this.wunden.linkes_bein >= 1) {
this.computed.wunden_modifiers.attacke += -2 * this.wunden.linkes_bein;
this.computed.wunden_modifiers.parade += -2 * this.wunden.linkes_bein;
this.computed.wunden_modifiers.agility += -2 * this.wunden.linkes_bein;
this.computed.wunden_modifiers.initiative_basis += -2 * this.wunden.linkes_bein;
}
if (this.wunden.rechtes_bein >= 1) {
this.computed.wunden_modifiers.attacke += -2 * this.wunden.rechtes_bein;
this.computed.wunden_modifiers.parade += -2 * this.wunden.rechtes_bein;
this.computed.wunden_modifiers.agility += -2 * this.wunden.rechtes_bein;
this.computed.wunden_modifiers.initiative_basis += -2 * this.wunden.rechtes_bein;
}
this.computed.abenteuerpunkte.uebrig = this.abenteuerpunkte.gesamt - this.abenteuerpunkte.ausgegeben;
for (const [attribute, values] of Object.entries(this.attributes)) {
this.computed.attributes[attribute] = values.initial + values.advancement + values.modifier;
this.computed.attributes_without_modifiers[attribute] = values.initial + values.advancement;
}
this.computed.attributes_without_modifiers.courage = this.attributes.courage.initial + this.attributes.courage.advancement;
this.computed.attributes_without_modifiers.cleverness = this.attributes.cleverness.initial + this.attributes.cleverness.advancement;
this.computed.attributes_without_modifiers.intuition = this.attributes.intuition.initial + this.attributes.intuition.advancement;
this.computed.attributes_without_modifiers.charisma = this.attributes.charisma.initial + this.attributes.charisma.advancement;
this.computed.attributes_without_modifiers.dexterity = this.attributes.dexterity.initial + this.attributes.dexterity.advancement;
this.computed.attributes_without_modifiers.agility = this.attributes.agility.initial + this.attributes.agility.advancement;
this.computed.attributes_without_modifiers.constitution = this.attributes.constitution.initial + this.attributes.constitution.advancement;
this.computed.attributes_without_modifiers.strength = this.attributes.strength.initial + this.attributes.strength.advancement;
this.computed.attributes.courage = this.computed.attributes_without_modifiers.courage + this.attributes.courage.modifier + this.computed.wunden_modifiers.courage;
this.computed.attributes.cleverness = this.computed.attributes_without_modifiers.cleverness + this.attributes.cleverness.modifier + this.computed.wunden_modifiers.cleverness;
this.computed.attributes.intuition = this.computed.attributes_without_modifiers.intuition + this.attributes.intuition.modifier + this.computed.wunden_modifiers.intuition;
this.computed.attributes.charisma = this.computed.attributes_without_modifiers.charisma + this.attributes.charisma.modifier;
this.computed.attributes.dexterity = this.computed.attributes_without_modifiers.dexterity + this.attributes.dexterity.modifier + this.computed.wunden_modifiers.dexterity;
this.computed.attributes.agility = this.computed.attributes_without_modifiers.agility + this.attributes.agility.modifier + this.computed.wunden_modifiers.agility;
this.computed.attributes.constitution = this.computed.attributes_without_modifiers.constitution + this.attributes.constitution.modifier + this.computed.wunden_modifiers.constitution;
this.computed.attributes.strength = this.computed.attributes_without_modifiers.strength + this.attributes.strength.modifier + this.computed.wunden_modifiers.strength;
this.computed.lebenspunkte = {};
this.computed.ausdauer = {};
@@ -694,12 +804,12 @@ class DSA41_CharacterData extends TypeDataModel {
this.computed.kampf.ruestungen_gesamt[key] = Math.round(value);
}
this.computed.initiative.wert = this.computed.initiative.basiswert + this.modifikator_initiative - this.computed.kampf.ruestungen_gesamt.gesamt_behinderung;
this.computed.attacke.wert = this.computed.attacke.basiswert + this.modifikator_attacke;
this.computed.parade.wert = this.computed.parade.basiswert + this.modifikator_parade;
this.computed.initiative.wert = this.computed.initiative.basiswert + this.modifikator_initiative - this.computed.kampf.ruestungen_gesamt.gesamt_behinderung + this.computed.wunden_modifiers.initiative_basis;
this.computed.attacke.wert = this.computed.attacke.basiswert + this.modifikator_attacke + this.computed.wunden_modifiers.attacke;
this.computed.parade.wert = this.computed.parade.basiswert + this.modifikator_parade + this.computed.wunden_modifiers.parade;
this.computed.fernkampf.wert = this.computed.fernkampf.basiswert + this.modifikator_fernkampf;
this.kampftalente = this.parent.items.filter((x) => x.type === "Kampftalent").sort((a, b) => a.name > b.name);
this.kampftalente = this.parent.items.filter((x) => x.type === "Kampftalent").sort((a, b) => string_compare(a.name, b.name));
for(const talent of this.kampftalente) {
this.computed.kampf.talente[talent.name] = {};
this.computed.kampf.talente[talent.name].attacke = (talent.system.kategorie === "fernkampf" ? this.computed.fernkampf.wert : this.computed.attacke.wert) + talent.system.attacke;
@@ -807,7 +917,7 @@ class DSA41_CharacterData extends TypeDataModel {
computed.trefferpunkte_display = computed.trefferpunkte.replace(/[\+\-]/, (op) => "<br>" + op);
}
const talente = this.parent.items.filter((x) => x.type === "Talent").sort((a, b) => a.name > b.name);
const talente = this.parent.items.filter((x) => x.type === "Talent").sort((a, b) => string_compare(a.name, b.name));
this.talente = {
koerperliche: talente.filter((x) => x.system.kategorie === "koerperliche"),
gesellschaftliche: talente.filter((x) => x.system.kategorie === "gesellschaftliche"),
@@ -818,6 +928,7 @@ class DSA41_CharacterData extends TypeDataModel {
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_magische_sonderfertigkeiten = this.parent.items.filter((x) => x.type === "Sonderfertigkeit" && x.system.kategorie === "magisch").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;
}
@@ -828,6 +939,7 @@ class DSA41_GegenstandData extends TypeDataModel {
return {
gewicht: new GewichtField(),
preis: new PreisField(),
anzahl: new NumberField({ integer: true, initial: 1, min: 0 }),
beschreibung: new StringField({ initial: "" }),
};
@@ -1182,10 +1294,12 @@ class DSA41_Dialog extends DSA41_ApplicationMixin(ApplicationV2) {
};
get formData() {
const inputs = this.element.querySelector("[data-application-part]")?.querySelectorAll("input") ?? [];
const types = Object.fromEntries(Array.from(inputs, x => [x.name, x.type]));
const data = Object.fromEntries(
new FormData(this.element).entries().map(([key, value])=>{
if (typeof value != "string") return [key, value];
return isNaN(value) ? [key, value] : [key, Number(value)];
if (types[key] == "number") return [key, Number(value)];
return [key, value];
})
);
@@ -1284,9 +1398,9 @@ class DSA41_ActorSheet extends DSA41_ApplicationMixin(ActorSheetV2) {
const data = await DSA41_Dialog.wait("Talent", { window: {title: title}, item: item });
const eBE = (await new Roll(item.system.behinderung || "0", { BE: this.document.system.computed.kampf.ruestungen_gesamt.gesamt_behinderung }).evaluate()).total;
data.modifikator += eBE;
data.modifikator -= eBE;
const talentwert = item.system.talentwert - data.modifikator;
const talentwert = item.system.talentwert + data.modifikator;
const roll_modifier = talentwert < 0 ? -talentwert: 0;
if (hp_roll_modifier !== 0)
@@ -1308,7 +1422,7 @@ class DSA41_ActorSheet extends DSA41_ApplicationMixin(ActorSheetV2) {
const context = {
talent: item,
modifikator: -data.modifikator,
modifikator: data.modifikator,
attribute1: { type: item.system.attribute1, value: attribute1 },
attribute2: { type: item.system.attribute2, value: attribute2 },
@@ -1346,6 +1460,10 @@ class DSA41_ActorSheet extends DSA41_ApplicationMixin(ActorSheetV2) {
flavor += " <= " + (Number(success_value) + data.modifikator);
}
if (data.anmerkung) {
flavor += "<br>" + data.anmerkung;
}
if (hp_roll_modifier !== 0)
roll_formula = roll_formula + " + " + hp_roll_modifier;
@@ -1372,6 +1490,10 @@ class DSA41_ActorSheet extends DSA41_ApplicationMixin(ActorSheetV2) {
let flavor = game.i18n.localize("DSA41.roll_types." + roll_type);
flavor += " <= " + (Number((data.crit == "on") ? item.parade_crit : item.parade) + data.modifikator);
if (data.anmerkung) {
flavor += "<br>" + data.anmerkung;
}
if (hp_roll_modifier !== 0)
roll_formula = roll_formula + " + " + hp_roll_modifier;
@@ -1466,7 +1588,7 @@ class DSA41_ActorSheet extends DSA41_ApplicationMixin(ActorSheetV2) {
const title = game.i18n.localize("DSA41.roll_types." + roll_type) + ": " + item.name;
const data = await DSA41_Dialog.wait("Zauber", { window: {title: title}, item: item });
const zauberfertigkeitswert = item.system.zauberfertigkeitswert - data.modifikator - data.magieresistenz;
const zauberfertigkeitswert = item.system.zauberfertigkeitswert - data.modifikator - (data.magieresistenz ?? null);
const roll_modifier = zauberfertigkeitswert < 0 ? -zauberfertigkeitswert: 0;
if (hp_roll_modifier !== 0)
@@ -1490,7 +1612,7 @@ class DSA41_ActorSheet extends DSA41_ApplicationMixin(ActorSheetV2) {
zauber: item,
modifikator: -data.modifikator,
magieresistenz: -data.magieresistenz,
magieresistenz: -(data.magieresistenz ?? 0),
attribute1: { type: item.system.attribute1, value: attribute1 },
attribute2: { type: item.system.attribute2, value: attribute2 },
@@ -1560,6 +1682,13 @@ class DSA41_ActorSheet extends DSA41_ApplicationMixin(ActorSheetV2) {
content: item.system.beschreibung,
});
},
"toggle-wound": async function(event, target) {
const location = event.target.closest("[data-location]").dataset.location;
const current_count = this.document.system.wunden[location];
const toggled_count = Array.prototype.indexOf.call(event.target.parentNode.children, event.target) + 1;
this.document.update({ ["system.wunden." + location]: toggled_count > current_count ? toggled_count : toggled_count - 1 });
}
},
};
+1 -1
View File
@@ -3,7 +3,7 @@
.name = "Betören",
.system = .{
.kategorie = .gesellschaftliche,
.behinderung = "BE - 2",
.behinderung = "@BE - 2",
.attribute1 = .IN,
.attribute2 = .CH,
.attribute3 = .CH,
+1 -1
View File
@@ -3,7 +3,7 @@
.name = "Etikette",
.system = .{
.kategorie = .gesellschaftliche,
.behinderung = "BE - 2",
.behinderung = "@BE - 2",
.attribute1 = .KL,
.attribute2 = .IN,
.attribute3 = .CH,
+1 -1
View File
@@ -3,7 +3,7 @@
.name = "Gassenwissen",
.system = .{
.kategorie = .gesellschaftliche,
.behinderung = "BE - 4",
.behinderung = "@BE - 4",
.attribute1 = .KL,
.attribute2 = .IN,
.attribute3 = .CH,
+13
View File
@@ -0,0 +1,13 @@
.{
.Talent = .{
.name = "Singen",
.system = .{
.kategorie = .koerperliche,
.behinderung = "@BE - 3",
.attribute1 = .IN,
.attribute2 = .CH,
.attribute3 = .CH,
}
}
}
+2 -2
View File
@@ -17,8 +17,8 @@ const talente: system.ItemCompendium = .{ .entries = &.{
@import("Items/Talente/Schwimmen.zon"),
@import("Items/Talente/Selbstbeherrschung.zon"),
@import("Items/Talente/Sich_Verstecken.zon"),
@import("Items/Talente/Singen.zon"),
@import("Items/Talente/Singen.zon"),
@import("Items/Talente/Singen1.zon"),
@import("Items/Talente/Singen2.zon"),
@import("Items/Talente/Sinnenschaerfe1.zon"),
@import("Items/Talente/Sinnenschaerfe2.zon"),
@import("Items/Talente/Skifahren.zon"),