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(
|
||||
memberData.rollData,
|
||||
dieIndex,
|
||||
diceType
|
||||
diceType,
|
||||
false
|
||||
);
|
||||
const rollData = parsedRoll.toJSON();
|
||||
this.updatePartyData(
|
||||
|
|
|
|||
|
|
@ -122,10 +122,6 @@ export default class DHRoll extends Roll {
|
|||
if (roll._evaluated) {
|
||||
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) {
|
||||
await game.dice3d.waitFor3DAnimationByMessageID(message.id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -305,7 +305,6 @@ export default class DualityRoll extends D20Roll {
|
|||
!config.source?.actor ||
|
||||
(game.user.isGM ? !hopeFearAutomation.gm : !hopeFearAutomation.players) ||
|
||||
config.actionType === 'reaction' ||
|
||||
config.tagTeamSelected ||
|
||||
config.skips?.resources
|
||||
)
|
||||
return;
|
||||
|
|
@ -346,7 +345,6 @@ export default class DualityRoll extends D20Roll {
|
|||
if (
|
||||
automationSettings.countdownAutomation &&
|
||||
config.actionType !== 'reaction' &&
|
||||
!config.tagTeamSelected &&
|
||||
!config.skips?.updateCountdowns
|
||||
) {
|
||||
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 });
|
||||
const term = parsedRoll.terms[dieIndex];
|
||||
await term.reroll(`/r1=${term.total}`);
|
||||
|
|
@ -421,12 +419,14 @@ export default class DualityRoll extends D20Roll {
|
|||
source: { actor: parsedRoll.options.source.actor ?? '' },
|
||||
targets: parsedRoll.targets,
|
||||
roll: newRoll,
|
||||
rerolledRoll: parsedRoll.roll,
|
||||
rerolledRoll: parsedRoll.options.roll,
|
||||
resourceUpdates: new ResourceUpdateMap(actor)
|
||||
};
|
||||
|
||||
if (updateResources) {
|
||||
await DualityRoll.addDualityResourceUpdates(config);
|
||||
await config.resourceUpdates.updateResources();
|
||||
}
|
||||
|
||||
return { newRoll, parsedRoll };
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue