mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 11:41:08 +01:00
Fix bardic rally showing in damage dialog when it should not (#783)
This commit is contained in:
parent
080b6bc2da
commit
df5373cd20
2 changed files with 21 additions and 18 deletions
|
|
@ -159,25 +159,28 @@ export default class DamageRoll extends DHRoll {
|
|||
if (config.data?.parent) {
|
||||
if (config.data.parent.appliedEffects) {
|
||||
// Bardic Rally
|
||||
mods.rally = {
|
||||
label: 'DAGGERHEART.CLASS.Feature.rallyDice',
|
||||
values: config.data?.parent?.appliedEffects.reduce((a, c) => {
|
||||
const rallyChoices = config.data?.parent?.appliedEffects.reduce((a, c) => {
|
||||
const change = c.changes.find(ch => ch.key === 'system.bonuses.rally');
|
||||
if (change) a.push({ value: c.id, label: change.value });
|
||||
return a;
|
||||
}, []),
|
||||
value: null,
|
||||
beforeCrit: true,
|
||||
callback: part => {
|
||||
const rallyFaces = config.modifiers.rally.values.find(
|
||||
r => r.value === config.modifiers.rally.value
|
||||
)?.label;
|
||||
part.roll.terms.push(
|
||||
new foundry.dice.terms.OperatorTerm({ operator: '+' }),
|
||||
...this.parse(`1${rallyFaces}`)
|
||||
);
|
||||
}
|
||||
};
|
||||
}, [])
|
||||
if(rallyChoices.length) {
|
||||
mods.rally = {
|
||||
label: 'DAGGERHEART.CLASS.Feature.rallyDice',
|
||||
values: rallyChoices,
|
||||
value: null,
|
||||
beforeCrit: true,
|
||||
callback: part => {
|
||||
const rallyFaces = config.modifiers.rally.values.find(
|
||||
r => r.value === config.modifiers.rally.value
|
||||
)?.label;
|
||||
part.roll.terms.push(
|
||||
new foundry.dice.terms.OperatorTerm({ operator: '+' }),
|
||||
...this.parse(`1${rallyFaces}`)
|
||||
);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
const item = config.data.parent.items?.get(config.source.item);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue