mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-17 15:39:02 +01:00
Changed generalConfig.tiers to be number based
This commit is contained in:
parent
51ba94c83a
commit
721eb347db
7 changed files with 20 additions and 41 deletions
|
|
@ -1243,10 +1243,10 @@
|
||||||
},
|
},
|
||||||
"Tiers": {
|
"Tiers": {
|
||||||
"singular": "Tier",
|
"singular": "Tier",
|
||||||
"tier1": "Tier 1",
|
"1": "Tier 1",
|
||||||
"tier2": "Tier 2",
|
"2": "Tier 2",
|
||||||
"tier3": "Tier 3",
|
"3": "Tier 3",
|
||||||
"tier4": "Tier 4"
|
"4": "Tier 4"
|
||||||
},
|
},
|
||||||
"Trait": {
|
"Trait": {
|
||||||
"single": "Trait",
|
"single": "Trait",
|
||||||
|
|
|
||||||
|
|
@ -103,7 +103,7 @@ export default class BeastformDialog extends HandlebarsApplicationMixin(Applicat
|
||||||
const compendiumBeastforms = await game.packs.get(`daggerheart.beastforms`)?.getDocuments();
|
const compendiumBeastforms = await game.packs.get(`daggerheart.beastforms`)?.getDocuments();
|
||||||
context.beastformTiers = [...(compendiumBeastforms ? compendiumBeastforms : []), ...game.items].reduce(
|
context.beastformTiers = [...(compendiumBeastforms ? compendiumBeastforms : []), ...game.items].reduce(
|
||||||
(acc, x) => {
|
(acc, x) => {
|
||||||
const tier = CONFIG.DH.GENERAL.tiersAlternate[x.system.tier];
|
const tier = CONFIG.DH.GENERAL.tiers[x.system.tier];
|
||||||
if (x.type !== 'beastform' || tier.id > this.configData.tierLimit) return acc;
|
if (x.type !== 'beastform' || tier.id > this.configData.tierLimit) return acc;
|
||||||
|
|
||||||
if (!acc[tier.id]) acc[tier.id] = { label: game.i18n.localize(tier.label), values: {} };
|
if (!acc[tier.id]) acc[tier.id] = { label: game.i18n.localize(tier.label), values: {} };
|
||||||
|
|
|
||||||
|
|
@ -114,7 +114,7 @@ export default class DHActionConfig extends DaggerheartSheet(ApplicationV2) {
|
||||||
|
|
||||||
const settingsTiers = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.LevelTiers).tiers;
|
const settingsTiers = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.LevelTiers).tiers;
|
||||||
context.tierOptions = [
|
context.tierOptions = [
|
||||||
{ key: 1, label: game.i18n.localize('DAGGERHEART.GENERAL.Tiers.tier1') },
|
{ key: 1, label: game.i18n.localize('DAGGERHEART.GENERAL.Tiers.1') },
|
||||||
...Object.values(settingsTiers).map(x => ({ key: x.tier, label: x.name }))
|
...Object.values(settingsTiers).map(x => ({ key: x.tier, label: x.name }))
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -258,44 +258,21 @@ export const deathMoves = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const tiers = {
|
export const tiers = {
|
||||||
tier1: {
|
|
||||||
id: 'tier1',
|
|
||||||
label: 'DAGGERHEART.GENERAL.Tiers.tier1',
|
|
||||||
value: 1
|
|
||||||
},
|
|
||||||
tier2: {
|
|
||||||
id: 'tier2',
|
|
||||||
label: 'DAGGERHEART.GENERAL.Tiers.tier2',
|
|
||||||
value: 2
|
|
||||||
},
|
|
||||||
tier3: {
|
|
||||||
id: 'tier3',
|
|
||||||
label: 'DAGGERHEART.GENERAL.Tiers.tier3',
|
|
||||||
value: 3
|
|
||||||
},
|
|
||||||
tier4: {
|
|
||||||
id: 'tier4',
|
|
||||||
label: 'DAGGERHEART.GENERAL.Tiers.tier4',
|
|
||||||
value: 4
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export const tiersAlternate = {
|
|
||||||
1: {
|
1: {
|
||||||
id: 1,
|
id: 1,
|
||||||
label: 'DAGGERHEART.GENERAL.Tiers.tier1'
|
label: 'DAGGERHEART.GENERAL.Tiers.1'
|
||||||
},
|
},
|
||||||
2: {
|
2: {
|
||||||
id: 2,
|
id: 2,
|
||||||
label: 'DAGGERHEART.GENERAL.Tiers.tier2'
|
label: 'DAGGERHEART.GENERAL.Tiers.2'
|
||||||
},
|
},
|
||||||
3: {
|
3: {
|
||||||
id: 3,
|
id: 3,
|
||||||
label: 'DAGGERHEART.GENERAL.Tiers.tier3'
|
label: 'DAGGERHEART.GENERAL.Tiers.3'
|
||||||
},
|
},
|
||||||
4: {
|
4: {
|
||||||
id: 4,
|
id: 4,
|
||||||
label: 'DAGGERHEART.GENERAL.Tiers.tier4'
|
label: 'DAGGERHEART.GENERAL.Tiers.4'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,10 +18,11 @@ export default class DhpAdversary extends BaseDataActor {
|
||||||
const fields = foundry.data.fields;
|
const fields = foundry.data.fields;
|
||||||
return {
|
return {
|
||||||
...super.defineSchema(),
|
...super.defineSchema(),
|
||||||
tier: new fields.StringField({
|
tier: new fields.NumberField({
|
||||||
required: true,
|
required: true,
|
||||||
|
integer: true,
|
||||||
choices: CONFIG.DH.GENERAL.tiers,
|
choices: CONFIG.DH.GENERAL.tiers,
|
||||||
initial: CONFIG.DH.GENERAL.tiers.tier1.id
|
initial: CONFIG.DH.GENERAL.tiers[1].id
|
||||||
}),
|
}),
|
||||||
type: new fields.StringField({
|
type: new fields.StringField({
|
||||||
required: true,
|
required: true,
|
||||||
|
|
|
||||||
|
|
@ -18,10 +18,11 @@ export default class DhEnvironment extends BaseDataActor {
|
||||||
const fields = foundry.data.fields;
|
const fields = foundry.data.fields;
|
||||||
return {
|
return {
|
||||||
...super.defineSchema(),
|
...super.defineSchema(),
|
||||||
tier: new fields.StringField({
|
tier: new fields.NumberField({
|
||||||
required: true,
|
required: true,
|
||||||
|
integer: true,
|
||||||
choices: CONFIG.DH.GENERAL.tiers,
|
choices: CONFIG.DH.GENERAL.tiers,
|
||||||
initial: CONFIG.DH.GENERAL.tiers.tier1.id
|
initial: CONFIG.DH.GENERAL.tiers[1].id
|
||||||
}),
|
}),
|
||||||
type: new fields.StringField({ choices: CONFIG.DH.ACTOR.environmentTypes }),
|
type: new fields.StringField({ choices: CONFIG.DH.ACTOR.environmentTypes }),
|
||||||
impulses: new fields.StringField(),
|
impulses: new fields.StringField(),
|
||||||
|
|
|
||||||
|
|
@ -27,8 +27,8 @@ export default class DHBeastform extends BaseDataItem {
|
||||||
tier: new fields.NumberField({
|
tier: new fields.NumberField({
|
||||||
required: true,
|
required: true,
|
||||||
integer: true,
|
integer: true,
|
||||||
choices: CONFIG.DH.GENERAL.tiersAlternate,
|
choices: CONFIG.DH.GENERAL.tiers,
|
||||||
initial: CONFIG.DH.GENERAL.tiersAlternate[1].id
|
initial: CONFIG.DH.GENERAL.tiers[1].id
|
||||||
}),
|
}),
|
||||||
tokenImg: new fields.FilePathField({
|
tokenImg: new fields.FilePathField({
|
||||||
initial: 'icons/svg/mystery-man.svg',
|
initial: 'icons/svg/mystery-man.svg',
|
||||||
|
|
@ -59,7 +59,7 @@ export default class DHBeastform extends BaseDataItem {
|
||||||
evolved: new fields.SchemaField({
|
evolved: new fields.SchemaField({
|
||||||
maximumTier: new fields.NumberField({
|
maximumTier: new fields.NumberField({
|
||||||
integer: true,
|
integer: true,
|
||||||
choices: CONFIG.DH.GENERAL.tiersAlternate
|
choices: CONFIG.DH.GENERAL.tiers
|
||||||
}),
|
}),
|
||||||
mainTraitBonus: new fields.NumberField({
|
mainTraitBonus: new fields.NumberField({
|
||||||
required: true,
|
required: true,
|
||||||
|
|
@ -71,7 +71,7 @@ export default class DHBeastform extends BaseDataItem {
|
||||||
hybrid: new fields.SchemaField({
|
hybrid: new fields.SchemaField({
|
||||||
maximumTier: new fields.NumberField({
|
maximumTier: new fields.NumberField({
|
||||||
integer: true,
|
integer: true,
|
||||||
choices: CONFIG.DH.GENERAL.tiersAlternate,
|
choices: CONFIG.DH.GENERAL.tiers,
|
||||||
label: 'DAGGERHEART.ITEMS.Beastform.FIELDS.evolved.maximumTier.label'
|
label: 'DAGGERHEART.ITEMS.Beastform.FIELDS.evolved.maximumTier.label'
|
||||||
}),
|
}),
|
||||||
beastformOptions: new fields.NumberField({ required: true, integer: true, initial: 2, min: 2 }),
|
beastformOptions: new fields.NumberField({ required: true, integer: true, initial: 2, min: 2 }),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue