[V14] 1354 - Armor Effect (#1652)

* Initial

* progress

* Working armor application

* .

* Added a updateArmorValue function that updates armoreffects according to an auto order

* .

* Added createDialog

* .

* Updated Armor SRD

* .

* Fixed character sheet armor update

* Updated itemconfig

* Actions now use createDialog for effects

* .

* .

* Fixed ArmorEffect max being a string

* Fixed SRD armor effects

* Finally finished the migration ._.

* SRD finalization

* Added ArmoreEffect.armorInteraction option

* Added ArmorManagement menu

* Fixed DamageReductionDialog

* Fixed ArmorManagement pip syle

* feat: add style to armors tooltip, add a style to make armor slot label more clear that was a button and add a tooltip location

* .

* Removed tooltip on manageArmor

* Fixes

* Fixed Downtime armor repair

* Removed ArmorScore from character data model and instead adding it in basePrep

* [Feature] ArmorEffect reworked into ChangeType on BaseEffect (#1739)

* Initial

* .

* Single armor rework start

* More fixes

* Fixed DamageReductionDialog

* Removed last traces of ArmorEffect

* .

* Corrected the SRD to use base effects again

* Removed bare bones armor item

* [V14] Refactor ArmorChange schema and fix some bugs (#1742)

* Refactor ArmorChange schema and fix some bugs

* Add current back to schema

* Fixed so changing armor values and taking damage works again

* Fixed so that scrolltexts for armor changes work again

* Removed old marks on armor.system

* Restored damageReductionDialog armorScore.value

* Use toggle for css class addition/removal

* Fix armor change type choices

* Added ArmorChange DamageThresholds

---------

Co-authored-by: WBHarry <williambjrklund@gmail.com>

* [V14] Armor System ArmorScore (#1744)

* Readded so that armor items have their system defined armor instead of using an ActiveEffect

* Consolidate armor source retrieval

* Fix regression with updating armor when sources are disabled

* Simplify armor pip update

* Use helper in damage reduction dialog

* .

* Corrected SRD Armor Items

---------

Co-authored-by: Carlos Fernandez <cfern1990@gmail.com>

* Updated migrations

* Migrations are now not horrible =D

---------

Co-authored-by: Murilo Brito <dev.murilobrito@gmail.com>
Co-authored-by: Carlos Fernandez <CarlosFdez@users.noreply.github.com>
Co-authored-by: Carlos Fernandez <cfern1990@gmail.com>
This commit is contained in:
WBHarry 2026-03-22 01:57:46 +01:00 committed by GitHub
parent a3f515cf6d
commit ef53a7c561
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
94 changed files with 1961 additions and 545 deletions

View file

@ -7,53 +7,57 @@
<div class="section-container padded">
<div class="resources-container">
<div class="resource-container">
<h4 class="armor-title">{{localize "DAGGERHEART.APPLICATIONS.DamageReduction.armorMarks"}}</h4>
<div class="markers-subtitle">{{armorMarks}}/{{armorScore}}</div>
<h4 class="armor-title">{{localize "DAGGERHEART.APPLICATIONS.DamageReduction.maxUseableArmor"}}</h4>
<div class="markers-subtitle">{{availableArmor}}</div>
</div>
{{#if this.stress}}
<div class="resource-container">
<h4 class="armor-title">{{localize "DAGGERHEART.APPLICATIONS.DamageReduction.stress"}}</h4>
<div class="markers-subtitle">{{this.stress.value}}/{{this.stress.max}}</div>
</div>
{{/if}}
</div>
</div>
<div class="section-container">
<h4 class="mark-selection divider">
<div class="mark-selection-inner">
{{#each marks.armor}}
<div
class="mark-container {{#if this.selected}}selected{{/if}}"
data-action="setMarks" data-key="{{@key}}" data-type="armor"
>
<i class="fa-solid fa-shield"></i>
</div>
{{/each}}
<div class="section-container full-width">
{{#each marks.armor as |source|}}
<div class="mark-selection">
<h4 class="divider">{{source.label}}</h4>
<div class="mark-selection-inner">
{{#each source.marks}}
<a
class="mark-container {{#if this.selected}}selected{{/if}} {{#if this.spent}}spent{{/if}} {{#if this.disabled}}inactive{{/if}}"
data-action="setMarks" data-type="armor" data-path="{{concat "armor." @../key ".marks." @key}}" data-id="{{@key}}"
{{#if this.disabled}}disabled{{/if}}
>
<i class="fa-solid fa-shield"></i>
</a>
{{/each}}
</div>
</div>
{{/each}}
{{#if usesStressArmor}}
<div class="mark-selection">
<h4 class="divider">{{localize "Stress"}}</h4>
<div class="mark-selection-inner">
{{#each marks.stress}}
<div
class="mark-container {{#if this.selected}}selected{{/if}} {{#if (not @root.basicMarksUsed)}}inactive{{/if}}"
{{#if @root.basicMarksUsed}}data-action="setMarks"{{/if}} data-key="{{@key}}" data-type="stress" data-tooltip="{{#if @root.basicMarksUsed}}{{localize "DAGGERHEART.APPLICATIONS.DamageReduction.armorWithStress"}}{{else}}{{localize "DAGGERHEART.APPLICATIONS.DamageReduction.unncessaryStress"}}{{/if}}"
{{#if @root.basicMarksUsed}}data-action="setMarks"{{/if}} data-type="stress" data-path="{{concat "stress." @key}}" data-tooltip="{{#if @root.basicMarksUsed}}{{localize "DAGGERHEART.APPLICATIONS.DamageReduction.armorWithStress"}}{{else}}{{localize "DAGGERHEART.APPLICATIONS.DamageReduction.unncessaryStress"}}{{/if}}"
>
<i class="fa-solid fa-bolt"></i>
</div>
{{/each}}
</div>
</div>
</h4>
<div class="markers-subtitle bold">{{localize "DAGGERHEART.APPLICATIONS.DamageReduction.usedMarks"}}</div>
{{/if}}
</div>
{{#if availableStressReductions}}
<div class="resources-container">
<div class="resource-container">
<h4 class="armor-title">{{localize "DAGGERHEART.APPLICATIONS.DamageReduction.stressReduction"}}</h4>
<h4 class="armor-title divider">{{localize "DAGGERHEART.APPLICATIONS.DamageReduction.stressReduction"}}</h4>
</div>
</div>
{{/if}}
{{#each availableStressReductions}}
<div class="section-container">
<h4 class="chip-container divider">
<h4 class="chip-container">
<div class="chip-inner-container selectable {{#if (or this.any (eq this.from @root.currentDamage))}}active{{/if}} {{#if this.selected}}selected{{/if}}" data-action="useStressReduction" data-reduction="{{@key}}">
{{#if this.any}}
{{localize "DAGGERHEART.GENERAL.any"}}
@ -74,7 +78,7 @@
{{#if reduceSeverity}}
<div class="resources-container">
<div class="resource-container">
<h4 class="armor-title">{{localize "DAGGERHEART.APPLICATIONS.DamageReduction.reduceSeverity" nr=reduceSeverity}}</h4>
<h4 class="armor-title divider">{{localize "DAGGERHEART.APPLICATIONS.DamageReduction.reduceSeverity" nr=reduceSeverity}}</h4>
</div>
</div>
{{/if}}
@ -82,7 +86,7 @@
{{#if thresholdImmunities}}
<div class="resources-container">
<div class="resource-container">
<h4 class="armor-title">{{localize "DAGGERHEART.APPLICATIONS.DamageReduction.thresholdImmunities"}}</h4>
<h4 class="armor-title divider">{{localize "DAGGERHEART.APPLICATIONS.DamageReduction.thresholdImmunities"}}</h4>
</div>
</div>
{{/if}}

View file

@ -3,7 +3,9 @@
<input type="text" class="effect-change-input" name="{{change.keyPath}}" value="{{change.key}}" />
</div>
<div class="type">
{{formInput fields.type name=change.typePath value=change.type localize=true}}
<select name="{{change.typePath}}">
{{selectOptions types selected=change.type localize=true}}
</select>
</div>
<div class="value">
{{formInput fields.value name=change.valuePath value=change.value elementType="input"}}

View file

@ -13,4 +13,11 @@
{{{change}}}
{{/each}}
</ol>
<fieldset class="armor-change-container">
<legend>{{localize "DAGGERHEART.GENERAL.armor"}} <input type="checkbox" class="armor-change-checkbox" data-index="{{typedChanges.armor.index}}" {{checked typedChanges.armor}} /></legend>
{{#if typedChanges.armor}}
{{> "systems/daggerheart/templates/sheets/activeEffect/typeChanges/armorChange.hbs" typedChanges.armor fields=@root.systemFields.changes.element.types.armor.fields}}
{{/if}}
</fieldset>
</section>

View file

@ -0,0 +1,28 @@
<header>
<div>{{localize "EFFECT.FIELDS.changes.element.value.label"}}</div>
<div>{{localize "DAGGERHEART.GENERAL.max"}}</div>
<div>{{localize "DAGGERHEART.EFFECTS.ChangeTypes.armor.FIELDS.interaction.label"}}</div>
<div>{{localize "EFFECT.FIELDS.changes.element.priority.label"}}</div>
</header>
<ol class="scrollable">
<li data-index="{{index}}">
<input type="hidden" name="{{concat "system.changes." index ".type"}}" value="{{type}}" />
<input type="hidden" name="{{concat "system.changes." index ".phase"}}" value="{{phase}}" />
{{formInput fields.value.fields.current name=(concat "system.changes." index ".value.current") value=value.current data-dtype="Number"}}
{{formInput fields.value.fields.max name=(concat "system.changes." index ".value.max") value=value.max data-dtype="Number"}}
{{formInput fields.value.fields.interaction name=(concat "system.changes." index ".value.interaction") value=value.interaction localize=true}}
{{formInput fields.priority name=(concat "system.changes." index ".priority") value=priority}}
</li>
</ol>
<div class="damage-thresholds-container">
<div class="damage-threshold-title">
<span>{{localize "DAGGERHEART.GENERAL.DamageThresholds.title"}}</span>
<input type="checkbox" class="armor-damage-thresholds-checkbox" data-index="{{index}}" {{checked value.damageThresholds}} />
</div>
{{#if value.damageThresholds}}
<div class="flexrow">
{{formGroup fields.value.fields.damageThresholds.fields.major name=(concat "system.changes." index ".value.damageThresholds.major") value=value.damageThresholds.major localize=true }}
{{formGroup fields.value.fields.damageThresholds.fields.severe name=(concat "system.changes." index ".value.damageThresholds.severe") value=value.damageThresholds.severe localize=true }}
</div>
{{/if}}
</div>

View file

@ -18,6 +18,7 @@
collection=effects.inactives
canCreate=true
hideResources=true
disabled=true
}}
</div>
</section>

View file

@ -30,14 +30,14 @@
</div>
</div>
{{#if document.system.armor.system.marks}}
{{#if document.system.armorScore.max}}
<div class="status-bar armor-slots">
{{#if useResourcePips}}
<div class='slot-value'>
<div class="slot-bar">
{{#times document.system.armorScore}}
<a class='armor-slot' data-action='toggleArmor' data-value="{{add this 1}}">
{{#if (gte ../document.system.armor.system.marks.value (add this 1))}}
{{#times document.system.armorScore.max}}
<a class='armor-slot' data-action='toggleArmor' data-value="{{add this 1}}">
{{#if (gte ../document.system.armorScore.value (add this 1))}}
<i class="fa-solid fa-shield"></i>
{{else}}
<i class="fa-solid fa-shield-halved"></i>
@ -45,25 +45,29 @@
</a>
{{/times}}
</div>
<div class="slot-label">
<a class="slot-label" data-action="toggleArmorMangement">
<span class="label">{{localize "DAGGERHEART.GENERAL.armorSlots"}}</span>
<span class="value">{{document.system.armor.system.marks.value}} / {{document.system.armorScore}}</span>
</div>
<div class="slot-value-container">
<span class="value">{{document.system.armorScore.value}} / {{document.system.armorScore.max}}</span>
<i class="fa-solid fa-gear"></i>
</div>
</a>
</div>
{{else}}
<div class='status-value'>
<input class="bar-input armor-marks-input" value="{{document.system.armor.system.marks.value}}" type="number">
<input class="bar-input armor-marks-input" value="{{document.system.armorScore.value}}" type="number">
<span>/</span>
<span class="bar-label">{{document.system.armorScore}}</span>
<span class="bar-label">{{document.system.armorScore.max}}</span>
</div>
<progress
class='progress-bar stress-color'
value='{{document.system.armor.system.marks.value}}'
max='{{document.system.armorScore}}'
value='{{document.system.armorScore.value}}'
max='{{document.system.armorScore.max}}'
></progress>
<div class="status-label">
<a class="status-label" data-action="toggleArmorMangement">
<h4>{{localize "DAGGERHEART.GENERAL.armorSlots"}}</h4>
</div>
<i class="fa-solid fa-gear"></i>
</a>
{{/if}}
</div>
{{else}}

View file

@ -52,13 +52,12 @@
</div>
</div>
{{#if actor.system.armor.system.marks}}
{{#if actor.system.armorScore.max}}
<div class="slot-section">
<div class="slot-bar">
{{#times actor.system.armorScore}}
<a class='armor-slot'
data-action='toggleArmorSlot' data-actor-id="{{actor.uuid}}" data-item-uuid="{{actor.system.armor.uuid}}" data-value="{{add this 1}}">
{{#if (gte actor.system.armor.system.marks.value (add this 1))}}
{{#times actor.system.armorScore.max}}
<a class='armor-slot' data-action='toggleArmorSlot' data-actor-id="{{actor.id}}" data-value="{{add this 1}}">
{{#if (gte actor.system.armorScore.value (add this 1))}}
<i class="fa-solid fa-shield"></i>
{{else}}
<i class="fa-solid fa-shield-halved"></i>
@ -68,7 +67,7 @@
</div>
<div class="slot-label">
<span class="label">{{localize "DAGGERHEART.GENERAL.armorSlots"}}</span>
<span class="value">{{actor.system.armor.system.marks.value}} / {{actor.system.armorScore}}</span>
<span class="value">{{actor.system.armorScore.value}} / {{actor.system.armorScore.max}}</span>
</div>
</div>
{{/if}}

View file

@ -9,7 +9,7 @@
</h3>
<h3>
{{localize "DAGGERHEART.ITEMS.Armor.baseScore"}}:
{{source.system.baseScore}}
{{source.system.armor.max}}
<span>-</span>
{{localize "DAGGERHEART.ITEMS.Armor.baseThresholds.base"}}:
{{source.system.baseThresholds.major}}

View file

@ -6,9 +6,9 @@
<fieldset class="two-columns">
<legend>{{localize tabs.settings.label}}</legend>
<span>{{localize "DAGGERHEART.GENERAL.Tiers.singular"}}</span>
{{formField systemFields.tier value=source.system.tier}}
{{ formField systemFields.tier value=source.system.tier }}
<span>{{localize "DAGGERHEART.ITEMS.Armor.baseScore"}}</span>
{{formField systemFields.baseScore value=source.system.baseScore}}
{{ formField systemFields.armor.fields.max value=source.system.armor.max }}
<span>{{localize "TYPES.Item.feature"}}</span>
<input type="text" class="features-input" value="{{features}}" />

View file

@ -1,18 +1,18 @@
<div class="daggerheart armor-management-container">
<h3>{{localize "DAGGERHEART.GENERAL.armorSlots"}}</h3>
{{#each sources as |source|}}
<div class="armor-source-container">
<label class="armor-source-label">{{source.name}}</label>
<div class="status-bar armor-slots">
<div class='status-value'>
<input class="bar-input armor-marks-input" value="{{source.value}}" data-uuid="{{source.uuid}}" type="number">
<span>/</span>
<span class="bar-label">{{source.max}}</span>
</div>
<progress
class='progress-bar stress-color'
value='{{source.value}}'
max='{{source.max}}'
></progress>
<p class="armor-source-label">{{source.name}}</p>
<div class="slot-bar">
{{#times source.max}}
<a class='armor-slot' data-value="{{add this 1}}" data-uuid="{{source.uuid}}">
{{#if (gte ../current (add this 1))}}
<i class="fa-solid fa-shield" data-index="{{this}}"></i>
{{else}}
<i class="fa-solid fa-shield-halved" data-index="{{this}}"></i>
{{/if}}
</a>
{{/times}}
</div>
</div>
{{/each}}