Changed how levels are handled
This commit is contained in:
@@ -433,8 +433,8 @@ Characters.helpers({
|
||||
var mod = +getMod(this.attributeValue(attribute));
|
||||
return 10 + mod;
|
||||
},
|
||||
|
||||
level: function(){
|
||||
|
||||
xpLevel: function(){
|
||||
var xp = this.experience();
|
||||
var xpTable = [0, 300, 900, 2700, 6500, 14000, 23000, 34000, 48000, 64000,
|
||||
85000, 100000, 120000, 140000, 165000, 195000, 225000, 265000,
|
||||
@@ -447,6 +447,14 @@ Characters.helpers({
|
||||
if(xp > 355000) return 20;
|
||||
return 0;
|
||||
},
|
||||
|
||||
level: function(){
|
||||
var level = 0;
|
||||
Classes.find({charId: this._id}).forEach(function(cls){
|
||||
level += cls.level;
|
||||
})
|
||||
return level;
|
||||
},
|
||||
|
||||
experience: function(){
|
||||
var xp = 0;
|
||||
|
||||
@@ -3,6 +3,7 @@ Classes = new Meteor.Collection("classes");
|
||||
Schemas.Class = new SimpleSchema({
|
||||
charId: {type: String, regEx: SimpleSchema.RegEx.Id},
|
||||
name: {type: String, trim: false},
|
||||
level: {type: Number},
|
||||
createdAt: {
|
||||
type: Date,
|
||||
autoValue: function() {
|
||||
@@ -15,6 +16,7 @@ Schemas.Class = new SimpleSchema({
|
||||
}
|
||||
}
|
||||
},
|
||||
color: {type: String, allowedValues: _.pluck(colorOptions, "key"), defaultValue: "q"}
|
||||
});
|
||||
|
||||
Classes.attachSchema(Schemas.Class);
|
||||
@@ -33,7 +33,7 @@ Schemas.Effect = new SimpleSchema({
|
||||
type: {
|
||||
type: String,
|
||||
defaultValue: "editable",
|
||||
allowedValues: ["editable", "feature", "level", "buff", "equipment", "racial", "inate"]
|
||||
allowedValues: ["editable", "feature", "class", "buff", "equipment", "racial", "inate"]
|
||||
},
|
||||
//the id of the feature, buff or item that created this effect
|
||||
sourceId: {
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
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);
|
||||
Reference in New Issue
Block a user