Merge branch 'main' into refactor/275-actor-sheets-simplification

This commit is contained in:
joaquinpereyra98 2025-07-07 17:16:47 -03:00 committed by GitHub
commit 17a9630736
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
44 changed files with 358 additions and 251 deletions

View file

@ -47,6 +47,10 @@ export default class BaseDataItem extends foundry.abstract.TypeDataModel {
return this.parent.actor;
}
get actionsList() {
return this.actions;
}
/**
* Obtain a data object used to evaluate any dice rolls associated with this Item Type
* @param {object} [options] - Options which modify the getRollData method.

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({
@ -49,10 +38,42 @@ export default class DHWeapon extends BaseDataItem {
actionIds: new fields.ArrayField(new fields.StringField({ required: true }))
})
),
attack: new ActionField({
initial: {
name: 'Attack',
img: 'icons/skills/melee/blood-slash-foam-red.webp',
_id: foundry.utils.randomID(),
systemPath: 'attack',
type: 'attack',
range: 'melee',
target: {
type: 'any',
amount: 1
},
roll: {
trait: 'agility',
type: 'weapon'
},
damage: {
parts: [
{
value: {
multiplier: 'prof',
dice: "d8"
}
}
]
}
}
}),
actions: new fields.ArrayField(new ActionField())
};
}
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;