add Wunden
This commit is contained in:
parent
60036fc37f
commit
e338b79d3a
@ -441,6 +441,46 @@
|
||||
</div>
|
||||
|
||||
<div class="tab Kampf {{#if (eq tabGroups.primary 'kampf')}}active{{/if}}" data-group="primary" data-tab="kampf">
|
||||
<div class="list Wunden">
|
||||
<div class="list-header">
|
||||
<div>{{localize "DSA41.kampf.wunden.label"}}</div>
|
||||
</div>
|
||||
|
||||
{{#*inline "wunden"}}
|
||||
<div class="center" data-location="{{location}}">
|
||||
<img class="wunde{{#if (gte (lookup @root.actor.system.wunden location) 1)}} active{{/if}}" data-action="toggle-wound">
|
||||
<img class="wunde{{#if (gte (lookup @root.actor.system.wunden location) 2)}} active{{/if}}" data-action="toggle-wound">
|
||||
<img class="wunde{{#if (gte (lookup @root.actor.system.wunden location) 3)}} active{{/if}}" data-action="toggle-wound">
|
||||
</div>
|
||||
{{/inline}}
|
||||
|
||||
<div class="list-item">
|
||||
<div>{{localize "DSA41.kampf.wunden.kopf"}}</div>
|
||||
{{>wunden location="kopf"}}
|
||||
<div>{{localize "DSA41.kampf.wunden.brust"}}</div>
|
||||
{{>wunden location="brust"}}
|
||||
</div>
|
||||
|
||||
<div class="list-item">
|
||||
<div>{{localize "DSA41.kampf.wunden.bauch"}}</div>
|
||||
{{>wunden location="bauch"}}
|
||||
</div>
|
||||
|
||||
<div class="list-item">
|
||||
<div>{{localize "DSA41.kampf.wunden.linker_arm"}}</div>
|
||||
{{>wunden location="linker_arm"}}
|
||||
<div>{{localize "DSA41.kampf.wunden.rechter_arm"}}</div>
|
||||
{{>wunden location="rechter_arm"}}
|
||||
</div>
|
||||
|
||||
<div class="list-item">
|
||||
<div>{{localize "DSA41.kampf.wunden.linkes_bein"}}</div>
|
||||
{{>wunden location="linkes_bein"}}
|
||||
<div>{{localize "DSA41.kampf.wunden.rechtes_bein"}}</div>
|
||||
{{>wunden location="rechtes_bein"}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="list Bewaffnung">
|
||||
<div class="list-header ">
|
||||
<div>{{localize "DSA41.kampf.bewaffnung"}}</div>
|
||||
|
||||
@ -537,6 +537,18 @@
|
||||
"still": "Still",
|
||||
"seitenwind": "Böiger Seitenwind",
|
||||
"starker_seitenwind": "Starker Seitenwind"
|
||||
},
|
||||
|
||||
"wunden": {
|
||||
"label": "Wunden",
|
||||
|
||||
"kopf": "Kopf",
|
||||
"brust": "Brust",
|
||||
"bauch": "Bauch",
|
||||
"linker_arm": "Linker Arm",
|
||||
"rechter_arm": "Rechter Arm",
|
||||
"linkes_bein": "Linkes Bein",
|
||||
"rechtes_bein": "Rechtes Bein"
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
32
src/main.css
32
src/main.css
@ -592,6 +592,38 @@ html {
|
||||
}
|
||||
|
||||
&[data-tab="kampf"] {
|
||||
& .Wunden {
|
||||
grid-template-columns: minmax(0, max-content) minmax(0, 1fr) minmax(0, max-content) minmax(0, 1fr);
|
||||
|
||||
& .wunde {
|
||||
display: inline;
|
||||
|
||||
width: 2em;
|
||||
height: 2em;
|
||||
margin: 0 .25em 0 .25em;
|
||||
|
||||
content: url("/icons/skills/wounds/injury-triple-slash-bleed.webp");
|
||||
|
||||
mix-blend-mode: difference;
|
||||
|
||||
&.active {
|
||||
filter: grayscale(0.0);
|
||||
|
||||
&:hover, &:hover ~ .wunde.active {
|
||||
filter: grayscale(0.75);
|
||||
}
|
||||
}
|
||||
|
||||
&:not(.active) {
|
||||
filter: grayscale(1.0);
|
||||
|
||||
&:hover, &:has( ~ .wunde:hover) {
|
||||
filter: grayscale(0.25);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
& .Bewaffnung {
|
||||
grid-template-columns: minmax(0, max-content) repeat(3, minmax(0, auto));
|
||||
|
||||
|
||||
114
src/main.mjs
114
src/main.mjs
@ -598,6 +598,16 @@ class DSA41_CharacterData extends TypeDataModel {
|
||||
modifikator_attacke: new NumberField({integer: true, initial: 0}),
|
||||
modifikator_parade: new NumberField({integer: true, initial: 0}),
|
||||
modifikator_fernkampf: new NumberField({integer: true, initial: 0}),
|
||||
|
||||
wunden: new SchemaField({
|
||||
kopf: new NumberField({integer: true, initial: 0, min: 0, max: 3 }),
|
||||
brust: new NumberField({integer: true, initial: 0, min: 0, max: 3 }),
|
||||
bauch: new NumberField({integer: true, initial: 0, min: 0, max: 3 }),
|
||||
linker_arm: new NumberField({integer: true, initial: 0, min: 0, max: 3 }),
|
||||
rechter_arm: new NumberField({integer: true, initial: 0, min: 0, max: 3 }),
|
||||
linkes_bein: new NumberField({integer: true, initial: 0, min: 0, max: 3 }),
|
||||
rechtes_bein: new NumberField({integer: true, initial: 0, min: 0, max: 3 }),
|
||||
}),
|
||||
}
|
||||
}
|
||||
|
||||
@ -634,14 +644,97 @@ class DSA41_CharacterData extends TypeDataModel {
|
||||
gesamt_behinderung: 0.0,
|
||||
},
|
||||
},
|
||||
|
||||
wunden_modifiers: {
|
||||
courage: 0,
|
||||
cleverness: 0,
|
||||
intuition: 0,
|
||||
dexterity: 0,
|
||||
agility: 0,
|
||||
constitution: 0,
|
||||
strength: 0,
|
||||
initiative_basis: 0,
|
||||
initiative: "",
|
||||
attacke: 0,
|
||||
parade: 0,
|
||||
schaden: "",
|
||||
},
|
||||
};
|
||||
|
||||
if (this.wunden.kopf >= 1) {
|
||||
this.computed.wunden_modifiers.courage += -2 * this.wunden.kopf;
|
||||
this.computed.wunden_modifiers.cleverness += -2 * this.wunden.kopf;
|
||||
this.computed.wunden_modifiers.intuition += -2 * this.wunden.kopf;
|
||||
this.computed.wunden_modifiers.initiative_basis += -2 * this.wunden.kopf;
|
||||
this.computed.wunden_modifiers.initiative += (-2 * this.wunden.kopf) + "d6";
|
||||
|
||||
if (this.wunden.kopf >= 3) this.computed.wunden_modifiers.schaden += "+ 2d6";
|
||||
}
|
||||
|
||||
if (this.wunden.brust >= 1) {
|
||||
this.computed.wunden_modifiers.attacke += -this.wunden.brust;
|
||||
this.computed.wunden_modifiers.parade += -this.wunden.brust;
|
||||
this.computed.wunden_modifiers.constitution += -this.wunden.brust;
|
||||
this.computed.wunden_modifiers.strength += -this.wunden.brust;
|
||||
this.computed.wunden_modifiers.schaden += "+" + this.wunden.brust + "d6";
|
||||
}
|
||||
|
||||
if (this.wunden.bauch >= 1) {
|
||||
this.computed.wunden_modifiers.attacke += -this.wunden.bauch;
|
||||
this.computed.wunden_modifiers.parade += -this.wunden.bauch;
|
||||
this.computed.wunden_modifiers.constitution += -this.wunden.bauch;
|
||||
this.computed.wunden_modifiers.strength += -this.wunden.bauch;
|
||||
this.computed.wunden_modifiers.initiative_basis += -this.wunden.bauch;
|
||||
this.computed.wunden_modifiers.schaden += "+" + this.wunden.bauch + "d6";
|
||||
}
|
||||
|
||||
if (this.wunden.linker_arm >= 1) {
|
||||
this.computed.wunden_modifiers.attacke += -2 * this.wunden.linker_arm;
|
||||
this.computed.wunden_modifiers.parade += -2 * this.wunden.linker_arm;
|
||||
this.computed.wunden_modifiers.strength += -2 * this.wunden.linker_arm;
|
||||
this.computed.wunden_modifiers.dexterity += -2 * this.wunden.linker_arm;
|
||||
}
|
||||
|
||||
if (this.wunden.rechter_arm >= 1) {
|
||||
this.computed.wunden_modifiers.attacke += -2 * this.wunden.rechter_arm;
|
||||
this.computed.wunden_modifiers.parade += -2 * this.wunden.rechter_arm;
|
||||
this.computed.wunden_modifiers.strength += -2 * this.wunden.rechter_arm;
|
||||
this.computed.wunden_modifiers.dexterity += -2 * this.wunden.rechter_arm;
|
||||
}
|
||||
|
||||
if (this.wunden.linkes_bein >= 1) {
|
||||
this.computed.wunden_modifiers.attacke += -2 * this.wunden.linkes_bein;
|
||||
this.computed.wunden_modifiers.parade += -2 * this.wunden.linkes_bein;
|
||||
this.computed.wunden_modifiers.agility += -2 * this.wunden.linkes_bein;
|
||||
this.computed.wunden_modifiers.initiative_basis += -2 * this.wunden.linkes_bein;
|
||||
}
|
||||
|
||||
if (this.wunden.rechtes_bein >= 1) {
|
||||
this.computed.wunden_modifiers.attacke += -2 * this.wunden.rechtes_bein;
|
||||
this.computed.wunden_modifiers.parade += -2 * this.wunden.rechtes_bein;
|
||||
this.computed.wunden_modifiers.agility += -2 * this.wunden.rechtes_bein;
|
||||
this.computed.wunden_modifiers.initiative_basis += -2 * this.wunden.rechtes_bein;
|
||||
}
|
||||
|
||||
this.computed.abenteuerpunkte.uebrig = this.abenteuerpunkte.gesamt - this.abenteuerpunkte.ausgegeben;
|
||||
|
||||
for (const [attribute, values] of Object.entries(this.attributes)) {
|
||||
this.computed.attributes[attribute] = values.initial + values.advancement + values.modifier;
|
||||
this.computed.attributes_without_modifiers[attribute] = values.initial + values.advancement;
|
||||
}
|
||||
this.computed.attributes_without_modifiers.courage = this.attributes.courage.initial + this.attributes.courage.advancement;
|
||||
this.computed.attributes_without_modifiers.cleverness = this.attributes.cleverness.initial + this.attributes.cleverness.advancement;
|
||||
this.computed.attributes_without_modifiers.intuition = this.attributes.intuition.initial + this.attributes.intuition.advancement;
|
||||
this.computed.attributes_without_modifiers.charisma = this.attributes.charisma.initial + this.attributes.charisma.advancement;
|
||||
this.computed.attributes_without_modifiers.dexterity = this.attributes.dexterity.initial + this.attributes.dexterity.advancement;
|
||||
this.computed.attributes_without_modifiers.agility = this.attributes.agility.initial + this.attributes.agility.advancement;
|
||||
this.computed.attributes_without_modifiers.constitution = this.attributes.constitution.initial + this.attributes.constitution.advancement;
|
||||
this.computed.attributes_without_modifiers.strength = this.attributes.strength.initial + this.attributes.strength.advancement;
|
||||
|
||||
this.computed.attributes.courage = this.computed.attributes_without_modifiers.courage + this.attributes.courage.modifier + this.computed.wunden_modifiers.courage;
|
||||
this.computed.attributes.cleverness = this.computed.attributes_without_modifiers.cleverness + this.attributes.cleverness.modifier + this.computed.wunden_modifiers.cleverness;
|
||||
this.computed.attributes.intuition = this.computed.attributes_without_modifiers.intuition + this.attributes.intuition.modifier + this.computed.wunden_modifiers.intuition;
|
||||
this.computed.attributes.charisma = this.computed.attributes_without_modifiers.charisma + this.attributes.charisma.modifier;
|
||||
this.computed.attributes.dexterity = this.computed.attributes_without_modifiers.dexterity + this.attributes.dexterity.modifier + this.computed.wunden_modifiers.dexterity;
|
||||
this.computed.attributes.agility = this.computed.attributes_without_modifiers.agility + this.attributes.agility.modifier + this.computed.wunden_modifiers.agility;
|
||||
this.computed.attributes.constitution = this.computed.attributes_without_modifiers.constitution + this.attributes.constitution.modifier + this.computed.wunden_modifiers.constitution;
|
||||
this.computed.attributes.strength = this.computed.attributes_without_modifiers.strength + this.attributes.strength.modifier + this.computed.wunden_modifiers.strength;
|
||||
|
||||
this.computed.lebenspunkte = {};
|
||||
this.computed.ausdauer = {};
|
||||
@ -694,9 +787,9 @@ class DSA41_CharacterData extends TypeDataModel {
|
||||
this.computed.kampf.ruestungen_gesamt[key] = Math.round(value);
|
||||
}
|
||||
|
||||
this.computed.initiative.wert = this.computed.initiative.basiswert + this.modifikator_initiative - this.computed.kampf.ruestungen_gesamt.gesamt_behinderung;
|
||||
this.computed.attacke.wert = this.computed.attacke.basiswert + this.modifikator_attacke;
|
||||
this.computed.parade.wert = this.computed.parade.basiswert + this.modifikator_parade;
|
||||
this.computed.initiative.wert = this.computed.initiative.basiswert + this.modifikator_initiative - this.computed.kampf.ruestungen_gesamt.gesamt_behinderung + this.computed.wunden_modifiers.initiative_basis;
|
||||
this.computed.attacke.wert = this.computed.attacke.basiswert + this.modifikator_attacke + this.computed.wunden_modifiers.attacke;
|
||||
this.computed.parade.wert = this.computed.parade.basiswert + this.modifikator_parade + this.computed.wunden_modifiers.parade;
|
||||
this.computed.fernkampf.wert = this.computed.fernkampf.basiswert + this.modifikator_fernkampf;
|
||||
|
||||
this.kampftalente = this.parent.items.filter((x) => x.type === "Kampftalent").sort((a, b) => a.name > b.name);
|
||||
@ -1560,6 +1653,13 @@ class DSA41_ActorSheet extends DSA41_ApplicationMixin(ActorSheetV2) {
|
||||
content: item.system.beschreibung,
|
||||
});
|
||||
},
|
||||
|
||||
"toggle-wound": async function(event, target) {
|
||||
const location = event.target.closest("[data-location]").dataset.location;
|
||||
const current_count = this.document.system.wunden[location];
|
||||
const toggled_count = Array.prototype.indexOf.call(event.target.parentNode.children, event.target) + 1;
|
||||
this.document.update({ ["system.wunden." + location]: toggled_count > current_count ? toggled_count : toggled_count - 1 });
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user