diff --git a/lang/en.json b/lang/en.json index 36b68ad7..6c84f92b 100755 --- a/lang/en.json +++ b/lang/en.json @@ -2322,6 +2322,7 @@ "action": { "title": "Action" }, + "appliedTo": "Applied To", "applyEffect": { "title": "Apply Effects - {name}" }, @@ -2331,6 +2332,10 @@ "rollHealing": "Roll Healing", "applyEffect": "Apply Effects" }, + "damageSummary": { + "title": "Damage Applied", + "healingTitle": "Healing Applied" + }, "damageRoll": { "title": "Damage - {damage}", "dealDamageToTargets": "Damage Hit Targets", @@ -2352,6 +2357,9 @@ "dualityRoll": { "abilityCheckTitle": "{ability} Check" }, + "effectSummary": { + "title": "Effects Applied" + }, "featureTitle": "Class Feature", "healingRoll": { "title": "Heal - {damage}", diff --git a/module/documents/chatMessage.mjs b/module/documents/chatMessage.mjs index e04341b5..9b7565f3 100644 --- a/module/documents/chatMessage.mjs +++ b/module/documents/chatMessage.mjs @@ -220,7 +220,9 @@ export default class DhpChatMessage extends foundry.documents.ChatMessage { const msg = { user: game.user.id, speaker: cls.getSpeaker(), - title: game.i18n.localize('DAGGERHEART.UI.Chat.deathMove.title'), + title: game.i18n.localize( + `DAGGERHEART.UI.Chat.damageSummary.${this.system.hasHealing ? 'healingTitle' : 'title'}` + ), content: await foundry.applications.handlebars.renderTemplate( 'systems/daggerheart/templates/ui/chat/damageSummary.hbs', { @@ -255,6 +257,25 @@ export default class DhpChatMessage extends foundry.documents.ChatMessage { ui.notifications.info(game.i18n.localize('DAGGERHEART.UI.Notifications.noTargetsSelected')); this.consumeOnSuccess(); await action.applyEffects(event, this, targets); + + const effects = this.system.action.item.effects.filter(effect => + this.system.action.effects.some(x => x._id === effect.id) + ); + const cls = getDocumentClass('ChatMessage'); + const msg = { + user: game.user.id, + speaker: cls.getSpeaker(), + title: game.i18n.localize('DAGGERHEART.UI.Chat.effectSummary.title'), + content: await foundry.applications.handlebars.renderTemplate( + 'systems/daggerheart/templates/ui/chat/effectSummary.hbs', + { + effects, + targets + } + ) + }; + + cls.create(msg); } } diff --git a/styles/less/ui/chat/effect-summary.less b/styles/less/ui/chat/effect-summary.less new file mode 100644 index 00000000..151c95e0 --- /dev/null +++ b/styles/less/ui/chat/effect-summary.less @@ -0,0 +1,54 @@ +.daggerheart.chat.effect-summary { + display: flex; + flex-direction: column; + + h5 { + color: light-dark(@dark, @beige); + margin: 0; + text-align: center; + } + + .effects-container { + display: flex; + flex-wrap: wrap; + gap: 4px; + margin-bottom: 8px; + } + + .targets-container { + display: flex; + flex-direction: column; + gap: 4px; + } + + .effect-target-container, + .token-target-container { + display: flex; + align-items: center; + gap: 2px; + border: 1px solid light-dark(@dark-blue, @golden); + border-radius: 6px; + padding: 0 2px; + + img { + width: 24px; + height: 24px; + flex: 0; + pointer-events: none; + } + + label { + flex: 1; + text-align: center; + pointer-events: none; + } + } + + .token-target-container { + cursor: pointer; + + &:hover { + filter: drop-shadow(0 0 3px @golden); + } + } +} diff --git a/styles/less/ui/index.less b/styles/less/ui/index.less index 360a30e3..c93f39a7 100644 --- a/styles/less/ui/index.less +++ b/styles/less/ui/index.less @@ -3,6 +3,7 @@ @import './chat/chat.less'; @import './chat/damage-summary.less'; @import './chat/downtime.less'; +@import './chat/effect-summary.less'; @import './chat/sheet.less'; @import './combat-sidebar/combat-sidebar.less'; diff --git a/templates/ui/chat/effectSummary.hbs b/templates/ui/chat/effectSummary.hbs new file mode 100644 index 00000000..c908d5ff --- /dev/null +++ b/templates/ui/chat/effectSummary.hbs @@ -0,0 +1,21 @@ +