Compare commits

...

7 Commits

Author SHA1 Message Date
Sven Balzer
6aa65be7a0 update ActorSheet to ActorSheetV2 and do a general cleanup pass
move editable-input partial into its own file so it doesn't have to be copy-pasted everywhere
change css to use nesting
2024-11-05 13:07:17 +01:00
Sven Balzer
2f9410180c update ItemSheets to ItemSheetV2 2024-11-01 20:21:09 +01:00
Sven Balzer
307307d271 add tooltips for attributes and combat rolls 2024-10-30 21:34:36 +01:00
Sven Balzer
a6ae10beba add compatibility information to system.json 2024-10-28 13:06:36 +01:00
Sven Balzer
19297c4bd7 change file ending of handlebars templates to "hbs" from "html" for syntax highlighting 2024-10-27 18:23:03 +01:00
Sven Balzer
6e58e06058 compute Ruestungen stats 2024-10-19 00:42:15 +02:00
Sven Balzer
172e98f663 change d20 display 2024-10-18 21:12:17 +02:00
17 changed files with 1086 additions and 843 deletions

284
src/ActorSheet.hbs Normal file
View File

@ -0,0 +1,284 @@
{{#*inline "die-type"}}
<div class="center die die-{{type}}">{{localize (concat "DSA41.attributes.short." type)}}</div>
{{/inline}}
{{#*inline "die-value"}}
<div class="col noflex center">
{{#if header}}<div class="center">{{header}}</div>{{/if}}
<div class="die die-{{type}}" data-action="roll" data-roll-type="{{type}}" {{#if success-value}}data-success-value="{{success-value}}"{{/if}} {{#if data-roll}}data-roll="{{data-roll}}"{{/if}} {{#if data-tooltip}}data-tooltip='{{> (lookup . "data-tooltip")}}'{{/if}}>
<div><svg viewbox="0 0 64 64"><use href="/systems/dsa-4th-edition/src/Assets/d20.svg#d20"></use></svg></div>
<div>{{{value}}}</div>
</div>
</div>
{{/inline}}
<div class="actor-sheet ActorSheet">
<div class="row">
{{>editable-input type="text" name="name" value=actor.name placeholder=(localize "DSA41.name")}}
{{>editable-input type="text" name="system.race" value=actor.system.race placeholder=(localize "DSA41.race")}}
{{>editable-input type="text" name="system.culture" value=actor.system.culture placeholder=(localize "DSA41.culture")}}
{{>editable-input type="text" name="system.profession" value=actor.system.profession placeholder=(localize "DSA41.profession")}}
</div>
<div class="row">
<img class="character-image" src="{{ actor.img }}" title="{{ actor.name }}" {{#if editable}}data-edit="img"{{/if}}>
{{#each actor.system.attributes}}
{{>die-value type=@key header=(localize (concat "DSA41.attributes.short." @key)) value=(lookup @root.actor.system.computed.attributes @key) success-value=(lookup @root.actor.system.computed.attributes @key) data-roll="1d20" data-tooltip="attribute_tooltip"}}
{{/each}}
</div>
<nav class="tabs">
<div class="row noflex {{#if (eq tabGroups.primary 'tab1')}}active{{/if}}" data-group="primary" data-tab="tab1">
<a data-group="primary" data-tab="tab1" data-action="tab">{{localize "DSA41.character.eigenschaften"}}</a>
</div>
<div class="row noflex {{#if (eq tabGroups.primary 'tab2')}}active{{/if}}" data-group="primary" data-tab="tab2">
<a data-group="primary" data-tab="tab2" data-action="tab">{{localize "DSA41.character.talente"}}</a>
</div>
<div class="row noflex {{#if (eq tabGroups.primary 'tab3')}}active{{/if}}" data-group="primary" data-tab="tab3">
<a data-group="primary" data-tab="tab3" data-action="tab">{{localize "DSA41.character.inventar"}}</a>
</div>
<div class="row noflex {{#if (eq tabGroups.primary 'tab4')}}active{{/if}}" data-group="primary" data-tab="tab4">
<a data-group="primary" data-tab="tab4" data-action="tab">{{localize "DSA41.character.kampf"}}</a>
</div>
</nav>
<div class="tab {{#if (eq tabGroups.primary 'tab1')}}active{{/if}}" data-group="primary" data-tab="tab1">
<fieldset>
<legend>{{localize "DSA41.attributes.label"}}</legend>
<div class="Eigenschaften">
<span></span>
{{#each actor.system.attributes}}
<span class="center">{{localize (concat "DSA41.attributes.short." @key)}}</span>
{{/each}}
<span>{{localize "DSA41.attributes.initial"}}</span>
{{#each actor.system.attributes}}
{{>editable-input type="number" name=(concat "system.attributes." @key ".initial") value=(lookup this "initial")}}
{{/each}}
<span>{{localize "DSA41.attributes.advancement"}}</span>
{{#each actor.system.attributes}}
{{>editable-input type="number" name=(concat "system.attributes." @key ".advancement") value=(lookup this "advancement")}}
{{/each}}
<span>{{localize "DSA41.attributes.modifier"}}</span>
{{#each actor.system.attributes}}
<span>{{>editable-input type="number" name=(concat "system.attributes." @key ".modifier") value=(lookup this "modifier")}}</span>
{{/each}}
</div>
</fieldset>
<div class="Basiswerte">
<span>Lebenspunkte</span>
<span>{{actor.system.computed.max_lebenspunkte}}</span>
<span>Ausdauer</span>
<span>{{actor.system.computed.max_ausdauer}}</span>
<span>Astralenergie</span>
<span>{{actor.system.computed.max_atralenergie}}</span>
<span>Magieresistenz</span>
<span>{{actor.system.computed.magieresistenz}}</span>
<span>INI-Basiswert</span>
<span>{{actor.system.computed.ini_basiswert}}</span>
<span>AT-Basiswert</span>
<span>{{actor.system.computed.at_basiswert}}</span>
<span>PA-Basiswert</span>
<span>{{actor.system.computed.pa_basiswert}}</span>
<span>FK-Basiswert</span>
<span>{{actor.system.computed.fk_basiswert}}</span>
</div>
</div>
<div class="tab {{#if (eq tabGroups.primary 'tab2')}}active{{/if}}" data-group="primary" data-tab="tab2">
<fieldset>
<legend>{{localize "DSA41.talente.kampf.label"}}</legend>
<div class="Kampftalente">
<span class="center">{{localize "DSA41.talente.label"}}</span>
<span class="center">{{localize "DSA41.talente.label_talentwert"}}</span>
<span class="center">{{localize "DSA41.talente.kampf.label_attacke"}}</span>
<span class="center">{{localize "DSA41.talente.kampf.label_parade"}}</span>
<span class="center">{{localize "DSA41.talente.kampf.label_attacke_total"}}</span>
<span class="center">{{localize "DSA41.talente.kampf.label_parade_total"}}</span>
{{#each actor.system.kampf_talente}}
<span>{{localize (concat "DSA41.talente.kampf.name." @key)}}</span>
<span>{{>editable-input type="number" name=(concat "system.kampf_talente." @key ".talentwert") value=(lookup this "talentwert")}}</span>
<span>{{>editable-input type="number" name=(concat "system.kampf_talente." @key ".attacke") value=(lookup this "attacke")}}</span>
<span>{{>editable-input type="number" name=(concat "system.kampf_talente." @key ".parade") value=(lookup this "parade")}}</span>
<span class="center">{{lookup (lookup @root.actor.system.computed.kampf.talente @key) "attacke"}}</span>
<span class="center">{{lookup (lookup @root.actor.system.computed.kampf.talente @key) "parade"}}</span>
{{/each}}
</div>
</fieldset>
{{#each actor.system.talente}}
<fieldset>
<legend>{{localize (concat "DSA41.talente." @key ".label")}}</legend>
<div class="Talente">
<span class="center">{{localize "DSA41.talente.label"}}</span>
<span class="center">{{localize "DSA41.talente.label_eigenschaften"}}</span>
<span class="center">{{localize "DSA41.talente.label_talentwert"}}</span>
{{#each @this}}
<span>{{localize (concat "DSA41.talente." @../key ".name." @key)}}</span>
<span></span>
<span>{{>editable-input type="number" name=(concat "system.talente." @../key "." @key) value=@this}}</span>
{{/each}}
</div>
</fieldset>
{{/each}}
</div>
<div class="tab {{#if (eq tabGroups.primary 'tab3')}}active{{/if}}" data-group="primary" data-tab="tab3">
<div class="list Bewaffnung subgrid-columns">
<div class="list-header">
<div>{{localize "DSA41.inventar.bewaffnung"}}</div>
<div></div>
<div class="center">{{localize "DSA41.weight"}}</div>
<div></div>
</div>
{{#each actor.itemTypes.Bewaffnung}}
<div class="list-item" data-item-id="{{this._id}}">
<div class="item-name row" data-action="item-open">
<img class="item-image" src="{{this.img}}" title="{{this.name}}">
<div class="col">
<span>{{this.name}}</span>
<span class="small">
{{#if this.system.nahkampfwaffe.aktiv}} Nahkampfwaffe {{/if}}
{{#if this.system.parierwaffe.aktiv}} Parierwaffe {{/if}}
{{#if this.system.schild.aktiv}} Schild {{/if}}
{{#if this.system.fernkampfwaffe.aktiv}} Fernkampfwaffe {{/if}}
</span>
</div>
</div>
<div></div>
<div class="center">{{this.system.gewicht}}</div>
<div class="center fas fa-trash" data-action="item-delete"></div>
</div>
{{/each}}
</div>
<div class="list Ruestung subgrid-columns">
<div class="list-header">
<div class="row">{{localize "DSA41.inventar.ruestungen"}}</div>
<div></div>
<div class="center">{{localize "DSA41.weight"}}</div>
</div>
{{#each actor.itemTypes.Ruestung}}
<div class="list-item" data-item-id="{{this._id}}">
<div class="item-name row" data-action="item-open">
<img class="item-image" src="{{this.img}}" title="{{this.name}}">
<span class="center">{{this.name}}</span>
</div>
<div></div>
<div class="center">{{this.system.gewicht}}</div>
<div class="center fas fa-trash" data-action="item-delete"></div>
</div>
{{/each}}
</div>
<div class="list Gegenstand subgrid-columns">
<div class="list-header">
<div>{{localize "DSA41.inventar.gegenstaende"}}</div>
<div></div>
<div class="center">{{localize "DSA41.weight"}}</div>
</div>
{{#each actor.itemTypes.Gegenstand}}
<div class="list-item" data-item-id="{{this._id}}">
<div class="item-name row" data-action="item-open">
<img class="item-image" src="{{this.img}}" title="{{this.name}}">
<span class="center">{{this.name}}</span>
</div>
<div></div>
<div class="center">{{this.system.gewicht}}</div>
<div class="center fas fa-trash" data-action="item-delete"></div>
</div>
{{/each}}
</div>
</div>
<div class="tab Kampf {{#if (eq tabGroups.primary 'tab4')}}active{{/if}}" data-group="primary" data-tab="tab4">
<div class="list Bewaffnung">
<div class="list-header ">
<div>{{localize "DSA41.kampf.bewaffnung"}}</div>
<div class="center">{{localize "DSA41.kampf.attacke"}}</div>
<div class="center">{{localize "DSA41.kampf.parade"}}</div>
<div class="center">{{localize "DSA41.kampf.trefferpunkte"}}</div>
</div>
{{#each actor.system.computed.kampf.waffen}}
<div class="list-item" data-item-id="{{item._id}}">
<div class="item-name row" data-action="item-open">
<img class="item-image" src="{{item.img}}" title="{{item.name}}">
<div class="col">
<span>{{item.name}}</span>
</div>
</div>
<div class="center">{{>die-value type="attacke" data-roll="1d20" value=attacke success-value=attacke data-tooltip="attacke_tooltip"}}</div>
<div class="center">{{>die-value type="parade" data-roll="1d20" value=parade success-value=parade data-tooltip="parade_tooltip"}}</div>
<div class="center">{{>die-value type="trefferpunkte" data-roll=trefferpunkte value=trefferpunkte_display data-tooltip="trefferpunkte_tooltip"}}</div>
</div>
{{/each}}
</div>
<div class="list Ruestung">
<div class="list-header rowspan2">
<div class="rowspan2">{{localize "DSA41.kampf.ruestungen"}}</div>
<div class="rowspan2">{{localize "DSA41.ruestungen.kopf"}}</div>
<div class="rowspan2">{{localize "DSA41.ruestungen.brust"}}</div>
<div class="rowspan2">{{localize "DSA41.ruestungen.ruecken"}}</div>
<div class="rowspan2">{{localize "DSA41.ruestungen.bauch"}}</div>
<div class="colspan2 rowspan2 subgrid">
<div class="colspan2">{{localize "DSA41.ruestungen.arm"}}</div>
<div>{{localize "DSA41.ruestungen.links"}}</div>
<div>{{localize "DSA41.ruestungen.rechts"}}</div>
</div>
<div class="colspan2 rowspan2 subgrid">
<div class="colspan2">{{localize "DSA41.ruestungen.bein"}}</div>
<div>{{localize "DSA41.ruestungen.links"}}</div>
<div>{{localize "DSA41.ruestungen.rechts"}}</div>
</div>
<div class="colspan2 rowspan2 subgrid">
<div class="colspan2">{{localize "DSA41.ruestungen.gesamt"}}</div>
<div>{{localize "DSA41.ruestungen.ruestungsschutz"}}</div>
<div>{{localize "DSA41.ruestungen.behinderung"}}</div>
</div>
</div>
{{#each actor.system.computed.kampf.ruestungen}}
<div class="list-item" data-item-id="{{item._id}}">
<div class="row item-name" data-action="item-open">
<img class="item-image" src="{{item.img}}" title="{{item.name}}">
<span class="center">{{item.name}}</span>
</div>
<div>{{item.system.kopf}}</div>
<div>{{item.system.brust}}</div>
<div>{{item.system.ruecken}}</div>
<div>{{item.system.bauch}}</div>
<div>{{item.system.linker_arm}}</div>
<div>{{item.system.rechter_arm}}</div>
<div>{{item.system.linkes_bein}}</div>
<div>{{item.system.rechtes_bein}}</div>
<div>{{item.system.gesamt_ruestungsschutz}}</div>
<div>{{item.system.gesamt_behinderung}}</div>
</div>
{{/each}}
<div class="list-item">
<div class="left">Total</div>
<div>{{actor.system.computed.kampf.ruestungen_gesamt.kopf}}</div>
<div>{{actor.system.computed.kampf.ruestungen_gesamt.brust}}</div>
<div>{{actor.system.computed.kampf.ruestungen_gesamt.ruecken}}</div>
<div>{{actor.system.computed.kampf.ruestungen_gesamt.bauch}}</div>
<div>{{actor.system.computed.kampf.ruestungen_gesamt.linker_arm}}</div>
<div>{{actor.system.computed.kampf.ruestungen_gesamt.rechter_arm}}</div>
<div>{{actor.system.computed.kampf.ruestungen_gesamt.linkes_bein}}</div>
<div>{{actor.system.computed.kampf.ruestungen_gesamt.rechtes_bein}}</div>
<div>{{actor.system.computed.kampf.ruestungen_gesamt.gesamt_ruestungsschutz}}</div>
<div>{{actor.system.computed.kampf.ruestungen_gesamt.gesamt_behinderung}}</div>
</div>
</div>
</div>
</div>

View File

@ -1,294 +0,0 @@
{{#*inline "editable-input"}}
<div class="editable-input editable-{{type}}">
{{#if @root.editable}}
<input type="{{type}}" name="{{name}}" value="{{value}}" placeholder="{{placeholder}}">
{{else}}
<div>
{{value}}
{{#unless value}}{{placeholder}}{{/unless}}
</div>
{{/if}}
{{#if placeholder}}
<div class="placeholder">{{placeholder}}</div>
{{/if}}
</div>
{{/inline}}
{{#*inline "editable-checkbox"}}
<div class="editable-input editable-checkbox">
{{#if @root.editable}}
<input type="checkbox" name="{{name}}" {{checked value}}>
{{else}}
<div>
{{value}}
{{#unless value}}{{placeholder}}{{/unless}}
</div>
{{/if}}
{{#if placeholder}}
<div class="placeholder">{{placeholder}}</div>
{{/if}}
</div>
{{/inline}}
{{#*inline "die-type"}}
<div class="center die die-{{type}}">{{localize (concat "DSA41.attributes.short." type)}}</div>
{{/inline}}
{{#*inline "die-value"}}
<div class="col noflex">
{{#if header}}<div class="center">{{header}}</div>{{/if}}
<div class="die die-{{type}} roll" data-roll-type="{{type}}" {{#if value}}data-success-value="{{value}}"{{/if}} {{#if data-roll}}data-roll="{{data-roll}}"{{/if}}>{{value}}</div>
</div>
{{/inline}}
<form class="actor-sheet {{ cssClass }}" autocomplete="off">
<div class="row">
{{>editable-input type="text" name="name" value=actor.name placeholder=(localize "DSA41.name")}}
{{>editable-input type="text" name="system.race" value=actor.system.race placeholder=(localize "DSA41.race")}}
{{>editable-input type="text" name="system.culture" value=actor.system.culture placeholder=(localize "DSA41.culture")}}
{{>editable-input type="text" name="system.profession" value=actor.system.profession placeholder=(localize "DSA41.profession")}}
</div>
<div class="row">
<img class="character-image" src="{{ actor.img }}" title="{{ actor.name }}" {{#if editable}}data-edit="img"{{/if}}>
{{#each actor.system.attributes}}
{{>die-value type=@key header=(localize (concat "DSA41.attributes.short." @key)) value=(lookup @root.actor.system.computed.attributes.with_modifiers @key) data-roll="1d20"}}
{{/each}}
</div>
<nav class="tabs" data-group="primary">
<div class="row noflex">
<a data-tab="tab1">{{localize "DSA41.character.eigenschaften"}}</a>
</div>
<div class="row noflex">
<a data-tab="tab2">{{localize "DSA41.character.talente"}}</a>
</div>
<div class="row noflex">
<a data-tab="tab3">{{localize "DSA41.character.inventar"}}</a>
</div>
<div class="row noflex">
<a data-tab="tab4">{{localize "DSA41.character.kampf"}}</a>
</div>
</nav>
<section class="content">
<div class="tab" data-group="primary" data-tab="tab1">
<div class="row">
<fieldset>
<legend>{{localize "DSA41.attributes.label"}}</legend>
<table>
<tr>
<th></th>
{{#each actor.system.attributes}}
<th>{{localize (concat "DSA41.attributes.short." @key)}}</th>
{{/each}}
</tr>
<tr>
<td>{{localize "DSA41.attributes.initial"}}</td>
{{#each actor.system.attributes}}
<td>{{>editable-input type="number" name=(concat "system.attributes." @key ".initial") value=(lookup this "initial")}}</td>
{{/each}}
</tr>
<tr>
<td>{{localize "DSA41.attributes.advancement"}}</td>
{{#each actor.system.attributes}}
<td>{{>editable-input type="number" name=(concat "system.attributes." @key ".advancement") value=(lookup this "advancement")}}</td>
{{/each}}
</tr>
<tr>
<td>{{localize "DSA41.attributes.modifier"}}</td>
{{#each actor.system.attributes}}
<td>{{>editable-input type="number" name=(concat "system.attributes." @key ".modifier") value=(lookup this "modifier")}}</td>
{{/each}}
</tr>
</table>
</fieldset>
</div>
<table>
<tr>
<td>Lebenspunkte</td>
<td>{{actor.system.computed.max_lebenspunkte}}</td>
<td>Ausdauer</td>
<td>{{actor.system.computed.max_ausdauer}}</td>
</tr>
<tr>
<td>Astralenergie</td>
<td>{{actor.system.computed.max_atralenergie}}</td>
<td>Magieresistenz</td>
<td>{{actor.system.computed.magieresistenz}}</td>
</tr>
<tr>
<td>INI-Basiswert</td>
<td>{{actor.system.computed.ini_basiswert}}</td>
<td>AT-Basiswert</td>
<td>{{actor.system.computed.at_basiswert}}</td>
</tr>
<tr>
<td>PA-Basiswert</td>
<td>{{actor.system.computed.pa_basiswert}}</td>
<td>FK-Basiswert</td>
<td>{{actor.system.computed.fk_basiswert}}</td>
</tr>
</table>
</div>
<div class="tab" data-group="primary" data-tab="tab2">
<div class="row">
<fieldset>
<legend>{{localize "DSA41.talente.kampf.label"}}</legend>
<table>
<tr>
<th>{{localize "DSA41.talente.label"}}</th>
<th>{{localize "DSA41.talente.label_talentwert"}}</th>
<th>{{localize "DSA41.talente.kampf.label_attacke"}}</th>
<th>{{localize "DSA41.talente.kampf.label_parade"}}</th>
<th>{{localize "DSA41.talente.kampf.label_attacke_total"}}</th>
<th>{{localize "DSA41.talente.kampf.label_parade_total"}}</th>
</tr>
{{#each actor.system.kampf_talente}}
<tr>
<td>{{localize (concat "DSA41.talente.kampf.name." @key)}}</td>
<td>{{>editable-input type="number" name=(concat "system.kampf_talente." @key ".talentwert") value=(lookup this "talentwert")}}</td>
<td>{{>editable-input type="number" name=(concat "system.kampf_talente." @key ".attacke") value=(lookup this "attacke")}}</td>
<td>{{>editable-input type="number" name=(concat "system.kampf_talente." @key ".parade") value=(lookup this "parade")}}</td>
<td class="center">{{lookup (lookup @root.actor.system.computed.kampf.talente @key) "attacke"}}</td>
<td class="center">{{lookup (lookup @root.actor.system.computed.kampf.talente @key) "parade"}}</td>
</tr>
{{/each}}
</table>
</fieldset>
</div>
{{#each actor.system.talente}}
<div class="row">
<fieldset>
<legend>{{localize (concat "DSA41.talente." @key ".label")}}</legend>
<table>
<tr>
<th>{{localize "DSA41.talente.label"}}</th>
<th>{{localize "DSA41.talente.label_eigenschaften"}}</th>
<th>{{localize "DSA41.talente.label_talentwert"}}</th>
</tr>
{{#each @this}}
<tr>
<td>{{localize (concat "DSA41.talente." @../key ".name." @key)}}</td>
<td></td>
<td>{{>editable-input type="number" name=(concat "system.talente." @../key "." @key) value=@this}}</td>
</tr>
{{/each}}
</table>
</fieldset>
</div>
{{/each}}
</div>
<div class="tab" data-group="primary" data-tab="tab3">
<div class="col inventar">
<div class="col list">
<div class="row list-header">
<div class="row">{{localize "DSA41.inventar.bewaffnung"}}</div>
<div>{{localize "DSA41.weight"}}</div>
</div>
{{#each actor.itemTypes.Bewaffnung}}
<div class="row list-item" data-item-id="{{this._id}}">
<div class="row item-name item-open">
<img class="item-image" src="{{this.img}}" title="{{this.name}}">
<div class="col">
<span>{{this.name}}</span>
<span class="item-sub">
{{#if this.system.nahkampfwaffe.aktiv}} Nahkampfwaffe {{/if}}
{{#if this.system.parierwaffe.aktiv}} Parierwaffe {{/if}}
{{#if this.system.schild.aktiv}} Schild {{/if}}
{{#if this.system.fernkampfwaffe.aktiv}} Fernkampfwaffe {{/if}}
</span>
</div>
</div>
<div class="row"></div>
<div class="center">{{this.system.gewicht}}</div>
<div class="center fas fa-trash item-delete"></div>
</div>
{{/each}}
</div>
<div class="col list">
<div class="row list-header">
<div class="row">{{localize "DSA41.inventar.ruestungen"}}</div>
<div>{{localize "DSA41.weight"}}</div>
</div>
{{#each actor.itemTypes.Ruestung}}
<div class="row list-item" data-item-id="{{this._id}}">
<div class="row item-name">
<img class="item-image" src="{{this.img}}" title="{{this.name}}">
<span class="center">{{this.name}}</span>
</div>
<div class="center">{{this.system.gewicht}}</div>
<div class="center">{{>editable-checkbox value=this.system.angelegt}}</div>
</div>
{{/each}}
</div>
<div class="col list">
<div class="row list-header">
<div class="row">{{localize "DSA41.inventar.gegenstaende"}}</div>
<div>{{localize "DSA41.weight"}}</div>
</div>
{{#each actor.itemTypes.Gegenstand}}
<div class="row list-item" data-item-id="{{this._id}}">
<div class="row item-name">
<img class="item-image" src="{{this.img}}" title="{{this.name}}">
<span class="center">{{this.name}}</span>
</div>
<div class="center">{{this.system.gewicht}}</div>
<div class="center">{{>editable-checkbox value=this.system.angelegt}}</div>
</div>
{{/each}}
</div>
</div>
</div>
<div class="tab" data-group="primary" data-tab="tab4">
<div class="col kampf">
<div class="col list">
<div class="row list-header">
<div class="row">{{localize "DSA41.kampf.bewaffnung"}}</div>
<div>{{localize "DSA41.kampf.attacke"}}</div>
<div>{{localize "DSA41.kampf.parade"}}</div>
<div>{{localize "DSA41.kampf.trefferpunkte"}}</div>
</div>
{{#each actor.system.computed.kampf.waffen}}
<div class="row list-item" data-item-id="{{item._id}}">
<div class="row item-name">
<img class="item-image" src="{{item.img}}" title="{{item.name}}">
<div class="col">
<span>{{item.name}}</span>
</div>
</div>
<div class="center">{{>die-value type="attacke" data-roll="1d20" value=attacke}}</div>
<div class="center">{{>die-value type="parade" data-roll="1d20" value=parade}}</div>
<div class="center">{{>die-value type="trefferpunkte" data-roll=trefferpunkte}}</div>
</div>
{{/each}}
</div>
<div class="col list">
<div class="row list-header">
<div class="row">{{localize "DSA41.kampf.ruestungen"}}</div>
<div>{{localize "DSA41.weight"}}</div>
</div>
{{#each actor.itemTypes.Ruestung}}
<div class="row list-item" data-item-id="{{this._id}}">
<div class="row item-name">
<img class="item-image" src="{{this.img}}" title="{{this.name}}">
<span class="center">{{this.name}}</span>
</div>
<div class="center">{{this.system.gewicht}}</div>
<div class="center">{{>editable-checkbox value=this.system.angelegt}}</div>
</div>
{{/each}}
</div>
</div>
</div>
</section>
</form>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="64" height="64" version="1.1" viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg">
<g>
<g id="d20">
<path d="m11.906 20.4h40.188l-20.094 34.801z"/>
<path d="m52.635 21.059 6.5977 26.664-26.391 7.6172z"/>
<path d="m32 .55664 19.791 19.043h-39.582z"/>

Before

Width:  |  Height:  |  Size: 696 B

After

Width:  |  Height:  |  Size: 705 B

11
src/EditableInput.hbs Normal file
View File

@ -0,0 +1,11 @@
<div class="editable-input editable-{{type}}">
{{#if (eq type "checkbox")}}
<input type="checkbox" name="{{name}}" {{checked value}}>
{{else}}
<input type="{{type}}" name="{{name}}" value="{{value}}" placeholder="{{placeholder}}">
{{/if}}
{{#if placeholder}}
<div class="placeholder">{{placeholder}}</div>
{{/if}}
</div>

View File

@ -0,0 +1,130 @@
<div class="Bewaffnung {{ cssClass }}">
<div class="row">
<img class="item-image" src="{{ item.img }}" title="{{ item.name }}" {{#if editable}}data-edit="img"{{/if}}>
<div class="col">
{{>editable-input type="text" name="name" value=item.name placeholder=(localize "DSA41.name")}}
<div class="row">
{{>editable-input type="number" name="system.gewicht" value=item.system.gewicht placeholder=(localize "DSA41.weight")}}
{{>editable-input type="number" name="system.preis" value=item.system.preis placeholder=(localize "DSA41.price")}}
</div>
</div>
</div>
<nav class="tabs">
<div class="row noflex {{#if (eq tabGroups.primary 'tab1')}}active{{/if}}" data-group="primary" data-tab="tab1">
<a data-group="primary" data-tab="tab1" data-action="tab">{{localize "DSA41.bewaffnung.nahkampfwaffe.label"}}</a>
{{>editable-input type="checkbox" name="system.nahkampfwaffe.aktiv" value=item.system.nahkampfwaffe.aktiv}}
</div>
<div class="row noflex {{#if (eq tabGroups.primary 'tab2')}}active{{/if}}" data-group="primary" data-tab="tab2">
<a data-group="primary" data-tab="tab2" data-action="tab">{{localize "DSA41.bewaffnung.parierwaffe.label"}}</a>
{{>editable-input type="checkbox" name="system.parierwaffe.aktiv" value=item.system.parierwaffe.aktiv}}
</div>
<div class="row noflex {{#if (eq tabGroups.primary 'tab3')}}active{{/if}}" data-group="primary" data-tab="tab3">
<a data-group="primary" data-tab="tab3" data-action="tab">{{localize "DSA41.bewaffnung.schild.label"}}</a>
{{>editable-input type="checkbox" name="system.schild.aktiv" value=item.system.schild.aktiv}}
</div>
<div class="row noflex {{#if (eq tabGroups.primary 'tab4')}}active{{/if}}" data-group="primary" data-tab="tab4">
<a data-group="primary" data-tab="tab4" data-action="tab">{{localize "DSA41.bewaffnung.fernkampfwaffe.label"}}</a>
{{>editable-input type="checkbox" name="system.fernkampfwaffe.aktiv" value=item.system.fernkampfwaffe.aktiv}}
</div>
</nav>
<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">
{{>editable-input type="text" name="system.nahkampfwaffe.basis" value=item.system.nahkampfwaffe.basis placeholder=(localize "DSA41.bewaffnung.nahkampfwaffe.basis")}}
{{>editable-input type="number" name="system.nahkampfwaffe.schwellenwert" value=item.system.nahkampfwaffe.schwellenwert placeholder=(localize "DSA41.bewaffnung.nahkampfwaffe.schwellenwert")}}
{{>editable-input type="number" name="system.nahkampfwaffe.schadensschritte" value=item.system.nahkampfwaffe.schadensschritte placeholder=(localize "DSA41.bewaffnung.nahkampfwaffe.schadensschritte")}}
</div>
<span>{{localize "DSA41.bewaffnung.nahkampfwaffe.modifikator"}}</span>
<div class="grid2">
{{>editable-input type="number" name="system.nahkampfwaffe.modifikator_attacke" value=item.system.nahkampfwaffe.modifikator_attacke placeholder=(localize "DSA41.bewaffnung.nahkampfwaffe.attacke")}}
{{>editable-input type="number" name="system.nahkampfwaffe.modifikator_parade" value=item.system.nahkampfwaffe.modifikator_parade placeholder=(localize "DSA41.bewaffnung.nahkampfwaffe.parade")}}
</div>
<span>{{localize "DSA41.bewaffnung.nahkampfwaffe.initiative"}}</span>
<div>{{>editable-input type="number" name="system.nahkampfwaffe.initiative" value=item.system.nahkampfwaffe.initiative}}</div>
<span>{{localize "DSA41.bewaffnung.bruchfaktor"}}</span>
<div>{{>editable-input type="number" name="system.nahkampfwaffe.bruchfaktor" value=item.system.nahkampfwaffe.bruchfaktor}}</div>
<span>{{localize "DSA41.bewaffnung.nahkampfwaffe.distanzklasse"}}</span>
<div>{{>editable-input type="text" name="system.nahkampfwaffe.distanzklasse" value=item.system.nahkampfwaffe.distanzklasse}}</div>
<span>{{localize "DSA41.bewaffnung.nahkampfwaffe.kampftalente"}}</span>
<div>{{>editable-input type="text" name="system.nahkampfwaffe.kampftalente" value=item.system.nahkampfwaffe.kampftalente}}</div>
<span>{{localize "DSA41.bewaffnung.nahkampfwaffe.laenge"}}</span>
<div>{{>editable-input type="number" name="system.nahkampfwaffe.laenge" value=item.system.nahkampfwaffe.laenge}}</div>
<div class="colspan2"></div>
<span>{{localize "DSA41.bewaffnung.nahkampfwaffe.zweihaendig"}}</span>
<div>{{>editable-input type="checkbox" name="system.nahkampfwaffe.zweihaendig" value=item.system.nahkampfwaffe.zweihaendig}}</div>
<span>{{localize "DSA41.bewaffnung.nahkampfwaffe.werfbar"}}</span>
<div>{{>editable-input type="checkbox" name="system.nahkampfwaffe.werfbar" value=item.system.nahkampfwaffe.werfbar}}</div>
<span>{{localize "DSA41.bewaffnung.nahkampfwaffe.improvisiert"}}</span>
<div>{{>editable-input type="checkbox" name="system.nahkampfwaffe.improvisiert" value=item.system.nahkampfwaffe.improvisiert}}</div>
<span>{{localize "DSA41.bewaffnung.nahkampfwaffe.priviligiert"}}</span>
<div>{{>editable-input type="checkbox" name="system.nahkampfwaffe.priviligiert" value=item.system.nahkampfwaffe.priviligiert}}</div>
</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>{{>editable-input type="number" name="system.parierwaffe.initiative" value=item.system.parierwaffe.initiative}}</div>
<span>{{localize "DSA41.bewaffnung.parierwaffe.modifikator"}}</span>
<div class="grid2">
{{>editable-input type="number" name="system.parierwaffe.modifikator_attacke" value=item.system.parierwaffe.modifikator_attacke placeholder=(localize "DSA41.bewaffnung.parierwaffe.attacke")}}
{{>editable-input type="number" name="system.parierwaffe.modifikator_parade" value=item.system.parierwaffe.modifikator_parade placeholder=(localize "DSA41.bewaffnung.parierwaffe.parade")}}
</div>
<span>{{localize "DSA41.bewaffnung.bruchfaktor"}}</span>
<div>{{>editable-input type="number" name="system.parierwaffe.bruchfaktor" value=item.system.parierwaffe.bruchfaktor}}</div>
</div>
<div class="tab {{#if (eq tabGroups.primary 'tab3')}}active{{/if}}" data-group="primary" data-tab="tab3">
<span>{{localize "DSA41.bewaffnung.schild.groesse.label"}}</span>
<select name="system.schild.groesse">
<option value="klein" {{#if (eq item.system.schild.groesse "klein")}} selected {{/if}}>{{localize "DSA41.bewaffnung.schild.groesse.klein"}}</option>
<option value="gross" {{#if (eq item.system.schild.groesse "gross")}} selected {{/if}}>{{localize "DSA41.bewaffnung.schild.groesse.gross"}}</option>
<option value="sehr_gross" {{#if (eq item.system.schild.groesse "sehr_gross")}} selected {{/if}}>{{localize "DSA41.bewaffnung.schild.groesse.sehr_gross"}}</option>
</select>
<span>{{localize "DSA41.bewaffnung.schild.modifikator"}}</span>
<div class="grid2">
{{>editable-input type="number" name="system.schild.modifikator_attacke" value=item.system.schild.modifikator_attacke placeholder=(localize "DSA41.bewaffnung.schild.attacke")}}
{{>editable-input type="number" name="system.schild.modifikator_parade" value=item.system.schild.modifikator_parade placeholder=(localize "DSA41.bewaffnung.schild.parade")}}
</div>
<span>{{localize "DSA41.bewaffnung.schild.initiative"}}</span>
<div>{{>editable-input type="number" name="system.schild.initiative" value=item.system.schild.initiative}}</div>
<span>{{localize "DSA41.bewaffnung.bruchfaktor"}}</span>
<div>{{>editable-input type="number" name="system.schild.bruchfaktor" value=item.system.schild.bruchfaktor}}</div>
</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">{{>editable-input type="text" name="system.fernkampfwaffe.basis" value=item.system.fernkampfwaffe.basis}}</div>
<span>{{localize "DSA41.bewaffnung.fernkampfwaffe.laden"}}</span>
<div>{{>editable-input type="number" name="system.fernkampfwaffe.laden" value=item.system.fernkampfwaffe.laden}}</div>
<span>{{localize "DSA41.bewaffnung.fernkampfwaffe.munitionskosten"}}</span>
<div>{{>editable-input type="number" name="system.fernkampfwaffe.munitionskosten" value=item.system.fernkampfwaffe.munitionskosten}}</div>
<span>{{localize "DSA41.bewaffnung.fernkampfwaffe.munitionsgewicht"}}</span>
<div>{{>editable-input type="number" name="system.fernkampfwaffe.munitionsgewicht" value=item.system.fernkampfwaffe.munitionsgewicht}}</div>
<span>{{localize "DSA41.bewaffnung.fernkampfwaffe.reichweiten"}}</span>
<div class="colspan3 grid5">
{{>editable-input type="number" name="system.fernkampfwaffe.reichweite1" value=item.system.fernkampfwaffe.reichweite1}}
{{>editable-input type="number" name="system.fernkampfwaffe.reichweite2" value=item.system.fernkampfwaffe.reichweite2}}
{{>editable-input type="number" name="system.fernkampfwaffe.reichweite3" value=item.system.fernkampfwaffe.reichweite3}}
{{>editable-input type="number" name="system.fernkampfwaffe.reichweite4" value=item.system.fernkampfwaffe.reichweite4}}
{{>editable-input type="number" name="system.fernkampfwaffe.reichweite5" value=item.system.fernkampfwaffe.reichweite5}}
</div>
<span>{{localize "DSA41.bewaffnung.fernkampfwaffe.modifikator"}}</span>
<div class="row colspan3 grid5">
{{>editable-input type="number" name="system.fernkampfwaffe.modifikator1" value=item.system.fernkampfwaffe.modifikator1}}
{{>editable-input type="number" name="system.fernkampfwaffe.modifikator2" value=item.system.fernkampfwaffe.modifikator2}}
{{>editable-input type="number" name="system.fernkampfwaffe.modifikator3" value=item.system.fernkampfwaffe.modifikator3}}
{{>editable-input type="number" name="system.fernkampfwaffe.modifikator4" value=item.system.fernkampfwaffe.modifikator4}}
{{>editable-input type="number" name="system.fernkampfwaffe.modifikator5" value=item.system.fernkampfwaffe.modifikator5}}
</div>
</div>
</div>

View File

@ -1,205 +0,0 @@
{{#*inline "editable-input"}}
<div class="editable-input editable-{{type}}">
{{#if @root.editable}}
<input type="{{type}}" name="{{name}}" value="{{value}}" placeholder="{{placeholder}}">
{{else}}
<div>
{{value}}
{{#unless value}}{{placeholder}}{{/unless}}
</div>
{{/if}}
{{#if placeholder}}
<div class="placeholder">{{placeholder}}</div>
{{/if}}
</div>
{{/inline}}
{{#*inline "editable-checkbox"}}
<div class="editable-input editable-checkbox">
{{#if @root.editable}}
<input type="checkbox" name="{{name}}" {{checked value}}>
{{else}}
<div>
{{value}}
{{#unless value}}{{placeholder}}{{/unless}}
</div>
{{/if}}
{{#if placeholder}}
<div class="placeholder">{{placeholder}}</div>
{{/if}}
</div>
{{/inline}}
<form class="item-sheet {{ cssClass }}" autocomplete="off">
<div class="row">
<img class="item-image" src="{{ item.img }}" title="{{ item.name }}" {{#if editable}}data-edit="img"{{/if}}>
<div class="col">
{{>editable-input type="text" name="name" value=item.name placeholder=(localize "DSA41.name")}}
<div class="row">
{{>editable-input type="number" name="system.gewicht" value=item.system.gewicht placeholder=(localize "DSA41.weight")}}
{{>editable-input type="number" name="system.preis" value=item.system.preis placeholder=(localize "DSA41.price")}}
</div>
</div>
</div>
<nav class="tabs" data-group="primary">
<div class="row noflex">
<a data-tab="tab1">{{localize "DSA41.bewaffnung.nahkampfwaffe.label"}}</a>
{{>editable-checkbox name="system.nahkampfwaffe.aktiv" value=item.system.nahkampfwaffe.aktiv}}
</div>
<div class="row noflex">
<a data-tab="tab2">{{localize "DSA41.bewaffnung.parierwaffe.label"}}</a>
{{>editable-checkbox name="system.parierwaffe.aktiv" value=item.system.parierwaffe.aktiv}}
</div>
<div class="row noflex">
<a data-tab="tab3">{{localize "DSA41.bewaffnung.schild.label"}}</a>
{{>editable-checkbox name="system.schild.aktiv" value=item.system.schild.aktiv}}
</div>
<div class="row noflex">
<a data-tab="tab4">{{localize "DSA41.bewaffnung.fernkampfwaffe.label"}}</a>
{{>editable-checkbox name="system.fernkampfwaffe.aktiv" value=item.system.fernkampfwaffe.aktiv}}
</div>
</nav>
<section class="content">
<div class="tab" data-group="primary" data-tab="tab1">
<table>
<tr>
<td>{{localize "DSA41.bewaffnung.nahkampfwaffe.trefferpunkte"}}</td>
<td class="center">
<div class="row">
{{>editable-input type="text" name="system.nahkampfwaffe.basis" value=item.system.nahkampfwaffe.basis placeholder=(localize "DSA41.bewaffnung.nahkampfwaffe.basis")}}
{{>editable-input type="number" name="system.nahkampfwaffe.schwellenwert" value=item.system.nahkampfwaffe.schwellenwert placeholder=(localize "DSA41.bewaffnung.nahkampfwaffe.schwellenwert")}}
{{>editable-input type="number" name="system.nahkampfwaffe.schadensschritte" value=item.system.nahkampfwaffe.schadensschritte placeholder=(localize "DSA41.bewaffnung.nahkampfwaffe.schadensschritte")}}
</div>
</td>
<td>{{localize "DSA41.bewaffnung.nahkampfwaffe.modifikator"}}</td>
<td>
<div class="row">
{{>editable-input type="number" name="system.nahkampfwaffe.modifikator_attacke" value=item.system.nahkampfwaffe.modifikator_attacke placeholder=(localize "DSA41.bewaffnung.nahkampfwaffe.attacke")}}
{{>editable-input type="number" name="system.nahkampfwaffe.modifikator_parade" value=item.system.nahkampfwaffe.modifikator_parade placeholder=(localize "DSA41.bewaffnung.nahkampfwaffe.parade")}}
</div>
</td>
</tr>
<tr>
<td>{{localize "DSA41.bewaffnung.nahkampfwaffe.initiative"}}</td>
<td>{{>editable-input type="number" name="system.nahkampfwaffe.initiative" value=item.system.nahkampfwaffe.initiative}}</td>
<td>{{localize "DSA41.bewaffnung.bruchfaktor"}}</td>
<td>{{>editable-input type="number" name="system.nahkampfwaffe.bruchfaktor" value=item.system.nahkampfwaffe.bruchfaktor}}</td>
</tr>
<tr>
<td>{{localize "DSA41.bewaffnung.nahkampfwaffe.distanzklasse"}}</td>
<td>{{>editable-input type="text" name="system.nahkampfwaffe.distanzklasse" value=item.system.nahkampfwaffe.distanzklasse}}</td>
<td>{{localize "DSA41.bewaffnung.nahkampfwaffe.kampftalente"}}</td>
<td>{{>editable-input type="text" name="system.nahkampfwaffe.kampftalente" value=item.system.nahkampfwaffe.kampftalente}}</td>
</tr>
<tr>
<td>{{localize "DSA41.bewaffnung.nahkampfwaffe.laenge"}}</td>
<td>{{>editable-input type="number" name="system.nahkampfwaffe.laenge" value=item.system.nahkampfwaffe.laenge}}</td>
</tr>
<tr>
<td>{{localize "DSA41.bewaffnung.nahkampfwaffe.zweihaendig"}}</td>
<td>{{>editable-checkbox name="system.nahkampfwaffe.zweihaendig" value=item.system.nahkampfwaffe.zweihaendig}}</td>
<td>{{localize "DSA41.bewaffnung.nahkampfwaffe.werfbar"}}</td>
<td>{{>editable-checkbox name="system.nahkampfwaffe.werfbar" value=item.system.nahkampfwaffe.werfbar}}</td>
</tr>
<tr>
<td>{{localize "DSA41.bewaffnung.nahkampfwaffe.improvisiert"}}</td>
<td>{{>editable-checkbox name="system.nahkampfwaffe.improvisiert" value=item.system.nahkampfwaffe.improvisiert}}</td>
<td>{{localize "DSA41.bewaffnung.nahkampfwaffe.priviligiert"}}</td>
<td>{{>editable-checkbox name="system.nahkampfwaffe.priviligiert" value=item.system.nahkampfwaffe.priviligiert}}</td>
</tr>
</table>
</div>
<div class="tab" data-group="primary" data-tab="tab2">
<table>
<tr>
<td>{{localize "DSA41.bewaffnung.parierwaffe.initiative"}}</td>
<td>{{>editable-input type="number" name="system.parierwaffe.initiative" value=item.system.parierwaffe.initiative}}</td>
<td>{{localize "DSA41.bewaffnung.parierwaffe.modifikator"}}</td>
<td>
<div class="row">
{{>editable-input type="number" name="system.parierwaffe.modifikator_attacke" value=item.system.parierwaffe.modifikator_attacke placeholder=(localize "DSA41.bewaffnung.parierwaffe.attacke")}}
{{>editable-input type="number" name="system.parierwaffe.modifikator_parade" value=item.system.parierwaffe.modifikator_parade placeholder=(localize "DSA41.bewaffnung.parierwaffe.parade")}}
</div>
</td>
</tr>
<tr>
<td>{{localize "DSA41.bewaffnung.bruchfaktor"}}</td>
<td>{{>editable-input type="number" name="system.parierwaffe.bruchfaktor" value=item.system.parierwaffe.bruchfaktor}}</td>
</tr>
</table>
</div>
<div class="tab" data-group="primary" data-tab="tab3">
<table>
<tr>
<td>{{localize "DSA41.bewaffnung.schild.groesse.label"}}</td>
<td>
<select name="system.schild.groesse">
<option value="klein" {{#if (eq item.system.schild.groesse "klein")}} selected {{/if}}>{{localize "DSA41.bewaffnung.schild.groesse.klein"}}</option>
<option value="gross" {{#if (eq item.system.schild.groesse "gross")}} selected {{/if}}>{{localize "DSA41.bewaffnung.schild.groesse.gross"}}</option>
<option value="sehr_gross" {{#if (eq item.system.schild.groesse "sehr_gross")}} selected {{/if}}>{{localize "DSA41.bewaffnung.schild.groesse.sehr_gross"}}</option>
</select>
</td>
<td>{{localize "DSA41.bewaffnung.schild.modifikator"}}</td>
<td>
<div class="row">
{{>editable-input type="number" name="system.schild.modifikator_attacke" value=item.system.schild.modifikator_attacke placeholder=(localize "DSA41.bewaffnung.schild.attacke")}}
{{>editable-input type="number" name="system.schild.modifikator_parade" value=item.system.schild.modifikator_parade placeholder=(localize "DSA41.bewaffnung.schild.parade")}}
</div>
</td>
</tr>
<tr>
<td>{{localize "DSA41.bewaffnung.schild.initiative"}}</td>
<td>{{>editable-input type="number" name="system.schild.initiative" value=item.system.schild.initiative}}</td>
<td>{{localize "DSA41.bewaffnung.bruchfaktor"}}</td>
<td>{{>editable-input type="number" name="system.schild.bruchfaktor" value=item.system.schild.bruchfaktor}}</td>
</tr>
</table>
</div>
<div class="tab" data-group="primary" data-tab="tab4">
<table>
<tr>
<td>{{localize "DSA41.bewaffnung.fernkampfwaffe.trefferpunkte"}}</td>
<td class="center">{{>editable-input type="text" name="system.fernkampfwaffe.basis" value=item.system.fernkampfwaffe.basis}}</td>
<td>{{localize "DSA41.bewaffnung.fernkampfwaffe.laden"}}</td>
<td>{{>editable-input type="number" name="system.fernkampfwaffe.laden" value=item.system.fernkampfwaffe.laden}}</td>
</tr>
<tr>
<td>{{localize "DSA41.bewaffnung.fernkampfwaffe.reichweiten"}}</td>
<td colspan="3">
<div class="row">
{{>editable-input type="number" name="system.fernkampfwaffe.reichweite1" value=item.system.fernkampfwaffe.reichweite1}}
{{>editable-input type="number" name="system.fernkampfwaffe.reichweite2" value=item.system.fernkampfwaffe.reichweite2}}
{{>editable-input type="number" name="system.fernkampfwaffe.reichweite3" value=item.system.fernkampfwaffe.reichweite3}}
{{>editable-input type="number" name="system.fernkampfwaffe.reichweite4" value=item.system.fernkampfwaffe.reichweite4}}
{{>editable-input type="number" name="system.fernkampfwaffe.reichweite5" value=item.system.fernkampfwaffe.reichweite5}}
</div>
</td>
</tr>
<tr>
<td>{{localize "DSA41.bewaffnung.fernkampfwaffe.modifikator"}}</td>
<td colspan="3">
<div class="row">
{{>editable-input type="number" name="system.fernkampfwaffe.modifikator1" value=item.system.fernkampfwaffe.modifikator1}}
{{>editable-input type="number" name="system.fernkampfwaffe.modifikator2" value=item.system.fernkampfwaffe.modifikator2}}
{{>editable-input type="number" name="system.fernkampfwaffe.modifikator3" value=item.system.fernkampfwaffe.modifikator3}}
{{>editable-input type="number" name="system.fernkampfwaffe.modifikator4" value=item.system.fernkampfwaffe.modifikator4}}
{{>editable-input type="number" name="system.fernkampfwaffe.modifikator5" value=item.system.fernkampfwaffe.modifikator5}}
</div>
</td>
</tr>
<tr>
<td>{{localize "DSA41.bewaffnung.fernkampfwaffe.munitionskosten"}}</td>
<td>{{>editable-input type="number" name="system.fernkampfwaffe.munitionskosten" value=item.system.fernkampfwaffe.munitionskosten}}</td>
<td>{{localize "DSA41.bewaffnung.fernkampfwaffe.munitionsgewicht"}}</td>
<td>{{>editable-input type="number" name="system.fernkampfwaffe.munitionsgewicht" value=item.system.fernkampfwaffe.munitionsgewicht}}</td>
</tr>
</table>
</div>
</section>
</form>

View File

@ -1,21 +1,4 @@
{{#*inline "editable-input"}}
<div class="editable-input editable-{{type}}">
{{#if @root.editable}}
<input type="{{type}}" name="{{name}}" value="{{value}}" placeholder="{{placeholder}}">
{{else}}
<div>
{{value}}
{{#unless value}}{{placeholder}}{{/unless}}
</div>
{{/if}}
{{#if placeholder}}
<div class="placeholder">{{placeholder}}</div>
{{/if}}
</div>
{{/inline}}
<form class="item-sheet {{ cssClass }}" autocomplete="off">
<div class="item-sheet {{ cssClass }}" autocomplete="off">
<div class="row">
<img class="item-image" src="{{ item.img }}" title="{{ item.name }}" {{#if editable}}data-edit="img"{{/if}}>
<div class="col">
@ -26,4 +9,4 @@
</div>
</div>
</div>
</form>
</div>

View File

@ -0,0 +1,39 @@
<div class="item-sheet {{ cssClass }}" autocomplete="off">
<div class="row">
<img class="item-image" src="{{ item.img }}" title="{{ item.name }}" {{#if editable}}data-edit="img"{{/if}}>
<div class="col">
{{>editable-input type="text" name="name" value=item.name placeholder=(localize "DSA41.name")}}
<div class="row">
{{>editable-input type="number" name="system.gewicht" value=item.system.gewicht placeholder=(localize "DSA41.weight")}}
{{>editable-input type="number" name="system.preis" value=item.system.preis placeholder=(localize "DSA41.price")}}
</div>
</div>
</div>
<div class="tab active">
<span>{{localize "DSA41.ruestungen.kopf"}}</span>
<div>{{>editable-input type="number" name="system.kopf" value=item.system.kopf}}</div>
<span>{{localize "DSA41.ruestungen.brust"}}</span>
<div>{{>editable-input type="number" name="system.brust" value=item.system.brust}}</div>
<span>{{localize "DSA41.ruestungen.ruecken"}}</span>
<div>{{>editable-input type="number" name="system.ruecken" value=item.system.ruecken}}</div>
<span>{{localize "DSA41.ruestungen.bauch"}}</span>
<div>{{>editable-input type="number" name="system.bauch" value=item.system.bauch}}</div>
<span>{{localize "DSA41.ruestungen.linker_arm"}}</span>
<div>{{>editable-input type="number" name="system.linker_arm" value=item.system.linker_arm}}</div>
<span>{{localize "DSA41.ruestungen.rechter_arm"}}</span>
<div>{{>editable-input type="number" name="system.rechter_arm" value=item.system.rechter_arm}}</div>
<span>{{localize "DSA41.ruestungen.linkes_bein"}}</span>
<div>{{>editable-input type="number" name="system.linkes_bein" value=item.system.linkes_bein}}</div>
<span>{{localize "DSA41.ruestungen.rechtes_bein"}}</span>
<div>{{>editable-input type="number" name="system.rechtes_bein" value=item.system.rechtes_bein}}</div>
<span>{{localize "DSA41.ruestungen.gesamt_ruestungsschutz"}}</span>
<div>{{>editable-input type="number" name="system.gesamt_ruestungsschutz" value=item.system.gesamt_ruestungsschutz}}</div>
<span>{{localize "DSA41.ruestungen.gesamt_behinderung"}}</span>
<div>{{>editable-input type="number" name="system.gesamt_behinderung" value=item.system.gesamt_behinderung}}</div>
</div>
</div>

View File

@ -1,64 +0,0 @@
{{#*inline "editable-input"}}
<div class="editable-input editable-{{type}}">
{{#if @root.editable}}
<input type="{{type}}" name="{{name}}" value="{{value}}" placeholder="{{placeholder}}">
{{else}}
<div>
{{value}}
{{#unless value}}{{placeholder}}{{/unless}}
</div>
{{/if}}
{{#if placeholder}}
<div class="placeholder">{{placeholder}}</div>
{{/if}}
</div>
{{/inline}}
<form class="item-sheet {{ cssClass }}" autocomplete="off">
<div class="row">
<img class="item-image" src="{{ item.img }}" title="{{ item.name }}" {{#if editable}}data-edit="img"{{/if}}>
<div class="col">
{{>editable-input type="text" name="name" value=item.name placeholder=(localize "DSA41.name")}}
<div class="row">
{{>editable-input type="number" name="system.gewicht" value=item.system.gewicht placeholder=(localize "DSA41.weight")}}
{{>editable-input type="number" name="system.preis" value=item.system.preis placeholder=(localize "DSA41.price")}}
</div>
</div>
</div>
<div class="row">
<table>
<tr>
<td>{{localize "DSA41.ruestungen.kopf"}}</td>
<td>{{>editable-input type="number" name="system.kopf" value=item.system.kopf}}</td>
<td>{{localize "DSA41.ruestungen.brust"}}</td>
<td>{{>editable-input type="number" name="system.brust" value=item.system.brust}}</td>
</tr>
<tr>
<td>{{localize "DSA41.ruestungen.ruecken"}}</td>
<td>{{>editable-input type="number" name="system.ruecken" value=item.system.ruecken}}</td>
<td>{{localize "DSA41.ruestungen.bauch"}}</td>
<td>{{>editable-input type="number" name="system.bauch" value=item.system.bauch}}</td>
</tr>
<tr>
<td>{{localize "DSA41.ruestungen.linker_arm"}}</td>
<td>{{>editable-input type="number" name="system.linker_arm" value=item.system.linker_arm}}</td>
<td>{{localize "DSA41.ruestungen.rechter_arm"}}</td>
<td>{{>editable-input type="number" name="system.rechter_arm" value=item.system.rechter_arm}}</td>
</tr>
<tr>
<td>{{localize "DSA41.ruestungen.linkes_bein"}}</td>
<td>{{>editable-input type="number" name="system.linkes_bein" value=item.system.linkes_bein}}</td>
<td>{{localize "DSA41.ruestungen.rechtes_bein"}}</td>
<td>{{>editable-input type="number" name="system.rechtes_bein" value=item.system.rechtes_bein}}</td>
</tr>
<tr>
<td>{{localize "DSA41.ruestungen.gesamt_ruestungsschutz"}}</td>
<td>{{>editable-input type="number" name="system.gesamt_ruestungsschutz" value=item.system.gesamt_ruestungsschutz}}</td>
<td>{{localize "DSA41.ruestungen.gesamt_behinderung"}}</td>
<td>{{>editable-input type="number" name="system.gesamt_behinderung" value=item.system.gesamt_behinderung}}</td>
</tr>
</table>
</div>
</form>

19
src/Tooltips/Attacke.hbs Normal file
View File

@ -0,0 +1,19 @@
<div class="dsa41-tooltip">
<ruby>{{talent_attacke}}<rt>{{localize "DSA41.talente.label"}}</rt></ruby>
{{#if (ne modifikator_attacke 0)}}
+ <ruby>{{modifikator_attacke}}<rt>{{localize "DSA41.bewaffnung.nahkampfwaffe.modifikator"}}</rt></ruby>
{{/if}}
{{#if (ne parierwaffe_attacke 0)}}
+ <ruby>{{parierwaffe_attacke}}<rt>{{localize "DSA41.bewaffnung.parierwaffe.label"}}</rt></ruby>
{{/if}}
{{#if (ne schild_attacke 0)}}
+ <ruby>{{schild_attacke}}<rt>{{localize "DSA41.bewaffnung.schild.label"}}</rt></ruby>
{{/if}}
{{#if (lt tp_kk 0)}}
+ <ruby>{{tp_kk}}<rt>{{localize "DSA41.attributes.long.strength"}}</rt></ruby>
{{/if}}
</div>

View File

@ -0,0 +1,9 @@
<div class="dsa41-tooltip">
<ruby>{{initial}}<rt>{{localize "DSA41.attributes.initial"}}</rt></ruby>
{{#if (ne advancement 0)}}
+ <ruby>{{advancement}}<rt>{{localize "DSA41.attributes.advancement"}}</rt></ruby>
{{/if}}
{{#if (ne modifier 0)}}
+ <ruby>{{modifier}}<rt>{{localize "DSA41.attributes.modifier"}}</rt></ruby>
{{/if}}
</div>

19
src/Tooltips/Parade.hbs Normal file
View File

@ -0,0 +1,19 @@
<div class="dsa41-tooltip">
<ruby>{{talent_parade}}<rt>{{localize "DSA41.talente.label"}}</rt></ruby>
{{#if (ne modifikator_parade 0)}}
+ <ruby>{{modifikator_parade}}<rt>{{localize "DSA41.bewaffnung.nahkampfwaffe.modifikator"}}</rt></ruby>
{{/if}}
{{#if (ne parierwaffe_parade 0)}}
+ <ruby>{{parierwaffe_parade}}<rt>{{localize "DSA41.bewaffnung.parierwaffe.label"}}</rt></ruby>
{{/if}}
{{#if (ne schild_parade 0)}}
+ <ruby>{{schild_parade}}<rt>{{localize "DSA41.bewaffnung.schild.label"}}</rt></ruby>
{{/if}}
{{#if (lt tp_kk 0)}}
+ <ruby>{{tp_kk}}<rt>{{localize "DSA41.attributes.long.strength"}}</rt></ruby>
{{/if}}
</div>

View File

@ -0,0 +1,7 @@
<div class="dsa41-tooltip">
<ruby>{{item.system.nahkampfwaffe.basis}}<rt>{{localize "DSA41.bewaffnung.nahkampfwaffe.basis"}}</rt></ruby>
{{#if (ne tp_kk 0)}}
+ <ruby>{{tp_kk}}<rt>{{localize "DSA41.attributes.long.strength"}}</rt></ruby>
{{/if}}
</div>

View File

@ -271,7 +271,18 @@
"rechtes_bein": "Rechtes Bein",
"gesamt_ruestungsschutz": "Gesamt Rüstungsschutz",
"gesamt_behinderung": "Gesamt Behinderung"
"gesamt_behinderung": "Gesamt Behinderung",
"arm": "Arm",
"bein": "Bein",
"ruestungsschutz": "Rüstungsschutz",
"behinderung": "Behinderung",
"gesamt": "Gesamt",
"links": "Links",
"rechts": "Rechts"
},
"bewaffnung": {

View File

@ -1,168 +1,305 @@
.row {
.DSA41 {
font-size: 14px;
/* Change from FoundryVTT's default of 'none' to 'auto' to allow checkboxes in the nav bar */
& .tabs > [data-tab] > * {
pointer-events: auto;
}
/* Allow application content to be scrolled */
& .window-content {
overflow-y: scroll;
}
& [data-action] {
cursor: pointer;
&:hover {
transform: scale(1.05);
}
}
& .small {
font-size: 0.75em;
}
& .left {
text-align: left;
justify-content: left;
justify-self: left;
}
& .right {
text-align: right;
justify-content: right;
justify-self: right;
}
& .center {
text-align: center;
justify-content: center;
align-content: center;
align-items: center;
}
& .row {
display: flex;
flex-direction: row;
flex: 1;
}
.col {
& .col {
display: flex;
flex-direction: column;
flex: 1;
}
.noflex {
& .noflex {
flex: 0;
}
.wrap {
flex-wrap: wrap;
& .subgrid {
display: grid;
grid-template-rows: subgrid;
grid-template-columns: subgrid;
}
.center {
text-align: center;
justify-content: center;
align-content: center;
& .subgrid-columns {
display: grid;
grid-template-columns: subgrid;
}
& .subgrid-rows {
display: grid;
grid-template-rows: subgrid;
}
& .grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
& .grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
& .grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
& .grid5 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
& .grid6 { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
& .grid7 { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
& .grid8 { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); }
& .grid9 { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); }
.editable-input {
& .colspan2 { grid-column: span 2; }
& .colspan3 { grid-column: span 3; }
& .colspan4 { grid-column: span 4; }
& .colspan5 { grid-column: span 5; }
& .colspan6 { grid-column: span 6; }
& .colspan7 { grid-column: span 7; }
& .colspan8 { grid-column: span 8; }
& .colspan9 { grid-column: span 9; }
& .colspan-all { grid-column: 1 / -1; }
& .rowspan2 { grid-row: span 2; }
& .rowspan3 { grid-row: span 3; }
& .rowspan4 { grid-row: span 4; }
& .rowspan5 { grid-row: span 5; }
& .rowspan6 { grid-row: span 6; }
& .rowspan7 { grid-row: span 7; }
& .rowspan8 { grid-row: span 8; }
& .rowspan9 { grid-row: span 9; }
& .rowspan-all { grid-row: 1 / -1; }
& .editable-input {
flex: 1;
padding: 0px 3px;
}
.editable-input input {
& input {
border: none;
}
.editable-number {
&.editable-number {
text-align: center;
}
.placeholder {
& .placeholder {
font-size: 0.8em;
border-top: 1px solid;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.sheet .die {
width: 48px;
height: 48px;
line-height: 48px;
background-color: #000;
mask-image: url("../src/Assets/d20.svg");
mask-size: contain;
text-align: center;
color: #fff;
}
.sheet .die-courage { background-color: #b22319; }
.sheet .die-cleverness { background-color: #8158a3; }
.sheet .die-intuition { background-color: #388834; }
.sheet .die-charisma { background-color: #0c0c0c; }
.sheet .die-dexterity { background-color: #d4b366; }
.sheet .die-agility { background-color: #678ec3; }
.sheet .die-constitution { background-color: #a3a3a3; }
.sheet .die-strength { background-color: #d5a877; }
.sheet .die-attacke { background-color: #b22319; }
.sheet .die-parade { background-color: #388834; }
.sheet .die-trefferpunkte { background-color: #0c0c0c; }
.sheet .item-open,
.sheet .item-delete,
.sheet .roll {
cursor: pointer;
}
.sheet .item-open:hover,
.sheet .item-delete:hover,
.sheet .roll:hover {
transform: scale(1.05);
}
.character-image {
& .character-image {
width: 115px;
height: 115px;
}
.item-image {
& .item-image {
width: 80px;
height: 80px;
}
.list-header {
padding: 0.5rem;
& .die {
display: inline-grid;
text-align: center;
align-items: center;
color: #fff;
width: 3.5em;
height: 3.5em;
& > * {
grid-row: 1;
grid-column: 1;
}
.list {
box-shadow: 0 0 6px rgba(0, 0, 0, 0.45);
&.die-courage { fill: #b22319; }
&.die-cleverness { fill: #8158a3; }
&.die-intuition { fill: #388834; }
&.die-charisma { fill: #0c0c0c; }
&.die-dexterity { fill: #d4b366; }
&.die-agility { fill: #678ec3; }
&.die-constitution { fill: #a3a3a3; }
&.die-strength { fill: #d5a877; }
&.die-attacke { fill: #b22319; }
&.die-parade { fill: #388834; }
&.die-trefferpunkte { fill: #0c0c0c; }
}
.list-item {
padding: 0.25rem;
border-bottom: 1px dotted;
}
.list-item:last-child {
border: none;
}
.item-name {
gap: 0.5rem;
flex: 0 1 auto;
}
.item-sub {
font-size: 0.625rem;
}
.inventar {
gap: 16px;
}
.actor-sheet fieldset {
width: 100%;
}
.actor-sheet table {
border: none;
background: none;
table-layout: fixed;
}
.actor-sheet .item-image {
width: 32px;
height: 32px;
}
.actor-sheet .tabs,
.item-sheet .tabs {
padding: 6px;
margin-top: 6px;
& .tabs {
padding: .5rem;
margin-top: .5rem;
margin-bottom: .5rem;
border-top: 1px solid;
border-bottom: 1px solid;
& > * {
align-items: center;
}
.actor-sheet .tabs a,
.item-sheet .tabs a {
line-height: 18px;
}
.actor-sheet .tabs a.active,
.item-sheet .tabs a.active {
& .active {
text-decoration: underline;
}
.item-sheet .tabs input[type="checkbox"] {
width: 12px;
height: 12px;
}
& .tab.active {
display: grid;
gap: 0.5rem;
}
& .list {
display: grid;
background: #252830;
box-shadow: 0 0 6px rgba(0, 0, 0, 0.45);
& .item-image {
width: 40px;
height: 40px;
}
& .item-name {
gap: 0.5rem;
}
}
& .list-header {
display: grid;
grid-column: 1 / -1;
grid-template-rows: subgrid;
grid-template-columns: subgrid;
align-items: center;
padding: 0.5rem;
border-radius: 5px 5px 0px 0px;
background: linear-gradient(90deg, rgb(36, 133, 44) 0%, rgb(0, 79, 7) 40%, rgb(0, 51, 5) 100%);
}
& .list-item {
display: grid;
grid-column: 1 / -1;
grid-template-rows: subgrid;
grid-template-columns: subgrid;
align-items: center;
padding: 0.25rem;
border-bottom: 1px dotted;
&:last-child {
border: none;
}
}
& [data-application-part="Bewaffnung"] {
& .tab {
grid-template-columns: minmax(0, max-content) minmax(0, 1fr) minmax(0, max-content) minmax(0, 1fr);
align-items: center;
}
}
& [data-application-part="Ruestung"] {
& .tab {
grid-template-columns: minmax(0, max-content) minmax(0, 1fr) minmax(0, max-content) minmax(0, 1fr);
align-items: center;
}
}
& [data-application-part="ActorSheet"] {
& .tab {
&[data-tab="tab1"] {
& .Eigenschaften {
display: grid;
grid-template-columns: minmax(0, max-content) repeat(8, minmax(0, 1fr));
align-items: center;
gap: 0.5rem;
}
& .Basiswerte {
display: grid;
grid-template-columns: repeat(4, minmax(0, 1fr));
}
}
&[data-tab="tab2"] {
& .Kampftalente {
display: grid;
grid-template-columns: minmax(0, max-content) repeat(5, minmax(0, 1fr));
align-items: center;
gap: 0.5rem;
}
& .Talente {
display: grid;
grid-template-columns: minmax(0, max-content) repeat(2, minmax(0, 1fr));
align-items: center;
gap: 0.5rem;
}
}
&[data-tab="tab3"] {
grid-template-columns: minmax(min-content, max-content) auto minmax(min-content, max-content) min-content;
& > * {
grid-column: 1 / -1;
}
}
&[data-tab="tab4"] {
& .Bewaffnung {
grid-template-columns: minmax(0, max-content) repeat(3, minmax(0, auto));
& .die {
font-size: 12px;
}
}
& .Ruestung {
grid-template-columns: 2fr repeat(8, 1fr) repeat(2, 1.5fr);
text-align: center;
}
}
}
}
}

View File

@ -1,3 +1,9 @@
const { TypeDataModel } = foundry.abstract;
const { SchemaField, NumberField, StringField, BooleanField } = foundry.data.fields;
const { ActorSheetV2, ItemSheetV2 } = foundry.applications.sheets;
const { HandlebarsApplicationMixin } = foundry.applications.api;
const { OperatorTerm, NumericTerm } = foundry.dice.terms;
Hooks.once("init", function() {
CONFIG.Combat.initiative.formula = "1d6 + @computed.ini_basiswert[INI-Basiswert]";
@ -8,7 +14,7 @@ Hooks.once("init", function() {
CONFIG.Item.dataModels.Ruestung = DSA41_RuestungData;
CONFIG.Item.dataModels.Bewaffnung = DSA41_BewaffnungData;
//DocumentSheetConfig.unregisterSheet(Actor, "core", ActorSheet);
DocumentSheetConfig.unregisterSheet(Actor, "core", ActorSheet);
DocumentSheetConfig.registerSheet(Actor, "dsa41", DSA41_ActorSheet, {
makeDefault: true,
types: [
@ -16,8 +22,8 @@ Hooks.once("init", function() {
]
});
//DocumentSheetConfig.unregisterSheet(Item, "core", ItemSheet);
DocumentSheetConfig.registerSheet(Item, "dsa41", DSA41_ItemSheet, {
DocumentSheetConfig.unregisterSheet(Item, "core", ItemSheet);
DocumentSheetConfig.registerSheet(Item, "dsa41", DSA41_ItemSheetV2, {
makeDefault: true,
types: [
"Gegenstand",
@ -25,11 +31,67 @@ Hooks.once("init", function() {
"Bewaffnung",
]
});
loadTemplates({
"editable-input": "systems/dsa-4th-edition/src/EditableInput.hbs",
"attribute_tooltip": "systems/dsa-4th-edition/src/Tooltips/Attribute.hbs",
"attacke_tooltip": "systems/dsa-4th-edition/src/Tooltips/Attacke.hbs",
"parade_tooltip": "systems/dsa-4th-edition/src/Tooltips/Parade.hbs",
"trefferpunkte_tooltip": "systems/dsa-4th-edition/src/Tooltips/Trefferpunkte.hbs",
});
});
const { SchemaField, NumberField, StringField, BooleanField } = foundry.data.fields;
function get_minified_formula(formula, data) {
const terms = Roll.simplifyTerms(Roll.parse(formula, data));
let output = [];
class AttributeField extends foundry.data.fields.SchemaField {
let is_combinable = true;
for (let i = 0; i < terms.length; i++) {
const term = terms[i];
if (is_combinable && term instanceof NumericTerm) {
for (let j = i + 1; j < terms.length - 1; j += 2) {
let operator = terms[j];
let next = terms[j + 1];
if (!(operator instanceof OperatorTerm && next instanceof NumericTerm))
break;
switch (operator.operator) {
case "+": {
term.number += next.number;
i += 2;
} break;
case "-": {
term.number -= next.number;
i += 2;
} break;
default:
break;
}
}
is_combinable = false;
} else {
if (term instanceof OperatorTerm && (term.operator == "+" || term.operator == "-")) {
is_combinable = true;
} else {
is_combinable = false;
}
}
output.push(term);
}
output = Roll.simplifyTerms(output);
return Roll.getFormula(output);
}
class AttributeField extends SchemaField {
constructor() {
return super({
initial: new NumberField({ integer: true, initial: 8, min: 0 }),
@ -39,7 +101,7 @@ class AttributeField extends foundry.data.fields.SchemaField {
}
}
class CombatTalentField extends foundry.data.fields.SchemaField {
class CombatTalentField extends SchemaField {
constructor() {
return super({
talentwert: new NumberField({ integer: true, initial: 0 }),
@ -53,7 +115,7 @@ class DSA41_CharacterDocument extends Actor {
}
class DSA41_CharacterData extends foundry.abstract.TypeDataModel {
class DSA41_CharacterData extends TypeDataModel {
static defineSchema() {
return {
race: new StringField(),
@ -231,34 +293,66 @@ class DSA41_CharacterData extends foundry.abstract.TypeDataModel {
}
}
prepareDerivedData() {
async prepareDerivedData() {
super.prepareDerivedData();
this.computed = {
attributes: {
without_modifiers: {},
with_modifiers: {},
},
attributes: {},
attributes_without_modifiers: {},
kampf: {
talente: {},
waffen: {},
ruestungen: {},
ruestungen_gesamt: {
kopf: 0,
brust: 0,
ruecken: 0,
bauch: 0,
linker_arm: 0,
rechter_arm: 0,
linkes_bein: 0,
rechtes_bein: 0,
gesamt_ruestungsschutz: 0.0,
gesamt_behinderung: 0.0,
},
},
};
for (const [attribute, values] of Object.entries(this.attributes)) {
this.computed.attributes.without_modifiers[attribute] = values.initial + values.advancement;
this.computed.attributes.with_modifiers [attribute] = values.initial + values.advancement + values.modifier;
this.computed.attributes[attribute] = values.initial + values.advancement + values.modifier;
this.computed.attributes_without_modifiers[attribute] = values.initial + values.advancement;
}
this.computed.max_lebenspunkte = Math.round((this.computed.attributes.without_modifiers.constitution + this.computed.attributes.without_modifiers.constitution + this.computed.attributes.without_modifiers.strength) / 2);
this.computed.max_ausdauer = Math.round((this.computed.attributes.without_modifiers.courage + this.computed.attributes.without_modifiers.constitution + this.computed.attributes.without_modifiers.agility) / 2);
this.computed.max_atralenergie = Math.round((this.computed.attributes.without_modifiers.courage + this.computed.attributes.without_modifiers.intuition + this.computed.attributes.without_modifiers.charisma) / 2);
this.computed.max_lebenspunkte = Math.round((this.computed.attributes_without_modifiers.constitution + this.computed.attributes_without_modifiers.constitution + this.computed.attributes_without_modifiers.strength) / 2);
this.computed.max_ausdauer = Math.round((this.computed.attributes_without_modifiers.courage + this.computed.attributes_without_modifiers.constitution + this.computed.attributes_without_modifiers.agility) / 2);
this.computed.max_atralenergie = Math.round((this.computed.attributes_without_modifiers.courage + this.computed.attributes_without_modifiers.intuition + this.computed.attributes_without_modifiers.charisma) / 2);
this.computed.magieresistenz = Math.round((this.computed.attributes.without_modifiers.courage + this.computed.attributes.without_modifiers.cleverness + this.computed.attributes.without_modifiers.constitution) / 5);
this.computed.ini_basiswert = Math.round((this.computed.attributes.without_modifiers.courage + this.computed.attributes.without_modifiers.courage + this.computed.attributes.without_modifiers.intuition + this.computed.attributes.without_modifiers.agility) / 5);
this.computed.at_basiswert = Math.round((this.computed.attributes.without_modifiers.courage + this.computed.attributes.without_modifiers.agility + this.computed.attributes.without_modifiers.strength) / 5);;
this.computed.pa_basiswert = Math.round((this.computed.attributes.without_modifiers.intuition + this.computed.attributes.without_modifiers.agility + this.computed.attributes.without_modifiers.strength) / 5);;
this.computed.fk_basiswert = Math.round((this.computed.attributes.without_modifiers.intuition + this.computed.attributes.without_modifiers.dexterity + this.computed.attributes.without_modifiers.strength) / 5);;
this.computed.magieresistenz = Math.round((this.computed.attributes_without_modifiers.courage + this.computed.attributes_without_modifiers.cleverness + this.computed.attributes_without_modifiers.constitution) / 5);
this.computed.ini_basiswert = Math.round((this.computed.attributes_without_modifiers.courage + this.computed.attributes_without_modifiers.courage + this.computed.attributes_without_modifiers.intuition + this.computed.attributes_without_modifiers.agility) / 5);
this.computed.at_basiswert = Math.round((this.computed.attributes_without_modifiers.courage + this.computed.attributes_without_modifiers.agility + this.computed.attributes_without_modifiers.strength) / 5);;
this.computed.pa_basiswert = Math.round((this.computed.attributes_without_modifiers.intuition + this.computed.attributes_without_modifiers.agility + this.computed.attributes_without_modifiers.strength) / 5);;
this.computed.fk_basiswert = Math.round((this.computed.attributes_without_modifiers.intuition + this.computed.attributes_without_modifiers.dexterity + this.computed.attributes_without_modifiers.strength) / 5);;
const equipped_ruestungen = this.parent.items.filter((x) => x.type === "Ruestung");
for (const item of equipped_ruestungen) {
this.computed.kampf.ruestungen[item._id] = { item: item };
this.computed.kampf.ruestungen_gesamt.kopf += item.system.kopf;
this.computed.kampf.ruestungen_gesamt.brust += item.system.brust;
this.computed.kampf.ruestungen_gesamt.ruecken += item.system.ruecken;
this.computed.kampf.ruestungen_gesamt.bauch += item.system.bauch;
this.computed.kampf.ruestungen_gesamt.linker_arm += item.system.linker_arm;
this.computed.kampf.ruestungen_gesamt.rechter_arm += item.system.rechter_arm;
this.computed.kampf.ruestungen_gesamt.linkes_bein += item.system.linkes_bein;
this.computed.kampf.ruestungen_gesamt.rechtes_bein += item.system.rechtes_bein;
this.computed.kampf.ruestungen_gesamt.gesamt_ruestungsschutz += item.system.gesamt_ruestungsschutz;
this.computed.kampf.ruestungen_gesamt.gesamt_behinderung += item.system.gesamt_behinderung;
}
for (let [key, value] of Object.entries(this.computed.kampf.ruestungen_gesamt)) {
this.computed.kampf.ruestungen_gesamt[key] = Math.round(value);
}
for(const [name, values] of Object.entries(this.kampf_talente)) {
this.computed.kampf.talente[name] = {};
@ -266,52 +360,73 @@ class DSA41_CharacterData extends foundry.abstract.TypeDataModel {
this.computed.kampf.talente[name].parade = this.computed.pa_basiswert + values.parade;
}
let equipped_bewaffnung = this.parent.items.filter((x) => x.type === "Bewaffnung");
let equipped_nahkampfwaffen = equipped_bewaffnung.filter((x) => x.system.nahkampfwaffe.aktiv);
let equipped_parierwaffen = equipped_bewaffnung.filter((x) => x.system.parierwaffe.aktiv);
let equipped_schilde = equipped_bewaffnung.filter((x) => x.system.schild.aktiv);
let equipped_fernkampfwaffen = equipped_bewaffnung.filter((x) => x.system.fernkampfwaffe.aktiv);
const equipped_bewaffnung = this.parent.items.filter((x) => x.type === "Bewaffnung");
const equipped_nahkampfwaffen = equipped_bewaffnung.filter((x) => x.system.nahkampfwaffe.aktiv);
const equipped_parierwaffen = equipped_bewaffnung.filter((x) => x.system.parierwaffe.aktiv);
const equipped_schilde = equipped_bewaffnung.filter((x) => x.system.schild.aktiv);
const equipped_fernkampfwaffen = equipped_bewaffnung.filter((x) => x.system.fernkampfwaffe.aktiv);
for(const item of equipped_nahkampfwaffen) {
this.computed.kampf.waffen[item._id] = {};
this.computed.kampf.waffen[item._id].item = item;
if (item.system.nahkampfwaffe.aktiv) {
let computed = this.computed.kampf.waffen[item._id] = {
item: item,
attacke: 0,
parade: 0,
trefferpunkte: "",
trefferpunkte_display: "",
talent_attacke: 0,
talent_parade: 0,
modifikator_attacke: 0,
modifikator_parade: 0,
tp_kk: 0,
parierwaffe_attacke: 0,
parierwaffe_parade: 0,
schild_attacke: 0,
schild_parade: 0,
};
const talent = item.system.nahkampfwaffe.kampftalente;
this.computed.kampf.waffen[item._id].attacke = this.computed.kampf.talente[talent].attacke + item.system.nahkampfwaffe.modifikator_attacke;
this.computed.kampf.waffen[item._id].parade = this.computed.kampf.talente[talent].parade + item.system.nahkampfwaffe.modifikator_attacke;
computed.talent_attacke = this.computed.kampf.talente[talent].attacke;
computed.talent_parade = this.computed.kampf.talente[talent].parade;
const tp_kk = Math.trunc((this.computed.attributes.with_modifiers.strength - item.system.nahkampfwaffe.schwellenwert) / item.system.nahkampfwaffe.schadensschritte);
computed.modifikator_attacke = item.system.nahkampfwaffe.modifikator_attacke;
computed.modifikator_parade = item.system.nahkampfwaffe.modifikator_parade;
if (tp_kk >= 0) {
this.computed.kampf.waffen[item._id].trefferpunkte = item.system.nahkampfwaffe.basis + " + " + tp_kk;
} else {
this.computed.kampf.waffen[item._id].trefferpunkte = item.system.nahkampfwaffe.basis + "" + tp_kk;
this.computed.kampf.waffen[item._id].attacke += tp_kk;
this.computed.kampf.waffen[item._id].parade += tp_kk;
if (item.system.nahkampfwaffe.schadensschritte != 0) {
computed.tp_kk = Math.trunc((this.computed.attributes.strength - item.system.nahkampfwaffe.schwellenwert) / item.system.nahkampfwaffe.schadensschritte);
}
for (const parierwaffe of equipped_parierwaffen) {
if (parierwaffe._id === item._id) continue;
this.computed.kampf.waffen[item._id].attacke += parierwaffe.system.parierwaffe.modifikator_attacke;
this.computed.kampf.waffen[item._id].parade += parierwaffe.system.parierwaffe.modifikator_parade;
computed.parierwaffe_attacke += parierwaffe.system.parierwaffe.modifikator_attacke;
computed.parierwaffe_parade += parierwaffe.system.parierwaffe.modifikator_parade;
}
for (const schild of equipped_schilde) {
if (schild._id === item._id) continue;
this.computed.kampf.waffen[item._id].attacke += schild.system.schild.modifikator_attacke;
this.computed.kampf.waffen[item._id].parade += schild.system.schild.modifikator_parade;
computed.schild_attacke += schild.system.schild.modifikator_attacke;
computed.schild_parade += schild.system.schild.modifikator_parade;
}
computed.attacke = computed.talent_attacke + computed.modifikator_attacke + computed.parierwaffe_attacke + computed.schild_attacke + Math.min(computed.tp_kk, 0);
computed.parade = computed.talent_parade + computed.modifikator_parade + computed.parierwaffe_parade + computed.schild_parade + Math.min(computed.tp_kk, 0);
computed.trefferpunkte = get_minified_formula(item.system.nahkampfwaffe.basis + (computed.tp_kk != 0 ? " + " + computed.tp_kk : ""));
computed.trefferpunkte_display = computed.trefferpunkte.replace(/[\+\-]/, (op) => "<br>" + op);
}
}
}
}
class DSA41_GegenstandData extends foundry.abstract.TypeDataModel {
class DSA41_GegenstandData extends TypeDataModel {
static defineSchema() {
return {
gewicht: new NumberField({ integer: false, initial: 0, min: 0 }),
@ -320,7 +435,7 @@ class DSA41_GegenstandData extends foundry.abstract.TypeDataModel {
}
}
class DSA41_RuestungData extends foundry.abstract.TypeDataModel {
class DSA41_RuestungData extends TypeDataModel {
static defineSchema() {
return {
gewicht: new NumberField({ integer: false, initial: 0, min: 0 }),
@ -341,7 +456,7 @@ class DSA41_RuestungData extends foundry.abstract.TypeDataModel {
}
}
class DSA41_BewaffnungData extends foundry.abstract.TypeDataModel {
class DSA41_BewaffnungData extends TypeDataModel {
static defineSchema() {
return {
gewicht: new NumberField({ integer: false, initial: 0, min: 0 }),
@ -420,59 +535,96 @@ class DSA41_BewaffnungData extends foundry.abstract.TypeDataModel {
}
}
class DSA41_ActorSheet extends ActorSheet {
static get defaultOptions() {
return foundry.utils.mergeObject(super.defaultOptions, {
tabs: [{ navSelector: ".tabs", contentSelector: ".content", initial: "tab1" }],
});
function DSA41_ApplicationMixin(BaseApplication) {
class DSA41_Application extends HandlebarsApplicationMixin(BaseApplication) {
static DEFAULT_OPTIONS= {
classes: [ "DSA41" ],
window: { resizable: true },
form: { submitOnChange: true },
};
async _prepareContext(options) {
return this;
}
}
get template() {
return "systems/dsa-4th-edition/src/ActorSheet.html";
return DSA41_Application;
}
activateListeners(html) {
super.activateListeners(html);
class DSA41_ActorSheet extends DSA41_ApplicationMixin(ActorSheetV2) {
static PARTS = {
ActorSheet: { template: "systems/dsa-4th-edition/src/ActorSheet.hbs" },
};
html.on("click", ".item-open", async (event) => {
const item_id = event.currentTarget.closest("[data-item-id]").dataset.itemId;
const item = this.object.items.get(item_id);
item.sheet.render(true)
});
html.on("click", ".item-delete", async (event) => {
const item_id = event.currentTarget.closest("[data-item-id]").dataset.itemId;
const item = this.object.items.get(item_id);
item.delete();
});
html.on("click", ".roll", async (event) => {
const roll_formula = event.currentTarget.closest("[data-roll]").dataset.roll;
const roll_type = event.currentTarget.closest("[data-roll]").dataset.rollType;
const success_value = event.currentTarget.closest("[data-roll]").dataset.successValue;
static DEFAULT_OPTIONS = {
position: { width: "800", height: "650" },
actions: {
"roll": async function(event, target) {
const roll_formula = event.target.closest("[data-roll]").dataset.roll;
const roll_type = event.target.closest("[data-roll-type]").dataset.rollType;
const success_value = event.target.closest("[data-success-value]")?.dataset.successValue;
let flavor = game.i18n.localize("DSA41.roll_types." + roll_type);
if (typeof success_value !== 'undefined') {
flavor += " <= " + success_value;
}
let roll = new Roll(roll_formula, this.object.system);
let roll = new Roll(roll_formula, this.document.system);
roll.toMessage({
speaker: ChatMessage.getSpeaker({ actor: this.object }),
speaker: ChatMessage.getSpeaker({ actor: this.document }),
flavor: flavor,
});
});
}
}
},
class DSA41_ItemSheet extends ItemSheet {
static get defaultOptions() {
return foundry.utils.mergeObject(super.defaultOptions, {
tabs: [{ navSelector: ".tabs", contentSelector: ".content", initial: "tab1" }],
"item-open": async function(event, target) {
const item_id = event.target.closest("[data-item-id]").dataset.itemId;
const item = this.document.items.get(item_id);
item.sheet.render(true)
},
"item-delete": async function(event, target) {
const item_id = event.target.closest("[data-item-id]").dataset.itemId;
const item = this.document.items.get(item_id);
item.delete();
},
},
};
_onFirstRender(context, options) {
super._onFirstRender(context, options);
const content = this.element.querySelector(".window-content");
content.addEventListener("drop", async (event) => {
event.preventDefault();
const data = TextEditor.getDragEventData(event);
switch (data.type) {
case "Item": {
const item = await Item.implementation.fromDropData(data);
await this.actor.createEmbeddedDocuments("Item", [item.toObject()]);
} break;
}
});
}
get template() {
return "systems/dsa-4th-edition/src/ItemSheets/" + this.item.type + ".html";
tabGroups = { primary: "tab1" };
}
class DSA41_ItemSheetV2 extends DSA41_ApplicationMixin(ItemSheetV2) {
static PARTS = {
Bewaffnung: { template: "systems/dsa-4th-edition/src/ItemSheets/Bewaffnung.hbs" },
Gegenstand: { template: "systems/dsa-4th-edition/src/ItemSheets/Gegenstand.hbs" },
Ruestung: { template: "systems/dsa-4th-edition/src/ItemSheets/Ruestung.hbs" },
};
static DEFAULT_OPTIONS = {
position: { width: "600", height: "auto" },
};
tabGroups = { primary: "tab1" };
_configureRenderOptions(options) {
super._configureRenderOptions(options);
options.parts = [ this.options.document.type ];
}
}

View File

@ -18,6 +18,11 @@
}
],
"compatibility": {
"minimum": "12",
"verified": "12"
},
"version": "0.1.5",
"manifest": "https://gitea.ammerhai.com/foundry/dsa-4th-edition/releases/download/latest/system.json",
"download": "https://gitea.ammerhai.com/foundry/dsa-4th-edition/releases/download/test2/dsa-4th-edition.zip"