mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-06-06 12:54:16 +02:00
Fixed
This commit is contained in:
parent
7530e4b512
commit
22c3212e5e
4 changed files with 22 additions and 30 deletions
|
|
@ -78,6 +78,24 @@ export class DHActionRollData extends foundry.abstract.DataModel {
|
|||
return formula;
|
||||
}
|
||||
|
||||
getModifier() {
|
||||
const modifiers = [];
|
||||
if (!this.parent?.actor) return modifiers;
|
||||
switch (this.parent.actor.type) {
|
||||
case 'companion':
|
||||
case 'adversary':
|
||||
if (this.type === CONFIG.DH.GENERAL.rollTypes.attack.id)
|
||||
modifiers.push({
|
||||
label: 'Bonus to Hit',
|
||||
value: this.bonus ?? this.parent.actor.system.attack.roll.bonus ?? 0
|
||||
});
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return modifiers;
|
||||
}
|
||||
|
||||
get rollTrait() {
|
||||
if (this.parent?.actor?.type !== 'character') return null;
|
||||
switch (this.type) {
|
||||
|
|
@ -127,6 +145,7 @@ export default class RollField extends fields.EmbeddedDataField {
|
|||
config.dialog.configure = RollField.getAutomation() ? !config.dialog.configure : config.dialog.configure;
|
||||
|
||||
const roll = {
|
||||
baseModifiers: this.roll.getModifier(),
|
||||
label: 'Attack',
|
||||
type: this.roll?.type,
|
||||
trait: this.roll?.rollTrait,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue