From dda93eeacbebe250df56bd3c5115b800e27cd4f6 Mon Sep 17 00:00:00 2001 From: macniel Date: Thu, 30 Oct 2025 23:06:51 +0100 Subject: [PATCH] implements basic liturgy casting dialog --- src/main.mjs | 11 + src/module/data/liturgy.mjs | 2 + src/module/data/miracle/liturgydata.mjs | 70 +++++- src/module/data/talent.mjs | 14 +- src/module/dialog/modify-liturgy.mjs | 218 +++++++++++++----- .../liturgie-initiation.json | 2 +- .../segnung-feuersegen.json | 2 +- .../segnung-glückssegen.json | 2 +- src/style/molecules/_attribute-die.scss | 144 ++++++++++++ src/style/molecules/_attributes.scss | 143 +----------- src/style/organisms/_modify-liturgy.scss | 112 ++++++--- src/templates/dialog/liturgy-dialog.hbs | 89 ++++--- src/templates/ui/partial-attribute-button.hbs | 3 +- 13 files changed, 549 insertions(+), 263 deletions(-) create mode 100644 src/style/molecules/_attribute-die.scss diff --git a/src/main.mjs b/src/main.mjs index 58a062df..a6f57f06 100644 --- a/src/main.mjs +++ b/src/main.mjs @@ -290,6 +290,17 @@ Hooks.once("init", () => { }, requiresReload: true }) + game.settings.register('DSA_4-1', 'optional_aufstufen_von_liturgien', { + name: "Optional: Aufstufen von Liturgien", + hint: "Aktiviert die Regeln zum Aufstufen von Liturgien", + scope: "world", + config: true, + type: Boolean, + default: false, + disabled: true, + requiresReload: true + }) + Handlebars.registerHelper("weight", (data) => { diff --git a/src/module/data/liturgy.mjs b/src/module/data/liturgy.mjs index 87095a4c..ba6cd0c2 100644 --- a/src/module/data/liturgy.mjs +++ b/src/module/data/liturgy.mjs @@ -13,7 +13,9 @@ export class LiturgyDataModel extends BaseItem { grad: new NumberField({min: 1, max: 5}), reichweite: new StringField(), ziel: new StringField(), + zielArt: new StringField(), // Person, Object wirkungsdauer: new StringField(), + zauberdauer: new StringField(), auswirkung: new SchemaField({ I: new StringField(), II: new StringField(), diff --git a/src/module/data/miracle/liturgydata.mjs b/src/module/data/miracle/liturgydata.mjs index 7cfdac1a..af08145d 100644 --- a/src/module/data/miracle/liturgydata.mjs +++ b/src/module/data/miracle/liturgydata.mjs @@ -3,8 +3,29 @@ export class LiturgyData { static ranks = ["I", "II", "III", "IV", "V", "VI", "VII", "VIII"] static #ranks = [ - {index: 0, name: "O", lkp: 3, mod: 2, costKaP: 2, costKaPPermant: 0, duration: "LkP* KR", strength: "LkP*/2"}, - {index: 1, name: "I", lkp: 3, mod: 0, costKaP: 5, costKaPPermant: 0, duration: "LkP* KR", strength: "LkP*/2"}, + { + index: 0, + name: "O", + lkp: 3, + mod: 2, + costKaP: 2, + costKaPPermant: 0, + duration: "Augenblicklich", + castDuration: "Stoßgebet", + strength: "LkP*/2" + }, + { + index: 1, + name: "I", + lkp: 3, + mod: 0, + costKaP: 5, + costKaPPermant: 0, + range: "Selbst", + castDuration: "Gebet", + duration: "LkP* KR", + strength: "LkP*/2" + }, { index: 2, name: "II", @@ -12,6 +33,9 @@ export class LiturgyData { mod: -2, costKaP: 10, costKaPPermant: 0, + range: "Berührung", + target: ["Geweihter"], + castDuration: "Andacht", duration: "LkP*10 KR", strength: "LkP/2+5" }, @@ -22,7 +46,10 @@ export class LiturgyData { mod: -4, costKaP: 15, costKaPPermant: 0, - duration: "LkP* SR", + range: "Sicht", + target: ["1 Person", "1 Objekt"], + castDuration: "Zeremonie", + duration: "LkP* Spielrunden", strength: "LkP*+5" }, { @@ -32,6 +59,9 @@ export class LiturgyData { mod: -6, costKaP: 20, costKaPPermant: 0, + range: "Fern", + target: ["10 Personen", "10 Objekte"], + castDuration: "Zyklus", duration: "LkP* Stunden", strength: "LkP*+10" }, @@ -42,6 +72,7 @@ export class LiturgyData { mod: -8, costKaP: 25, costKaPPermant: 1, + target: ["100 Personen", "100 Objekte"], duration: "LkP* Tage", strength: "LkP*+15" }, @@ -52,6 +83,7 @@ export class LiturgyData { mod: -10, costKaP: 30, costKaPPermant: 3, + target: ["1000 Personen", "1000 Objekte"], duration: "LkP* Wochen", strength: "LkP*+20" }, @@ -109,21 +141,45 @@ export class LiturgyData { ] static getModifiedStrength(originalString, rankIncrease) { - return this.#ranks[this.#ranks.findIndex(p => p.strength === originalString) + rankIncrease] + // TODO as "Flagge des Regenbogens" demonstrates there may be different variations of Strengths which separately needs to be adjusted + + return Object.assign({}, this.#ranks[this.#ranks.findIndex(p => p.strength === originalString) + rankIncrease]) } static getModifiedDuration(originalString, rankIncrease) { - return this.#ranks[this.#ranks.findIndex(p => p.duration === originalString) + rankIncrease] + + + let currentDuration = 0 + let durationText = "" + let adjustedDurationText = "" + let found = false + for (let {duration} of this.#ranks) { + if (originalString.indexOf(duration) !== -1) { + durationText = duration + adjustedDurationText = this.#ranks[currentDuration + rankIncrease].duration + found = true + break + } + ++currentDuration + } + + if (found) { + durationText = this.#ranks[currentDuration].duration + console.log({currentDuration, durationText, adjustedDurationText}) + return {currentDuration, durationText, adjustedDurationText} + } + + return {currentDuration: 0, durationText: originalString, adjustedDurationText: originalString} } static getModifiedRank(rank) { - return LiturgyData.#ranks[rank] + return Object.assign({}, LiturgyData.#ranks[rank]) } static getRankOfLiturgy(liturgy, deity) { const lookupData = liturgy.herkunft.find(p => p.name === deity) const rank = lookupData?.grad - return LiturgyData.#ranks[rank] + return Object.assign({}, LiturgyData.#ranks[rank]) } static lookupAlias(alias) { diff --git a/src/module/data/talent.mjs b/src/module/data/talent.mjs index 04762cce..3f477213 100644 --- a/src/module/data/talent.mjs +++ b/src/module/data/talent.mjs @@ -17,6 +17,7 @@ export class Talent { * @typedef TalentData * @property {String} name * @property {Number} taw + * @property {Number} mod * @property {TalentEigenschaften} eigenschaften * @property {"mu","kl","in","ch","ff","ge","ko","kk"} eigenschaft1 * @property {"mu","kl","in","ch","ff","ge","ko","kk"} eigenschaft2 @@ -55,6 +56,7 @@ export class Talent { const dsaDieRollEvaluated = this._evaluateRoll(evaluated1.terms[0].results, { taw: data.taw, + mod: data.mod, werte: [data.eigenschaften[data.eigenschaft1], data.eigenschaften[data.eigenschaft2], data.eigenschaften[data.eigenschaft3]], }) @@ -66,25 +68,25 @@ export class Talent { _evaluateRoll(rolledDice, { taw, + mod, lowerThreshold = 1, upperThreshold = 20, countToMeisterlich = 3, countToPatzer = 3, werte = [] }) { - let tap = taw; let meisterlichCounter = 0; let patzerCounter = 0; let failCounter = 0; rolledDice.forEach((rolledDie, index) => { - if (tap < 0 && rolledDie.result > werte[index]) { - tap -= rolledDie.result - werte[index]; - if (tap < 0) { // konnte nicht vollständig ausgeglichen werden + if (mod < 0 && rolledDie.result > werte[index]) { + mod -= rolledDie.result - werte[index]; + if (mod < 0) { // konnte nicht vollständig ausgeglichen werden failCounter++; } } else if (rolledDie.result > werte[index]) { // taw ist bereits aufgebraucht und wert kann nicht ausgeglichen werden - tap -= rolledDie.result - werte[index]; + mod -= rolledDie.result - werte[index]; failCounter++; } if (rolledDie.result <= lowerThreshold) meisterlichCounter++; @@ -92,7 +94,7 @@ export class Talent { }) return { - tap, + tap: Math.min(taw, mod), meisterlich: meisterlichCounter === countToMeisterlich, patzer: patzerCounter === countToPatzer, } diff --git a/src/module/dialog/modify-liturgy.mjs b/src/module/dialog/modify-liturgy.mjs index 9d9767eb..0883a298 100644 --- a/src/module/dialog/modify-liturgy.mjs +++ b/src/module/dialog/modify-liturgy.mjs @@ -1,4 +1,5 @@ import {LiturgyData} from "../data/miracle/liturgydata.mjs"; +import {Talent} from "../data/talent.mjs"; const {ApplicationV2, HandlebarsApplicationMixin} = foundry.applications.api @@ -16,7 +17,7 @@ export class LiturgyDialog extends HandlebarsApplicationMixin(ApplicationV2) { title: "Liturgie wirken" }, form: { - submitOnChange: false, + submitOnChange: true, closeOnSubmit: false, handler: LiturgyDialog.#onSubmitForm }, @@ -24,6 +25,7 @@ export class LiturgyDialog extends HandlebarsApplicationMixin(ApplicationV2) { selectVariant: LiturgyDialog.#selectVariant, addMod: LiturgyDialog.#addModification, removeMod: LiturgyDialog.#removeModification, + castLiturgy: LiturgyDialog.#castLiturgy, } } @@ -70,11 +72,16 @@ export class LiturgyDialog extends HandlebarsApplicationMixin(ApplicationV2) { }) this._variation = this._variations[0] this._mods = [] + this._blessing = this._actor.itemTypes["Blessing"].find(p => p.system.gottheit === this._deity) this._initialRank = 0 + this._circumstance = 0 } static async #onSubmitForm(event, form, formData) { event.preventDefault() + + this._circumstance = formData.object["circumstance"] + this.render({parts: ["form"]}) } static #selectVariant(event, target) { @@ -91,28 +98,91 @@ export class LiturgyDialog extends HandlebarsApplicationMixin(ApplicationV2) { static #addModification(event, target) { event.stopPropagation() event.preventDefault() - const value = this.element.querySelector('select[name="mod"]').value + if (game.settings.get("DSA_4-1", "optional_aufstufen_von_liturgien")) { + const value = this.element.querySelector('select[name="mod"]').value - if (value === '') return - const currentRank = this._mods.length + (this._variation?.level ?? 0) - this._mods.push({ - rank: currentRank, - displayRank: LiturgyDialog.#romanNumerals.findIndex(p => p === currentRank), - mod: value, - }) - this.render({parts: ["form"]}) + if (value === '') return + const currentRank = this._mods.length + (this._variation?.level ?? 0) + this._mods.push({ + rank: currentRank, + displayRank: LiturgyDialog.#romanNumerals.findIndex(p => p === currentRank), + mod: value, + }) + this.render({parts: ["form"]}) + } return false } static #removeModification(event, target) { event.stopPropagation() event.preventDefault() - const {index} = target.dataset - this._mods.splice(index, 1) - this.render({parts: ["form"]}) + if (game.settings.get("DSA_4-1", "optional_aufstufen_von_liturgien")) { + const {index} = target.dataset + this._mods.splice(index, 1) + this.render({parts: ["form"]}) + } return false } + static async #castLiturgy(event, target) { + + const lkp = context.lkp = this._blessing.system.wert + const resultingLiturgy = this.#getLiturgyData() + const circumstance = this._circumstance + + const mod = 0 + lkp + resultingLiturgy.castPenalty - circumstance + + const castingTime = this.#normalizeCastingTime(this._liturgy) + + //TODO push it into the sun eeerh cooldown queue + //if (castingTime > 0) { + + // this._actor.system.cooldowns.push() + //} else { + const result = await new Talent({ + name: this._liturgy.name, + taw: lkp, + mod: mod, + eigenschaften: { + mu: this._actor.system.attribute.mu.aktuell, + in: this._actor.system.attribute.in.aktuell, + ch: this._actor.system.attribute.ch.aktuell, + }, + eigenschaft1: "mu", + eigenschaft2: "mu", + eigenschaft3: "mu" + }).evaluate("publicroll") + + result.evaluatedRoll.toMessage({ + speaker: ChatMessage.getSpeaker({actor: this._actor}), + flavor: `Liturgie: ${this._liturgy.name}
Zauberdauer: ${castingTime > 0 ? castingTime + " Aktionen" : resultingLiturgy.castduration}
LkP*: ${result.tap}
${result.meisterlich ? "Meisterlich" : ""}${result.patzer ? "Petzer" : ""}
${this._variation.effect}`, + }) + //} + + this.close() + } + + #normalizeCastingTime(liturgy) { + + const castingTime = liturgy.system.zauberdauer + + // direct actions + const stoßgebetRegExp = /(.*) Aktionen \(Stoßgebet\)/ + const gebetRegExp = /(.*) Spielrunden? \(Gebet\)/ + const invalidForCooldownRegExp = /Andacht|Zeremonie|Zyklus/ + + if (castingTime.match(stoßgebetRegExp)) { + const [_, actions] = castingTime.match(stoßgebetRegExp) + return actions + } else if (castingTime.match(gebetRegExp)) { + const [_, actions] = castingTime.match(stoßgebetRegExp) + return actions * 20 + } else if (castingTime.match(invalidForCooldownRegExp)) { + return -1 + } + return -1 + } + _configureRenderOptions(options) { super._configureRenderOptions(options) @@ -120,60 +190,86 @@ export class LiturgyDialog extends HandlebarsApplicationMixin(ApplicationV2) { if (this._liturgy) { options.window.title = `${this._liturgy.name} wirken` } + if (game.settings.get("DSA_4-1", "optional_aufstufen_von_liturgien")) { + options.position.height = 800 + } else { + options.position.height = 640 + } } + return options } #getLiturgyData() { - let baseline = LiturgyData.getModifiedRank(this._variation?.level ?? 0) - - baseline.duration = this._liturgy.system.wirkungsdauer - - let upgradeDuration = false - let upgradeCastDuration = false - let upgradeStrength = false - - this._mods.forEach(({mod}) => { - switch (mod) { - case "range": - break; - case "strength": - upgradeStrength = true - break; - case "target": - break; - case "castduration": - upgradeCastDuration = true - break; - case "duration": - upgradeDuration = true - break; - } - }) + let baseline = this._liturgy.system baseline.name = this._liturgy.name - baseline.effectiveLevel = (this._variation?.level ?? 0) + this._mods.length - baseline.costKaP = LiturgyData.getModifiedRank(baseline.effectiveLevel).costKaP - baseline.costKaPPermanent = LiturgyData.getModifiedRank(baseline.effectiveLevel).costKaPPermanent - baseline.mod = LiturgyData.getModifiedRank(baseline.effectiveLevel).mod - baseline.rank = LiturgyData.getModifiedRank(baseline.effectiveLevel).name + + if (game.settings.get("DSA_4-1", "optional_aufstufen_von_liturgien")) { - // insert mods into text - baseline.text = this._variation.effect + let upgradeDuration = false + let upgradeCastDuration = false + let upgradeStrength = false - const strengthRegexp = /(LkP\*.*?)[ .]/g + this._mods.forEach(({mod}) => { + switch (mod) { + case "range": + break; + case "strength": + upgradeStrength = true + break; + case "target": + break; + case "castduration": + upgradeCastDuration = true + break; + case "duration": + upgradeDuration = true + break; + } + }) - baseline.text = baseline.text.replace(strengthRegexp, LiturgyData.getModifiedRank((baseline.effectiveLevel ?? 0) + upgradeStrength).strength) + baseline.effectiveLevel = (this._variation?.level ?? 0) + this._mods.length + baseline.costKaP = LiturgyData.getModifiedRank(baseline.effectiveLevel).costKaP + baseline.costKaPPermanent = LiturgyData.getModifiedRank(baseline.effectiveLevel).costKaPPermanent + //baseline.mod = LiturgyData.getModifiedRank(baseline.effectiveLevel).mod + baseline.rank = LiturgyData.getModifiedRank(baseline.effectiveLevel).name - const durationRegexp = /(LkP\*?.*?)(\*10 KR| Stunden| Tage| Wochen| Monate| Jahre oder permanent)/g + // estimate duration rank - const effectiveDuration = LiturgyData.getModifiedDuration((baseline.effectiveLevel ?? 0) + upgradeDuration + upgradeStrength).duration - baseline.duration = baseline.duration.replace(durationRegexp, effectiveDuration.replace("{*}", "LkP")) + // insert mods into text + baseline.text = this._variation.effect + const strengthRegexp = /(LkP\*.*?)[ .]/g + + //baseline.text = baseline.text.replace(strengthRegexp, LiturgyData.getModifiedRank((baseline.effectiveLevel ?? 0) + upgradeStrength).strength) + + const durationRegexp = /(LkP\*?.*?)(\*10 KR| Stunden| Tage| Wochen| Monate| Jahre oder permanent)/g + + const effectiveDuration = LiturgyData.getModifiedDuration(baseline.duration, upgradeDuration + upgradeStrength) + + baseline.duration = baseline.duration.replace(effectiveDuration.durationText, effectiveDuration.adjustedDurationText) + } else { + baseline.rank = this._variation.rank + baseline.text = this._variation.effect + baseline.target = baseline.ziel + baseline.duration = baseline.wirkungsdauer + baseline.castduration = baseline.zauberdauer + baseline.costKaP = LiturgyData.getModifiedRank(this._variation.level).costKaP + baseline.costKaPPermanent = LiturgyData.getModifiedRank(this._variation.level).costKaPPermanent + + + if (this._variation.level > this._liturgy.system.herkunft.find(p => p.name === this._deity).grad) { + baseline.castPenalty = LiturgyData.getModifiedRank(this._liturgy.system.herkunft.find(p => p.name === this._deity).grad).mod + } else { + baseline.castPenalty = LiturgyData.getModifiedRank(this._variation.level).mod + } + + } return baseline } @@ -186,11 +282,27 @@ export class LiturgyDialog extends HandlebarsApplicationMixin(ApplicationV2) { context.variation = this._variation context.maxmods = this._maxmods context.variations = this._variations - - context.canMod = (this._maxmods - (this._variation?.level ?? 0) - this._mods.length) >= 0 + context.colorfulDice = game.settings.get('DSA_4-1', 'optional_colorfuldice') + context.mu = {wert: this._actor.system.attribute.mu.aktuell, name: "MU", tooltip: "Mut"} + context.in = {wert: this._actor.system.attribute.in.aktuell, name: "IN", tooltip: "Intuition"} + context.ch = {wert: this._actor.system.attribute.ch.aktuell, name: "CH", tooltip: "Charisma"} + context.moddingEnabled = game.settings.get("DSA_4-1", "optional_aufstufen_von_liturgien") + context.canMod = game.settings.get("DSA_4-1", "optional_aufstufen_von_liturgien") && (this._maxmods - (this._variation?.level ?? 0) - this._mods.length) >= 0 context.addingModRank = LiturgyDialog.#romanNumerals[(context._variation?.level ?? 0) + this._mods.length + 1] - + context.lkp = this._blessing.system.wert + context.deity = this._blessing.system.name context.resultingLiturgy = this.#getLiturgyData() + context.resultingCastPenalty = 0 + context.circumstance = this._circumstance + if (context.resultingLiturgy.castPenalty > 0) { + context.resultingCastPenalty = `+${context.resultingLiturgy.castPenalty}` + } else { + context.resultingCastPenalty = context.resultingLiturgy.castPenalty + } + + context.modResult = 0 + context.lkp + context.resultingLiturgy.castPenalty - this._circumstance + + context.displayModResult = context.modResult > 0 ? "+" + context.modResult : context.modResult return context } diff --git a/src/packs/_source/liturgien-und-segnungen/liturgie-initiation.json b/src/packs/_source/liturgien-und-segnungen/liturgie-initiation.json index f13bb118..90f46be4 100644 --- a/src/packs/_source/liturgien-und-segnungen/liturgie-initiation.json +++ b/src/packs/_source/liturgien-und-segnungen/liturgie-initiation.json @@ -55,7 +55,7 @@ ], "reichweite": "Berührung", "ziel": "1 Person", - "zauberdauer": "1/2 Stund (Andacht)", + "zauberdauer": "1/2 Stunde (Andacht)", "wirkungsdauer": "permanent; kann nur durch eine Exkommunikation aufgehoben werden", "auswirkung": { "II": "Zwölfjährige oder Bekehrte werden mittels dieser Liturgie in den Zwölfgötterkult eingeführt, ihren Seelen steht prinzipiell eines der zwölfgöttlichen Paradiese offen. Im Zuge der Initiation erkennen Geweihte auch, ob Kinder potenzielle Novizen darstellen." diff --git a/src/packs/_source/liturgien-und-segnungen/segnung-feuersegen.json b/src/packs/_source/liturgien-und-segnungen/segnung-feuersegen.json index c929e513..8804de80 100644 --- a/src/packs/_source/liturgien-und-segnungen/segnung-feuersegen.json +++ b/src/packs/_source/liturgien-und-segnungen/segnung-feuersegen.json @@ -54,7 +54,7 @@ } ], "reichweite": "selbst / Sicht (Variante des Feuerschutzes)", - "ziel": "Gewewihter / 1 Gegenstand (Variante des Feuerschutzes)", + "ziel": "Geweihter / 1 Gegenstand (Variante des Feuerschutzes)", "zauberdauer": "1 Spielrunde (Gebet)", "wirkungsdauer": "bis zum Ende der Probe, maximal LkP* Tage", "auswirkung": { diff --git a/src/packs/_source/liturgien-und-segnungen/segnung-glückssegen.json b/src/packs/_source/liturgien-und-segnungen/segnung-glückssegen.json index a9143bfa..b2e19476 100644 --- a/src/packs/_source/liturgien-und-segnungen/segnung-glückssegen.json +++ b/src/packs/_source/liturgien-und-segnungen/segnung-glückssegen.json @@ -1,5 +1,5 @@ { - "name": "Geburtssegen", + "name": "Glückssegen", "alias": [], "grad": 1, "primärHerkunft": "Phex", diff --git a/src/style/molecules/_attribute-die.scss b/src/style/molecules/_attribute-die.scss new file mode 100644 index 00000000..918be118 --- /dev/null +++ b/src/style/molecules/_attribute-die.scss @@ -0,0 +1,144 @@ +@use "../atoms/colours"; +@use "../atoms/numbers"; +@use "../atoms/assets"; +@use "sass:color"; + +@mixin attributes { + display: flex; + position: relative; + top: -10px; + right: -10px; + + .attribute { + width: 48px; + height: 48px; + position: relative; + margin-left: 2px; + + .die { + + svg { + position: absolute; + + path { + fill: colours.$attribute-die-color; + } + } + } + + .wert { + font-weight: bold; + position: absolute; + left: -1px; + width: 48px; + top: -1px; + font-size: smaller; + line-height: 48px; + vertical-align: middle; + text-align: center; + color: colours.$attribute-die-label-color; + } + + .name { + position: absolute; + left: 0; + right: 0; + bottom: -12px; + line-height: 12px; + vertical-align: middle; + text-align: center; + color: colours.$attribute-label-color; + } + } + + &.colorfulDice { + + &.Mut { + + .die svg path { + fill: colours.$attribute-die-co-color; + } + + .wert { + color: colours.$attribute-die-co-text-color; + } + } + + .Klugheit { + + .die svg path { + fill: colours.$attribute-die-sm-color; + } + + .wert { + color: colours.$attribute-die-sm-text-color; + } + } + + .Intuition { + + .die svg path { + fill: colours.$attribute-die-in-color; + } + + .wert { + color: colours.$attribute-die-in-text-color; + } + } + + .Charisma { + + .die svg path { + fill: colours.$attribute-die-ch-color; + } + + .wert { + color: colours.$attribute-die-ch-text-color; + } + } + + .Geschicklichkeit { + + .die svg path { + fill: colours.$attribute-die-dx-color; + } + + .wert { + color: colours.$attribute-die-dx-text-color; + } + } + + .Fingerfertigkeit { + + .die svg path { + fill: colours.$attribute-die-ag-color; + } + + .wert { + color: colours.$attribute-die-ag-text-color; + } + } + + .Konstitution { + + .die svg path { + fill: colours.$attribute-die-bd-color; + } + + .wert { + color: colours.$attribute-die-bd-text-color; + } + } + + .Körperkraft { + + .die svg path { + fill: colours.$attribute-die-st-color; + } + + .wert { + color: colours.$attribute-die-st-text-color; + } + } + } +} diff --git a/src/style/molecules/_attributes.scss b/src/style/molecules/_attributes.scss index 178a3cfa..6aa036aa 100644 --- a/src/style/molecules/_attributes.scss +++ b/src/style/molecules/_attributes.scss @@ -2,6 +2,7 @@ @use "../atoms/numbers"; @use "../atoms/assets"; @use "sass:color"; +@use "attribute-die"; .dsa41.sheet.actor.character { @@ -9,145 +10,9 @@ position: relative; .attributes { - display: flex; - position: relative; - top: -10px; - right: -10px; - - .attribute.rollable { - width: 48px; - height: 48px; - position: relative; - margin-left: 2px; - - .die { - - svg { - position: absolute; - - path { - fill: colours.$attribute-die-color; - } - } - } - - .wert { - font-weight: bold; - position: absolute; - left: -1px; - width: 48px; - top: -1px; - font-size: smaller; - line-height: 48px; - vertical-align: middle; - text-align: center; - color: colours.$attribute-die-label-color; - } - - .name { - position: absolute; - left: 0; - right: 0; - bottom: -12px; - line-height: 12px; - vertical-align: middle; - text-align: center; - color: colours.$attribute-label-color; - } - } - - &.colorfulDice { - - &.Mut { - - .die svg path { - fill: colours.$attribute-die-co-color; - } - - .wert { - color: colours.$attribute-die-co-text-color; - } - } - - .Klugheit { - - .die svg path { - fill: colours.$attribute-die-sm-color; - } - - .wert { - color: colours.$attribute-die-sm-text-color; - } - } - - .Intuition { - - .die svg path { - fill: colours.$attribute-die-in-color; - } - - .wert { - color: colours.$attribute-die-in-text-color; - } - } - - .Charisma { - - .die svg path { - fill: colours.$attribute-die-ch-color; - } - - .wert { - color: colours.$attribute-die-ch-text-color; - } - } - - .Geschicklichkeit { - - .die svg path { - fill: colours.$attribute-die-dx-color; - } - - .wert { - color: colours.$attribute-die-dx-text-color; - } - } - - .Fingerfertigkeit { - - .die svg path { - fill: colours.$attribute-die-ag-color; - } - - .wert { - color: colours.$attribute-die-ag-text-color; - } - } - - .Konstitution { - - .die svg path { - fill: colours.$attribute-die-bd-color; - } - - .wert { - color: colours.$attribute-die-bd-text-color; - } - } - - .Körperkraft { - - .die svg path { - fill: colours.$attribute-die-st-color; - } - - .wert { - color: colours.$attribute-die-st-text-color; - } - } - - } - + @include attribute-die.attributes } + } + } diff --git a/src/style/organisms/_modify-liturgy.scss b/src/style/organisms/_modify-liturgy.scss index 86414daa..496f91b2 100644 --- a/src/style/organisms/_modify-liturgy.scss +++ b/src/style/organisms/_modify-liturgy.scss @@ -1,45 +1,103 @@ +@use "../molecules/attribute-die"; + .dsa41.dialog.liturgy { - table { - tr { - th:first-child { - width: 48px; + section[data-application-part] { + + display: flex; + flex-direction: column; + gap: 16px; + height: 100%; + + .attributes { + @include attribute-die.attributes; + top: 0; + left: 0; + justify-content: center; + + hr.zier { + flex: 1; + align-self: center; + border-top: 1px inset; + } + } - } - table#mods { - - tr { - th:first-child { - width: 48px; + table { + tr { + th:first-child { + width: 48px; + } } } - .remove-mod { - width: 32px; - height: 32px; + .scroll-y { + flex: 1; + overflow: hidden; + overflow-y: auto; } - } + table#mods { - .editor { + tr { + th:first-child { + width: 48px; + } + } - display: grid; - grid-template-columns: 48px 1fr; - - #mod_rank { - display: inline-block; - width: 48px; - } - - select { + .remove-mod { + width: 32px; + height: 32px; + } } - } + .editor { - .dialog-buttons { - flex: 0; + display: grid; + grid-template-columns: 48px 1fr; + + #mod_rank { + display: inline-block; + width: 48px; + } + + select { + + } + + } + + .malus-and-mod { + display: grid; + grid-template-columns: 1fr 1fr 1fr; + grid-template-rows: 1fr; + gap: 0 8px; + + label { + + span { + text-align: center; + } + + output { + height: 32px; + width: 100%; + line-height: 32px; + vertical-align: middle; + display: block; + padding: 0 8px; + border: 1px inset; + border-radius: 4px; + box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.1); + } + } + } + + .actions { + align-self: center; + flex: 0; + } } } diff --git a/src/templates/dialog/liturgy-dialog.hbs b/src/templates/dialog/liturgy-dialog.hbs index 90b9ff3c..4ff69552 100644 --- a/src/templates/dialog/liturgy-dialog.hbs +++ b/src/templates/dialog/liturgy-dialog.hbs @@ -1,20 +1,49 @@
- - - - - - - {{#each variations}} - - - - - {{/each}} + +
+ +
+ + {{> "systems/DSA_4-1/templates/ui/partial-attribute-button.hbs" this.mu}} + {{> "systems/DSA_4-1/templates/ui/partial-attribute-button.hbs" this.in}} + {{> "systems/DSA_4-1/templates/ui/partial-attribute-button.hbs" this.ch}} + +
+ +
-
GradWirkung
{{this.effect}}
+
+ {{#if resultingLiturgy}} +
Liturgie: {{resultingLiturgy.name}}
+
Grad: {{resultingLiturgy.rank}}
+
Kosten: {{resultingLiturgy.costKaP}} KaP {{#if resultingLiturgy.costKaPPermanent}} + (davon {{resultingLiturgy.costKaP}} permanent){{/if}}
+
Ziel: {{resultingLiturgy.target}}
+
Wirkdauer: {{resultingLiturgy.duration}}
+
Wirkzeit: {{resultingLiturgy.castduration}}
+ {{/if}} +
+ +
+ + + + + + {{#each variations}} + + + + + {{/each}} + + +
GradWirkung
{{this.effect}}
+
+ + {{#if moddingEnabled}}

Modifizieren

@@ -49,18 +78,26 @@ + {{/if}} -
- {{#if resultingLiturgy}} -
Liturgie: {{resultingLiturgy.name}}
-
Grad: {{resultingLiturgy.rank}}
-
Kosten:{{resultingLiturgy.costKaP}} KaP {{#if resultingLiturgy.costKaPPermanent}} - (davon {{resultingLiturgy.costKaP}} permanent){{/if}}
-
Ziel:{{resultingLiturgy.target}}
-
Wirkdauer:{{resultingLiturgy.duration}}
-
Wirkzeit:{{resultingLiturgy.casttime}}
-
{{resultingLiturgy.text}}
+
+ Erschwernisse +
+ + + +
+ +
+ + + - {{/if}} -
\ No newline at end of file diff --git a/src/templates/ui/partial-attribute-button.hbs b/src/templates/ui/partial-attribute-button.hbs index 4e439926..95158308 100644 --- a/src/templates/ui/partial-attribute-button.hbs +++ b/src/templates/ui/partial-attribute-button.hbs @@ -1,6 +1,5 @@
+ data-value="{{this.wert}}">
{{> 'systems/DSA_4-1/templates/ui/partial-die.hbs' }}