mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-04-21 23:13:39 +02:00
Fixed resource error on TagTeamDialog reroll
This commit is contained in:
parent
8d8fa983ef
commit
d7ce388cad
3 changed files with 8 additions and 11 deletions
|
|
@ -453,7 +453,8 @@ export default class TagTeamDialog extends HandlebarsApplicationMixin(Applicatio
|
||||||
const { parsedRoll, newRoll } = await game.system.api.dice.DualityRoll.reroll(
|
const { parsedRoll, newRoll } = await game.system.api.dice.DualityRoll.reroll(
|
||||||
memberData.rollData,
|
memberData.rollData,
|
||||||
dieIndex,
|
dieIndex,
|
||||||
diceType
|
diceType,
|
||||||
|
false
|
||||||
);
|
);
|
||||||
const rollData = parsedRoll.toJSON();
|
const rollData = parsedRoll.toJSON();
|
||||||
this.updatePartyData(
|
this.updatePartyData(
|
||||||
|
|
|
||||||
|
|
@ -122,10 +122,6 @@ export default class DHRoll extends Roll {
|
||||||
if (roll._evaluated) {
|
if (roll._evaluated) {
|
||||||
const message = await cls.create(msgData, { messageMode: config.selectedMessageMode });
|
const message = await cls.create(msgData, { messageMode: config.selectedMessageMode });
|
||||||
|
|
||||||
if (config.tagTeamSelected) {
|
|
||||||
game.system.api.applications.dialogs.TagTeamDialog.assignRoll(message.speakerActor, message);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (roll.formula !== '' && game.modules.get('dice-so-nice')?.active) {
|
if (roll.formula !== '' && game.modules.get('dice-so-nice')?.active) {
|
||||||
await game.dice3d.waitFor3DAnimationByMessageID(message.id);
|
await game.dice3d.waitFor3DAnimationByMessageID(message.id);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -305,7 +305,6 @@ export default class DualityRoll extends D20Roll {
|
||||||
!config.source?.actor ||
|
!config.source?.actor ||
|
||||||
(game.user.isGM ? !hopeFearAutomation.gm : !hopeFearAutomation.players) ||
|
(game.user.isGM ? !hopeFearAutomation.gm : !hopeFearAutomation.players) ||
|
||||||
config.actionType === 'reaction' ||
|
config.actionType === 'reaction' ||
|
||||||
config.tagTeamSelected ||
|
|
||||||
config.skips?.resources
|
config.skips?.resources
|
||||||
)
|
)
|
||||||
return;
|
return;
|
||||||
|
|
@ -346,7 +345,6 @@ export default class DualityRoll extends D20Roll {
|
||||||
if (
|
if (
|
||||||
automationSettings.countdownAutomation &&
|
automationSettings.countdownAutomation &&
|
||||||
config.actionType !== 'reaction' &&
|
config.actionType !== 'reaction' &&
|
||||||
!config.tagTeamSelected &&
|
|
||||||
!config.skips?.updateCountdowns
|
!config.skips?.updateCountdowns
|
||||||
) {
|
) {
|
||||||
const { updateCountdowns } = game.system.api.applications.ui.DhCountdowns;
|
const { updateCountdowns } = game.system.api.applications.ui.DhCountdowns;
|
||||||
|
|
@ -374,7 +372,7 @@ export default class DualityRoll extends D20Roll {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static async reroll(rollBase, dieIndex, diceType) {
|
static async reroll(rollBase, dieIndex, diceType, updateResources = true) {
|
||||||
let parsedRoll = game.system.api.dice.DualityRoll.fromData({ ...rollBase, evaluated: false });
|
let parsedRoll = game.system.api.dice.DualityRoll.fromData({ ...rollBase, evaluated: false });
|
||||||
const term = parsedRoll.terms[dieIndex];
|
const term = parsedRoll.terms[dieIndex];
|
||||||
await term.reroll(`/r1=${term.total}`);
|
await term.reroll(`/r1=${term.total}`);
|
||||||
|
|
@ -421,12 +419,14 @@ export default class DualityRoll extends D20Roll {
|
||||||
source: { actor: parsedRoll.options.source.actor ?? '' },
|
source: { actor: parsedRoll.options.source.actor ?? '' },
|
||||||
targets: parsedRoll.targets,
|
targets: parsedRoll.targets,
|
||||||
roll: newRoll,
|
roll: newRoll,
|
||||||
rerolledRoll: parsedRoll.roll,
|
rerolledRoll: parsedRoll.options.roll,
|
||||||
resourceUpdates: new ResourceUpdateMap(actor)
|
resourceUpdates: new ResourceUpdateMap(actor)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (updateResources) {
|
||||||
await DualityRoll.addDualityResourceUpdates(config);
|
await DualityRoll.addDualityResourceUpdates(config);
|
||||||
await config.resourceUpdates.updateResources();
|
await config.resourceUpdates.updateResources();
|
||||||
|
}
|
||||||
|
|
||||||
return { newRoll, parsedRoll };
|
return { newRoll, parsedRoll };
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue