Work on creating more of the necessary data models
This commit is contained in:
parent
ef9a3f2542
commit
eb8d4f7c11
8 changed files with 56 additions and 15 deletions
|
|
@ -1,11 +1,22 @@
|
|||
import { itemTiers } from "../../config.mjs";
|
||||
|
||||
export class CommonItemData extends foundry.abstract.TypeDataModel {
|
||||
static defineSchema() {
|
||||
const fields = foundry.data.fields;
|
||||
return {
|
||||
cost: new fields.NumberField({
|
||||
buy: new fields.NumberField({
|
||||
initial: null,
|
||||
nullable: true,
|
||||
}),
|
||||
usage_cost: new fields.NumberField({
|
||||
initial: null,
|
||||
nullable: true,
|
||||
}),
|
||||
tier: new fields.StringField({
|
||||
initial: `simple`,
|
||||
nullable: false,
|
||||
choices: itemTiers,
|
||||
}),
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
15
module/models/Item/Equipment.mjs
Normal file
15
module/models/Item/Equipment.mjs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import { DescribedItemData } from "./DescribedItemData.mjs";
|
||||
|
||||
export class EquipmentItemData extends DescribedItemData {
|
||||
static defineSchema() {
|
||||
const fields = foundry.data.fields;
|
||||
return mergeObject(super.defineSchema(), {
|
||||
extra_inventory: new fields.NumberField({
|
||||
initial: null,
|
||||
nullable: true,
|
||||
required: false,
|
||||
}),
|
||||
material
|
||||
});
|
||||
};
|
||||
};
|
||||
|
|
@ -4,7 +4,6 @@ export class PetItemData extends DescribedItemData {
|
|||
static defineSchema() {
|
||||
const fields = foundry.data.fields;
|
||||
return mergeObject(super.defineSchema(), {
|
||||
purchase: new fields.NumberField({ initial: 0, }),
|
||||
upkeep: new fields.NumberField({ intial: null, nullable: true }),
|
||||
pokeballd: new fields.BooleanField({ initial: false }),
|
||||
});
|
||||
|
|
|
|||
|
|
@ -8,10 +8,6 @@ export class TransportationItemData extends DescribedItemData {
|
|||
initial: null,
|
||||
nullable: true,
|
||||
}),
|
||||
purchase: new fields.NumberField({
|
||||
initial: null,
|
||||
nullable: true,
|
||||
}),
|
||||
upkeep: new fields.NumberField({
|
||||
initial: null,
|
||||
nullable: true,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue