mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-04-22 07:23:37 +02:00
Make all item types quantifiable in the party actor
This commit is contained in:
parent
76a3268cf3
commit
9aab9fca52
13 changed files with 91 additions and 45 deletions
|
|
@ -19,7 +19,8 @@ export default class DhCharacter extends DhCreature {
|
|||
type: 'character',
|
||||
settingSheet: DHCharacterSettings,
|
||||
isNPC: false,
|
||||
hasInventory: true
|
||||
hasInventory: true,
|
||||
quantifiable: ["loot", "consumable"]
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,8 @@ export default class DhParty extends BaseDataActor {
|
|||
/** @inheritdoc */
|
||||
static get metadata() {
|
||||
return foundry.utils.mergeObject(super.metadata, {
|
||||
hasInventory: true
|
||||
hasInventory: true,
|
||||
quantifiable: ["weapon", "armor", "loot", "consumable"]
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ export default class DHArmor extends AttachableItem {
|
|||
current: new fields.NumberField({ integer: true, min: 0, initial: 0 }),
|
||||
max: new fields.NumberField({ required: true, integer: true, initial: 0 })
|
||||
}),
|
||||
quantity: new fields.NumberField({ integer: true, initial: 1, min: 0, required: true }),
|
||||
baseThresholds: new fields.SchemaField({
|
||||
major: new fields.NumberField({ integer: true, initial: 0 }),
|
||||
severe: new fields.NumberField({ integer: true, initial: 0 })
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ export default class DHConsumable extends BaseDataItem {
|
|||
label: 'TYPES.Item.consumable',
|
||||
type: 'consumable',
|
||||
hasDescription: true,
|
||||
isQuantifiable: true,
|
||||
isInventoryItem: true,
|
||||
hasActions: true
|
||||
});
|
||||
|
|
@ -18,7 +17,8 @@ export default class DHConsumable extends BaseDataItem {
|
|||
const fields = foundry.data.fields;
|
||||
return {
|
||||
...super.defineSchema(),
|
||||
consumeOnUse: new fields.BooleanField({ initial: true })
|
||||
consumeOnUse: new fields.BooleanField({ initial: true }),
|
||||
quantity: new fields.NumberField({ integer: true, initial: 1, min: 0, required: true })
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ export default class DHLoot extends BaseDataItem {
|
|||
label: 'TYPES.Item.loot',
|
||||
type: 'loot',
|
||||
hasDescription: true,
|
||||
isQuantifiable: true,
|
||||
isInventoryItem: true,
|
||||
hasActions: true
|
||||
});
|
||||
|
|
@ -15,8 +14,10 @@ export default class DHLoot extends BaseDataItem {
|
|||
|
||||
/** @inheritDoc */
|
||||
static defineSchema() {
|
||||
const fields = foundry.data.fields;
|
||||
return {
|
||||
...super.defineSchema()
|
||||
...super.defineSchema(),
|
||||
quantity: new fields.NumberField({ integer: true, initial: 1, min: 0, required: true }),
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ export default class DHWeapon extends AttachableItem {
|
|||
label: 'DAGGERHEART.GENERAL.Tiers.singular'
|
||||
}),
|
||||
equipped: new fields.BooleanField({ initial: false }),
|
||||
quantity: new fields.NumberField({ integer: true, initial: 1, min: 0, required: true }),
|
||||
|
||||
//SETTINGS
|
||||
secondary: new fields.BooleanField({ initial: false, label: 'DAGGERHEART.ITEMS.Weapon.secondaryWeapon' }),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue