From 47280f7216b31824447f56d94a551c5c41f9827b Mon Sep 17 00:00:00 2001 From: macniel Date: Thu, 13 Nov 2025 15:04:34 +0100 Subject: [PATCH] beginning operation:health. --- .../character/{combat.mjs => health.mjs} | 15 +++---- src/module/sheets/characterSheet.mjs | 14 +++---- src/style/organisms/_character-sheet.scss | 10 ++--- .../{_combat.scss => _health.scss} | 0 .../{tab-combat.hbs => tab-health.hbs} | 40 +++++++++---------- 5 files changed, 40 insertions(+), 39 deletions(-) rename src/module/sheets/character/{combat.mjs => health.mjs} (81%) rename src/style/organisms/character-tabs/{_combat.scss => _health.scss} (100%) rename src/templates/actor/character/{tab-combat.hbs => tab-health.hbs} (89%) diff --git a/src/module/sheets/character/combat.mjs b/src/module/sheets/character/health.mjs similarity index 81% rename from src/module/sheets/character/combat.mjs rename to src/module/sheets/character/health.mjs index ff41d23c..0e409976 100644 --- a/src/module/sheets/character/combat.mjs +++ b/src/module/sheets/character/health.mjs @@ -1,5 +1,3 @@ -import {ActionManager} from "../actions/action-manager.mjs"; - export default { _prepareContext: async (context, object) => { @@ -15,9 +13,6 @@ export default { return object.items.get(object.system.heldenausruestung[setNumber]?.[slot]) } - const am = new ActionManager(actorData) - context.actions = am.evaluate().filter(action => action.type !== ActionManager.ATTACK) - context.inidice = actorData.system.ini.wuerfel context.inivalue = actorData.system.ini.aktuell context.inimod = actorData.system.ini.mod @@ -32,6 +27,12 @@ export default { context.aspcurrent = actorData.system.asp.aktuell ?? 0 context.kapcurrent = actorData.system.kap.aktuell ?? 0 + context.effects = [] + for (let i = 0; i < actorData.appliedEffects.length; i++) { + const item = actorData.appliedEffects[i] + context.effects.push(item.name) + } + return context }, @@ -39,7 +40,7 @@ export default { }, _getTabConfig: (group) => { - group.tabs.push({id: "combat", group: "sheet", label: "Kampf"}) + group.tabs.push({id: "health", group: "sheet", label: "Gesundheit"}) }, - template: `systems/DSA_4-1/templates/actor/character/tab-combat.hbs` + template: `systems/DSA_4-1/templates/actor/character/tab-health.hbs` } \ No newline at end of file diff --git a/src/module/sheets/characterSheet.mjs b/src/module/sheets/characterSheet.mjs index 51e5ee86..2c8a6064 100644 --- a/src/module/sheets/characterSheet.mjs +++ b/src/module/sheets/characterSheet.mjs @@ -1,5 +1,5 @@ import Advsf from "./character/advsf.mjs" -import Combat from "./character/combat.mjs" +import Health from "./character/health.mjs" import Effects from "./character/effects.mjs" import Equipment from "./character/equipment.mjs" import Liturgies from "./character/liturgies.mjs" @@ -80,8 +80,8 @@ class CharacterSheet extends HandlebarsApplicationMixin(ActorSheetV2) { advsf: { template: Advsf.template }, - combat: { - template: Combat.template + health: { + template: Health.template }, equipment: { template: Equipment.template, @@ -329,7 +329,7 @@ class CharacterSheet extends HandlebarsApplicationMixin(ActorSheetV2) { Meta._getTabConfig(tabs, this) Social._getTabConfig(tabs, this) Advsf._getTabConfig(tabs, this) - Combat._getTabConfig(tabs, this) + Health._getTabConfig(tabs, this) Equipment._getTabConfig(tabs, this) Skills._getTabConfig(tabs, this) Spells._getTabConfig(tabs, this) @@ -572,8 +572,8 @@ class CharacterSheet extends HandlebarsApplicationMixin(ActorSheetV2) { case "advsf": await Advsf._prepareContext(context, this.document) break - case "combat": - await Combat._prepareContext(context, this.document) + case "health": + await Health._prepareContext(context, this.document) break case "equipment": await Equipment._prepareContext(context, this.document, this) @@ -598,7 +598,7 @@ class CharacterSheet extends HandlebarsApplicationMixin(ActorSheetV2) { Meta._onRender(context, options, this.element) Social._onRender(context, options, this.element) Advsf._onRender(context, options, this) - Combat._onRender(context, options, this.element) + Health._onRender(context, options, this.element) Effects._onRender(context, options, this.element) Equipment._onRender(context, options, this) Liturgies._onRender(context, options, this.element) diff --git a/src/style/organisms/_character-sheet.scss b/src/style/organisms/_character-sheet.scss index a653ed6f..4be1f8b5 100644 --- a/src/style/organisms/_character-sheet.scss +++ b/src/style/organisms/_character-sheet.scss @@ -5,7 +5,7 @@ @use "./character-tabs/social"; @use "./character-tabs/advsf"; @use "./character-tabs/inventory"; -@use "./character-tabs/combat"; +@use "./character-tabs/health"; @use "./character-tabs/spells"; @use "./character-tabs/liturgies"; @use "./character-tabs/skills"; @@ -95,8 +95,8 @@ @include inventory.tab; } - .tab.combat.active { - @include combat.tab; + .tab.health.active { + @include health.tab; } .tab.skills.active { @@ -135,8 +135,8 @@ @include inventory.tab(true); } - .tab.combat.active { - @include combat.tab(true); + .tab.health.active { + @include health.tab(true); } .tab.skills.active { diff --git a/src/style/organisms/character-tabs/_combat.scss b/src/style/organisms/character-tabs/_health.scss similarity index 100% rename from src/style/organisms/character-tabs/_combat.scss rename to src/style/organisms/character-tabs/_health.scss diff --git a/src/templates/actor/character/tab-combat.hbs b/src/templates/actor/character/tab-health.hbs similarity index 89% rename from src/templates/actor/character/tab-combat.hbs rename to src/templates/actor/character/tab-health.hbs index 67511b0f..2d49e510 100644 --- a/src/templates/actor/character/tab-combat.hbs +++ b/src/templates/actor/character/tab-health.hbs @@ -1,7 +1,6 @@ -
- +
@@ -55,23 +54,25 @@
{{/if}} +
+ +
-
-

Aktionen im Kampf

-
-
- Angriff - variabel -
-
- Verteidigen - variabel -
+
+ +
- {{#each this.actions}} - {{> "systems/DSA_4-1/templates/ui/partial-action-button.hbs" this}} - {{/each}} -
+
+ +
    + {{#each effects}} +
  • {{this}}
  • + {{/each}} +
{{#if (or trefferzonen zonenruestung)}} @@ -111,5 +112,4 @@
{{/if}} -