mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-07-22 02:19: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.DH = SYSTEM;
|
||||||
CONFIG.TextEditor.enrichers.push(...enricherConfig);
|
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 = {
|
CONFIG.Dice.daggerheart = {
|
||||||
DHRoll: DHRoll,
|
DHRoll: DHRoll,
|
||||||
DualityRoll: DualityRoll,
|
DualityRoll: DualityRoll,
|
||||||
|
|
|
||||||
|
|
@ -4,4 +4,8 @@ export default class BaseRoll extends Roll {
|
||||||
|
|
||||||
/** @inheritdoc */
|
/** @inheritdoc */
|
||||||
static TOOLTIP_TEMPLATE = 'systems/daggerheart/templates/ui/chat/foundryRollTooltip.hbs';
|
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="roll-data {{#if isCritical}}critical{{/if}}">
|
||||||
<div class="duality-label">
|
<div class="duality-label">
|
||||||
<span>{{localize (concat "DAGGERHEART.CONFIG.HealingType." key ".name")}}:</span>
|
<span>{{localize (concat "DAGGERHEART.CONFIG.HealingType." key ".name")}}:</span>
|
||||||
<span>{{damage.roll.total}}</span>
|
<span>{{roll.total}}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="roll-dice-container">
|
<div class="roll-dice-container">
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@
|
||||||
{{#if active}}
|
{{#if active}}
|
||||||
<div class="roll-die{{#unless @../first}} has-plus{{/unless}}">
|
<div class="roll-die{{#unless @../first}} has-plus{{/unless}}">
|
||||||
<div
|
<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}}"
|
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}}
|
{{#if hasRerolls}}<i class="fa-solid fa-dice dice-rerolled" data-tooltip="{{localize "DAGGERHEART.GENERAL.rerolled"}}"></i>{{/if}}
|
||||||
|
|
@ -49,6 +49,7 @@
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/each}}
|
{{/each}}
|
||||||
{{/each}}
|
{{/each}}
|
||||||
|
|
||||||
{{#if roll.modifierTotal}}
|
{{#if roll.modifierTotal}}
|
||||||
<div class="roll-die{{#if (gt roll.modifierTotal 0)}} has-plus{{/if}}">
|
<div class="roll-die{{#if (gt roll.modifierTotal 0)}} has-plus{{/if}}">
|
||||||
<div class="font-20">{{roll.modifierTotal}}</div>
|
<div class="font-20">{{roll.modifierTotal}}</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue