Gave Features a use limit option
This commit is contained in:
@@ -4,9 +4,18 @@ Schemas.Feature = new SimpleSchema({
|
||||
charId: {type: String, regEx: SimpleSchema.RegEx.Id},
|
||||
name: {type: String},
|
||||
description:{type: String, optional: true},
|
||||
actions: {type: [Schemas.Action], defaultValue: []},
|
||||
attacks: {type: [Schemas.Attack], defaultValue: []},
|
||||
spells: {type: [Schemas.Spell] , defaultValue: []},
|
||||
uses: {type: String, optional: true, trim: false},
|
||||
used: {type: Number, defaultValue: 0},
|
||||
reset: {type: String, allowedValues: ["manual", "longRest", "shortRest"], defaultValue: "manual"},
|
||||
});
|
||||
|
||||
Features.attachSchema(Schemas.Feature);
|
||||
|
||||
Features.helpers({
|
||||
usesLeft: function(){
|
||||
return evaluate(this.charId, this.uses) - this.used;
|
||||
},
|
||||
usesValue: function(){
|
||||
return evaluate(this.charId, this.uses);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user