Compare commits

...

2 Commits

Author SHA1 Message Date
Sven Balzer
00fb647f0f add basic attribute and combat rolls 2024-10-17 19:59:31 +02:00
Sven Balzer
e2ffb67d35 add Inventar and combat system base values 2024-10-12 16:58:13 +02:00
6 changed files with 589 additions and 120 deletions

View File

@ -15,14 +15,31 @@
</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">
<div class="center">{{localize (concat "DSA41.attributes.short." type)}}</div>
<div class="die die-{{type}}">{{lookup @root.actor.system.computed type}}</div>
<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}}
@ -37,87 +54,241 @@
<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}}
{{>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>
<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>
<div class="row">
<fieldset>
<legend>{{localize "DSA41.talente.kampf_talente.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">0</td>
<td class="center">0</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>
<nav class="tabs" data-group="primary">
<div class="row noflex">
<a data-tab="tab1">{{localize "DSA41.character.eigenschaften"}}</a>
</div>
{{/each}}
<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

@ -85,7 +85,7 @@
<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.nahkampfwaffe.bruchfaktor"}}</td>
<td>{{localize "DSA41.bewaffnung.bruchfaktor"}}</td>
<td>{{>editable-input type="number" name="system.nahkampfwaffe.bruchfaktor" value=item.system.nahkampfwaffe.bruchfaktor}}</td>
</tr>
<tr>
@ -127,7 +127,7 @@
</td>
</tr>
<tr>
<td>{{localize "DSA41.bewaffnung.parierwaffe.bruchfaktor"}}</td>
<td>{{localize "DSA41.bewaffnung.bruchfaktor"}}</td>
<td>{{>editable-input type="number" name="system.parierwaffe.bruchfaktor" value=item.system.parierwaffe.bruchfaktor}}</td>
</tr>
</table>
@ -155,7 +155,7 @@
<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.schild.bruchfaktor"}}</td>
<td>{{localize "DSA41.bewaffnung.bruchfaktor"}}</td>
<td>{{>editable-input type="number" name="system.schild.bruchfaktor" value=item.system.schild.bruchfaktor}}</td>
</tr>
</table>

View File

@ -14,6 +14,28 @@
"profession": "Profession",
"weight": "Gewicht",
"price": "Preis",
"roll_types": {
"courage": "Mut",
"cleverness": "Klugheit",
"intuition": "Intuition",
"charisma": "Charisma",
"dexterity": "Fingerfertigkeit",
"agility": "Gewandheit",
"constitution": "Konstitution",
"strength": "Körperkraft",
"attacke": "Attacke",
"parade": "Parade",
"trefferpunkte": "Trefferpunkte"
},
"character": {
"eigenschaften": "Eigenschaften",
"talente": "Talente",
"inventar": "Inventar",
"kampf": "Kampf"
},
"attributes": {
"label": "Eigenschaften",
@ -57,8 +79,33 @@
"label_parade_total": "Parade",
"name": {
"anderthalbhaender": "Anderthalbhänder",
"armbrust": "Armbrust"
"anderthalbhaender": "Anderthalbhänder",
"armbrust": "Armbrust",
"belagerungswaffen": "Belagerungswaffen",
"blasrohr": "Blasrohr",
"bogen": "Bogen",
"diskus": "Diskus",
"dolche": "Dolche",
"fechtwaffen": "Fechtwaffen",
"hiebwaffen": "Hiebwaffen",
"infanteriewaffen": "Infanteriewaffen",
"kettenstaebe": "Kettenstäbe",
"kettenwaffen": "Kettenwaffen",
"lanzenreiten": "Lanzenreiten",
"peitsche": "Peitsche",
"raufen": "Raufen",
"ringen": "Ringen",
"saebel": "Saebel",
"schleuder": "Schleuder",
"schwerter": "Schwerter",
"speere": "Speere",
"staebe": "Stäbe",
"wurfbeile": "Wurfbeile",
"wurfmesser": "Wurfmesser",
"wurfspeere": "Wurfspeere",
"zweihandflegel": "Zweihandflegel",
"zweihand_hiebwaffen": "Zweihand-Hiebwaffen",
"zweihandschwerter": "Zweihandschwerter/-säbel"
}
},
@ -122,8 +169,29 @@
"label": "Wissenstalente",
"name": {
"anatomie": "Anatomie",
"baukunst": "Baukunst"
"anatomie": "Anatomie",
"baukunst": "Baukunst",
"brett_kartenspiel": "Brett-/Kartenspiel",
"geographie": "Geographie",
"geschichtswissen": "Geschichtswissen",
"gesteinskunde": "Gesteinskunde",
"goetter_kulte": "Götter/Kulte",
"heraldik": "Heraldik",
"huettenkunde": "Hüttenkunde",
"kriegskunst": "Kriegskunst",
"kryptographie": "Kryptographie",
"magiekunde": "Magiekunde",
"mechanik": "Mechanik",
"pflanzenkunde": "Pflanzenkunde",
"philosophie": "Philosophie",
"rechnen": "Rechnen",
"rechtskunde": "Rechtskunde",
"sagen_legenden": "Sagen/Legenden",
"schaetzen": "Schätzen",
"sprachenkunde": "Sprachenkunde",
"staatskunst": "Staatskunst",
"sternkunde": "Sternenkunde",
"tierkunde": "Tierkunde"
}
},
@ -141,8 +209,53 @@
"label": "Handwerkstalente",
"name": {
"abrichten": "Abrichten",
"ackerbau": "Ackerbau"
"abrichten": "Abrichten",
"ackerbau": "Ackerbau",
"alchimie": "Alchimie",
"bergbau": "Bergbau",
"bogenbau": "Bogenbau",
"boote_fahren": "Boote Fahren",
"brauer": "Brauer",
"drucker": "Drucker",
"fahrzeug_lenken": "Fahrzeug Lenken",
"falschspiel": "Falschspiel",
"feinmechanik": "Feinmechanik",
"feuersteinbearbeitung": "Feuersteinbearbeitung",
"fleischer": "Fleischer",
"gerber": "Gerber/Kürschner",
"glaskunst": "Glaskunst",
"grobschmied": "Grobschmied",
"handel": "Handel",
"hauswirtschaft": "Hauswirtschaft",
"heilkunde_gift": "Heilkunde Gift",
"heilkunde_krankheiten": "Heilkunde Krankheiten",
"heilkunde_seele": "Heilkunde Seele",
"heilkunde_wunden": "Heilkunde Wunden",
"holzbearbeitung": "Holzbearbeitung",
"instrumentenbauer": "Instrumentenbauer",
"kartographie": "Kartographie",
"kochen": "Kochen",
"kristallzucht": "Kristallzucht",
"lederarbeiten": "Lederarbeiten",
"malen_zeichnen": "Malen/Zeichnen",
"maurer": "Maurer",
"metallguss": "Metallguss",
"musizieren": "Musizieren",
"schloesser_knacken": "Schlösser Knacken",
"schnapps_brennen": "Schnapps Brennen",
"schneidern": "Schneidern",
"seefahrt": "Seefahrt",
"seiler": "Seiler",
"steinmetz": "Steinmetz",
"juwelier": "Steinschneider/Juwelier",
"stellmacher": "Stellmacher",
"stoffe_faerben": "Stoffe Faerben",
"taetowieren": "Tätowieren",
"toepfern": "Töpfern",
"viehzucht": "Viehzucht",
"webkunst": "Webkunst",
"winzer": "Winzer",
"zimmermann": "Zimmermann"
}
}
},
@ -162,6 +275,8 @@
},
"bewaffnung": {
"bruchfaktor": "Bruchfaktor",
"nahkampfwaffe": {
"label": "Nahkampfwaffe",
@ -174,7 +289,6 @@
"modifikator": "Modifikator",
"attacke": "Attacke",
"parade": "Parade",
"bruchfaktor": "Bruchfaktor",
"distanzklasse": "Distanzklasse",
"zweihaendig": "Zweihändig",
"werfbar": "Werfbar",
@ -189,8 +303,7 @@
"modifikator": "Modifikator",
"attacke": "Attacke",
"parade": "Parade",
"initiative": "Initiative",
"bruchfaktor": "Bruchfaktor"
"initiative": "Initiative"
},
"schild": {
@ -207,8 +320,7 @@
"modifikator": "Modifikator",
"attacke": "Attacke",
"parade": "Parade",
"initiative": "Initiative",
"bruchfaktor": "Bruchfaktor"
"initiative": "Initiative"
},
"fernkampfwaffe": {
@ -222,6 +334,20 @@
"munitionskosten": "Munitionskosten",
"munitionsgewicht": "Munitionsgewicht"
}
},
"inventar": {
"bewaffnung": "Bewaffnung",
"ruestungen": "Rüstungen",
"gegenstaende": "Gegenstände"
},
"kampf": {
"bewaffnung": "Bewaffnung",
"attacke": "Attacke",
"parade": "Parade",
"trefferpunkte": "Trefferpunkte",
"ruestungen": "Rüstungen"
}
}
}

