Feature/167 damage types and resistances (#330)

* Add Resistances

* Relocate Damage Reduction

* Damage Types

* dmg type fallback

* Actor getRollData

* Remove comments
This commit is contained in:
Dapoulp 2025-07-12 20:13:09 +02:00 committed by GitHub
parent 3f4c884974
commit 812a5e8dd7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 167 additions and 97 deletions

View file

@ -46,7 +46,7 @@
{{> formula fields=../../fields.value.fields type=../fields.type dmg=dmg source=dmg.value target="value" realIndex=realIndex}}
</fieldset>
{{/if}}
{{formField ../../fields.type value=dmg.type name=(concat "damage.parts." realIndex ".type") localize=true}}
{{formField ../../fields.type value=dmg.type name=(concat "damage.parts." realIndex ".type") localize=true}}
<input type="hidden" name="damage.parts.{{realIndex}}.base" value="{{dmg.base}}">
</fieldset>
{{#unless dmg.base}}<div class="fas fa-trash" data-action="removeDamage" data-index="{{realIndex}}"></div>{{/unless}}

View file

@ -10,12 +10,12 @@
<div class='status-value'>
<p><input class="bar-input" name="system.resources.hitPoints.value" value="{{source.system.resources.hitPoints.value}}" type="number"></p>
<p>/</p>
<p class="bar-label">{{source.system.resources.hitPoints.max}}</p>
<p class="bar-label">{{source.system.resources.hitPoints.maxTotal}}</p>
</div>
<progress
class='progress-bar'
value='{{source.system.resources.hitPoints.value}}'
max='{{source.system.resources.hitPoints.max}}'
max='{{source.system.resources.hitPoints.maxTotal}}'
></progress>
<div class="status-label">
<h4>HP</h4>
@ -26,12 +26,12 @@
<div class='status-value'>
<p><input class="bar-input" name="system.resources.stress.value" value="{{source.system.resources.stress.value}}" type="number"></p>
<p>/</p>
<p class="bar-label">{{source.system.resources.stress.max}}</p>
<p class="bar-label">{{source.system.resources.stress.maxTotal}}</p>
</div>
<progress
class='progress-bar stress-color'
value='{{source.system.resources.stress.value}}'
max='{{source.system.resources.stress.max}}'
max='{{source.system.resources.stress.maxTotal}}'
></progress>
<div class="status-label">
<h4>Stress</h4>

View file

@ -6,7 +6,7 @@
{{else}}
<div class="item-name">{{item.name}}</div>
{{/if}}
{{#if (eq type 'weapon')}}
{{#if (eq type 'weapon')}}
<div class="item-tags">
{{#if isSidebar}}
<div class="item-labels">
@ -16,11 +16,11 @@
<span> - </span>
{{item.system.attack.damage.parts.0.value.dice}}{{#if item.system.attack.damage.parts.0.value.bonus}} + {{item.system.attack.damage.parts.0.value.bonus}}{{/if}}
{{!-- ({{localize (concat 'DAGGERHEART.CONFIG.DamageType.' item.system.attack.damage.parts.0.type '.abbreviation')}}) --}}
{{#with (lookup @root.config.GENERAL.damageTypes item.system.attack.damage.parts.0.type)}}
{{#each icon}}
<i class="fa-solid {{this}}"></i>
{{/each}}
{{/with}}
{{#each item.system.attack.damage.parts.0.type as | type | }}
{{#with (lookup @root.config.GENERAL.damageTypes type)}}
<i class="fa-solid {{icon}}"></i>
{{/with}}
{{/each}}
</div>
</div>
{{else}}
@ -32,7 +32,11 @@
</div>
<div class="tag">
{{item.system.attack.damage.parts.0.value.dice}}{{#if item.system.attack.damage.parts.0.value.bonus}} + {{item.system.attack.damage.parts.0.value.bonus}}{{/if}}
({{localize (concat 'DAGGERHEART.CONFIG.DamageType.' item.system.attack.damage.parts.0.type '.abbreviation')}})
(
{{#each item.system.attack.damage.parts.0.type}}
{{localize (concat 'DAGGERHEART.CONFIG.DamageType.' this '.abbreviation')}}
{{/each}}
)
</div>
<div class="tag">
{{localize (concat 'DAGGERHEART.CONFIG.Burden.' item.system.burden)}}

View file

@ -15,7 +15,11 @@
{{localize (concat 'DAGGERHEART.CONFIG.Range.' source.system.attack.range '.name')}}
<span>-</span>
{{source.system.attack.damage.parts.0.value.dice}}{{#if source.system.attack.damage.parts.0.value.bonus}} + {{source.system.attack.damage.parts.0.value.bonus}}{{/if}}
({{localize (concat 'DAGGERHEART.CONFIG.DamageType.' source.system.attack.damage.parts.0.type '.abbreviation')}})
(
{{#each source.system.attack.damage.parts.0.type}}
{{localize (concat 'DAGGERHEART.CONFIG.DamageType.' this '.abbreviation')}}
{{/each}}
)
<span>-</span>
{{localize (concat 'DAGGERHEART.CONFIG.Burden.' source.system.burden)}}
</h3>