mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-04-21 23:13:39 +02:00
[V14] Message Rolls Rework (#1757)
* Basic rework to the roll data in messages * . * Fixed advantage/disadvantage * . * . * Fixed TagTeamDialog * Reuse getter in faces setter * Simplify fate roll type css class * Add more caution to the dualityRoll fromData function * Apply suggestion from @CarlosFdez * Compute modifiers using deterministic terms (#1758) --------- Co-authored-by: Carlos Fernandez <cfern1990@gmail.com> Co-authored-by: Carlos Fernandez <CarlosFdez@users.noreply.github.com>
This commit is contained in:
parent
dbd5ef8bb0
commit
f156b12d79
20 changed files with 267 additions and 249 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { emitAsGM, GMUpdateEvent, RefreshType, socketEvent } from '../systemRegistration/socket.mjs';
|
||||
import { emitAsGM, GMUpdateEvent } from '../systemRegistration/socket.mjs';
|
||||
|
||||
export default class DhpChatMessage extends foundry.documents.ChatMessage {
|
||||
targetHook = null;
|
||||
|
|
@ -78,25 +78,14 @@ export default class DhpChatMessage extends foundry.documents.ChatMessage {
|
|||
if (this.isContentVisible) {
|
||||
if (this.type === 'dualityRoll') {
|
||||
html.classList.add('duality');
|
||||
switch (this.system.roll?.result?.duality) {
|
||||
case 1:
|
||||
html.classList.add('hope');
|
||||
break;
|
||||
case -1:
|
||||
html.classList.add('fear');
|
||||
break;
|
||||
default:
|
||||
html.classList.add('critical');
|
||||
break;
|
||||
}
|
||||
if (this.system.roll.withHope) html.classList.add('hope');
|
||||
else if (this.system.roll.withFear) html.classList.add('fear');
|
||||
else html.classList.add('critical');
|
||||
}
|
||||
if (this.type === 'fateRoll') {
|
||||
html.classList.add('fate');
|
||||
if (this.system.roll?.fate.fateDie == 'Hope') {
|
||||
html.classList.add('hope');
|
||||
}
|
||||
if (this.system.roll?.fate.fateDie == 'Fear') {
|
||||
html.classList.add('fear');
|
||||
if (this.system.roll?.fateDie) {
|
||||
html.classList.add(this.system.roll.fateDie.toLowerCase());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue