mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 19:51:08 +01:00
30 lines
1.2 KiB
JavaScript
30 lines
1.2 KiB
JavaScript
const fields = foundry.data.fields;
|
|
|
|
export default class BeastformField extends fields.SchemaField {
|
|
constructor(options = {}, context = {}) {
|
|
const beastformFields = {
|
|
tierAccess: new fields.SchemaField({
|
|
exact: new fields.NumberField({
|
|
integer: true,
|
|
nullable: true,
|
|
initial: null,
|
|
choices: () => {
|
|
const settingsTiers = game.settings.get(
|
|
CONFIG.DH.id,
|
|
CONFIG.DH.SETTINGS.gameSettings.LevelTiers
|
|
).tiers;
|
|
return Object.values(settingsTiers).reduce(
|
|
(acc, tier) => {
|
|
acc[tier.tier] = game.i18n.localize(tier.name);
|
|
return acc;
|
|
},
|
|
{ 1: game.i18n.localize('DAGGERHEART.GENERAL.Tiers.1') }
|
|
);
|
|
},
|
|
hint: 'DAGGERHEART.ACTIONS.Config.beastform.exactHint'
|
|
})
|
|
})
|
|
};
|
|
super(beastformFields, options, context);
|
|
}
|
|
}
|