diff --git a/src/ActorSheet.html b/src/ActorSheet.html index 9dc5077..685c355 100644 --- a/src/ActorSheet.html +++ b/src/ActorSheet.html @@ -15,14 +15,31 @@ {{/inline}} +{{#*inline "editable-checkbox"}} +
+ {{#if @root.editable}} + + {{else}} +
+ {{value}} + {{#unless value}}{{placeholder}}{{/unless}} +
+ {{/if}} + + {{#if placeholder}} +
{{placeholder}}
+ {{/if}} +
+{{/inline}} + {{#*inline "die-type"}}
{{localize (concat "DSA41.attributes.short." type)}}
{{/inline}} {{#*inline "die-value"}} -
+
{{localize (concat "DSA41.attributes.short." type)}}
-
{{lookup @root.actor.system.computed type}}
+
{{lookup @root.actor.system.computed.attributes.with_modifiers type}}
{{/inline}} @@ -41,83 +58,190 @@ {{/each}}
-
-
- {{localize "DSA41.attributes.label"}} - - - - {{#each actor.system.attributes}} - - {{/each}} - - - - {{#each actor.system.attributes}} - - {{/each}} - - - - {{#each actor.system.attributes}} - - {{/each}} - - - - {{#each actor.system.attributes}} - - {{/each}} - -
{{localize (concat "DSA41.attributes.short." @key)}}
{{localize "DSA41.attributes.initial"}}{{>editable-input type="number" name=(concat "system.attributes." @key ".initial") value=(lookup this "initial")}}
{{localize "DSA41.attributes.advancement"}}{{>editable-input type="number" name=(concat "system.attributes." @key ".advancement") value=(lookup this "advancement")}}
{{localize "DSA41.attributes.modifier"}}{{>editable-input type="number" name=(concat "system.attributes." @key ".modifier") value=(lookup this "modifier")}}
-
-
- -
-
- {{localize "DSA41.talente.kampf_talente.label"}} - - - - - - - - - - {{#each actor.system.kampf_talente}} - - - - - - - - - {{/each}} -
{{localize "DSA41.talente.label"}}{{localize "DSA41.talente.label_talentwert"}}{{localize "DSA41.talente.kampf.label_attacke"}}{{localize "DSA41.talente.kampf.label_parade"}}{{localize "DSA41.talente.kampf.label_attacke_total"}}{{localize "DSA41.talente.kampf.label_parade_total"}}
{{localize (concat "DSA41.talente.kampf.name." @key)}}{{>editable-input type="number" name=(concat "system.kampf_talente." @key ".talentwert") value=(lookup this "talentwert")}}{{>editable-input type="number" name=(concat "system.kampf_talente." @key ".attacke") value=(lookup this "attacke")}}{{>editable-input type="number" name=(concat "system.kampf_talente." @key ".parade") value=(lookup this "parade")}}00
-
-
- - {{#each actor.system.talente}} -
-
- {{localize (concat "DSA41.talente." @key ".label")}} - - - - - - - {{#each @this}} - - - - - - {{/each}} -
{{localize "DSA41.talente.label"}}{{localize "DSA41.talente.label_eigenschaften"}}{{localize "DSA41.talente.label_talentwert"}}
{{localize (concat "DSA41.talente." @../key ".name." @key)}}{{>editable-input type="number" name=(concat "system.talente." @../key "." @key) value=@this}}
-
+ + +
+
+
+
+ {{localize "DSA41.attributes.label"}} + + + + {{#each actor.system.attributes}} + + {{/each}} + + + + {{#each actor.system.attributes}} + + {{/each}} + + + + {{#each actor.system.attributes}} + + {{/each}} + + + + {{#each actor.system.attributes}} + + {{/each}} + +
{{localize (concat "DSA41.attributes.short." @key)}}
{{localize "DSA41.attributes.initial"}}{{>editable-input type="number" name=(concat "system.attributes." @key ".initial") value=(lookup this "initial")}}
{{localize "DSA41.attributes.advancement"}}{{>editable-input type="number" name=(concat "system.attributes." @key ".advancement") value=(lookup this "advancement")}}
{{localize "DSA41.attributes.modifier"}}{{>editable-input type="number" name=(concat "system.attributes." @key ".modifier") value=(lookup this "modifier")}}
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Lebenspunkte{{actor.system.computed.max_lebenspunkte}}Ausdauer{{actor.system.computed.max_ausdauer}}
Astralenergie{{actor.system.computed.max_atralenergie}}Magieresistenz{{actor.system.computed.magieresistenz}}
INI-Basiswert{{actor.system.computed.ini_basiswert}}AT-Basiswert{{actor.system.computed.at_basiswert}}
PA-Basiswert{{actor.system.computed.pa_basiswert}}FK-Basiswert{{actor.system.computed.fk_basiswert}}
+
+ +
+
+
+ {{localize "DSA41.talente.kampf_talente.label"}} + + + + + + + + + + {{#each actor.system.kampf_talente}} + + + + + + + + + {{/each}} +
{{localize "DSA41.talente.label"}}{{localize "DSA41.talente.label_talentwert"}}{{localize "DSA41.talente.kampf.label_attacke"}}{{localize "DSA41.talente.kampf.label_parade"}}{{localize "DSA41.talente.kampf.label_attacke_total"}}{{localize "DSA41.talente.kampf.label_parade_total"}}
{{localize (concat "DSA41.talente.kampf.name." @key)}}{{>editable-input type="number" name=(concat "system.kampf_talente." @key ".talentwert") value=(lookup this "talentwert")}}{{>editable-input type="number" name=(concat "system.kampf_talente." @key ".attacke") value=(lookup this "attacke")}}{{>editable-input type="number" name=(concat "system.kampf_talente." @key ".parade") value=(lookup this "parade")}}00
+
+
+ + {{#each actor.system.talente}} +
+
+ {{localize (concat "DSA41.talente." @key ".label")}} + + + + + + + {{#each @this}} + + + + + + {{/each}} +
{{localize "DSA41.talente.label"}}{{localize "DSA41.talente.label_eigenschaften"}}{{localize "DSA41.talente.label_talentwert"}}
{{localize (concat "DSA41.talente." @../key ".name." @key)}}{{>editable-input type="number" name=(concat "system.talente." @../key "." @key) value=@this}}
+
+
+ {{/each}} +
+ +
+
+
+
+
{{localize "DSA41.inventar.bewaffnung"}}
+
{{localize "DSA41.weight"}}
+
+ {{#each actor.itemTypes.Bewaffnung}} +
+
+ +
+ {{this.name}} + + {{#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}} + +
+
+
{{this.system.gewicht}}
+
{{>editable-checkbox value=this.system.angelegt}}
+
+ {{/each}} +
+ +
+
+
{{localize "DSA41.inventar.ruestungen"}}
+
{{localize "DSA41.weight"}}
+
+ {{#each actor.itemTypes.Ruestung}} +
+
+ + {{this.name}} +
+
{{this.system.gewicht}}
+
{{>editable-checkbox value=this.system.angelegt}}
+
+ {{/each}} +
+ +
+
+
{{localize "DSA41.inventar.gegenstaende"}}
+
{{localize "DSA41.weight"}}
+
+ {{#each actor.itemTypes.Gegenstand}} +
+
+ + {{this.name}} +
+
{{this.system.gewicht}}
+
{{>editable-checkbox value=this.system.angelegt}}
+
+ {{/each}} +
+
+
+
\ No newline at end of file diff --git a/src/ItemSheets/Bewaffnung.html b/src/ItemSheets/Bewaffnung.html index 339bf16..440c834 100644 --- a/src/ItemSheets/Bewaffnung.html +++ b/src/ItemSheets/Bewaffnung.html @@ -85,7 +85,7 @@ {{localize "DSA41.bewaffnung.nahkampfwaffe.initiative"}} {{>editable-input type="number" name="system.nahkampfwaffe.initiative" value=item.system.nahkampfwaffe.initiative}} - {{localize "DSA41.bewaffnung.nahkampfwaffe.bruchfaktor"}} + {{localize "DSA41.bewaffnung.bruchfaktor"}} {{>editable-input type="number" name="system.nahkampfwaffe.bruchfaktor" value=item.system.nahkampfwaffe.bruchfaktor}} @@ -127,7 +127,7 @@ - {{localize "DSA41.bewaffnung.parierwaffe.bruchfaktor"}} + {{localize "DSA41.bewaffnung.bruchfaktor"}} {{>editable-input type="number" name="system.parierwaffe.bruchfaktor" value=item.system.parierwaffe.bruchfaktor}} @@ -155,7 +155,7 @@ {{localize "DSA41.bewaffnung.schild.initiative"}} {{>editable-input type="number" name="system.schild.initiative" value=item.system.schild.initiative}} - {{localize "DSA41.bewaffnung.schild.bruchfaktor"}} + {{localize "DSA41.bewaffnung.bruchfaktor"}} {{>editable-input type="number" name="system.schild.bruchfaktor" value=item.system.schild.bruchfaktor}} diff --git a/src/lang/de.json b/src/lang/de.json index 879958b..084060d 100644 --- a/src/lang/de.json +++ b/src/lang/de.json @@ -14,6 +14,12 @@ "profession": "Profession", "weight": "Gewicht", "price": "Preis", + + "character": { + "eigenschaften": "Eigenschaften", + "talente": "Talente", + "inventar": "Inventar" + }, "attributes": { "label": "Eigenschaften", @@ -162,6 +168,8 @@ }, "bewaffnung": { + "bruchfaktor": "Bruchfaktor", + "nahkampfwaffe": { "label": "Nahkampfwaffe", @@ -174,7 +182,6 @@ "modifikator": "Modifikator", "attacke": "Attacke", "parade": "Parade", - "bruchfaktor": "Bruchfaktor", "distanzklasse": "Distanzklasse", "zweihaendig": "Zweihändig", "werfbar": "Werfbar", @@ -189,8 +196,7 @@ "modifikator": "Modifikator", "attacke": "Attacke", "parade": "Parade", - "initiative": "Initiative", - "bruchfaktor": "Bruchfaktor" + "initiative": "Initiative" }, "schild": { @@ -207,8 +213,7 @@ "modifikator": "Modifikator", "attacke": "Attacke", "parade": "Parade", - "initiative": "Initiative", - "bruchfaktor": "Bruchfaktor" + "initiative": "Initiative" }, "fernkampfwaffe": { @@ -222,6 +227,12 @@ "munitionskosten": "Munitionskosten", "munitionsgewicht": "Munitionsgewicht" } + }, + + "inventar": { + "bewaffnung": "Bewaffnung", + "ruestungen": "Rüstungen", + "gegenstaende": "Gegenstände" } } } \ No newline at end of file diff --git a/src/lang/en.json b/src/lang/en.json index b78f6b5..f51d775 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -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": { diff --git a/src/main.css b/src/main.css index ef6b44b..ea0ca52 100644 --- a/src/main.css +++ b/src/main.css @@ -20,6 +20,8 @@ .center { text-align: center; + justify-content: center; + align-content: center; } @@ -80,6 +82,35 @@ 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; +} + +.item-sub { + font-size: 0.625rem; +} + +.inventar { + gap: 16px; +} + .actor-sheet fieldset { width: 100%; @@ -91,22 +122,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; -} \ No newline at end of file +} diff --git a/src/main.mjs b/src/main.mjs index af299f4..cb0d67c 100644 --- a/src/main.mjs +++ b/src/main.mjs @@ -1,7 +1,11 @@ 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 +34,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 +51,10 @@ class CombatTalentField extends foundry.data.fields.SchemaField { } } +class DSA41_CharacterDocument extends Actor { + +} + class DSA41_CharacterData extends foundry.abstract.TypeDataModel { static defineSchema() { return { @@ -227,11 +235,29 @@ class DSA41_CharacterData extends foundry.abstract.TypeDataModel { prepareDerivedData() { super.prepareDerivedData(); - this.computed = {}; + this.computed = { + attributes: { + without_modifiers: {}, + with_modifiers: {}, + }, + }; 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);; + + } } @@ -271,6 +297,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,6 +371,12 @@ 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"; }