Merge branch 'main' into 419-feature-add-createtagsmethods-for-documents-and-actions

This commit is contained in:
Joaquin Pereyra 2025-07-28 23:42:16 -03:00
commit faa412bfc1
264 changed files with 13626 additions and 896 deletions

View file

@ -63,6 +63,19 @@ export default class DHWeapon extends AttachableItem {
]
}
}
}),
rules: new fields.SchemaField({
attack: new fields.SchemaField({
roll: new fields.SchemaField({
trait: new fields.StringField({
required: true,
choices: CONFIG.DH.ACTOR.abilities,
nullable: true,
initial: null,
label: 'DAGGERHEART.GENERAL.Rules.attack.roll.trait.label'
})
})
})
})
};
}
@ -77,6 +90,10 @@ export default class DHWeapon extends AttachableItem {
);
}
prepareDerivedData() {
this.attack.roll.trait = this.rules.attack.roll.trait ?? this.attack.roll.trait;
}
async _preUpdate(changes, options, user) {
const allowed = await super._preUpdate(changes, options, user);
if (allowed === false) return false;