daggerheart/templates/ui/chat/parts/damage-part.hbs
Carlos Fernandez 2b8e4cb2fa
[v14] Add toggle for critical damage (#1762)
* Fix rolling critical damage after rerolling into a crit

* Add toggle for critical damage

---------

Co-authored-by: WBHarry <williambjrklund@gmail.com>
2026-04-01 19:39:26 +02:00

68 lines
No EOL
4 KiB
Handlebars

<div class="roll-part damage-section dice-roll" data-action="expandRoll"{{#if (empty damage)}} hidden{{/if}}>
<div class="roll-part-header">
<div>
{{#if hasHealing}}
<span>{{localize "DAGGERHEART.ACTIONS.TYPES.healing.name"}}</span>
{{else}}
<span>{{localize (ifThen roll.isCritical "DAGGERHEART.ACTIONS.TYPES.damage.critical" "DAGGERHEART.ACTIONS.TYPES.damage.name")}}</span>
{{/if}}
</div>
</div>
<div class="roll-part-extra on-reduced">
<div class="wrapper">
{{#each damage as | roll index | }}
<div class="roll-formula">{{localize (concat 'DAGGERHEART.CONFIG.HealingType.' index '.inChatRoll')}}: {{total}}</div>
{{/each}}
</div>
</div>
<div class="roll-part-content dice-result">
<div class="dice-tooltip">
<div class="wrapper">
{{#each damage as | roll index | }}
<fieldset>
<legend>
{{#if ../hasHealing}}{{localize (concat 'DAGGERHEART.CONFIG.HealingType.' index '.name')}}{{else}}{{localize (concat 'DAGGERHEART.CONFIG.HealingType.' index '.inChatRoll')}}{{/if}} <div class="roll-formula">{{localize "DAGGERHEART.GENERAL.total"}}: {{roll.total}}</div>{{#if (and (eq index "hitPoints") ../isDirect)}} <div class="roll-formula">{{localize "DAGGERHEART.CONFIG.DamageType.direct.short"}}</div>{{/if}}
</legend>
{{#each roll.parts}}
{{#if (and (not @root.hasHealing) damageTypes.length)}}
<label class="roll-part-header"><span>
{{#each damageTypes}}
{{localize (concat 'DAGGERHEART.CONFIG.ArmorFeature.' this '.name')}}
{{#unless @last}}/{{/unless}}
{{/each}}
<div class="roll-formula">{{total}}</div></span></label>
{{/if}}
<div class="roll-dice">
{{#each dice}}
{{#each results}}
{{#unless discarded}}
<div class="roll-die{{#unless @../first}} has-plus{{/unless}}">
<div
class="dice reroll-button {{../dice}}"
data-die-index="0" data-type="damage" data-damage-type="{{@../../../key}}" data-part="{{@../../key}}" data-dice="{{@../key}}" data-result="{{@key}}"
>
{{#if hasRerolls}}<i class="fa-solid fa-dice dice-rerolled" data-tooltip="{{localize "DAGGERHEART.GENERAL.rerolled"}}"></i>{{/if}}
{{result}}
</div>
</div>
{{/unless}}
{{/each}}
{{/each}}
{{#if modifierTotal}}
<div class="roll-die{{#if (gt modifierTotal 0)}} has-plus{{/if}}">
<div class="font-20">{{modifierTotal}}</div>
</div>
{{/if}}
{{#unless dice.length}}
<div class="roll-die">
<div class="font-20">{{total}}</div>
</div>
{{/unless}}
</div>
{{/each}}
</fieldset>
{{/each}}
</div>
</div>
</div>
</div>