diff --git a/src/module/dialog/restingDialog.mjs b/src/module/dialog/restingDialog.mjs index 7dcc00dd..e71efc4a 100644 --- a/src/module/dialog/restingDialog.mjs +++ b/src/module/dialog/restingDialog.mjs @@ -33,7 +33,7 @@ export class RestingDialog extends HandlebarsApplicationMixin(ApplicationV2) { } /** - * @type {Actor} + * @type {Character} * @private */ _actor = null @@ -159,7 +159,7 @@ export class RestingDialog extends HandlebarsApplicationMixin(ApplicationV2) { this.badWeather = -1 this.woundTreated = false this.woundRegenerationModifier = 0 - this.wounds = 1 + this.wounds = this._actor.getWoundModel().current this.badCamp = false this.watch = false this.interrupted = false @@ -176,13 +176,14 @@ export class RestingDialog extends HandlebarsApplicationMixin(ApplicationV2) { static async #regenerate() { const context = this.#updateData() - const rollData = this._actor.getRollData() + const rollData = this._actor.system // regenerate LeP const targetBonusLep = rollData.attribute.ko.aktuell + context.koRoll const targetBonusAsp = rollData.attribute.in.aktuell + context.inRoll + // TODO: needs to be situational (not every character has AsP for example) and not a compound roll statement const regenerationRoll = await new Roll("1d20[Konstitution]+1d20[Intuition]+1d20[Konstitution] + 2d6").evaluate() const [koRoll, _, inRoll, __, woundRoll, ___, lepAndAsp] = regenerationRoll.terms // the 3d20s @@ -191,6 +192,7 @@ export class RestingDialog extends HandlebarsApplicationMixin(ApplicationV2) { const woundHealed = woundRoll.results[0].result <= rollData.attribute.ko.aktuell + (context.woundMod * -1) const [regLep, regAsp] = lepAndAsp.results // the 2d6s + // TODO: message needs to be better structured, and also include Buttons to heal LeP and restore AsP await regenerationRoll.toMessage({ speaker: ChatMessage.getSpeaker({actor: this.actor}), flavor: @@ -245,8 +247,6 @@ export class RestingDialog extends HandlebarsApplicationMixin(ApplicationV2) { context.hasAsP = true context.wounds = this.wounds - // TODO count wounds - let lepRestModifier = 0 let aspRestModifier = 0 diff --git a/src/module/documents/character.mjs b/src/module/documents/character.mjs index 5fdfd117..85283053 100644 --- a/src/module/documents/character.mjs +++ b/src/module/documents/character.mjs @@ -621,4 +621,38 @@ export class Character extends Actor { } await this.update({system: {lep: {aktuell: previousLeP - damage}}}) } + + getWoundModel() { + if (this.type === "Character") { + const actorData = this; + const systemData = actorData.system; + let returnValue = { + max: 0, + current: 0, + ws: 0 + } + + returnValue.max = systemData.wunden.max; + console.log("spiel mit trefferzonen: ", game.settings.get("DSA_4-1", "optional_trefferzonen")); + if (game.settings.get("DSA_4-1", "optional_trefferzonen")) { + returnValue.current = + systemData.wunden.kopf + + systemData.wunden.brust + + systemData.wunden.bauch + + systemData.wunden.ruecken + + systemData.wunden.armlinks + + systemData.wunden.armrechts + + systemData.wunden.beinlinks + + systemData.wunden.beinrechts + + systemData.wunden.gesamt; + } else { + returnValue.current = systemData.wunden.aktuell; + } + + returnValue.ws = systemData.ws; + return returnValue; + } else { + return null; + } + } } diff --git a/src/style/organisms/_resting-dialog.scss b/src/style/organisms/_resting-dialog.scss index 6d6ef938..da65fa30 100644 --- a/src/style/organisms/_resting-dialog.scss +++ b/src/style/organisms/_resting-dialog.scss @@ -1,4 +1,5 @@ -.application.dsa41.dialog.resting { +.application.dsa41.dialog.resting, +.application.dsa41.dialog.meditating { section { @@ -13,6 +14,7 @@ div.setting { margin-left: 32px; padding-bottom: 16px; + position: relative; &.setting-nest-1 { margin-left: 64px; @@ -23,6 +25,14 @@ margin-left: 34px; } + input[type="checkbox"] { + margin-left: -32px; + + &+span { + margin-left: 6px; + } + } + &.combined { input[type="checkbox"], input[type="radio"] { margin-left: -32px; @@ -43,6 +53,8 @@ input[type="checkbox"], input[type="radio"] { margin-left: -32px; padding-right: 8px; + position: absolute; + left: 0; } span { diff --git a/src/templates/dialog/resting-dialog.hbs b/src/templates/dialog/resting-dialog.hbs index ac4dd9af..aeaf2819 100644 --- a/src/templates/dialog/resting-dialog.hbs +++ b/src/templates/dialog/resting-dialog.hbs @@ -1,24 +1,25 @@
- + {{!-- TODO: Refactor dialog and explain more what each and every knob and input does --}}
-
+