mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-11 19:25:21 +01:00
Feature/163 actor subdatas (#346)
* Actor Roll bonuses * Removed console log and comment --------- Co-authored-by: WBHarry <williambjrklund@gmail.com>
This commit is contained in:
parent
422f28c93c
commit
37c1d7ad88
21 changed files with 210 additions and 103 deletions
|
|
@ -24,8 +24,26 @@ export default class DamageRoll extends DHRoll {
|
|||
}
|
||||
}
|
||||
|
||||
applyBaseBonus() {
|
||||
const modifiers = [],
|
||||
type = this.options.messageType ?? 'damage';
|
||||
|
||||
modifiers.push(...this.getBonus(`${type}`, `${type.capitalize()} Bonus`));
|
||||
this.options.damageTypes?.forEach(t => {
|
||||
modifiers.push(...this.getBonus(`${type}.${t}`, `${t.capitalize()} ${type.capitalize()} Bonus`));
|
||||
});
|
||||
const weapons = ['primaryWeapon', 'secondaryWeapon'];
|
||||
weapons.forEach(w => {
|
||||
if(this.options.source.item && this.options.source.item === this.data[w]?.id)
|
||||
modifiers.push(...this.getBonus(`${type}.${w}`, 'Weapon Bonus'));
|
||||
});
|
||||
|
||||
return modifiers;
|
||||
}
|
||||
|
||||
constructFormula(config) {
|
||||
super.constructFormula(config);
|
||||
|
||||
if (config.isCritical) {
|
||||
const tmpRoll = new Roll(this._formula)._evaluateSync({ maximize: true }),
|
||||
criticalBonus = tmpRoll.total - this.constructor.calculateTotalModifiers(tmpRoll);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue