diff --git a/lang/en.json b/lang/en.json index 56207e34..b86b4738 100755 --- a/lang/en.json +++ b/lang/en.json @@ -1874,6 +1874,7 @@ "multiclass": "Multiclass", "newCategory": "New Category", "none": "None", + "noTarget": "No current target", "partner": "Partner", "proficiency": "Proficiency", "quantity": "Quantity", diff --git a/module/applications/dialogs/d20RollDialog.mjs b/module/applications/dialogs/d20RollDialog.mjs index 9075c454..4b8749a3 100644 --- a/module/applications/dialogs/d20RollDialog.mjs +++ b/module/applications/dialogs/d20RollDialog.mjs @@ -7,7 +7,7 @@ export default class D20RollDialog extends HandlebarsApplicationMixin(Applicatio this.roll = roll; this.config = config; this.config.experiences = []; - this.reactionOverride = config.roll.type === 'reaction'; + this.reactionOverride = config.roll?.type === 'reaction'; if (config.source?.action) { this.item = config.data.parent.items.get(config.source.item) ?? config.data.parent; @@ -149,16 +149,16 @@ export default class D20RollDialog extends HandlebarsApplicationMixin(Applicatio static toggleReaction() { if (this.config.roll) { this.reactionOverride = !this.reactionOverride; + this.config.roll.type = this.reactionOverride + ? CONFIG.DH.ITEM.actionTypes.reaction.id + : this.config.roll.type === CONFIG.DH.ITEM.actionTypes.reaction.id + ? null + : this.config.roll.type; this.render(); } } static async submitRoll() { - this.config.roll.type = this.reactionOverride - ? CONFIG.DH.ITEM.actionTypes.reaction.id - : this.config.roll.type === CONFIG.DH.ITEM.actionTypes.reaction.id - ? null - : this.config.roll.type; await this.close({ submitted: true }); } diff --git a/module/dice/d20Roll.mjs b/module/dice/d20Roll.mjs index f65a0eff..85d9f277 100644 --- a/module/dice/d20Roll.mjs +++ b/module/dice/d20Roll.mjs @@ -142,6 +142,7 @@ export default class D20Roll extends DHRoll { static postEvaluate(roll, config = {}) { const data = super.postEvaluate(roll, config); + data.type = config.roll?.type; if (config.targets?.length) { config.targetSelection = true; config.targets.forEach(target => { diff --git a/module/dice/damageRoll.mjs b/module/dice/damageRoll.mjs index b805bdbd..f916dde3 100644 --- a/module/dice/damageRoll.mjs +++ b/module/dice/damageRoll.mjs @@ -16,11 +16,7 @@ export default class DamageRoll extends DHRoll { for (const roll of config.roll) await roll.roll.evaluate(); } roll._evaluated = true; - const parts = []; - for (let r of config.roll) { - const part = this.postEvaluate(r); - parts.push(part); - } + const parts = config.roll.map(r => this.postEvaluate(r)); config.roll = this.unifyDamageRoll(parts); } diff --git a/module/dice/dhRoll.mjs b/module/dice/dhRoll.mjs index 1da90d2f..c9cbb069 100644 --- a/module/dice/dhRoll.mjs +++ b/module/dice/dhRoll.mjs @@ -74,9 +74,7 @@ export default class DHRoll extends Roll { } static postEvaluate(roll, config = {}) { - console.log(roll, config) return { - type: config.roll.type, total: roll.total, formula: roll.formula, dice: roll.dice.map(d => ({ @@ -188,7 +186,7 @@ export default class DHRoll extends Roll { export const registerRollDiceHooks = () => { Hooks.on(`${CONFIG.DH.id}.postRollDuality`, async (config, message) => { - const hopeFearAutomation = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Automation).hopeFear; + const hopeFearAutomation = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Automation).hopeFear; if ( !config.source?.actor || (game.user.isGM ? !hopeFearAutomation.gm : !hopeFearAutomation.players) || diff --git a/styles/less/ui/chat/chat-temp.less b/styles/less/ui/chat/chat-temp.less index d185966f..46e76f27 100644 --- a/styles/less/ui/chat/chat-temp.less +++ b/styles/less/ui/chat/chat-temp.less @@ -182,6 +182,10 @@ } } } + + i { + text-align: center; + } .roll-target { display: flex; diff --git a/templates/ui/chat/parts/damage-part.hbs b/templates/ui/chat/parts/damage-part.hbs index fbaebbfc..c7d0644c 100644 --- a/templates/ui/chat/parts/damage-part.hbs +++ b/templates/ui/chat/parts/damage-part.hbs @@ -2,70 +2,59 @@
Damage
-
Hit Points: 10
-
Stress: 10
+ {{#each damage.roll as | roll index | }} +
{{localize (concat 'DAGGERHEART.CONFIG.HealingType.' index '.name')}}: {{total}}
+ {{/each}}
-
- - Hit Points
Total: 10
-
- -
-
-
4
-
-
-
+
-
-
-
6
-
-
- -
-
-
4
-
-
-
+
-
-
-
6
-
-
- -
-
-
4
-
-
-
+
-
-
-
6
-
-
-
-
- - Stress
Total: 10
-
-
-
-
4
-
-
-
+
-
-
-
6
-
-
-
+ {{#each damage.roll as | roll index | }} +
+ + {{localize (concat 'DAGGERHEART.CONFIG.HealingType.' index '.name')}}
{{localize "DAGGERHEART.GENERAL.total"}}: {{roll.total}}
+
+ {{#each roll.parts}} + {{#if damageTypes.length}} + + {{/if}} +
+ {{#each dice}} +
+ {{!--
{{total}}
--}} +
{{total}}
  • +
    + {{#unless @last}} +
    +
    +
    +
    + {{/unless}} + {{/each}} + {{#if modifierTotal}} + {{#if (gt modifierTotal 0)}} +
    +
    +
    +
    + {{/if}} +
    +
    {{modifierTotal}}
    +
    + {{/if}} + {{#unless dice.length}} +
    +
    {{total}}
    +
    + {{/unless}} +
    + {{/each}} +
    + {{/each}}
    diff --git a/templates/ui/chat/parts/target-part.hbs b/templates/ui/chat/parts/target-part.hbs index f63056d1..909b70ed 100644 --- a/templates/ui/chat/parts/target-part.hbs +++ b/templates/ui/chat/parts/target-part.hbs @@ -11,11 +11,13 @@
    -
    -
    -
    {{localize "DAGGERHEART.UI.Chat.damageRoll.hitTarget"}}
    {{localize "DAGGERHEART.UI.Chat.damageRoll.currentTarget"}}
    -
    -
    + {{#if targets.length}} +
    +
    +
    {{localize "DAGGERHEART.UI.Chat.damageRoll.hitTarget"}}
    {{localize "DAGGERHEART.UI.Chat.damageRoll.currentTarget"}}
    +
    +
    + {{/if}} {{#if roll.hasSave}}
    Reaction Roll All Targets
    {{/if}} {{#each currentTargets}}
    @@ -34,6 +36,8 @@
    {{#if ../roll.hasSave}}{{/if}}
    + {{else}} + {{localize "DAGGERHEART.GENERAL.noTarget"}} {{/each}}
    diff --git a/templates/ui/chat/roll.hbs b/templates/ui/chat/roll.hbs index 2903dfee..05ce15e2 100644 --- a/templates/ui/chat/roll.hbs +++ b/templates/ui/chat/roll.hbs @@ -1,6 +1,6 @@
    {{log this}} {{#if hasRoll}}{{> 'systems/daggerheart/templates/ui/chat/parts/roll-part.hbs'}}{{/if}} - {{#if (or hasDamage hasHealing)}}{{> 'systems/daggerheart/templates/ui/chat/parts/damage-part.hbs'}}{{/if}} + {{#if (and damage.roll (or hasDamage hasHealing))}}{{> 'systems/daggerheart/templates/ui/chat/parts/damage-part.hbs'}}{{/if}} {{> 'systems/daggerheart/templates/ui/chat/parts/target-part.hbs'}}