View File

@ -162,6 +162,8 @@
},
"bewaffnung": {
"bruchfaktor": "!!TODO!!",
"nahkampfwaffe": {
"label": "!!TODO!!",
@ -174,7 +176,6 @@
"modifikator": "!!TODO!!",
"attacke": "!!TODO!!",
"parade": "!!TODO!!",
"bruchfaktor": "!!TODO!!",
"distanzklasse": "!!TODO!!",
"zweihaendig": "!!TODO!!",
"werfbar": "!!TODO!!",
@ -189,8 +190,7 @@
"modifikator": "!!TODO!!",
"attacke": "!!TODO!!",
"parade": "!!TODO!!",
"initiative": "!!TODO!!",
"bruchfaktor": "!!TODO!!"
"initiative": "!!TODO!!"
},
"schild": {
@ -207,8 +207,7 @@
"modifikator": "!!TODO!!",
"attacke": "!!TODO!!",
"parade": "!!TODO!!",
"initiative": "!!TODO!!",
"bruchfaktor": "!!TODO!!"
"initiative": "!!TODO!!"
},
"fernkampfwaffe": {

View File

@ -20,6 +20,8 @@
.center {
text-align: center;
justify-content: center;
align-content: center;
}
@ -47,7 +49,7 @@
.die {
.sheet .die {
width: 48px;
height: 48px;
line-height: 48px;
@ -60,14 +62,30 @@
color: #fff;
}
.die-courage { background-color: #b22319; }
.die-cleverness { background-color: #8158a3; }
.die-intuition { background-color: #388834; }
.die-charisma { background-color: #0c0c0c; }
.die-dexterity { background-color: #d4b366; }
.die-agility { background-color: #678ec3; }
.die-constitution { background-color: #a3a3a3; }
.die-strength { background-color: #d5a877; }
.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 {
@ -80,6 +98,36 @@
height: 80px;
}
.list-header {
padding: 0.5rem;
}
.list {
box-shadow: 0 0 6px rgba(0, 0, 0, 0.45);
}
.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%;
@ -91,22 +139,30 @@
table-layout: fixed;
}
.item-sheet .tabs {
.actor-sheet .item-image {
width: 32px;
height: 32px;
}
.actor-sheet .tabs,
.item-sheet .tabs {
padding: 6px;
margin-top: 6px;
border-top: 1px solid;
border-bottom: 1px solid;
}
.item-sheet .tabs a {
.actor-sheet .tabs a,
.item-sheet .tabs a {
line-height: 18px;
}
.item-sheet .tabs a.active {
.actor-sheet .tabs a.active,
.item-sheet .tabs a.active {
text-decoration: underline;
}
.item-sheet .tabs input[type="checkbox"] {
width: 12px;
height: 12px;
}
}

View File

@ -1,7 +1,9 @@
Hooks.once("init", function() {
console.log("INIT");
CONFIG.Combat.initiative.formula = "1d6 + @computed.ini_basiswert[INI-Basiswert]";
CONFIG.Actor.dataModels.Player = DSA41_CharacterData;
CONFIG.Actor.documentClass = DSA41_CharacterDocument;
CONFIG.Item. dataModels.Gegenstand = DSA41_GegenstandData;
CONFIG.Item. dataModels.Ruestung = DSA41_RuestungData;
CONFIG.Item. dataModels.Bewaffnung = DSA41_BewaffnungData;
@ -30,9 +32,9 @@ const { SchemaField, NumberField, StringField, BooleanField } = foundry.data.fie
class AttributeField extends foundry.data.fields.SchemaField {
constructor() {
return super({
initial: new NumberField({ integer: true, initial: 8, min: 8, max: 14, }),
advancement: new NumberField({ integer: true, initial: 0, min: 0, max: 4, }),
modifier: new NumberField({ integer: true, initial: 0, min: 0, }),
initial: new NumberField({ integer: true, initial: 8, min: 0 }),
advancement: new NumberField({ integer: true, initial: 0, min: 0 }),
modifier: new NumberField({ integer: true, initial: 0 }),
});
}
}
@ -47,6 +49,10 @@ class CombatTalentField extends foundry.data.fields.SchemaField {
}
}
class DSA41_CharacterDocument extends Actor {
}
class DSA41_CharacterData extends foundry.abstract.TypeDataModel {
static defineSchema() {
return {
@ -227,10 +233,80 @@ class DSA41_CharacterData extends foundry.abstract.TypeDataModel {
prepareDerivedData() {
super.prepareDerivedData();
this.computed = {};
this.computed = {
attributes: {
without_modifiers: {},
with_modifiers: {},
},
kampf: {
talente: {},
waffen: {},
},
};
for (const [attribute, values] of Object.entries(this.attributes)) {
this.computed[attribute] = Object.values(values).reduce((a, b) => a + b, 0);
this.computed.attributes.without_modifiers[attribute] = values.initial + values.advancement;
this.computed.attributes.with_modifiers [attribute] = values.initial + values.advancement + values.modifier;
}
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);;
for(const [name, values] of Object.entries(this.kampf_talente)) {
this.computed.kampf.talente[name] = {};
this.computed.kampf.talente[name].attacke = this.computed.at_basiswert + values.attacke;
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);
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) {
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;
const tp_kk = Math.trunc((this.computed.attributes.with_modifiers.strength - item.system.nahkampfwaffe.schwellenwert) / item.system.nahkampfwaffe.schadensschritte);
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;
}
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;
}
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;
}
}
}
}
}
@ -271,6 +347,8 @@ class DSA41_BewaffnungData extends foundry.abstract.TypeDataModel {
gewicht: new NumberField({ integer: false, initial: 0, min: 0 }),
preis: new NumberField({ integer: true, initial: 0, min: 0 }),
angelegt: new BooleanField(),
nahkampfwaffe: new SchemaField({
aktiv: new BooleanField(),
@ -343,9 +421,48 @@ 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" }],
});
}
get template() {
return "systems/dsa-4th-edition/src/ActorSheet.html";
}
activateListeners(html) {
super.activateListeners(html);
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;
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);
roll.toMessage({
speaker: ChatMessage.getSpeaker({ actor: this.object }),
flavor: flavor,
});
});
}
}
class DSA41_ItemSheet extends ItemSheet {