Merged with main

This commit is contained in:
WBHarry 2025-07-19 23:37:08 +02:00
commit 4b82169fbf
74 changed files with 2018 additions and 1299 deletions

View file

@ -164,7 +164,7 @@ export default class DHBaseAction extends foundry.abstract.DataModel {
getRollData(data = {}) {
if (!this.actor) return null;
const actorData = this.actor.getRollData(false);
const actorData = this.actor.system.getRollData(false);
// Add Roll results to RollDatas
actorData.result = data.roll?.total ?? 1;

View file

@ -53,7 +53,7 @@ export default class DhpAdversary extends BaseDataActor {
})
}),
resources: new fields.SchemaField({
hitPoints: resourceField(0, 'DAGGERHEART.GENERAL.hitPoints.plural', true),
hitPoints: resourceField(0, 'DAGGERHEART.GENERAL.HitPoints.plural', true),
stress: resourceField(0, 'DAGGERHEART.GENERAL.stress', true)
}),
attack: new ActionField({

View file

@ -22,7 +22,7 @@ export default class DhCharacter extends BaseDataActor {
return {
...super.defineSchema(),
resources: new fields.SchemaField({
hitPoints: resourceField(0, 'DAGGERHEART.GENERAL.hitPoints.plural', true),
hitPoints: resourceField(0, 'DAGGERHEART.GENERAL.HitPoints.plural', true),
stress: resourceField(6, 'DAGGERHEART.GENERAL.stress', true),
hope: resourceField(6, 'DAGGERHEART.GENERAL.hope')
}),
@ -68,7 +68,7 @@ export default class DhCharacter extends BaseDataActor {
scars: new fields.TypedObjectField(
new fields.SchemaField({
name: new fields.StringField({}),
description: new fields.HTMLField()
description: new fields.StringField()
})
),
biography: new fields.SchemaField({
@ -90,7 +90,7 @@ export default class DhCharacter extends BaseDataActor {
}),
attack: new ActionField({
initial: {
name: 'DAGGERHEART.GENERAL.unarmedStrike',
name: 'Attack',
img: 'icons/skills/melee/unarmed-punch-fist-yellow-red.webp',
_id: foundry.utils.randomID(),
systemPath: 'attack',
@ -334,6 +334,7 @@ export default class DhCharacter extends BaseDataActor {
return !primaryWeaponEquipped && !secondaryWeaponEquipped
? {
...this.attack,
id: this.attack.id,
name: this.activeBeastform ? 'DAGGERHEART.ITEMS.Beastform.attackName' : this.attack.name,
img: this.activeBeastform ? 'icons/creatures/claws/claw-straight-brown.webp' : this.attack.img
}
@ -520,13 +521,14 @@ export default class DhCharacter extends BaseDataActor {
const data = super.getRollData();
return {
...data,
tier: this.tier,
level: this.levelData.level.current,
system: {
...this.resources.tokens,
...this.resources.dice,
...this.bonuses,
...this.rules,
tier: this.tier,
level: this.levelData.level.current
token: this.resources.tokens,
dice: this.resources.dice,
bonuses: this.bonuses,
rules: this.rules,
levelData: this.levelData
}
};
}

View file

@ -13,6 +13,7 @@ export default class DhCompanion extends BaseDataActor {
return foundry.utils.mergeObject(super.metadata, {
label: 'TYPES.Actor.companion',
type: 'companion',
isNPC: false,
settingSheet: DHCompanionSettings
});
}

View file

@ -24,7 +24,7 @@ export default class DHClass extends BaseDataItem {
integer: true,
min: 1,
initial: 5,
label: 'DAGGERHEART.GENERAL.hitPoints.plural'
label: 'DAGGERHEART.GENERAL.HitPoints.plural'
}),
evasion: new fields.NumberField({ initial: 0, integer: true, label: 'DAGGERHEART.GENERAL.evasion' }),
features: new ForeignDocumentUUIDArrayField({ type: 'Item' }),