mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-17 23:49:02 +01:00
y
This commit is contained in:
parent
56e11943b7
commit
ee899cba59
15 changed files with 205 additions and 45 deletions
|
|
@ -1717,6 +1717,7 @@
|
|||
},
|
||||
"Roll": {
|
||||
"attack": "Attack Roll",
|
||||
"basic": "Roll",
|
||||
"difficulty": "Roll (Difficulty {difficulty})",
|
||||
"primaryWeaponAttack": "Primary Weapon Attack Roll",
|
||||
"secondaryWeaponAttack": "Secondary Weapon Attack Roll",
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ export default class DHActionConfig extends DaggerheartSheet(ApplicationV2) {
|
|||
|
||||
static DEFAULT_OPTIONS = {
|
||||
tag: 'form',
|
||||
classes: ['daggerheart', 'dh-style', 'dialog'],
|
||||
classes: ['daggerheart', 'dh-style', 'dialog', 'max-800'],
|
||||
window: {
|
||||
icon: 'fa-solid fa-wrench',
|
||||
resizable: false
|
||||
|
|
|
|||
|
|
@ -165,8 +165,8 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo
|
|||
const targetSelection = Boolean(event.target.dataset.targetHit),
|
||||
msg = ui.chat.collection.get(message._id);
|
||||
if (msg.system.targetSelection === targetSelection) return;
|
||||
if (targetSelection !== true && !Array.from(game.user.targets).length)
|
||||
return ui.notifications.info(game.i18n.localize('DAGGERHEART.UI.Notifications.noTargetsSelected'));
|
||||
// if (targetSelection !== true && !Array.from(game.user.targets).length)
|
||||
// return ui.notifications.info(game.i18n.localize('DAGGERHEART.UI.Notifications.noTargetsSelected'));
|
||||
msg.system.targetSelection = targetSelection;
|
||||
msg.system.prepareDerivedData();
|
||||
ui.chat.updateMessage(msg);
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ export default class DHAdversaryRoll extends foundry.abstract.TypeDataModel {
|
|||
}
|
||||
|
||||
get messageTemplate() {
|
||||
return 'systems/daggerheart/templates/ui/chat/adversary-roll.hbs';
|
||||
return 'systems/daggerheart/templates/ui/chat/roll.hbs';
|
||||
}
|
||||
|
||||
prepareDerivedData() {
|
||||
|
|
|
|||
|
|
@ -34,7 +34,8 @@ export default class DHDamageRoll extends foundry.abstract.TypeDataModel {
|
|||
}
|
||||
|
||||
get messageTemplate() {
|
||||
return `systems/daggerheart/templates/ui/chat/${this.messageType}-roll.hbs`;
|
||||
return `systems/daggerheart/templates/ui/chat/roll.hbs`;
|
||||
// return `systems/daggerheart/templates/ui/chat/${this.messageType}-roll.hbs`;
|
||||
}
|
||||
|
||||
prepareDerivedData() {
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ export class DHActionRollData extends foundry.abstract.DataModel {
|
|||
this.diceRolling.multiplier === 'flat'
|
||||
? this.diceRolling.flatMultiplier
|
||||
: `@${this.diceRolling.multiplier}`;
|
||||
if (this.diceRolling.compare && this.diceRolling.threshold) {
|
||||
if (this.diceRolling.compare && this.diceRolling.treshold) {
|
||||
formula = `${multiplier}${this.diceRolling.dice}cs${CONFIG.DH.ACTIONS.diceCompare[this.diceRolling.compare].operator}${this.diceRolling.treshold}`;
|
||||
} else {
|
||||
formula = `${multiplier}${this.diceRolling.dice}`;
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ export default class DHRoll extends Roll {
|
|||
|
||||
get title() {
|
||||
return game.i18n.localize(
|
||||
"DAGGERHEART.GENERAL.Roll"
|
||||
"DAGGERHEART.GENERAL.Roll.basic"
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,13 @@
|
|||
@import '../../utils/colors.less';
|
||||
|
||||
.application.daggerheart.dh-style {
|
||||
&.max-800 {
|
||||
max-height: 800px;
|
||||
.tab.active {
|
||||
overflow: auto;
|
||||
}
|
||||
}
|
||||
|
||||
.actions-list,
|
||||
.action-buttons-list {
|
||||
display: flex;
|
||||
|
|
|
|||
80
styles/less/global/dice.less
Normal file
80
styles/less/global/dice.less
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
.dice {
|
||||
position: relative;
|
||||
height: 2rem;
|
||||
aspect-ratio: 1;
|
||||
font-size: 1rem;
|
||||
paint-order: stroke fill;
|
||||
-webkit-text-stroke: 2px black;
|
||||
z-index: 1;
|
||||
|
||||
&.xxs {
|
||||
height: 1rem;
|
||||
font-size: .5rem;
|
||||
-webkit-text-stroke: 1px black;
|
||||
}
|
||||
|
||||
&.xs {
|
||||
height: 1.5rem;
|
||||
font-size: .75rem;
|
||||
}
|
||||
|
||||
&.lg {
|
||||
height: 2.5rem;
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
|
||||
&.xl {
|
||||
height: 3rem;
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
|
||||
&.discarded {
|
||||
opacity: .5;
|
||||
}
|
||||
|
||||
&:before {
|
||||
content: ' ';
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: -1;
|
||||
mask: var(--svg-die) no-repeat center;
|
||||
mask-size: contain;
|
||||
background: linear-gradient(139.01deg, #EFE6D8 3.51%, #372E1F 96.49%);
|
||||
}
|
||||
|
||||
&.d4:before {
|
||||
--svg-die: url(../assets/icons/dice/default/d4.svg);
|
||||
}
|
||||
&.d6:before {
|
||||
--svg-die: url(../assets/icons/dice/default/d6.svg);
|
||||
}
|
||||
&.d8:before {
|
||||
--svg-die: url(../assets/icons/dice/default/d8.svg);
|
||||
}
|
||||
&.d10:before {
|
||||
--svg-die: url(../assets/icons/dice/default/d10.svg);
|
||||
}
|
||||
&.d12:before {
|
||||
--svg-die: url('../assets/icons/dice/default/d12.svg');
|
||||
}
|
||||
&.d20:before {
|
||||
--svg-die: url(../assets/icons/dice/default/d20.svg);
|
||||
}
|
||||
|
||||
&.color-hope:before {
|
||||
background: linear-gradient(139.01deg, #F3C267 3.51%, #4C3407 96.49%);
|
||||
}
|
||||
|
||||
&.color-fear:before {
|
||||
background: linear-gradient(151.21deg, #352AB2 7.21%, #18162E 92.79%);
|
||||
}
|
||||
|
||||
&.color-adv:before {
|
||||
background: linear-gradient(139.01deg, #40A640 3.51%, #011B01 96.49%);
|
||||
}
|
||||
|
||||
&.color-dis:before {
|
||||
background: linear-gradient(139.01deg, #E54E4E 3.51%, #3C0000 82.19%);
|
||||
}
|
||||
}
|
||||
|
|
@ -16,3 +16,4 @@
|
|||
@import './prose-mirror.less';
|
||||
@import './filter-menu.less';
|
||||
@import './tab-attachments.less';
|
||||
@import './dice.less';
|
||||
|
|
|
|||
|
|
@ -121,9 +121,10 @@
|
|||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 10px;
|
||||
gap: 5px;
|
||||
font-weight: 700;
|
||||
font-family: 'Cinzel', sans-serif;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.roll-die {
|
||||
display: flex;
|
||||
|
|
@ -138,12 +139,9 @@
|
|||
> div {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 5px;
|
||||
font-size: var(--font-size-24);
|
||||
margin: auto;
|
||||
img {
|
||||
height: 30px;
|
||||
}
|
||||
// font-size: var(--font-size-20);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -290,4 +288,8 @@
|
|||
flex: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.font-20 {
|
||||
font-size: var(--font-size-20);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,9 +1,17 @@
|
|||
<div class="roll-buttons">
|
||||
{{#if hasDamage}}
|
||||
<button class="duality-action duality-action-damage">{{localize "DAGGERHEART.UI.Chat.attackRoll.rollDamage"}}</button>
|
||||
{{#if damage.roll}}
|
||||
<button class="duality-action damage-button">{{localize "DAGGERHEART.UI.Chat.damageRoll.dealDamage"}}</button>
|
||||
{{else}}
|
||||
<button class="duality-action duality-action-damage">{{localize "DAGGERHEART.UI.Chat.attackRoll.rollDamage"}}</button>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{#if hasHealing}}
|
||||
<button class="duality-action duality-action-damage">{{localize "DAGGERHEART.UI.Chat.attackRoll.rollHealing"}}</button>
|
||||
{{#if damage.roll}}
|
||||
<button class="duality-action damage-button">{{localize "DAGGERHEART.UI.Chat.healingRoll.applyHealing"}}</button>
|
||||
{{else}}
|
||||
<button class="duality-action duality-action-damage">{{localize "DAGGERHEART.UI.Chat.attackRoll.rollHealing"}}</button>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{#if hasEffect}}<button>{{localize "DAGGERHEART.UI.Chat.attackRoll.applyEffect"}}</button>{{/if}}
|
||||
</div>
|
||||
|
|
@ -26,29 +26,37 @@
|
|||
{{/if}}
|
||||
<div class="roll-dice">
|
||||
{{#each dice}}
|
||||
<div class="roll-die">
|
||||
{{!-- <div>{{total}} <img class="dice-icon" src="systems/daggerheart/assets/icons/dice/default/{{dice}}.svg" alt=""></div> --}}
|
||||
<div>{{total}} <li class="roll die {{dice}} min"></li></div>
|
||||
</div>
|
||||
{{#each results}}
|
||||
{{#unless discarded}}
|
||||
<div class="roll-die">
|
||||
<div class="dice {{../dice}}">{{result}}</div>
|
||||
</div>
|
||||
{{#unless @last}}
|
||||
<div class="roll-die">
|
||||
<div class="font-20">+</div>
|
||||
</div>
|
||||
{{/unless}}
|
||||
{{/unless}}
|
||||
{{/each}}
|
||||
{{#unless @last}}
|
||||
<div class="roll-die">
|
||||
<div>+</div>
|
||||
<div class="font-20">+</div>
|
||||
</div>
|
||||
{{/unless}}
|
||||
{{/each}}
|
||||
{{#if modifierTotal}}
|
||||
{{#if (gt modifierTotal 0)}}
|
||||
<div class="roll-die">
|
||||
<div>+</div>
|
||||
<div class="font-20">+</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
<div class="roll-die">
|
||||
<div>{{modifierTotal}}</div>
|
||||
<div class="font-20">{{modifierTotal}}</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{#unless dice.length}}
|
||||
<div class="roll-die">
|
||||
<div>{{total}}</div>
|
||||
<div class="font-20">{{total}}</div>
|
||||
</div>
|
||||
{{/unless}}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -21,30 +21,79 @@
|
|||
<div class="dice-tooltip">
|
||||
<div class="wrapper">
|
||||
<div class="roll-dice">
|
||||
{{#each roll.dice}}
|
||||
{{#if roll.hope}}
|
||||
<div class="roll-die">
|
||||
<label>Hope</label>
|
||||
<div>{{total}} <img class="dice-icon" src="systems/daggerheart/assets/icons/dice/hope/{{dice}}.svg" alt=""></div>
|
||||
<label>{{localize "DAGGERHEART.GENERAL.hope"}}</label>
|
||||
<div class="dice {{roll.hope.dice}} color-hope">{{roll.hope.value}}</div>
|
||||
</div>
|
||||
{{#unless @last}}
|
||||
<div class="roll-die">
|
||||
<label></label>
|
||||
<div class="font-20">+</div>
|
||||
</div>
|
||||
<div class="roll-die">
|
||||
<label>{{localize "DAGGERHEART.GENERAL.fear"}}</label>
|
||||
<div class="dice {{roll.fear.dice}} color-fear" style="--svg-folder: 'fear';">{{roll.fear.value}}</div>
|
||||
</div>
|
||||
{{#if roll.advantage.type}}
|
||||
<div class="roll-die">
|
||||
<label></label>
|
||||
<div>+</div>
|
||||
<div class="font-20">+</div>
|
||||
</div>
|
||||
{{/unless}}
|
||||
{{/each}}
|
||||
{{!-- <div class="roll-die">
|
||||
<label>Hope</label>
|
||||
<div>12 <img class="dice-icon" src="systems/daggerheart/assets/icons/dice/hope/d20.svg" alt=""></div>
|
||||
</div>
|
||||
<div class="roll-die">
|
||||
<label></label>
|
||||
<div>+</div>
|
||||
</div>
|
||||
<div class="roll-die">
|
||||
<label>Fear</label>
|
||||
<div>6 <img class="dice-icon" src="systems/daggerheart/assets/icons/dice/fear/d12.svg" alt=""></div>
|
||||
</div> --}}
|
||||
<div class="roll-die">
|
||||
{{#if (eq roll.advantage.type 1)}}
|
||||
<label>{{localize "DAGGERHEART.GENERAL.Advantage.short"}}</label>
|
||||
<div class="dice {{roll.advantage.dice}} color-adv">{{roll.advantage.value}}</div>
|
||||
{{else}}
|
||||
<label>{{localize "DAGGERHEART.GENERAL.Disadvantage.short"}}</label>
|
||||
<div class="dice {{roll.advantage.dice}} color-dis">{{roll.advantage.value}}</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
{{/if}}
|
||||
{{#if roll.rally.dice}}
|
||||
<div class="roll-die">
|
||||
<label></label>
|
||||
<div class="font-20">+</div>
|
||||
</div>
|
||||
<div class="roll-die">
|
||||
<label>{{localize "DAGGERHEART.GENERAL.fear"}}</label>
|
||||
<div class="dice {{roll.rally.dice}}">{{roll.rally.value}}</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{#each roll.extra}}
|
||||
<div class="roll-die">
|
||||
<label></label>
|
||||
<div class="font-20">+</div>
|
||||
</div>
|
||||
<div class="roll-die">
|
||||
<label></label>
|
||||
<div class="dice {{dice}}">{{value}}</div>
|
||||
</div>
|
||||
{{#unless @last}}
|
||||
<div class="roll-die">
|
||||
<label></label>
|
||||
<div class="font-20">+</div>
|
||||
</div>
|
||||
{{/unless}}
|
||||
{{/each}}
|
||||
{{else}}
|
||||
{{#each roll.dice}}
|
||||
{{#each results}}
|
||||
<div class="roll-die">
|
||||
<div class="dice {{../dice}}{{#if discarded}} discarded{{else}}{{#if (and (eq @index 0) ../../roll.advantage.type)}}{{#if (eq ../../roll.advantage.type 1)}} color-adv{{else}} color-dis{{/if}}{{/if}}{{#if success}} color-adv{{/if}}{{/if}}">{{result}}</div>
|
||||
</div>
|
||||
{{#unless (or @last (not discarded))}}
|
||||
<div class="roll-die">
|
||||
<div class="font-20">+</div>
|
||||
</div>
|
||||
{{/unless}}
|
||||
{{/each}}
|
||||
{{#unless @last}}
|
||||
<div class="roll-die">
|
||||
<div class="font-20">+</div>
|
||||
</div>
|
||||
{{/unless}}
|
||||
{{/each}}
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="roll-formula">{{roll.formula}}</div>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<div class="roll-part target-section dice-roll" data-action="expandRoll">
|
||||
<div class="roll-part-header"><div><span>Target</span></div></div>
|
||||
{{#if targetSelection}}
|
||||
{{#if targets.length}}
|
||||
<div class="roll-part-extra on-reduced">
|
||||
<div class="wrapper">
|
||||
<div class="target-hit-status">{{targetShort.hit}} {{#if (gt targetShort.hit 1)}}{{localize "DAGGERHEART.GENERAL.hit.single"}}{{else}}{{localize "DAGGERHEART.GENERAL.hit.plural"}}{{/if}}</div>
|
||||
|
|
@ -11,10 +11,13 @@
|
|||
<div class="roll-part-content dice-result">
|
||||
<div class="dice-tooltip">
|
||||
<div class="wrapper">
|
||||
{{#if targets.length}}
|
||||
{{#if targetSelection}}
|
||||
<div class="target-selector">
|
||||
<div class="roll-part-header"><div></div></div>
|
||||
<div class="target-choice"><div {{#if targetSelection}}class="target-selected"{{/if}} data-target-hit="true">{{localize "DAGGERHEART.UI.Chat.damageRoll.hitTarget"}}</div><div {{#unless targetSelection}}class="target-selected"{{/unless}}>{{localize "DAGGERHEART.UI.Chat.damageRoll.currentTarget"}}</div></div>
|
||||
<div class="target-choice">
|
||||
<div class="button-target-selection{{#if targetSelection}} target-selected{{/if}}" data-target-hit="true">{{localize "DAGGERHEART.UI.Chat.damageRoll.hitTarget"}}</div>
|
||||
<div class="button-target-selection{{#unless targetSelection}} target-selected{{/unless}}">{{localize "DAGGERHEART.UI.Chat.damageRoll.currentTarget"}}</div>
|
||||
</div>
|
||||
<div class="roll-part-header"><div></div></div>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue