diff --git a/module/data/actor/adversary.mjs b/module/data/actor/adversary.mjs index 5b83f3c7..c0cecb59 100644 --- a/module/data/actor/adversary.mjs +++ b/module/data/actor/adversary.mjs @@ -53,8 +53,8 @@ export default class DhpAdversary extends BaseDataActor { }) }), resources: new fields.SchemaField({ - hitPoints: resourceField(0, 'DAGGERHEART.GENERAL.HitPoints.plural', true), - stress: resourceField(0, 'DAGGERHEART.GENERAL.stress', true) + hitPoints: resourceField(0, 0, 'DAGGERHEART.GENERAL.HitPoints.plural', true), + stress: resourceField(0, 0, 'DAGGERHEART.GENERAL.stress', true) }), attack: new ActionField({ initial: { diff --git a/module/data/actor/character.mjs b/module/data/actor/character.mjs index 0e78e96a..93723c70 100644 --- a/module/data/actor/character.mjs +++ b/module/data/actor/character.mjs @@ -25,13 +25,14 @@ export default class DhCharacter extends BaseDataActor { ...super.defineSchema(), resources: new fields.SchemaField({ hitPoints: resourceField( + 0, 0, 'DAGGERHEART.GENERAL.HitPoints.plural', true, 'DAGGERHEART.ACTORS.Character.maxHPBonus' ), - stress: resourceField(6, 'DAGGERHEART.GENERAL.stress', true), - hope: resourceField(6, 'DAGGERHEART.GENERAL.hope') + stress: resourceField(6, 0, 'DAGGERHEART.GENERAL.stress', true), + hope: resourceField(6, 2, 'DAGGERHEART.GENERAL.hope') }), traits: new fields.SchemaField({ agility: attributeField('DAGGERHEART.CONFIG.Traits.agility.name'), diff --git a/module/data/actor/companion.mjs b/module/data/actor/companion.mjs index af17b790..3d00661f 100644 --- a/module/data/actor/companion.mjs +++ b/module/data/actor/companion.mjs @@ -25,7 +25,7 @@ export default class DhCompanion extends BaseDataActor { ...super.defineSchema(), partner: new ForeignDocumentUUIDField({ type: 'Actor' }), resources: new fields.SchemaField({ - stress: resourceField(3, 'DAGGERHEART.GENERAL.stress', true), + stress: resourceField(3, 0, 'DAGGERHEART.GENERAL.stress', true), hope: new fields.NumberField({ initial: 0, integer: true, label: 'DAGGERHEART.GENERAL.hope' }) }), evasion: new fields.NumberField({ diff --git a/module/data/fields/actorField.mjs b/module/data/fields/actorField.mjs index b4c7f9b9..3c65b984 100644 --- a/module/data/fields/actorField.mjs +++ b/module/data/fields/actorField.mjs @@ -6,9 +6,9 @@ const attributeField = label => tierMarked: new fields.BooleanField({ initial: false }) }); -const resourceField = (max = 0, label, reverse = false, maxLabel) => +const resourceField = (max = 0, initial = 0, label, reverse = false, maxLabel) => new fields.SchemaField({ - value: new fields.NumberField({ initial: 0, min: 0, integer: true, label }), + value: new fields.NumberField({ initial: initial, min: 0, integer: true, label }), max: new fields.NumberField({ initial: max, integer: true,