mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
.
This commit is contained in:
parent
80595f4e79
commit
148aca7235
7 changed files with 129 additions and 57 deletions
|
|
@ -127,20 +127,53 @@ export default class D20Roll extends DHRoll {
|
|||
const modifiers = foundry.utils.deepClone(this.options.roll.baseModifiers) ?? [];
|
||||
|
||||
modifiers.push(
|
||||
...this.getBonus(`roll.${this.options.actionType}`, `${this.options.actionType?.capitalize()} Bonus`)
|
||||
);
|
||||
modifiers.push(
|
||||
...this.getBonus(`roll.${this.options.roll.type}`, `${this.options.roll.type?.capitalize()} Bonus`)
|
||||
...this.getBonus(
|
||||
`system.bonuses.roll.${this.options.actionType}`,
|
||||
`${this.options.actionType?.capitalize()} Bonus`
|
||||
)
|
||||
);
|
||||
|
||||
if (this.options.roll.type !== CONFIG.DH.GENERAL.rollTypes.attack.id) {
|
||||
modifiers.push(
|
||||
...this.getBonus(
|
||||
`system.bonuses.roll.${this.options.roll.type}`,
|
||||
`${this.options.roll.type?.capitalize()} Bonus`
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if (
|
||||
this.options.roll.type === CONFIG.DH.GENERAL.rollTypes.attack.id ||
|
||||
(this.options.roll.type === CONFIG.DH.GENERAL.rollTypes.spellcast.id && this.options.hasDamage)
|
||||
) {
|
||||
modifiers.push(
|
||||
...this.getBonus(`system.bonuses.roll.attack`, `${this.options.roll.type?.capitalize()} Bonus`)
|
||||
);
|
||||
}
|
||||
|
||||
return modifiers;
|
||||
}
|
||||
|
||||
bonusEffectBuilder(config) {
|
||||
const changeKeys = [`roll.${this.options.actionType}`, `roll.${this.options.roll.type}`];
|
||||
config.bonusEffects = foundry.utils.deepClone(
|
||||
config.effects.filter(x => x.changes.some(x => changeKeys.includes(x.key)))
|
||||
);
|
||||
getActionChangeKeys() {
|
||||
const changeKeys = new Set([`system.bonuses.roll.${this.options.actionType}`]);
|
||||
|
||||
if (this.options.roll.type !== CONFIG.DH.GENERAL.rollTypes.attack.id) {
|
||||
changeKeys.add(`system.bonuses.roll.${this.options.roll.type}`);
|
||||
}
|
||||
|
||||
if (
|
||||
this.options.roll.type === CONFIG.DH.GENERAL.rollTypes.attack.id ||
|
||||
(this.options.roll.type === CONFIG.DH.GENERAL.rollTypes.spellcast.id && this.options.hasDamage)
|
||||
) {
|
||||
changeKeys.add(`system.bonuses.roll.attack`);
|
||||
}
|
||||
|
||||
if (this.options.roll.trait && this.data.traits?.[this.options.roll.trait]) {
|
||||
if (this.options.roll.type !== CONFIG.DH.GENERAL.rollTypes.spellcast.id)
|
||||
changeKeys.add('system.bonuses.roll.trait');
|
||||
}
|
||||
|
||||
return changeKeys;
|
||||
}
|
||||
|
||||
static postEvaluate(roll, config = {}) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue