This commit is contained in:
Chris Ryan 2026-01-10 10:28:46 +10:00 committed by GitHub
commit 54b0cda45a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 647 additions and 155 deletions

View file

@ -78,12 +78,7 @@ export default class DhCharacter extends BaseDataActor {
bags: new fields.NumberField({ initial: 0, integer: true }),
chests: new fields.NumberField({ initial: 0, integer: true })
}),
scars: new fields.TypedObjectField(
new fields.SchemaField({
name: new fields.StringField({}),
description: new fields.StringField()
})
),
scars: new fields.NumberField({ initial: 0, integer: true, label: 'DAGGERHEART.GENERAL.scars' }),
biography: new fields.SchemaField({
background: new fields.HTMLField(),
connections: new fields.HTMLField(),
@ -283,6 +278,9 @@ export default class DhCharacter extends BaseDataActor {
runeWard: new fields.BooleanField({ initial: false }),
burden: new fields.SchemaField({
ignore: new fields.BooleanField()
}),
roll: new fields.SchemaField({
guaranteedCritical: new fields.BooleanField()
})
})
};
@ -624,7 +622,7 @@ export default class DhCharacter extends BaseDataActor {
? armor.system.baseThresholds.severe + this.levelData.level.current
: this.levelData.level.current * 2
};
this.resources.hope.max -= Object.keys(this.scars).length;
this.resources.hope.max -= this.scars;
this.resources.hitPoints.max += this.class.value?.system?.hitPoints ?? 0;
}
@ -696,4 +694,9 @@ export default class DhCharacter extends BaseDataActor {
t => !!t
);
}
static migrateData(source) {
if (typeof (source.scars) === 'object') source.scars = 0;
return super.migrateData(source);
}
}

View file

@ -8,6 +8,7 @@ export const config = {
adversaryRoll: DHActorRoll,
damageRoll: DHActorRoll,
dualityRoll: DHActorRoll,
fateRoll: DHActorRoll,
groupRoll: DHGroupRoll,
systemMessage: DHSystemMessage
};