mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-07-21 18:09:54 +02:00
Changed so all default rolls become BaseRolls to access convenience functions and getters
This commit is contained in:
parent
c68b3045f2
commit
d7f0747e5c
4 changed files with 8 additions and 3 deletions
|
|
@ -24,7 +24,7 @@ import TokenManager from './module/documents/tokenManager.mjs';
|
|||
CONFIG.DH = SYSTEM;
|
||||
CONFIG.TextEditor.enrichers.push(...enricherConfig);
|
||||
|
||||
CONFIG.Dice.rolls = [BaseRoll, DHRoll, DualityRoll, D20Roll, DamageRoll, FateRoll];
|
||||
CONFIG.Dice.rolls = [Roll = BaseRoll, DHRoll, DualityRoll, D20Roll, DamageRoll, FateRoll];
|
||||
CONFIG.Dice.daggerheart = {
|
||||
DHRoll: DHRoll,
|
||||
DualityRoll: DualityRoll,
|
||||
|
|
|
|||
|
|
@ -4,4 +4,8 @@ export default class BaseRoll extends Roll {
|
|||
|
||||
/** @inheritdoc */
|
||||
static TOOLTIP_TEMPLATE = 'systems/daggerheart/templates/ui/chat/foundryRollTooltip.hbs';
|
||||
|
||||
get modifierTotal() {
|
||||
return this.total - this.dice.reduce((acc, dice) => acc + dice.total, 0);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<div class="roll-data {{#if isCritical}}critical{{/if}}">
|
||||
<div class="duality-label">
|
||||
<span>{{localize (concat "DAGGERHEART.CONFIG.HealingType." key ".name")}}:</span>
|
||||
<span>{{damage.roll.total}}</span>
|
||||
<span>{{roll.total}}</span>
|
||||
</div>
|
||||
|
||||
<div class="roll-dice-container">
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@
|
|||
{{#if active}}
|
||||
<div class="roll-die{{#unless @../first}} has-plus{{/unless}}">
|
||||
<div
|
||||
class="dice reroll-button {{../dice}}"
|
||||
class="dice reroll-button {{../denomination}}"
|
||||
data-die-index="0" data-type="damage" data-damage-type="{{@../../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}}
|
||||
|
|
@ -49,6 +49,7 @@
|
|||
{{/if}}
|
||||
{{/each}}
|
||||
{{/each}}
|
||||
|
||||
{{#if roll.modifierTotal}}
|
||||
<div class="roll-die{{#if (gt roll.modifierTotal 0)}} has-plus{{/if}}">
|
||||
<div class="font-20">{{roll.modifierTotal}}</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue