Fixed chat /dr roll

This commit is contained in:
WBHarry 2025-06-12 23:22:23 +02:00
parent 3d034cd24e
commit 0f3da99f9d
2 changed files with 71 additions and 13 deletions

View file

@ -140,16 +140,16 @@ const renderDualityButton = async event => {
if (!target) return;
const config = {
event: event,
title: button.dataset.label,
roll: {
modifier: attributeValue ? target.system.attributes[attributeValue].data.value : null,
type: button.dataset.actionType ?? null, // Need check
},
chatMessage: {
template: 'systems/daggerheart/templates/chat/attack-roll.hbs'
}
};
event: event,
title: button.dataset.label,
roll: {
modifier: attributeValue ? target.system.attributes[attributeValue].data.value : null,
type: button.dataset.actionType ?? null // Need check
},
chatMessage: {
template: 'systems/daggerheart/templates/chat/attack-roll.hbs'
}
};
await target.diceRoll(config);
// Delete when new roll logic test done
@ -240,8 +240,7 @@ Hooks.on('chatMessage', (_, message) => {
const hopeAndFearRoll = `1${rollCommand.hope ?? 'd12'}+1${rollCommand.fear ?? 'd12'}`;
const advantageRoll = `${rollCommand.advantage && !rollCommand.disadvantage ? '+d6' : rollCommand.disadvantage && !rollCommand.advantage ? '-d6' : ''}`;
const attributeRoll = `${attribute?.data?.value ? `${attribute.data.value > 0 ? `+${attribute.data.value}` : `${attribute.data.value}`}` : ''}`;
const roll = new Roll(`${hopeAndFearRoll}${advantageRoll}${attributeRoll}`);
await roll.evaluate();
const roll = await Roll.create(`${hopeAndFearRoll}${advantageRoll}${attributeRoll}`).evaluate();
setDiceSoNiceForDualityRoll(
roll,
@ -264,7 +263,7 @@ Hooks.on('chatMessage', (_, message) => {
const systemData = new DHDualityRoll({
title: title,
origin: target?.id,
roll: roll._formula,
roll: roll,
modifiers: attribute ? [attribute] : [],
hope: { dice: rollCommand.hope ?? 'd12', value: roll.dice[0].total },
fear: { dice: rollCommand.fear ?? 'd12', value: roll.dice[1].total },

View file

@ -2216,6 +2216,34 @@ div.daggerheart.views.multiclass {
.daggerheart.views.action .action-category .action-category-data.open {
max-height: initial;
}
.daggerheart.views.action .action-category .action-category-data .multi-display {
display: flex;
gap: 1rem;
align-items: center;
}
.daggerheart.views.action .action-category .action-category-data .multi-display .form-group {
flex: 1;
}
.daggerheart.views.action .action-category .action-category-data .form-group {
display: flex;
align-items: center;
margin-bottom: 0.5rem;
}
.daggerheart.views.action .action-category .action-category-data .form-group label {
flex: 2;
}
.daggerheart.views.action .action-category .action-category-data .form-group .form-fields {
flex: 3;
}
.daggerheart.views.action .action-category .action-category-data .form-group img {
width: 1.5rem;
height: 1.5rem;
}
.daggerheart.views.action .action-category .action-category-data .data-form-array {
border: 1px solid var(--color-fieldset-border);
padding: 0.5rem;
margin-bottom: 0.5rem;
}
.daggerheart.views.ancestry-selection .ancestry-section {
display: flex;
flex-direction: column;
@ -3705,3 +3733,34 @@ div.daggerheart.views.multiclass {
cursor: pointer;
filter: drop-shadow(0 0 3px red);
}
.unlist {
list-style: none;
padding-inline-start: 0;
}
.list-select {
margin: 1rem;
}
.list-select li:not(:last-child) {
border-bottom: 1px solid #bbb;
}
.list-select li label {
padding: 4px 8px;
display: flex;
align-items: center;
gap: 1rem;
cursor: pointer;
}
.list-select li label > span {
flex: 1;
font-weight: bold;
font-size: var(--font-size-16);
}
dh-icon,
dh-icon > img {
width: 32px;
height: 32px;
display: flex;
align-items: center;
justify-content: center;
font-size: x-large;
}