Add Attack to Weapon & Override settings to Roll

This commit is contained in:
Dapoolp 2025-07-07 19:58:54 +02:00
parent 21f7d785f7
commit 357679a0a8
20 changed files with 140 additions and 107 deletions

View file

@ -11,7 +11,7 @@ export default class DHWeapon extends BaseDataItem {
hasDescription: true,
isQuantifiable: true,
isInventoryItem: true,
hasInitialAction: true
// hasInitialAction: true
});
}
@ -25,19 +25,8 @@ export default class DHWeapon extends BaseDataItem {
//SETTINGS
secondary: new fields.BooleanField({ initial: false }),
trait: new fields.StringField({ required: true, choices: CONFIG.DH.ACTOR.abilities, initial: 'agility' }),
range: new fields.StringField({ required: true, choices: CONFIG.DH.GENERAL.range, initial: 'melee' }),
burden: new fields.StringField({ required: true, choices: CONFIG.DH.GENERAL.burden, initial: 'oneHanded' }),
//DAMAGE
damage: new fields.SchemaField({
dice: new fields.StringField({ choices: CONFIG.DH.GENERAL.diceTypes, initial: 'd6' }),
bonus: new fields.NumberField({ nullable: true, initial: null }),
type: new fields.StringField({
required: true,
choices: CONFIG.DH.GENERAL.damageTypes,
initial: 'physical'
})
}),
features: new fields.ArrayField(
new fields.SchemaField({
value: new fields.StringField({
@ -62,12 +51,16 @@ export default class DHWeapon extends BaseDataItem {
amount: 1
},
roll: {
trait: 'agility',
type: 'weapon'
},
damage: {
parts: [
{
multiplier: 'prof'
value: {
multiplier: 'prof',
dice: "d8"
}
}
]
}
@ -77,6 +70,10 @@ export default class DHWeapon extends BaseDataItem {
};
}
get actionsList() {
return [this.attack, ...this.actions];
}
async _preUpdate(changes, options, user) {
const allowed = await super._preUpdate(changes, options, user);
if (allowed === false) return false;