compute Ruestungen stats
This commit is contained in:
parent
172e98f663
commit
6e58e06058
@ -222,12 +222,12 @@
|
|||||||
</div>
|
</div>
|
||||||
{{#each actor.itemTypes.Ruestung}}
|
{{#each actor.itemTypes.Ruestung}}
|
||||||
<div class="row list-item" data-item-id="{{this._id}}">
|
<div class="row list-item" data-item-id="{{this._id}}">
|
||||||
<div class="row item-name">
|
<div class="row item-name item-open">
|
||||||
<img class="item-image" src="{{this.img}}" title="{{this.name}}">
|
<img class="item-image" src="{{this.img}}" title="{{this.name}}">
|
||||||
<span class="center">{{this.name}}</span>
|
<span class="center">{{this.name}}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="center">{{this.system.gewicht}}</div>
|
<div class="row"></div>
|
||||||
<div class="center">{{>editable-checkbox value=this.system.angelegt}}</div>
|
<div class="center fas fa-trash item-delete"></div>
|
||||||
</div>
|
</div>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</div>
|
</div>
|
||||||
@ -239,12 +239,13 @@
|
|||||||
</div>
|
</div>
|
||||||
{{#each actor.itemTypes.Gegenstand}}
|
{{#each actor.itemTypes.Gegenstand}}
|
||||||
<div class="row list-item" data-item-id="{{this._id}}">
|
<div class="row list-item" data-item-id="{{this._id}}">
|
||||||
<div class="row item-name">
|
<div class="row item-name item-open">
|
||||||
<img class="item-image" src="{{this.img}}" title="{{this.name}}">
|
<img class="item-image" src="{{this.img}}" title="{{this.name}}">
|
||||||
<span class="center">{{this.name}}</span>
|
<span class="center">{{this.name}}</span>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="row"></div>
|
||||||
<div class="center">{{this.system.gewicht}}</div>
|
<div class="center">{{this.system.gewicht}}</div>
|
||||||
<div class="center">{{>editable-checkbox value=this.system.angelegt}}</div>
|
<div class="center fas fa-trash item-delete"></div>
|
||||||
</div>
|
</div>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</div>
|
</div>
|
||||||
@ -262,7 +263,7 @@
|
|||||||
</div>
|
</div>
|
||||||
{{#each actor.system.computed.kampf.waffen}}
|
{{#each actor.system.computed.kampf.waffen}}
|
||||||
<div class="row list-item" data-item-id="{{item._id}}">
|
<div class="row list-item" data-item-id="{{item._id}}">
|
||||||
<div class="row item-name">
|
<div class="row item-name item-open">
|
||||||
<img class="item-image" src="{{item.img}}" title="{{item.name}}">
|
<img class="item-image" src="{{item.img}}" title="{{item.name}}">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<span>{{item.name}}</span>
|
<span>{{item.name}}</span>
|
||||||
@ -276,21 +277,62 @@
|
|||||||
{{/each}}
|
{{/each}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col list">
|
<div class="ruestungen list">
|
||||||
<div class="row list-header">
|
<div>
|
||||||
<div class="row">{{localize "DSA41.kampf.ruestungen"}}</div>
|
<div class="rowspan2">{{localize "DSA41.kampf.ruestungen"}}</div>
|
||||||
<div>{{localize "DSA41.weight"}}</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>
|
||||||
{{#each actor.itemTypes.Ruestung}}
|
<div class="colspan2 rowspan2 subgrid">
|
||||||
<div class="row list-item" data-item-id="{{this._id}}">
|
<div class="colspan2">{{localize "DSA41.ruestungen.bein"}}</div>
|
||||||
<div class="row item-name">
|
<div>{{localize "DSA41.ruestungen.links"}}</div>
|
||||||
<img class="item-image" src="{{this.img}}" title="{{this.name}}">
|
<div>{{localize "DSA41.ruestungen.rechts"}}</div>
|
||||||
<span class="center">{{this.name}}</span>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="center">{{this.system.gewicht}}</div>
|
<div class="colspan2 rowspan2 subgrid">
|
||||||
<div class="center">{{>editable-checkbox value=this.system.angelegt}}</div>
|
<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 data-item-id="{{item._id}}">
|
||||||
|
<div class="left row item-name 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>
|
</div>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -271,7 +271,18 @@
|
|||||||
"rechtes_bein": "Rechtes Bein",
|
"rechtes_bein": "Rechtes Bein",
|
||||||
|
|
||||||
"gesamt_ruestungsschutz": "Gesamt Rüstungsschutz",
|
"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": {
|
"bewaffnung": {
|
||||||
|
|||||||
57
src/main.css
57
src/main.css
@ -18,9 +18,16 @@
|
|||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.left {
|
||||||
|
text-align: left;
|
||||||
|
justify-content: left;
|
||||||
|
justify-self: left;
|
||||||
|
}
|
||||||
|
|
||||||
.center {
|
.center {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
justify-self: center;
|
||||||
align-content: center;
|
align-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -28,6 +35,30 @@
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.subgrid {
|
||||||
|
display: grid;
|
||||||
|
grid-template-rows: subgrid;
|
||||||
|
grid-template-columns: subgrid;
|
||||||
|
}
|
||||||
|
|
||||||
|
.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; }
|
||||||
|
|
||||||
|
.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; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.editable-input {
|
.editable-input {
|
||||||
@ -135,6 +166,10 @@
|
|||||||
gap: 16px;
|
gap: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.kampf {
|
||||||
|
gap: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
.actor-sheet fieldset {
|
.actor-sheet fieldset {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@ -173,3 +208,25 @@
|
|||||||
width: 12px;
|
width: 12px;
|
||||||
height: 12px;
|
height: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.actor-sheet .kampf .ruestungen {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 2fr repeat(8, 1fr) repeat(2, 1.5fr);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.actor-sheet .kampf .ruestungen > * {
|
||||||
|
display: grid;
|
||||||
|
grid-column: 1 / -1;
|
||||||
|
grid-template-columns: subgrid;
|
||||||
|
|
||||||
|
padding: 0.25rem;
|
||||||
|
border-bottom: 1px dotted;
|
||||||
|
|
||||||
|
text-align: center;
|
||||||
|
place-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.actor-sheet .kampf .ruestungen > *:last-child {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|||||||
47
src/main.mjs
47
src/main.mjs
@ -242,6 +242,20 @@ class DSA41_CharacterData extends foundry.abstract.TypeDataModel {
|
|||||||
kampf: {
|
kampf: {
|
||||||
talente: {},
|
talente: {},
|
||||||
waffen: {},
|
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,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -260,21 +274,40 @@ class DSA41_CharacterData extends foundry.abstract.TypeDataModel {
|
|||||||
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.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.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)) {
|
for(const [name, values] of Object.entries(this.kampf_talente)) {
|
||||||
this.computed.kampf.talente[name] = {};
|
this.computed.kampf.talente[name] = {};
|
||||||
this.computed.kampf.talente[name].attacke = this.computed.at_basiswert + values.attacke;
|
this.computed.kampf.talente[name].attacke = this.computed.at_basiswert + values.attacke;
|
||||||
this.computed.kampf.talente[name].parade = this.computed.pa_basiswert + values.parade;
|
this.computed.kampf.talente[name].parade = this.computed.pa_basiswert + values.parade;
|
||||||
}
|
}
|
||||||
|
|
||||||
let equipped_bewaffnung = this.parent.items.filter((x) => x.type === "Bewaffnung");
|
const equipped_bewaffnung = this.parent.items.filter((x) => x.type === "Bewaffnung");
|
||||||
let equipped_nahkampfwaffen = equipped_bewaffnung.filter((x) => x.system.nahkampfwaffe.aktiv);
|
const equipped_nahkampfwaffen = equipped_bewaffnung.filter((x) => x.system.nahkampfwaffe.aktiv);
|
||||||
let equipped_parierwaffen = equipped_bewaffnung.filter((x) => x.system.parierwaffe.aktiv);
|
const equipped_parierwaffen = equipped_bewaffnung.filter((x) => x.system.parierwaffe.aktiv);
|
||||||
let equipped_schilde = equipped_bewaffnung.filter((x) => x.system.schild.aktiv);
|
const equipped_schilde = equipped_bewaffnung.filter((x) => x.system.schild.aktiv);
|
||||||
let equipped_fernkampfwaffen = equipped_bewaffnung.filter((x) => x.system.fernkampfwaffe.aktiv);
|
const equipped_fernkampfwaffen = equipped_bewaffnung.filter((x) => x.system.fernkampfwaffe.aktiv);
|
||||||
|
|
||||||
for(const item of equipped_nahkampfwaffen) {
|
for(const item of equipped_nahkampfwaffen) {
|
||||||
this.computed.kampf.waffen[item._id] = {};
|
this.computed.kampf.waffen[item._id] = { item: item };
|
||||||
this.computed.kampf.waffen[item._id].item = item;
|
|
||||||
|
|
||||||
if (item.system.nahkampfwaffe.aktiv) {
|
if (item.system.nahkampfwaffe.aktiv) {
|
||||||
const talent = item.system.nahkampfwaffe.kampftalente;
|
const talent = item.system.nahkampfwaffe.kampftalente;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user