mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-13 20:21:06 +01:00
Merged with data-models-structure branch
This commit is contained in:
commit
d1c968d0a2
62 changed files with 1760 additions and 956 deletions
|
|
@ -10,27 +10,27 @@ import DHSubclass from './subclass.mjs';
|
|||
import DHWeapon from './weapon.mjs';
|
||||
|
||||
export {
|
||||
DHAncestry,
|
||||
DHArmor,
|
||||
DHClass,
|
||||
DHCommunity,
|
||||
DHConsumable,
|
||||
DHDomainCard,
|
||||
DHFeature,
|
||||
DHMiscellaneous,
|
||||
DHSubclass,
|
||||
DHWeapon,
|
||||
}
|
||||
DHAncestry,
|
||||
DHArmor,
|
||||
DHClass,
|
||||
DHCommunity,
|
||||
DHConsumable,
|
||||
DHDomainCard,
|
||||
DHFeature,
|
||||
DHMiscellaneous,
|
||||
DHSubclass,
|
||||
DHWeapon
|
||||
};
|
||||
|
||||
export const config = {
|
||||
ancestry: DHAncestry,
|
||||
armor: DHArmor,
|
||||
class: DHClass,
|
||||
community: DHCommunity,
|
||||
consumable: DHConsumable,
|
||||
domainCard: DHDomainCard,
|
||||
feature: DHFeature,
|
||||
miscellaneous: DHMiscellaneous,
|
||||
subclass: DHSubclass,
|
||||
weapon: DHWeapon,
|
||||
};
|
||||
ancestry: DHAncestry,
|
||||
armor: DHArmor,
|
||||
class: DHClass,
|
||||
community: DHCommunity,
|
||||
consumable: DHConsumable,
|
||||
domainCard: DHDomainCard,
|
||||
feature: DHFeature,
|
||||
miscellaneous: DHMiscellaneous,
|
||||
subclass: DHSubclass,
|
||||
weapon: DHWeapon
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import DaggerheartAction from '../action.mjs';
|
||||
import DHAction from '../action/action.mjs';
|
||||
import BaseDataItem from './base.mjs';
|
||||
|
||||
export default class DHDomainCard extends BaseDataItem {
|
||||
|
|
@ -22,7 +22,7 @@ export default class DHDomainCard extends BaseDataItem {
|
|||
type: new fields.StringField({ choices: SYSTEM.DOMAIN.cardTypes, required: true, blank: true }),
|
||||
foundation: new fields.BooleanField({ initial: false }),
|
||||
inVault: new fields.BooleanField({ initial: false }),
|
||||
actions: new fields.ArrayField(new fields.EmbeddedDataField(DaggerheartAction))
|
||||
actions: new fields.ArrayField(new fields.EmbeddedDataField(DHAction))
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
import { getTier } from '../../helpers/utils.mjs';
|
||||
import DaggerheartAction from '../action.mjs';
|
||||
import DHAction from '../action/action.mjs';
|
||||
import BaseDataItem from './base.mjs';
|
||||
|
||||
export default class DHFeature extends BaseDataItem {
|
||||
/** @inheritDoc */
|
||||
static get metadata() {
|
||||
return foundry.utils.mergeObject(super.metadata, {
|
||||
label: "TYPES.Item.feature",
|
||||
type: "feature",
|
||||
hasDescription: true,
|
||||
label: 'TYPES.Item.feature',
|
||||
type: 'feature',
|
||||
hasDescription: true
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -17,7 +17,7 @@ export default class DHFeature extends BaseDataItem {
|
|||
const fields = foundry.data.fields;
|
||||
return {
|
||||
...super.defineSchema(),
|
||||
|
||||
|
||||
//A type of feature seems unnecessary
|
||||
type: new fields.StringField({ choices: SYSTEM.ITEM.featureTypes }),
|
||||
|
||||
|
|
@ -26,7 +26,7 @@ export default class DHFeature extends BaseDataItem {
|
|||
choices: SYSTEM.ITEM.actionTypes,
|
||||
initial: SYSTEM.ITEM.actionTypes.passive.id
|
||||
}),
|
||||
//TODO: remove featureType field
|
||||
//TODO: remove featureType field
|
||||
featureType: new fields.SchemaField({
|
||||
type: new fields.StringField({
|
||||
choices: SYSTEM.ITEM.valueTypes,
|
||||
|
|
@ -75,9 +75,10 @@ export default class DHFeature extends BaseDataItem {
|
|||
{ nullable: true, initial: null }
|
||||
),
|
||||
dataField: new fields.StringField({}),
|
||||
appliesOn: new fields.StringField({
|
||||
choices: SYSTEM.EFFECTS.applyLocations,
|
||||
},
|
||||
appliesOn: new fields.StringField(
|
||||
{
|
||||
choices: SYSTEM.EFFECTS.applyLocations
|
||||
},
|
||||
{ nullable: true, initial: null }
|
||||
),
|
||||
applyLocationChoices: new fields.TypedObjectField(new fields.StringField({}), {
|
||||
|
|
@ -92,7 +93,7 @@ export default class DHFeature extends BaseDataItem {
|
|||
})
|
||||
})
|
||||
),
|
||||
actions: new fields.ArrayField(new fields.EmbeddedDataField(DaggerheartAction))
|
||||
actions: new fields.ArrayField(new fields.EmbeddedDataField(DHAction))
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import BaseDataItem from './base.mjs';
|
|||
import FormulaField from '../fields/formulaField.mjs';
|
||||
import PseudoDocumentsField from '../fields/pseudoDocumentsField.mjs';
|
||||
import BaseFeatureData from '../pseudo-documents/feature/baseFeatureData.mjs';
|
||||
import ActionField from '../fields/actionField.mjs';
|
||||
|
||||
export default class DHWeapon extends BaseDataItem {
|
||||
/** @inheritDoc */
|
||||
|
|
@ -38,14 +39,15 @@ export default class DHWeapon extends BaseDataItem {
|
|||
initial: 'physical'
|
||||
})
|
||||
}),
|
||||
|
||||
feature: new fields.StringField({ choices: SYSTEM.ITEM.weaponFeatures, blank: true }),
|
||||
featureTest: new PseudoDocumentsField(BaseFeatureData, {
|
||||
required: true,
|
||||
nullable: true,
|
||||
max: 1,
|
||||
validTypes: ['weapon']
|
||||
})
|
||||
}),
|
||||
// actions: new fields.ArrayField(new fields.EmbeddedDataField(DHAttackAction))
|
||||
actions: new fields.ArrayField(new ActionField())
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue