mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-07-21 18:09:54 +02:00
Fixed so that DamageTypes are retained and joined together throughout TagTeamDialog
This commit is contained in:
parent
7afc98ed93
commit
e6dcb0f9a5
2 changed files with 12 additions and 1 deletions
|
|
@ -588,6 +588,7 @@ export default class TagTeamDialog extends HandlebarsApplicationMixin(Applicatio
|
||||||
new foundry.dice.terms.OperatorTerm({ operator: '+' }),
|
new foundry.dice.terms.OperatorTerm({ operator: '+' }),
|
||||||
criticalTerm
|
criticalTerm
|
||||||
]);
|
]);
|
||||||
|
newDamage.types[key].options = foundry.utils.deepClone(origDamage.types[key].options);
|
||||||
}
|
}
|
||||||
|
|
||||||
return newDamage;
|
return newDamage;
|
||||||
|
|
@ -650,6 +651,16 @@ export default class TagTeamDialog extends HandlebarsApplicationMixin(Applicatio
|
||||||
new foundry.dice.terms.OperatorTerm({ operator: '+' }),
|
new foundry.dice.terms.OperatorTerm({ operator: '+' }),
|
||||||
...baseSecondaryRoll.damageRollData.types[key].terms
|
...baseSecondaryRoll.damageRollData.types[key].terms
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
/* Joining the roll.options of both rolls */
|
||||||
|
const joinedDamageTypes = new Set([
|
||||||
|
...baseMainRoll.damageRollData.types[key].options.damageTypes,
|
||||||
|
...baseSecondaryRoll.damageRollData.types[key].options.damageTypes
|
||||||
|
]);
|
||||||
|
mainRoll.damageRollData.types[key].options = {
|
||||||
|
...baseMainRoll.damageRollData.types[key].options,
|
||||||
|
damageTypes: [...joinedDamageTypes]
|
||||||
|
};
|
||||||
} else {
|
} else {
|
||||||
mainRoll.damageRollData.types[key] = damage;
|
mainRoll.damageRollData.types[key] = damage;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ export default class DamageRoll extends DHRoll {
|
||||||
|
|
||||||
for (const roll of config.roll) {
|
for (const roll of config.roll) {
|
||||||
await roll.roll.evaluate();
|
await roll.roll.evaluate();
|
||||||
roll.roll.options = { damageTypes: roll.damageTypes ?? [] };
|
roll.roll.options = { damageTypes: roll.damageTypes ? [...roll.damageTypes] : [] };
|
||||||
|
|
||||||
if (!config.damage?.types) config.damage = { types: {} };
|
if (!config.damage?.types) config.damage = { types: {} };
|
||||||
config.damage.types[roll.applyTo] = roll.roll;
|
config.damage.types[roll.applyTo] = roll.roll;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue