mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-17 15:39:02 +01:00
Temp
This commit is contained in:
parent
ad9e0aa558
commit
29ce21d606
11 changed files with 198 additions and 65 deletions
|
|
@ -37,6 +37,12 @@ export default class BeastformDialog extends HandlebarsApplicationMixin(Applicat
|
|||
}
|
||||
};
|
||||
|
||||
// _attachPartListeners(partId, htmlElement, options) {
|
||||
// super._attachPartListeners(partId, htmlElement, options);
|
||||
|
||||
// htmlElement.querySelector('');
|
||||
// }
|
||||
|
||||
async _prepareContext(_options) {
|
||||
const context = await super._prepareContext(_options);
|
||||
|
||||
|
|
@ -60,8 +66,15 @@ export default class BeastformDialog extends HandlebarsApplicationMixin(Applicat
|
|||
this.render();
|
||||
}
|
||||
|
||||
static selectBeastform(_, target) {
|
||||
static async selectBeastform(_, target) {
|
||||
this.selected = this.selected === target.dataset.uuid ? null : target.dataset.uuid;
|
||||
const beastform = this.selected ? await foundry.utils.fromUuid(this.selected) : null;
|
||||
if (beastform && beastform.system.beastformType !== CONFIG.DH.ITEM.beastformTypes.normal.id) {
|
||||
this.element.classList.add('expanded');
|
||||
} else {
|
||||
this.element.classList.remove('expanded');
|
||||
}
|
||||
|
||||
this.render();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ export default class BeastformSheet extends DHBaseItemSheet {
|
|||
template: 'systems/daggerheart/templates/sheets/global/tabs/tab-features.hbs',
|
||||
scrollable: ['.features']
|
||||
},
|
||||
advanced: { template: 'systems/daggerheart/templates/sheets/items/beastform/advanced.hbs' },
|
||||
effects: {
|
||||
template: 'systems/daggerheart/templates/sheets/global/tabs/tab-effects.hbs',
|
||||
scrollable: ['.effects']
|
||||
|
|
@ -23,7 +24,7 @@ export default class BeastformSheet extends DHBaseItemSheet {
|
|||
|
||||
static TABS = {
|
||||
primary: {
|
||||
tabs: [{ id: 'settings' }, { id: 'features' }, { id: 'effects' }],
|
||||
tabs: [{ id: 'settings' }, { id: 'features' }, { id: 'advanced' }, { id: 'effects' }],
|
||||
initial: 'settings',
|
||||
labelPrefix: 'DAGGERHEART.GENERAL.Tabs'
|
||||
}
|
||||
|
|
@ -33,7 +34,14 @@ export default class BeastformSheet extends DHBaseItemSheet {
|
|||
async _prepareContext(_options) {
|
||||
const context = await super._prepareContext(_options);
|
||||
|
||||
context.document = context.document.toObject();
|
||||
const data = { ...context.document.toObject() };
|
||||
context.document = {
|
||||
...data,
|
||||
system: {
|
||||
...data.system,
|
||||
features: this.document.system.features
|
||||
}
|
||||
};
|
||||
context.document.effects = this.document.effects.map(effect => {
|
||||
const data = effect.toObject();
|
||||
data.id = effect.id;
|
||||
|
|
|
|||
|
|
@ -1350,3 +1350,18 @@ export const itemResourceTypes = {
|
|||
label: 'DAGGERHEART.CONFIG.ItemResourceType.diceValue'
|
||||
}
|
||||
};
|
||||
|
||||
export const beastformTypes = {
|
||||
normal: {
|
||||
id: 'normal',
|
||||
label: 'DAGGERHEART.CONFIG.BeastformType.normal'
|
||||
},
|
||||
evolved: {
|
||||
id: 'evolved',
|
||||
label: 'DAGGERHEART.CONFIG.BeastformType.evolved'
|
||||
},
|
||||
hybrid: {
|
||||
id: 'hybrid',
|
||||
label: 'DAGGERHEART.CONFIG.BeastformType.hybrid'
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -19,6 +19,11 @@ export default class DHBeastform extends BaseDataItem {
|
|||
const fields = foundry.data.fields;
|
||||
return {
|
||||
...super.defineSchema(),
|
||||
beastformType: new fields.StringField({
|
||||
required: true,
|
||||
choices: CONFIG.DH.ITEM.beastformTypes,
|
||||
initial: CONFIG.DH.ITEM.beastformTypes.normal.id
|
||||
}),
|
||||
tier: new fields.StringField({
|
||||
required: true,
|
||||
choices: CONFIG.DH.GENERAL.tiers,
|
||||
|
|
@ -40,7 +45,25 @@ export default class DHBeastform extends BaseDataItem {
|
|||
}),
|
||||
examples: new fields.StringField(),
|
||||
advantageOn: new fields.StringField(),
|
||||
features: new ForeignDocumentUUIDArrayField({ type: 'Item' })
|
||||
features: new ForeignDocumentUUIDArrayField({ type: 'Item' }),
|
||||
evolved: new fields.SchemaField({
|
||||
maximumTier: new fields.StringField({
|
||||
required: true,
|
||||
choices: CONFIG.DH.GENERAL.tiers,
|
||||
initial: CONFIG.DH.GENERAL.tiers.tier1.id
|
||||
})
|
||||
}),
|
||||
hybrid: new fields.SchemaField({
|
||||
maximumTier: new fields.StringField({
|
||||
required: true,
|
||||
choices: CONFIG.DH.GENERAL.tiers,
|
||||
initial: CONFIG.DH.GENERAL.tiers.tier1.id,
|
||||
label: 'DAGGERHEART.ITEMS.Beastform.FIELDS.evolved.maximumTier.label'
|
||||
}),
|
||||
beastformOptions: new fields.NumberField({ required: true, integer: true, initial: 2, min: 2 }),
|
||||
advantages: new fields.NumberField({ required: true, integer: true, initial: 2, min: 2 }),
|
||||
features: new fields.NumberField({ required: true, integer: true, initial: 2, min: 2 })
|
||||
})
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue