mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 19:51:08 +01:00
Added effect message
This commit is contained in:
parent
744412bf9f
commit
30229407cd
5 changed files with 106 additions and 1 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue