mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-04-22 07:23: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');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue