Merge branch 'main' into feature/Character-Setup-Rework

This commit is contained in:
WBHarry 2025-07-11 23:46:39 +02:00
commit 8079dec639
42 changed files with 752 additions and 66 deletions

View file

@ -180,8 +180,8 @@ export default class DHBaseAction extends foundry.abstract.DataModel {
const actorData = this.actor.getRollData(false);
// Remove when included directly in Actor getRollData
actorData.prof = actorData.proficiency?.value ?? 1;
actorData.cast = actorData.spellcast?.value ?? 1;
actorData.prof = actorData.proficiency?.total ?? 1;
actorData.cast = actorData.spellcast?.total ?? 1;
actorData.result = data.roll?.total ?? 1;
/* actorData.scale = data.costs?.length
? data.costs.reduce((a, c) => {

View file

@ -66,10 +66,9 @@ export default class DhCompanion extends BaseDataActor {
damage: {
parts: [
{
multiplier: 'flat',
value: {
dice: 'd6',
multiplier: 'flat'
multiplier: 'prof'
}
}
]
@ -87,6 +86,12 @@ export default class DhCompanion extends BaseDataActor {
};
}
get proficiency() {
return {
total: this.partner?.system?.proficiency?.total ?? 1
};
}
prepareBaseData() {
const partnerSpellcastingModifier = this.partner?.system?.spellcastingModifiers?.main;
const spellcastingModifier = this.partner?.system?.traits?.[partnerSpellcastingModifier]?.total;

View file

@ -44,6 +44,12 @@ export default class DHArmor extends BaseDataItem {
};
}
get customActions() {
return this.actions.filter(
action => !this.armorFeatures.some(feature => feature.actionIds.includes(action.id))
);
}
async _preUpdate(changes, options, user) {
const allowed = await super._preUpdate(changes, options, user);
if (allowed === false) return false;

View file

@ -73,6 +73,12 @@ export default class DHWeapon extends BaseDataItem {
return [this.attack, ...this.actions];
}
get customActions() {
return this.actions.filter(
action => !this.weaponFeatures.some(feature => feature.actionIds.includes(action.id))
);
}
async _preUpdate(changes, options, user) {
const allowed = await super._preUpdate(changes, options, user);
if (allowed === false) return false;

View file

@ -40,6 +40,10 @@ export default class DhAppearance extends foundry.abstract.DataModel {
outline: new fields.ColorField({ required: true, initial: '#ffffff' }),
edge: new fields.ColorField({ required: true, initial: '#000000' })
})
}),
showGenericStatusEffects: new fields.BooleanField({
initial: true,
label: 'DAGGERHEART.SETTINGS.Appearance.FIELDS.showGenericStatusEffects.label'
})
};
}

View file

@ -2,7 +2,7 @@ export default class DhRangeMeasurement extends foundry.abstract.DataModel {
static defineSchema() {
const fields = foundry.data.fields;
return {
enabled: new fields.BooleanField({ required: true, initial: false, label: 'DAGGERHEART.GENERAL.enabled' }),
enabled: new fields.BooleanField({ required: true, initial: true, label: 'DAGGERHEART.GENERAL.enabled' }),
melee: new fields.NumberField({ required: true, initial: 5, label: 'DAGGERHEART.CONFIG.Range.melee.name' }),
veryClose: new fields.NumberField({
required: true,