mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-03-07 14:36:13 +01:00
Migrated character.maxHope to homebrew settings
This commit is contained in:
parent
70f4e5f4e5
commit
b947b86c50
4 changed files with 23 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 = 6 - source.resources.hope.max;
|
||||||
|
|
||||||
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,
|
||||||
|
|
|
||||||
|
|
@ -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>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue