Update item data models
This commit is contained in:
parent
27c30b7eef
commit
5e2fb95c73
3 changed files with 21 additions and 10 deletions
|
|
@ -1,11 +1,12 @@
|
|||
export class AspectItemData extends foundry.abstract.TypeDataModel {
|
||||
import { DescribedItemData } from "./DescribedItemData.mjs";
|
||||
|
||||
export class AspectItemData extends DescribedItemData {
|
||||
static defineSchema() {
|
||||
const fields = foundry.data.fields;
|
||||
return {
|
||||
used: new fields.BooleanField({ initial: false }),
|
||||
/** The number of seconds that the effect of the aspect stays */
|
||||
deactivateAfter: new fields.NumberField({ nullable: true }),
|
||||
info: new fields.HTMLField({ nullable: true, blank: false, trim: true }),
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -25,10 +25,26 @@ export class CommonItemData extends foundry.abstract.TypeDataModel {
|
|||
integer: true,
|
||||
}),
|
||||
tier: new fields.StringField({
|
||||
initial: `simple`,
|
||||
initial: DOTDUNGEON.defaultItemTier,
|
||||
nullable: false,
|
||||
choices: DOTDUNGEON.itemTiers,
|
||||
}),
|
||||
location: new fields.StringField({
|
||||
initial: null,
|
||||
nullable: true,
|
||||
/*
|
||||
"equipped" = on player, actively having an effect (e.g. armour
|
||||
is worn, weapon is held), not all items have an equipped state
|
||||
"inventory" = on player, equivalent to being put in a backpack
|
||||
"storage" = not on player at all, in a chest in their house or
|
||||
smth, these items should be displayed in the storage tab
|
||||
"transportation" = not on player, in some form of transportation,
|
||||
these items should be hidden on the sheet and the items that
|
||||
are on a transportation should be referenced by UUID in that
|
||||
transportation item
|
||||
*/
|
||||
choices: ["equipped", "inventory", "storage", "transportation"],
|
||||
}),
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -3,12 +3,6 @@ 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,
|
||||
}),
|
||||
});
|
||||
return mergeObject(super.defineSchema(), {});
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue