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 @@
\ 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 @@
-
-
-
-