mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-15 13:11:08 +01:00
[Add] Hope/Scar Interplay (#1531)
* Migrated character.maxHope to homebrew settings * Added a visual for scars * . * .
This commit is contained in:
parent
70f4e5f4e5
commit
816bfe0a29
6 changed files with 33 additions and 2 deletions
|
|
@ -2061,6 +2061,7 @@
|
||||||
"description": "Description",
|
"description": "Description",
|
||||||
"main": "Data",
|
"main": "Data",
|
||||||
"information": "Information",
|
"information": "Information",
|
||||||
|
"itemFeatures": "Item Features",
|
||||||
"notes": "Notes",
|
"notes": "Notes",
|
||||||
"inventory": "Inventory",
|
"inventory": "Inventory",
|
||||||
"loadout": "Loadout",
|
"loadout": "Loadout",
|
||||||
|
|
@ -2512,6 +2513,7 @@
|
||||||
"resetMovesText": "Are you sure you want to reset?",
|
"resetMovesText": "Are you sure you want to reset?",
|
||||||
"FIELDS": {
|
"FIELDS": {
|
||||||
"maxFear": { "label": "Max Fear" },
|
"maxFear": { "label": "Max Fear" },
|
||||||
|
"maxHope": { "label": "Max Hope" },
|
||||||
"traitArray": { "label": "Initial Trait Modifiers" },
|
"traitArray": { "label": "Initial Trait Modifiers" },
|
||||||
"maxLoadout": {
|
"maxLoadout": {
|
||||||
"label": "Max Cards in Loadout",
|
"label": "Max Cards in Loadout",
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,14 @@ export default class DhCharacter extends BaseDataActor {
|
||||||
'DAGGERHEART.ACTORS.Character.maxHPBonus'
|
'DAGGERHEART.ACTORS.Character.maxHPBonus'
|
||||||
),
|
),
|
||||||
stress: resourceField(6, 0, 'DAGGERHEART.GENERAL.stress', true),
|
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({
|
traits: new fields.SchemaField({
|
||||||
agility: attributeField('DAGGERHEART.CONFIG.Traits.agility.name'),
|
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
|
? armor.system.baseThresholds.severe + this.levelData.level.current
|
||||||
: this.levelData.level.current * 2
|
: 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;
|
this.resources.hitPoints.max += this.class.value?.system?.hitPoints ?? 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -729,6 +738,8 @@ export default class DhCharacter extends BaseDataActor {
|
||||||
|
|
||||||
static migrateData(source) {
|
static migrateData(source) {
|
||||||
if (typeof source.scars === 'object') source.scars = 0;
|
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);
|
return super.migrateData(source);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,13 @@ export default class DhHomebrew extends foundry.abstract.DataModel {
|
||||||
initial: 12,
|
initial: 12,
|
||||||
label: 'DAGGERHEART.SETTINGS.Homebrew.FIELDS.maxFear.label'
|
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({
|
maxLoadout: new fields.NumberField({
|
||||||
required: true,
|
required: true,
|
||||||
integer: true,
|
integer: true,
|
||||||
|
|
|
||||||
|
|
@ -195,6 +195,11 @@
|
||||||
.hope-value {
|
.hope-value {
|
||||||
display: flex;
|
display: flex;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
||||||
|
&.scar {
|
||||||
|
cursor: initial;
|
||||||
|
opacity: 0.6;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@
|
||||||
<h1>{{localize 'DAGGERHEART.SETTINGS.Menu.homebrew.name'}}</h1>
|
<h1>{{localize 'DAGGERHEART.SETTINGS.Menu.homebrew.name'}}</h1>
|
||||||
</header>
|
</header>
|
||||||
{{formGroup settingFields.schema.fields.maxFear value=settingFields._source.maxFear localize=true}}
|
{{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.maxDomains value=settingFields._source.maxDomains localize=true}}
|
||||||
{{formGroup settingFields.schema.fields.maxLoadout value=settingFields._source.maxLoadout 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>
|
<div class="settings-hint"><label>{{localize "DAGGERHEART.SETTINGS.Homebrew.FIELDS.maxLoadout.hint"}}</label></div>
|
||||||
|
|
|
||||||
|
|
@ -76,6 +76,11 @@
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</span>
|
</span>
|
||||||
{{/times}}
|
{{/times}}
|
||||||
|
{{#times document.system.scars}}
|
||||||
|
<span class='hope-value scar'>
|
||||||
|
<i class='fa-regular fa-ban'></i>
|
||||||
|
</span>
|
||||||
|
{{/times}}
|
||||||
</div>
|
</div>
|
||||||
{{#if document.system.class.value}}
|
{{#if document.system.class.value}}
|
||||||
<div class="domains-section">
|
<div class="domains-section">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue