Improved Spell default values

This commit is contained in:
Thaum
2015-03-30 09:55:52 +00:00
parent a389647559
commit 35ce49ded8

View File

@@ -2,20 +2,20 @@ Spells = new Mongo.Collection("spells");
Schemas.Spell = new SimpleSchema({ Schemas.Spell = new SimpleSchema({
charId: {type: String, regEx: SimpleSchema.RegEx.Id}, charId: {type: String, regEx: SimpleSchema.RegEx.Id},
prepared: {type: String, defaultValue: "unprepared", allowedValues: ["prepared","unprepared","always"]}, prepared: {type: String, defaultValue: "prepared", allowedValues: ["prepared","unprepared","always"]},
name: {type: String, trim: false}, name: {type: String, trim: false, defaultValue: "New Spell"},
description: {type: String, optional: true, trim: false}, description: {type: String, optional: true, trim: false},
castingTime: {type: String, optional: true, defaultValue: "action", trim: false}, castingTime: {type: String, optional: true, defaultValue: "action", trim: false},
range: {type: String, optional: true, trim: false}, range: {type: String, optional: true, trim: false},
duration: {type: String, optional: true, trim: false}, duration: {type: String, optional: true, trim: false, defaultValue: "Instantaneous"},
"components.verbal": {type: Boolean, defaultValue: false}, "components.verbal": {type: Boolean, defaultValue: false},
"components.somatic": {type: Boolean, defaultValue: false}, "components.somatic": {type: Boolean, defaultValue: false},
"components.material": {type: String, optional: true}, "components.material": {type: String, optional: true},
"components.concentration": {type: Boolean, defaultValue: false}, "components.concentration": {type: Boolean, defaultValue: false},
ritual: {type: Boolean, defaultValue: false}, ritual: {type: Boolean, defaultValue: false},
level: {type: Number, defaultValue: 0}, level: {type: Number, defaultValue: 1},
school: {type: String, defaultValue: "Abjuration", allowedValues: magicSchools}, school: {type: String, defaultValue: "Abjuration", allowedValues: magicSchools},
color: {type: String, allowedValues: _.pluck(colorOptions, "key"), defaultValue: "q"} color: {type: String, allowedValues: _.pluck(colorOptions, "key"), defaultValue: "q"}
}); });
Spells.attachSchema(Schemas.Spell); Spells.attachSchema(Schemas.Spell);