diff --git a/lang/en.json b/lang/en.json index 18b0ae6c..56207e34 100755 --- a/lang/en.json +++ b/lang/en.json @@ -1824,6 +1824,7 @@ "burden": "Burden", "continue": "Continue", "criticalSuccess": "Critical Success", + "criticalShort": "Critical", "d20Roll": "D20 Roll", "damage": "Damage", "damageRoll": "Damage Roll", @@ -1846,6 +1847,10 @@ "formula": "Formula", "healing": "Healing", "healingRoll": "Healing Roll", + "hit": { + "single": "Hit", + "plural": "Hits" + }, "HitPoints": { "single": "Hit Point", "plural": "Hit Points", @@ -1862,6 +1867,10 @@ "levelUp": "Level Up", "loadout": "Loadout", "max": "Max", + "miss": { + "single": "Miss", + "plural": "Miss" + }, "multiclass": "Multiclass", "newCategory": "New Category", "none": "None", @@ -2147,8 +2156,9 @@ "dealDamageToTargets": "Damage Hit Targets", "dealDamage": "Deal Damage", "rollDamage": "Roll Damage", - "hitTarget": "Hit Targets", - "selectedTarget": "Selected" + "hitTarget": "Hit", + "selectedTarget": "Selected", + "currentTarget": "Current" }, "deathMove": { "title": "Death Move" diff --git a/module/data/action/baseAction.mjs b/module/data/action/baseAction.mjs index bac327f5..fd39bd20 100644 --- a/module/data/action/baseAction.mjs +++ b/module/data/action/baseAction.mjs @@ -165,6 +165,7 @@ export default class DHBaseAction extends ActionMixin(foundry.abstract.DataModel }, dialog: {}, type: this.type, + hasRoll: this.hasRoll, hasDamage: this.damage?.parts?.length && this.type !== 'healing', hasHealing: this.damage?.parts?.length && this.type === 'healing', hasEffect: !!this.effects?.length, diff --git a/module/data/chat-message/adversaryRoll.mjs b/module/data/chat-message/adversaryRoll.mjs index e34a632c..fab9d740 100644 --- a/module/data/chat-message/adversaryRoll.mjs +++ b/module/data/chat-message/adversaryRoll.mjs @@ -20,7 +20,7 @@ export default class DHAdversaryRoll extends foundry.abstract.TypeDataModel { }) }) ), - targetSelection: new fields.BooleanField({ initial: true }), + targetSelection: new fields.BooleanField({ initial: false }), hasRoll: new fields.BooleanField({ initial: false }), hasDamage: new fields.BooleanField({ initial: false }), hasHealing: new fields.BooleanField({ initial: false }), @@ -47,5 +47,12 @@ export default class DHAdversaryRoll extends foundry.abstract.TypeDataModel { game.system.api.fields.ActionFields.TargetField.formatTarget(t) ) : this.targets; + if(this.targetSelection === true) { + this.targetShort = this.targets.reduce((a,c) => { + if(c.hit) a.hit += 1; + else c.miss += 1; + return a; + }, {hit: 0, miss: 0}) + } } } diff --git a/module/dice/d20Roll.mjs b/module/dice/d20Roll.mjs index c61478b5..f65a0eff 100644 --- a/module/dice/d20Roll.mjs +++ b/module/dice/d20Roll.mjs @@ -143,6 +143,7 @@ export default class D20Roll extends DHRoll { static postEvaluate(roll, config = {}) { const data = super.postEvaluate(roll, config); if (config.targets?.length) { + config.targetSelection = true; config.targets.forEach(target => { const difficulty = config.roll.difficulty ?? target.difficulty ?? target.evasion; target.hit = this.isCritical || roll.total >= difficulty; diff --git a/module/dice/dhRoll.mjs b/module/dice/dhRoll.mjs index c8860414..1da90d2f 100644 --- a/module/dice/dhRoll.mjs +++ b/module/dice/dhRoll.mjs @@ -74,6 +74,7 @@ export default class DHRoll extends Roll { } static postEvaluate(roll, config = {}) { + console.log(roll, config) return { type: config.roll.type, total: roll.total, diff --git a/styles/less/ui/chat/chat-temp.less b/styles/less/ui/chat/chat-temp.less index 85b4b2b4..d185966f 100644 --- a/styles/less/ui/chat/chat-temp.less +++ b/styles/less/ui/chat/chat-temp.less @@ -219,11 +219,6 @@ padding: 3px 5px; text-transform: uppercase; font-weight: 600; - } - - .target-hit-status { - width: fit-content; - margin-top: 2px; &.is-miss { color: @medium-red; @@ -231,6 +226,11 @@ } } + .target-hit-status { + width: fit-content; + margin-top: 2px; + } + div[data-action="expandRoll"] { .roll-part-header > div > span { &:before, &:after { diff --git a/templates/ui/chat/parts/button-part.hbs b/templates/ui/chat/parts/button-part.hbs index e6d3f139..55e3b888 100644 --- a/templates/ui/chat/parts/button-part.hbs +++ b/templates/ui/chat/parts/button-part.hbs @@ -1,4 +1,9 @@
- - + {{#if hasDamage}} + + {{/if}} + {{#if hasHealing}} + + {{/if}} + {{#if hasEffect}}{{/if}}
\ No newline at end of file diff --git a/templates/ui/chat/parts/roll-part.hbs b/templates/ui/chat/parts/roll-part.hbs index 6a3bfabc..b634b897 100644 --- a/templates/ui/chat/parts/roll-part.hbs +++ b/templates/ui/chat/parts/roll-part.hbs @@ -1,11 +1,19 @@
-
Finesse Check
+
{{title}}
- 18 - with hope + {{roll.total}} + + {{#if roll.isCritical}} + {{localize "DAGGERHEART.GENERAL.criticalShort"}} + {{else}} + {{#if roll.result}} + {{localize "DAGGERHEART.GENERAL.withThing" thing=roll.result.label}} + {{/if}} + {{/if}} +
- difficulty 15 + {{#if roll.difficulty}}difficulty {{roll.difficulty}}{{/if}}
Formula
@@ -13,7 +21,19 @@
-
+ {{#each roll.dice}} +
+ +
{{total}}
+
+ {{#unless @last}} +
+ +
+
+
+ {{/unless}} + {{/each}} + {{!--
12
@@ -24,12 +44,10 @@
6
-
+
--}}
-
- 1d12 + 1d12 + 0 -
+
{{roll.formula}}
diff --git a/templates/ui/chat/parts/target-part.hbs b/templates/ui/chat/parts/target-part.hbs index cd870fd2..f63056d1 100644 --- a/templates/ui/chat/parts/target-part.hbs +++ b/templates/ui/chat/parts/target-part.hbs @@ -1,52 +1,40 @@
Target
-
-
-
2 Hits
-
2 Miss
+ {{#if targetSelection}} +
+
+
{{targetShort.hit}} {{#if (gt targetShort.hit 1)}}{{localize "DAGGERHEART.GENERAL.hit.single"}}{{else}}{{localize "DAGGERHEART.GENERAL.hit.plural"}}{{/if}}
+
{{targetShort.miss}} {{#if (gt targetShort.miss 1)}}{{localize "DAGGERHEART.GENERAL.miss.single"}}{{else}}{{localize "DAGGERHEART.GENERAL.miss.plural"}}{{/if}}
+
-
+ {{/if}}
-
Hit
Current
+
{{localize "DAGGERHEART.UI.Chat.damageRoll.hitTarget"}}
{{localize "DAGGERHEART.UI.Chat.damageRoll.currentTarget"}}
-
Reaction Roll All Targets
-
- -
-
Archer Squadron
-
Hit
+ {{#if roll.hasSave}}
Reaction Roll All Targets
{{/if}} + {{#each currentTargets}} +
+ +
+
{{name}}
+ {{#if ../targetSelection}} +
+ {{#if hit}} + {{localize "DAGGERHEART.GENERAL.hit.single"}} + {{else}} + {{localize "DAGGERHEART.GENERAL.miss.single"}} + {{/if}} +
+ {{/if}} +
+ {{#if ../roll.hasSave}}{{/if}}
- -
-
- -
-
Conscript
-
Miss
-
- -
-
- -
-
Elite Soldier
-
Hit
-
- -
-
- -
-
Knight of the Realm
-
Miss
-
- -
+ {{/each}}
diff --git a/templates/ui/chat/roll.hbs b/templates/ui/chat/roll.hbs index 93928713..2903dfee 100644 --- a/templates/ui/chat/roll.hbs +++ b/templates/ui/chat/roll.hbs @@ -1,6 +1,6 @@
{{log this}} - {{> 'systems/daggerheart/templates/ui/chat/parts/roll-part.hbs'}} - {{> 'systems/daggerheart/templates/ui/chat/parts/damage-part.hbs'}} + {{#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}} {{> 'systems/daggerheart/templates/ui/chat/parts/target-part.hbs'}}