diff --git a/lang/en.json b/lang/en.json index 2290fc26..0a8ab285 100755 --- a/lang/en.json +++ b/lang/en.json @@ -1219,6 +1219,11 @@ "selectType": "Select Action Type", "selectAction": "Action Selection" }, + "TagTeamRollTypes": { + "trait": "Trait", + "ability": "Ability", + "damageAbility": "Damage Ability" + }, "TargetTypes": { "any": "Any", "friendly": "Friendly", diff --git a/module/applications/dialogs/tagTeamDialog.mjs b/module/applications/dialogs/tagTeamDialog.mjs index 3797b3c4..7b75e77a 100644 --- a/module/applications/dialogs/tagTeamDialog.mjs +++ b/module/applications/dialogs/tagTeamDialog.mjs @@ -40,6 +40,7 @@ export default class TagTeamDialog extends HandlebarsApplicationMixin(Applicatio makeDamageRoll: TagTeamDialog.#makeDamageRoll, removeDamageRoll: TagTeamDialog.#removeDamageRoll, selectRoll: TagTeamDialog.#selectRoll, + cancelRoll: TagTeamDialog.#cancelRoll, finishRoll: TagTeamDialog.#finishRoll }, form: { handler: this.updateData, submitOnChange: true, closeOnSubmit: false } @@ -213,7 +214,8 @@ export default class TagTeamDialog extends HandlebarsApplicationMixin(Applicatio await this.party.update({ [`system.tagTeam.members.${button.dataset.member}`]: { rollData: null, - rollChoice: null + rollChoice: null, + selected: false } }); @@ -420,7 +422,7 @@ export default class TagTeamDialog extends HandlebarsApplicationMixin(Applicatio ? memberValues[1] : null; - if (!baseMainRoll && !baseSecondaryRoll) return null; + if (!baseMainRoll?.rollData || !baseSecondaryRoll) return null; const mainRoll = new MemberData(baseMainRoll.toObject()); const secondaryRollData = new MemberData(baseSecondaryRoll.toObject()).rollData; @@ -428,7 +430,7 @@ export default class TagTeamDialog extends HandlebarsApplicationMixin(Applicatio const isCritical = overrideIsCritical ?? systemData.roll.isCritical; if (isCritical) systemData.damage = await this.getCriticalDamage(systemData.damage); - if (secondaryRollData?.options.hasDamage && systemData.hasDamage) { + if (secondaryRollData?.options.hasDamage && systemData.damage) { const secondaryDamage = (displayVersion ? overrideIsCritical : isCritical) ? await this.getCriticalDamage(secondaryRollData.options.damage) : secondaryRollData.options.damage; @@ -445,6 +447,13 @@ export default class TagTeamDialog extends HandlebarsApplicationMixin(Applicatio return mainRoll; } + static async #cancelRoll() { + await this.party.update({ + 'system.tagTeam.==members': {} + }); + this.close(); + } + static async #finishRoll() { // const mainRollId = Object.keys(this.data.members).find(key => this.data.members[key].selected); // const mainRoll = game.messages.get(this.data.members[mainRollId].messageId); diff --git a/module/config/generalConfig.mjs b/module/config/generalConfig.mjs index 70558c27..63fb2eee 100644 --- a/module/config/generalConfig.mjs +++ b/module/config/generalConfig.mjs @@ -853,10 +853,14 @@ export const sceneRangeMeasurementSetting = { export const tagTeamRollTypes = { trait: { id: 'trait', - label: 'DAGGERHEART.GENERAL.Trait.single' + label: 'DAGGERHEART.CONFIG.TagTeamRollTypes.trait' }, ability: { id: 'ability', - label: 'DAGGERHEART.GENERAL.Ability.single' + label: 'DAGGERHEART.CONFIG.TagTeamRollTypes.ability' + }, + damageAbility: { + id: 'damageAbility', + label: 'DAGGERHEART.CONFIG.TagTeamRollTypes.damageAbility' } }; diff --git a/styles/less/dialog/tag-team-dialog/sheet.less b/styles/less/dialog/tag-team-dialog/sheet.less index 850c92a5..c6a79285 100644 --- a/styles/less/dialog/tag-team-dialog/sheet.less +++ b/styles/less/dialog/tag-team-dialog/sheet.less @@ -45,37 +45,86 @@ width: 100%; } - .roll-tools { - width: 100%; + .roll-container { + display: flex; + flex-direction: column; + } + + .roll-title { + font-size: var(--font-size-20); + font-weight: bold; + color: light-dark(@dark-blue, @golden); + text-align: center; display: flex; align-items: center; - justify-content: space-evenly; + gap: 8px; - .roll-button { - position: relative; + &::before, + &::after { + color: light-dark(@dark-blue, @golden); + content: ''; + flex: 1; + height: 2px; + } + + &::before { + background: linear-gradient(90deg, rgba(0, 0, 0, 0) 0%, @golden 100%); + } + + &::after { + background: linear-gradient(90deg, @golden 0%, rgba(0, 0, 0, 0) 100%); + } + } + + .roll-tools { + display: flex; + gap: 4px; + align-items: center; + + img { + height: 16px; + } + + a { display: flex; - justify-content: center; + font-size: 16px; - .roll-label { - position: absolute; - top: 8px; - width: 60px; - text-align: center; - padding: 2px; - background: light-dark(darkblue, gold); - color: light-dark(white, black); - border-radius: 6px; - border: 1px solid light-dark(white, black); - } - - img { - height: 80px; + &:hover { + text-shadow: none; + filter: drop-shadow(0 0 8px var(--golden)); } } - .delete-button i { - font-size: 40px; - } + // width: 100%; + // display: flex; + // align-items: center; + // justify-content: space-evenly; + + // .roll-button { + // position: relative; + // display: flex; + // justify-content: center; + + // .roll-label { + // position: absolute; + // top: 8px; + // width: 60px; + // text-align: center; + // padding: 2px; + // background: light-dark(darkblue, gold); + // color: light-dark(white, black); + // border-radius: 6px; + // border: 1px solid light-dark(white, black); + // } + + // img { + // height: 80px; + // } + // } + + // .delete-button i { + // font-size: 40px; + // } } .roll-data { @@ -138,6 +187,10 @@ .roll-operator { font-size: var(--font-size-24); } + + .roll-value { + font-size: 18px; + } } .roll-total { @@ -148,12 +201,16 @@ } } - .select-roll-button i { - color: light-dark(@dark-blue, @golden); - font-size: 48px; + .select-roll-button { + margin-top: 8px; - &.inactive { - opacity: 0.4; + i { + color: light-dark(@dark-blue, @golden); + font-size: 48px; + + &.inactive { + opacity: 0.4; + } } } } @@ -183,10 +240,6 @@ font-size: var(--font-size-20); } - .hint { - text-align: center; - } - .result-container { width: 100%; text-align: center; @@ -202,14 +255,17 @@ } .finish-container { - display: flex; - flex-direction: column; gap: 16px; - text-align: center; + display: grid; + grid-template-columns: 1fr 1fr 1fr; - button { - flex: 1; + .finish-button { + grid-column: span 2; } } + + .hint { + text-align: center; + } } } diff --git a/templates/dialogs/tagTeamDialog/tagTeamRoll.hbs b/templates/dialogs/tagTeamDialog/tagTeamRoll.hbs index 52793ecd..0e69b9f0 100644 --- a/templates/dialogs/tagTeamDialog/tagTeamRoll.hbs +++ b/templates/dialogs/tagTeamDialog/tagTeamRoll.hbs @@ -17,7 +17,7 @@ - + {{#if (eq member.rollType 'trait')}}
@@ -39,57 +39,102 @@ {{/if}}
-
- - {{#if member.hasRolled}}{{localize "DAGGERHEART.GENERAL.reroll"}}{{else}}{{localize "DAGGERHEART.GENERAL.roll"}}{{/if}} - - - -
+ {{#if member.readyToRoll}} +
+ + {{localize "DAGGERHEART.GENERAL.roll"}} +
+ + + - {{#if member.rollData}} - {{#with member.rollData.options.roll}} -
-
{{this.total}} {{localize "DAGGERHEART.GENERAL.withThing" thing=this.result.label}}
-
- - {{this.hope.value}} - - - + - - {{this.fear.value}} - - + {{#if member.hasRolled}} + + + + {{/if}}
-
{{this.formula}}
-
- {{/with}} + + + {{#if member.rollData}} + {{#with member.rollData.options.roll}} +
+
{{this.total}} {{localize "DAGGERHEART.GENERAL.withThing" thing=this.result.label}}
+
+ + {{this.hope.value}} + + + + + + {{this.fear.value}} + + + {{#if (gte this.modifierTotal 0)}}+{{else}}-{{/if}} + {{this.modifierTotal}} +
+
+ {{/with}} + {{else}} + {{localize "Make your roll"}} + {{/if}} +
{{/if}} {{#if member.rollData.options.hasDamage}} -
- - {{#if member.rollData.options.damage}}{{localize "DAGGERHEART.GENERAL.reroll"}}{{else}}{{localize "DAGGERHEART.GENERAL.roll"}}{{/if}} - - - +
+ + {{localize "DAGGERHEART.GENERAL.damage"}} +
+ + + + + {{#if damage}} + + + + {{/if}} +
+
+ {{#if damage}} + {{#each damage as |damage key|}} +
+
+ {{localize (concat "DAGGERHEART.CONFIG.HealingType." key ".name")}}: + {{#if ../useCritDamage}}{{lookup (lookup ../critDamage key) 'total'}}{{else}}{{damage.total}}{{/if}} +
+ {{#each damage.parts as |part|}} +
+ {{#each part.dice as |dice|}} + + {{dice.total}} + + + {{#unless @last}} + + + {{/unless}} + {{/each}} + {{#if part.modifierTotal}} + {{#if (gte part.modifierTotal 0)}}+{{else}}-{{/if}} + {{part.modifierTotal}} + {{/if}} +
+ {{/each}} +
+ {{/each}} + {{else}} + {{localize "Make your roll"}} + {{/if}}
{{/if}} - {{#each damage as |damage key|}} -
-
- {{localize "DAGGERHEART.GENERAL.damage"}} - {{#if ../useCritDamage}}{{lookup (lookup ../critDamage key) 'total'}}{{else}}{{damage.total}}{{/if}} -
-
{{#if ../useCritDamage}}{{lookup (lookup ../critDamage key) 'formula'}}{{else}}{{damage.formula}}{{/if}}
-
- {{/each}}
- - - + {{#if member.hasRolled}} + + + + {{/if}} {{/each}}
@@ -125,7 +170,8 @@
- + +
\ No newline at end of file