added mountmaster support

inventoryCtrl: Changed Matt to show 90 mounts instead of 180
notificationCtrl: added mountmaster achievement test
userCtrl: added scope.profile.mountCount
user.js: added fields for mountMaster and mountMasterCount (not used
yet),  mountCount function
modals/achievements.jade - added modal dialog for mountmaster (note:
wolf graphic was not available locally)
profiles/achievements - jade  - mountmaster added
stats.jade -- uncommented broken Mounts Tamed section, since it works
now
This commit is contained in:
Taldin
2014-10-30 12:35:40 -07:00
parent e004452257
commit 506ac6ebe7
7 changed files with 52 additions and 4 deletions
+12
View File
@@ -36,6 +36,8 @@ var UserSchema = new Schema({
ultimateGear: Boolean,
beastMaster: Boolean,
beastMasterCount: Number,
mountMaster: Boolean,
mountMasterCount: Number,
veteran: Boolean,
snowball: Number,
spookDust: Number,
@@ -412,6 +414,16 @@ UserSchema.pre('save', function(next) {
if (petCount >= 90 || this.achievements.beastMasterCount > 0) {
this.achievements.beastMaster = true
}
// mountmaster stuff starts
var mountCount = shared.countMounts(_.reduce(this.items.mounts,function(m,v){
//HOTFIX - Remove when solution is found, the first argument passed to reduce is a function
if(_.isFunction(v)) return m;
return m+(v?1:0)},0), this.items.mounts);
if (mountCount >= 90 || this.achievements.mountMasterCount > 0) {
this.achievements.mountMaster = true
}
// mountmaster stuff ends
// TODO remove this after 11/01
if (!this.items.pets['JackOLantern-Base'] && moment().isBefore('2014-11-01'))