Implemented remaining core features

This commit is contained in:
Thaum
2015-02-25 12:48:45 +00:00
parent 52b8c8b8d6
commit 56f8e95d81
38 changed files with 748 additions and 100 deletions

View File

@@ -9,7 +9,8 @@ Schemas.Attack = new SimpleSchema({
regEx: SimpleSchema.RegEx.Id
},
name: {
type: String
type: String,
defaultValue: "New Attack"
},
range: {
type: String,
@@ -17,15 +18,24 @@ Schemas.Attack = new SimpleSchema({
},
attackBonus: {
type: String,
optional: true
optional: true,
defaultValue: "strengthMod + proficiencyBonus"
},
damage: {
type: String
type: String,
optional: true,
defaultValue: "1d8 + {strengthMod}"
},
damageType: {
type: String,
allowedValues: ["acid", "bludgeoning", "cold", "fire", "force", "lightning", "necrotic",
"piercing", "poison", "psychic", "radiant", "slashing", "thunder"]
allowedValues: ["bludgeoning", "piercing", "slashing", "acid", "cold", "fire", "force", "lightning", "necrotic",
"poison", "psychic", "radiant", "thunder"],
defaultValue: "slashing"
},
color: {
type: String,
allowedValues: _.pluck(colorOptions, "key"),
defaultValue: "q"
}
});

View File

@@ -3,16 +3,18 @@ Characters = new Meteor.Collection("characters");
Schemas.Character = new SimpleSchema({
//strings
name: { type: String, defaultValue: "", trim: false},
alignment: { type: String, defaultValue: "", trim: false},
gender: { type: String, defaultValue: "", trim: false},
race: { type: String, defaultValue: "", trim: false},
description:{ type: String, defaultValue: "", trim: false},
personality:{ type: String, defaultValue: "", trim: false},
ideals: { type: String, defaultValue: "", trim: false},
bonds: { type: String, defaultValue: "", trim: false},
flaws: { type: String, defaultValue: "", trim: false},
backstory: { type: String, defaultValue: "", trim: false},
name: { type: String, defaultValue: "", trim: false},
alignment: { type: String, defaultValue: "", trim: false},
gender: { type: String, defaultValue: "", trim: false},
race: { type: String, defaultValue: "", trim: false},
description: { type: String, defaultValue: "", trim: false},
personality: { type: String, defaultValue: "", trim: false},
ideals: { type: String, defaultValue: "", trim: false},
bonds: { type: String, defaultValue: "", trim: false},
flaws: { type: String, defaultValue: "", trim: false},
backstory: { type: String, defaultValue: "", trim: false},
proficiencies:{ type: String, defaultValue: "", trim: false},
languages: { type: String, defaultValue: "", trim: false},
//attributes
//ability scores

View File

@@ -5,7 +5,7 @@ Effects = new Meteor.Collection("effects");
* that modify their final value or presentation in some way
*/
Schemas.Effect = new SimpleSchema({
charId: {
charId: {
type: String,
regEx: SimpleSchema.RegEx.Id
},
@@ -31,7 +31,7 @@ Schemas.Effect = new SimpleSchema({
type: {
type: String,
defaultValue: "editable",
allowedValues: ["editable", "feature", "buff", "equipment", "inate"]
allowedValues: ["editable", "feature", "level", "buff", "equipment", "racial", "inate"]
},
//the id of the feature, buff or item that created this effect
sourceId: {

View File

@@ -0,0 +1,20 @@
Classes = new Meteor.Collection("classes");
Schemas.Class = new SimpleSchema({
charId: {type: String, regEx: SimpleSchema.RegEx.Id},
name: {type: String},
createdAt: {
type: Date,
autoValue: function() {
if (this.isInsert) {
return new Date;
} else if (this.isUpsert) {
return {$setOnInsert: new Date};
} else {
this.unset();
}
}
},
});
Classes.attachSchema(Schemas.Class);

View File

@@ -0,0 +1,9 @@
Levels = new Meteor.Collection("levels");
Schemas.Level = new SimpleSchema({
charId: {type: String, regEx: SimpleSchema.RegEx.Id},
classId: {type: String, regEx: SimpleSchema.RegEx.Id},
value: {type: Number}
});
Levels.attachSchema(Schemas.Level);

View File

@@ -14,5 +14,9 @@ Schemas.DeathSave = new SimpleSchema({
canDeathSave: {
type: Boolean,
defaultValue: true
},
stable: {
type: Boolean,
defaultValue: false
}
});