mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-03-07 14:36:13 +01:00
34 lines
1,023 B
JavaScript
34 lines
1,023 B
JavaScript
import { DHDamageData } from './actionDice.mjs';
|
|
import DHDamageAction from './damageAction.mjs';
|
|
|
|
export default class DHAttackAction extends DHDamageAction {
|
|
static extraSchemas = [...super.extraSchemas, ...['roll', 'save']];
|
|
|
|
static getRollType(parent) {
|
|
return parent.type === 'weapon' ? 'weapon' : 'spellcast';
|
|
}
|
|
|
|
get chatTemplate() {
|
|
return 'systems/daggerheart/templates/ui/chat/duality-roll.hbs';
|
|
}
|
|
|
|
prepareData() {
|
|
super.prepareData();
|
|
if (this.damage.includeBase && !!this.item?.system?.damage) {
|
|
const baseDamage = this.getParentDamage();
|
|
this.damage.parts.unshift(new DHDamageData(baseDamage));
|
|
}
|
|
}
|
|
|
|
getParentDamage() {
|
|
return {
|
|
value: {
|
|
multiplier: 'prof',
|
|
dice: this.item?.system?.damage.dice,
|
|
bonus: this.item?.system?.damage.bonus ?? 0
|
|
},
|
|
type: this.item?.system?.damage.type,
|
|
base: true
|
|
};
|
|
}
|
|
}
|