Update item data models

This commit is contained in:
Oliver-Akins 2024-03-17 19:47:06 -06:00
parent 27c30b7eef
commit 5e2fb95c73
3 changed files with 21 additions and 10 deletions

View file

@ -1,11 +1,12 @@
export class AspectItemData extends foundry.abstract.TypeDataModel { import { DescribedItemData } from "./DescribedItemData.mjs";
export class AspectItemData extends DescribedItemData {
static defineSchema() { static defineSchema() {
const fields = foundry.data.fields; const fields = foundry.data.fields;
return { return {
used: new fields.BooleanField({ initial: false }), used: new fields.BooleanField({ initial: false }),
/** The number of seconds that the effect of the aspect stays */ /** The number of seconds that the effect of the aspect stays */
deactivateAfter: new fields.NumberField({ nullable: true }), deactivateAfter: new fields.NumberField({ nullable: true }),
info: new fields.HTMLField({ nullable: true, blank: false, trim: true }),
}; };
}; };
}; };

View file

@ -25,10 +25,26 @@ export class CommonItemData extends foundry.abstract.TypeDataModel {
integer: true, integer: true,
}), }),
tier: new fields.StringField({ tier: new fields.StringField({
initial: `simple`, initial: DOTDUNGEON.defaultItemTier,
nullable: false, nullable: false,
choices: DOTDUNGEON.itemTiers, 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"],
}),
}; };
}; };
}; };

View file

@ -3,12 +3,6 @@ import { DescribedItemData } from "./DescribedItemData.mjs";
export class EquipmentItemData extends DescribedItemData { export class EquipmentItemData extends DescribedItemData {
static defineSchema() { static defineSchema() {
const fields = foundry.data.fields; const fields = foundry.data.fields;
return mergeObject(super.defineSchema(), { return mergeObject(super.defineSchema(), {});
extra_inventory: new fields.NumberField({
initial: null,
nullable: true,
required: false,
}),
});
}; };
}; };