mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-04-22 23:43:37 +02:00
.
This commit is contained in:
parent
bf5a6d2a4d
commit
fe0cb4468c
3 changed files with 25 additions and 9 deletions
|
|
@ -43,6 +43,22 @@ export default class FateRoll extends D20Roll {
|
|||
return this.data.fateType;
|
||||
}
|
||||
|
||||
get withHope() {
|
||||
if (!this._evaluatedl) return;
|
||||
return this.dHope.total >= this.dFear.total;
|
||||
}
|
||||
|
||||
get withFear() {
|
||||
if (!this._evaluated) return;
|
||||
return this.dHope.total < this.dFear.total;
|
||||
}
|
||||
|
||||
get totalLabel() {
|
||||
const label = this.withHope ? 'DAGGERHEART.GENERAL.hope' : 'DAGGERHEART.GENERAL.fear';
|
||||
|
||||
return game.i18n.localize(label);
|
||||
}
|
||||
|
||||
static getHooks(hooks) {
|
||||
return [...(hooks ?? []), 'Fate'];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -84,10 +84,10 @@ export default class DhpChatMessage extends foundry.documents.ChatMessage {
|
|||
}
|
||||
if (this.type === 'fateRoll') {
|
||||
html.classList.add('fate');
|
||||
if (this.system.roll?.fate.fateDie == 'Hope') {
|
||||
if (this.system.roll?.fateDie == 'Hope') {
|
||||
html.classList.add('hope');
|
||||
}
|
||||
if (this.system.roll?.fate.fateDie == 'Fear') {
|
||||
if (this.system.roll?.fateDie == 'Fear') {
|
||||
html.classList.add('fear');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,20 +29,20 @@
|
|||
<div class="dice-tooltip">
|
||||
<div class="wrapper">
|
||||
<div class="roll-dice">
|
||||
{{#if roll.fate}}
|
||||
{{#if (eq roll.fate.fateDie "Hope")}}
|
||||
{{#if roll.fateDie}}
|
||||
{{#if (eq roll.fateDie "Hope")}}
|
||||
<div class="roll-die">
|
||||
<label>{{localize "DAGGERHEART.GENERAL.hope"}}</label>
|
||||
<div class="dice {{roll.fate.dice}} color-hope" data-die-index="0" data-type="hope">
|
||||
{{roll.fate.value}}
|
||||
<div class="dice {{roll.dHope.denomination}} color-hope" data-die-index="0" data-type="hope">
|
||||
{{roll.dHope.total}}
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{#if (eq roll.fate.fateDie "Fear")}}
|
||||
{{#if (eq roll.fateDie "Fear")}}
|
||||
<div class="roll-die">
|
||||
<label>{{localize "DAGGERHEART.GENERAL.fear"}}</label>
|
||||
<div class="dice {{roll.fate.dice}} color-fear" data-die-index="0" data-type="fear">
|
||||
{{roll.fate.value}}
|
||||
<div class="dice {{roll.dFear.denomination}} color-fear" data-die-index="0" data-type="fear">
|
||||
{{roll.dFear.total}}
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue