[Add] Hope/Scar Interplay (#1531)

* Migrated character.maxHope to homebrew settings

* Added a visual for scars

* .

* .
This commit is contained in:
WBHarry 2026-01-15 01:24:18 +01:00 committed by GitHub
parent 70f4e5f4e5
commit 816bfe0a29
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 33 additions and 2 deletions

View file

@ -2061,6 +2061,7 @@
"description": "Description",
"main": "Data",
"information": "Information",
"itemFeatures": "Item Features",
"notes": "Notes",
"inventory": "Inventory",
"loadout": "Loadout",
@ -2512,6 +2513,7 @@
"resetMovesText": "Are you sure you want to reset?",
"FIELDS": {
"maxFear": { "label": "Max Fear" },
"maxHope": { "label": "Max Hope" },
"traitArray": { "label": "Initial Trait Modifiers" },
"maxLoadout": {
"label": "Max Cards in Loadout",

View file

@ -35,7 +35,14 @@ export default class DhCharacter extends BaseDataActor {
'DAGGERHEART.ACTORS.Character.maxHPBonus'
),
stress: resourceField(6, 0, 'DAGGERHEART.GENERAL.stress', true),
hope: resourceField(6, 2, 'DAGGERHEART.GENERAL.hope')
hope: new fields.SchemaField({
value: new fields.NumberField({
initial: 2,
min: 0,
integer: true,
label: 'DAGGERHEART.GENERAL.hope'
})
})
}),
traits: new fields.SchemaField({
agility: attributeField('DAGGERHEART.CONFIG.Traits.agility.name'),
@ -640,7 +647,9 @@ export default class DhCharacter extends BaseDataActor {
? armor.system.baseThresholds.severe + this.levelData.level.current
: this.levelData.level.current * 2
};
this.resources.hope.max -= this.scars;
const globalHopeMax = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Homebrew).maxHope;
this.resources.hope.max = globalHopeMax - this.scars;
this.resources.hitPoints.max += this.class.value?.system?.hitPoints ?? 0;
}
@ -729,6 +738,8 @@ export default class DhCharacter extends BaseDataActor {
static migrateData(source) {
if (typeof source.scars === 'object') source.scars = 0;
if (source.resources.hope.max) source.scars = Math.max(6 - source.resources.hope.max, 0);
return super.migrateData(source);
}
}

View file

@ -23,6 +23,13 @@ export default class DhHomebrew extends foundry.abstract.DataModel {
initial: 12,
label: 'DAGGERHEART.SETTINGS.Homebrew.FIELDS.maxFear.label'
}),
maxHope: new fields.NumberField({
required: true,
integer: true,
min: 0,
initial: 6,
label: 'DAGGERHEART.SETTINGS.Homebrew.FIELDS.maxHope.label'
}),
maxLoadout: new fields.NumberField({
required: true,
integer: true,

View file

@ -195,6 +195,11 @@
.hope-value {
display: flex;
cursor: pointer;
&.scar {
cursor: initial;
opacity: 0.6;
}
}
}
}

View file

@ -8,6 +8,7 @@
<h1>{{localize 'DAGGERHEART.SETTINGS.Menu.homebrew.name'}}</h1>
</header>
{{formGroup settingFields.schema.fields.maxFear value=settingFields._source.maxFear localize=true}}
{{formGroup settingFields.schema.fields.maxHope value=settingFields._source.maxHope localize=true}}
{{formGroup settingFields.schema.fields.maxDomains value=settingFields._source.maxDomains localize=true}}
{{formGroup settingFields.schema.fields.maxLoadout value=settingFields._source.maxLoadout localize=true}}
<div class="settings-hint"><label>{{localize "DAGGERHEART.SETTINGS.Homebrew.FIELDS.maxLoadout.hint"}}</label></div>

View file

@ -76,6 +76,11 @@
{{/if}}
</span>
{{/times}}
{{#times document.system.scars}}
<span class='hope-value scar'>
<i class='fa-regular fa-ban'></i>
</span>
{{/times}}
</div>
{{#if document.system.class.value}}
<div class="domains-section">