From 0e913b1f63288199870befbe3c30c12919d73d46 Mon Sep 17 00:00:00 2001 From: Stefan Zermatten Date: Wed, 6 Feb 2019 10:08:22 +0200 Subject: [PATCH] Items now have a number of uses which can be used up. --- app/imports/api/inventory/Items.js | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/app/imports/api/inventory/Items.js b/app/imports/api/inventory/Items.js index ebbd38db..2332d26c 100644 --- a/app/imports/api/inventory/Items.js +++ b/app/imports/api/inventory/Items.js @@ -5,16 +5,18 @@ import ColorSchema from "/imports/api/creature/subSchemas/ColorSchema.js"; Items = new Mongo.Collection("items"); itemSchema = new SimpleSchema({ - name: {type: String, optional: true, trim: false, defaultValue: "New Item"}, - plural: {type: String, optional: true, trim: false}, - description:{type: String, optional: true, trim: false}, - charId: {type: String, regEx: SimpleSchema.RegEx.Id, index: 1}, //id of owner - quantity: {type: SimpleSchema.Integer, min: 0, defaultValue: 1}, - weight: {type: Number, min: 0, defaultValue: 0}, - value: {type: Number, min: 0, defaultValue: 0}, - enabled: {type: Boolean, defaultValue: false}, + name: {type: String, optional: true, trim: false, defaultValue: "New Item"}, + plural: {type: String, optional: true, trim: false}, + description: {type: String, optional: true, trim: false}, + charId: {type: String, regEx: SimpleSchema.RegEx.Id, index: 1}, //id of owner + quantity: {type: SimpleSchema.Integer, min: 0, defaultValue: 1}, + weight: {type: Number, min: 0, defaultValue: 0}, + value: {type: Number, min: 0, defaultValue: 0}, + uses: {type: SimpleSchema.Integer, min: 0, optional: true}, + usesUsed: {type: SimpleSchema.Integer, min: 0, optional: true}, + enabled: {type: Boolean, defaultValue: false}, requiresAttunement: {type: Boolean, defaultValue: false}, - settings: {type: Object}, + settings: {type: Object}, "settings.showIncrement": {type: Boolean, defaultValue: false}, });