Add the Weapon item details (closes #132)
This commit is contained in:
parent
60797ab1e2
commit
337370bbfe
6 changed files with 153 additions and 3 deletions
|
|
@ -1,6 +1,7 @@
|
|||
// Data Models
|
||||
import { DescribedItemData } from "./models/Item/DescribedItemData.mjs";
|
||||
import { CommonItemData } from "./models/Item/CommonItemData.mjs";
|
||||
import { WeaponItemData } from "./models/Item/Weapon.mjs";
|
||||
import { AspectItemData } from "./models/Item/Aspect.mjs";
|
||||
import { SpellItemData } from "./models/Item/Spell.mjs";
|
||||
import { PlayerData } from "./models/Actor/Player.mjs";
|
||||
|
|
@ -46,6 +47,7 @@ Hooks.once(`init`, async () => {
|
|||
CONFIG.Item.dataModels.untyped = DescribedItemData;
|
||||
CONFIG.Item.dataModels.material = CommonItemData;
|
||||
CONFIG.Item.dataModels.foil = DescribedItemData;
|
||||
CONFIG.Item.dataModels.weapon = WeaponItemData;
|
||||
CONFIG.Item.dataModels.aspect = AspectItemData;
|
||||
CONFIG.Item.dataModels.spell = SpellItemData;
|
||||
CONFIG.Item.dataModels.pet = PetItemData;
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ export const partials = [
|
|||
`actors/char-sheet/v2/partials/inventory/items/material.v2.pc.hbs`,
|
||||
`actors/char-sheet/v2/partials/inventory/items/untyped.v2.pc.hbs`,
|
||||
`actors/char-sheet/v2/partials/inventory/items/aspect.v2.pc.hbs`,
|
||||
`actors/char-sheet/v2/partials/inventory/items/weapon.v2.pc.hbs`,
|
||||
];
|
||||
|
||||
export const preAliasedPartials = {
|
||||
|
|
|
|||
24
module/models/Item/Weapon.mjs
Normal file
24
module/models/Item/Weapon.mjs
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
import { DescribedItemData } from "./DescribedItemData.mjs";
|
||||
import DOTDUNGEON from "../../config.mjs";
|
||||
|
||||
export class WeaponItemData extends DescribedItemData {
|
||||
static defineSchema() {
|
||||
const fields = foundry.data.fields;
|
||||
return mergeObject(super.defineSchema(), {
|
||||
damage: new fields.StringField({
|
||||
initial: null,
|
||||
nullable: true,
|
||||
blank: true,
|
||||
options: DOTDUNGEON.damageTypes,
|
||||
}),
|
||||
ranged: new fields.BooleanField({ initial: false, }),
|
||||
scoped: new fields.BooleanField({ initial: false, }),
|
||||
ammo: new fields.StringField({
|
||||
initial: null,
|
||||
nullable: true,
|
||||
blank: true,
|
||||
options: DOTDUNGEON.ammoTypes,
|
||||
}),
|
||||
});
|
||||
};
|
||||
};
|
||||
|
|
@ -118,7 +118,7 @@ export class PlayerSheetv2 extends GenericActorSheet {
|
|||
return stats;
|
||||
};
|
||||
|
||||
_itemTypesHidden = new Set([`weapon`, `armour`, `equipment`, `foil`, `structure`, `service`]);
|
||||
_itemTypesHidden = new Set([`pet`, `armour`, `equipment`, `foil`, `structure`, `service`]);
|
||||
toggleItemFilter(filterName) {
|
||||
if (this._itemTypesHidden.has(filterName)) {
|
||||
this._itemTypesHidden.delete(filterName);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue