mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
Initial
This commit is contained in:
parent
9564edb244
commit
80595f4e79
12 changed files with 182 additions and 25 deletions
|
|
@ -93,7 +93,6 @@ export default class DamageRoll extends DHRoll {
|
|||
type = this.options.messageType ?? (this.options.hasHealing ? 'healing' : 'damage'),
|
||||
options = part ?? this.options;
|
||||
|
||||
modifiers.push(...this.getBonus(`${type}`, `${type.capitalize()} Bonus`));
|
||||
if (!this.options.hasHealing) {
|
||||
options.damageTypes?.forEach(t => {
|
||||
modifiers.push(...this.getBonus(`${type}.${t}`, `${t.capitalize()} ${type.capitalize()} Bonus`));
|
||||
|
|
@ -108,6 +107,25 @@ export default class DamageRoll extends DHRoll {
|
|||
return modifiers;
|
||||
}
|
||||
|
||||
bonusEffectBuilder() {
|
||||
const type = this.options.messageType ?? (this.options.hasHealing ? 'healing' : 'damage');
|
||||
|
||||
return this.options.effects.reduce((acc, effect) => {
|
||||
if (effect.changes.some(x => x.key.includes(`system.bonuses.${type}`))) {
|
||||
acc[effect.id] = {
|
||||
id: effect.id,
|
||||
name: effect.name,
|
||||
description: effect.description,
|
||||
changes: effect.changes,
|
||||
origEffect: effect,
|
||||
selected: !effect.disabled
|
||||
};
|
||||
}
|
||||
|
||||
return acc;
|
||||
}, {});
|
||||
}
|
||||
|
||||
constructFormula(config) {
|
||||
this.options.roll.forEach((part, index) => {
|
||||
part.roll = new Roll(Roll.replaceFormulaData(part.formula, config.data));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue