displays costs that are too complex to calculate as text and also puts spell descriptions into details.

main
macniel 2026-02-16 15:50:47 +01:00
parent fd003075da
commit eebf7f3fd7
2 changed files with 16 additions and 8 deletions

View File

@ -211,7 +211,7 @@ export class SpellDialog extends HandlebarsApplicationMixin(ApplicationV2) {
}) })
} }
let message = this._spell.system.wirkung let message = `<details><summary>${this._spell.name}</summary>${this._spell.system.wirkung}</details>`
if (this._activeVariants?.length > 0 ?? false) { if (this._activeVariants?.length > 0 ?? false) {
message += "<hr/>" message += "<hr/>"
message += this._activeVariants.map(v => v.name).join(", ") message += this._activeVariants.map(v => v.name).join(", ")
@ -232,12 +232,19 @@ export class SpellDialog extends HandlebarsApplicationMixin(ApplicationV2) {
}) })
} }
if (this.cost) {
message += `Kosten: [[/roll ${this.cost}]]{${this.cost}}` message += `Kosten: [[/roll ${this.cost}]]{${this.cost}}`
//TODO: get complex key from cost } else {
if (this._costModel.complex) {
message += `Kosten: ${this._costModel.complex}`
}
}
message += "<hr/>" + this.zfp + " ZfP*<br/>" + this._spell.system.zfw + " ZfW" message += "<hr/>" + this.zfp + " ZfP*<br/>" + this._spell.system.zfw + " ZfW"
if (Number.isNaN(this.castingTime)) {
this.castingTime = 0
}
let currentCooldown = 0 let currentCooldown = 0
if (game.combats.size === 0) { // no combat started if (game.combats.size === 0) { // no combat started
currentCooldown = this.castingTime currentCooldown = this.castingTime
@ -635,6 +642,7 @@ export class SpellDialog extends HandlebarsApplicationMixin(ApplicationV2) {
context.notReadyReasons += `<li>${game.i18n.format("SPELL_DIALOG.notReadyReason.tooManySpoMods")}</li>` context.notReadyReasons += `<li>${game.i18n.format("SPELL_DIALOG.notReadyReason.tooManySpoMods")}</li>`
} }
if (!this._selectedRepresentation) { if (!this._selectedRepresentation) {
context.noSelectedRepresentation = true
context.notReadyReasons += `<li>${game.i18n.format("SPELL_DIALOG.notReadyReason.noRepresentation")}</li>` context.notReadyReasons += `<li>${game.i18n.format("SPELL_DIALOG.notReadyReason.noRepresentation")}</li>`
} }
context.notReadyReasons += "</ul>" context.notReadyReasons += "</ul>"

View File

@ -63,13 +63,13 @@
</fieldset> </fieldset>
{{/if}} {{/if}}
<button class="actions" data-action="diceRoll"><i class="fa-solid fa-dice"></i> Zauber würfeln {{#if <button class="actions" {{#unless noSelectedRepresentation}}data-action="diceRoll"{{else}} disabled="disabled"{{/unless}}><i class="fa-solid fa-dice"></i> Zauber würfeln {{#if
displayModResult}} displayModResult}}
[{{displayModResult}}]{{/if}}</button> [{{displayModResult}}]{{/if}}</button>
{{else}} {{else}}
<fieldset> <fieldset class="scroll-y">
<legend>{{spellName}}</legend> <legend>{{spellName}}</legend>
{{{this.text}}} {{{this.text}}}
{{#if variant}} {{#if variant}}