diff --git a/module/applications/dialogs/_module.mjs b/module/applications/dialogs/_module.mjs index 044fdf03..bc516b9e 100644 --- a/module/applications/dialogs/_module.mjs +++ b/module/applications/dialogs/_module.mjs @@ -17,4 +17,4 @@ export { default as TagTeamDialog } from './tagTeamDialog.mjs'; export { default as GroupRollDialog } from './groupRollDialog.mjs'; export { default as RiskItAllDialog } from './riskItAllDialog.mjs'; export { default as CompendiumBrowserSettingsDialog } from './CompendiumBrowserSettings.mjs'; -export { default as LevelupOptionsDialog } from './levelupOptionsDialog.mjs'; \ No newline at end of file +export { default as LevelupOptionsDialog } from './levelupOptionsDialog.mjs'; diff --git a/module/applications/dialogs/levelupOptionsDialog.mjs b/module/applications/dialogs/levelupOptionsDialog.mjs index dfe098e1..ad5f933f 100644 --- a/module/applications/dialogs/levelupOptionsDialog.mjs +++ b/module/applications/dialogs/levelupOptionsDialog.mjs @@ -1,4 +1,4 @@ -import { LevelOptionType } from "../../data/levelTier.mjs"; +import { LevelOptionType } from '../../data/levelTier.mjs'; const { HandlebarsApplicationMixin, ApplicationV2 } = foundry.applications.api; @@ -21,7 +21,7 @@ export default class LevelupOptionsDialog extends HandlebarsApplicationMixin(App window: { icon: 'fa-solid fa-angles-up fa-fw' }, actions: { addTierOption: LevelupOptionsDialog.#addTierOption, - removeTierOption: LevelupOptionsDialog.#removeTierOption, + removeTierOption: LevelupOptionsDialog.#removeTierOption }, form: { handler: this.updateData, submitOnChange: true, closeOnSubmit: false } }; @@ -29,25 +29,25 @@ export default class LevelupOptionsDialog extends HandlebarsApplicationMixin(App static PARTS = { header: { template: 'systems/daggerheart/templates/dialogs/levelupOptionsDialog/header.hbs' }, tabs: { template: 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs' }, - tiers: { template: 'systems/daggerheart/templates/dialogs/levelupOptionsDialog/tiers.hbs' }, + tiers: { template: 'systems/daggerheart/templates/dialogs/levelupOptionsDialog/tiers.hbs' } }; /** @inheritdoc */ static TABS = { primary: { tabs: [ - { id: 'tier2', label: 'DAGGERHEART.GENERAL.Tiers.2', tier: 2 }, - { id: 'tier3', label: 'DAGGERHEART.GENERAL.Tiers.3', tier: 3 }, + { id: 'tier2', label: 'DAGGERHEART.GENERAL.Tiers.2', tier: 2 }, + { id: 'tier3', label: 'DAGGERHEART.GENERAL.Tiers.3', tier: 3 }, { id: 'tier4', label: 'DAGGERHEART.GENERAL.Tiers.4', tier: 4 } ], - initial: 'tier2', + initial: 'tier2' } }; _attachPartListeners(partId, htmlElement, options) { super._attachPartListeners(partId, htmlElement, options); - for(const element of htmlElement.querySelectorAll('.option-type-select')) + for (const element of htmlElement.querySelectorAll('.option-type-select')) element.addEventListener('change', this.updateSelectedOption.bind(this)); } @@ -68,7 +68,7 @@ export default class LevelupOptionsDialog extends HandlebarsApplicationMixin(App }, {}); return acc; - }, {}) + }, {}); context.optionTypes = LevelOptionType; context.selectedOption = this.selectedOption; @@ -78,7 +78,7 @@ export default class LevelupOptionsDialog extends HandlebarsApplicationMixin(App static async updateData(_event, _element, formData) { const data = foundry.utils.expandObject(formData.object); - await this.item.update(data) + await this.item.update(data); this.render(); } @@ -90,10 +90,12 @@ export default class LevelupOptionsDialog extends HandlebarsApplicationMixin(App static async #addTierOption(_event, button) { const { tier } = button.dataset; - await this.item.update({ [`system.levelupOptionTiers.${tier}.${foundry.utils.randomID()}`]: { - label: LevelOptionType[this.selectedOption].label, - type: this.selectedOption - }}); + await this.item.update({ + [`system.levelupOptionTiers.${tier}.${foundry.utils.randomID()}`]: { + label: LevelOptionType[this.selectedOption].label, + type: this.selectedOption + } + }); this.selectedOption = null; this.render(); diff --git a/module/applications/levelup/characterLevelup.mjs b/module/applications/levelup/characterLevelup.mjs index 13ae0d87..b2a09059 100644 --- a/module/applications/levelup/characterLevelup.mjs +++ b/module/applications/levelup/characterLevelup.mjs @@ -364,7 +364,7 @@ export default class DhCharacterLevelUp extends LevelUpBase { advancement.experience?.flatMap(x => x.data.map(data => ({ name: data, modifier: x.value }))) ?? [], multiclass: advancement.multiclass, - subclass: advancement.subclass, + subclass: advancement.subclass }; context.advancements.statistics.proficiency.shown = diff --git a/module/applications/sheets/api/application-mixin.mjs b/module/applications/sheets/api/application-mixin.mjs index d828112f..09008aaa 100644 --- a/module/applications/sheets/api/application-mixin.mjs +++ b/module/applications/sheets/api/application-mixin.mjs @@ -100,7 +100,7 @@ export default function DHApplicationMixin(Base) { addNewItem: DHSheetV2.#addNewItem, browseItem: DHSheetV2.#browseItem, editAttribution: DHSheetV2.#editAttribution, - configureLevelUpOptions: DHSheetV2.#configureLevelUpOptions, + configureLevelUpOptions: DHSheetV2.#configureLevelUpOptions }, contextMenus: [ { @@ -126,9 +126,9 @@ export default function DHApplicationMixin(Base) { icon: 'fa-solid fa-angles-up fa-fw', label: 'DAGGERHEART.UI.Tooltip.configureLevelupOptions', action: 'configureLevelUpOptions', - visible: DHSheetV2.#hasLevelUpOptions, + visible: DHSheetV2.#hasLevelUpOptions } - ], + ] }, dragDrop: [{ dragSelector: '.inventory-item[data-type="effect"]', dropSelector: null }], tagifyConfigs: [] @@ -155,7 +155,7 @@ export default function DHApplicationMixin(Base) { static #hasLevelUpOptions() { return this.document.system.metadata.hasLevelUpOptions; - }; + } /** * Refresh the custom parts of the application frame diff --git a/module/data/actor/character.mjs b/module/data/actor/character.mjs index e0358329..5904483f 100644 --- a/module/data/actor/character.mjs +++ b/module/data/actor/character.mjs @@ -305,13 +305,13 @@ export default class DhCharacter extends DhCreature { label: 'DAGGERHEART.ACTORS.Creature.rules.roll.disadvantage.label', hint: 'DAGGERHEART.ACTORS.Creature.rules.roll.disadvantage.hint' }), - comboDieIndex: new fields.NumberField({ - integer: true, + comboDieIndex: new fields.NumberField({ + integer: true, min: 0, max: 5, - initial: 0, - }) - }), + initial: 0 + }) + }) }) }; } diff --git a/module/data/actor/companion.mjs b/module/data/actor/companion.mjs index dd00a7e8..956696c2 100644 --- a/module/data/actor/companion.mjs +++ b/module/data/actor/companion.mjs @@ -80,7 +80,7 @@ export default class DhCompanion extends DhCreature { initial: 1, label: 'DAGGERHEART.ACTORS.Creature.rules.roll.disadvantage.label', hint: 'DAGGERHEART.ACTORS.Creature.rules.roll.disadvantage.hint' - }), + }) }) }), attack: new ActionField({ diff --git a/module/data/item/class.mjs b/module/data/item/class.mjs index bb87fb88..f1f7a96d 100644 --- a/module/data/item/class.mjs +++ b/module/data/item/class.mjs @@ -12,7 +12,7 @@ export default class DHClass extends BaseDataItem { label: 'TYPES.Item.class', type: 'class', hasDescription: true, - hasLevelUpOptions: true, + hasLevelUpOptions: true }); } @@ -54,9 +54,12 @@ export default class DHClass extends BaseDataItem { backgroundQuestions: new fields.ArrayField(new fields.StringField(), { initial: ['', '', ''] }), connections: new fields.ArrayField(new fields.StringField(), { initial: ['', '', ''] }), isMulticlass: new fields.BooleanField({ initial: false }), - levelupOptionTiers: new fields.TypedObjectField(new fields.TypedObjectField(new fields.EmbeddedDataField(DhLevelOption)), { - initial: { 2: {}, 3: {}, 4: {} } - }), + levelupOptionTiers: new fields.TypedObjectField( + new fields.TypedObjectField(new fields.EmbeddedDataField(DhLevelOption)), + { + initial: { 2: {}, 3: {}, 4: {} } + } + ) }; } diff --git a/module/data/levelTier.mjs b/module/data/levelTier.mjs index d300756e..d2a446f2 100644 --- a/module/data/levelTier.mjs +++ b/module/data/levelTier.mjs @@ -48,36 +48,36 @@ export class DhLevelOption extends foundry.abstract.DataModel { const fields = foundry.data.fields; return { - label: new fields.StringField({ - required: true, - label: 'DAGGERHEART.GENERAL.label' + label: new fields.StringField({ + required: true, + label: 'DAGGERHEART.GENERAL.label' }), - checkboxSelections: new fields.NumberField({ - required: true, - integer: true, + checkboxSelections: new fields.NumberField({ + required: true, + integer: true, initial: 1, label: 'DAGGERHEART.CONFIG.LevelupData.checkboxSelections' }), - minCost: new fields.NumberField({ - required: true, - integer: true, + minCost: new fields.NumberField({ + required: true, + integer: true, initial: 1, label: 'DAGGERHEART.CONFIG.LevelupData.minCost' }), - type: new fields.StringField({ - required: true, + type: new fields.StringField({ + required: true, choices: LevelOptionType, label: 'DAGGERHEART.GENERAL.type' }), subType: new fields.StringField({ nullable: true, - label: 'DAGGERHEART.GENERAL.subType', + label: 'DAGGERHEART.GENERAL.subType' }), - value: new fields.NumberField({ + value: new fields.NumberField({ integer: true, label: 'DAGGERHEART.GENERAL.value' }), - amount: new fields.NumberField({ + amount: new fields.NumberField({ integer: true, label: 'DAGGERHEART.GENERAL.amount' }) @@ -192,12 +192,12 @@ export const LevelOptionType = { dice: { id: 'dice', label: 'Increase Dice Size', - subTypes: { + subTypes: { hopeIndex: { key: 'hopeIndex', label: 'DAGGERHEART.GENERAL.hope' }, fearIndex: { key: 'fearIndex', label: 'DAGGERHEART.GENERAL.fear' }, advantageIndex: { key: 'advantageIndex', label: 'DAGGERHEART.GENERAL.Advantage.full' }, - comboDieIndex:{ key: 'comboDieIndex', label: 'Combo Die' } // Translation pending actual useage - }, + comboDieIndex: { key: 'comboDieIndex', label: 'Combo Die' } // Translation pending actual useage + } }, ...CompanionLevelOptionType }; diff --git a/module/data/levelup.mjs b/module/data/levelup.mjs index 37d579c8..dbec711f 100644 --- a/module/data/levelup.mjs +++ b/module/data/levelup.mjs @@ -345,7 +345,7 @@ export class DhLevelupLevel extends foundry.abstract.DataModel { data: new fields.ArrayField(new fields.StringField()), secondaryData: new fields.TypedObjectField(new fields.StringField()), type: new fields.StringField({ required: true }), - subType: new fields.StringField({ nullable: true }), + subType: new fields.StringField({ nullable: true }) }) ) ) diff --git a/module/dice/dualityRoll.mjs b/module/dice/dualityRoll.mjs index e16ac5f2..ae50d307 100644 --- a/module/dice/dualityRoll.mjs +++ b/module/dice/dualityRoll.mjs @@ -11,7 +11,7 @@ export default class DualityRoll extends D20Roll { this.rallyChoices = this.setRallyChoices(); this.guaranteedCritical = options.guaranteedCritical; - const advantageFaces = data.rules?.roll?.advantageFaces ? Number.parseInt(data.rules.roll.advantageFaces) : 6 + const advantageFaces = data.rules?.roll?.advantageFaces ? Number.parseInt(data.rules.roll.advantageFaces) : 6; this.advantageFaces = Number.isNaN(advantageFaces) ? 6 : advantageFaces; }