classes: small tweaks

This commit is contained in:
Tyler Renelle
2013-12-07 11:31:11 -07:00
parent c51cdd0849
commit 59f8727cbf
4 changed files with 6 additions and 3 deletions

View File

@@ -11,6 +11,8 @@ db.users.find().forEach(function(user){
// grant backer/contrib gear, 300, rather than using js logic
// customizations redo: https://trello.com/c/YKXmHNjY/306-customization-redo
// migrate current owned items
// gender => size

View File

@@ -23,6 +23,7 @@ angular.module('userServices', []).
//first we populate user with schema
_.extend(user, $window.habitrpgShared.helpers.newUser());
user.apiToken = user._id = ''; // we use id / apitoken to determine if registered
$window.habitrpgShared.algos.defineComputed(user);
//than we try to load localStorage
if (localStorage.getItem(STORAGE_USER_ID)) {

View File

@@ -233,7 +233,7 @@ var UserSchema = new Schema({
'class': {type: String, enum: ['warrior','rogue','wizard','rogue'], 'default': 'warrior'},
points: {type: Number, 'default': 0},
str: {type: Number, 'default': 0},
def: {type: Number, 'default': 0},
con: {type: Number, 'default': 0},
int: {type: Number, 'default': 0},
per: {type: Number, 'default': 0},
buffs: {
@@ -306,7 +306,7 @@ UserSchema.pre('save', function(next) {
// FIXME handle this on level-up instead, and come up with how we're going to handle retroactively
// Actually, can this be used as an attr default? (schema {type: ..., 'default': function(){}})
this.stats.points = this.stats.lvl - (this.stats.def + this.stats.str + this.stats.per + this.stats.int);
this.stats.points = this.stats.lvl - (this.stats.con + this.stats.str + this.stats.per + this.stats.int);
var petCount = helpers.countPets(_.reduce(this.items.pets,function(m,v){
//HOTFIX - Remove when solution is found, the first argument passed to reduce is a function

View File

@@ -123,7 +123,7 @@ script(id='partials/options.profile.stats.html', type='text/ng-template')
i.icon-question-sign(popover-title='Defense', popover='Defense decreases damage inflicted by tasks, and increases the effectiveness of healing and buff spells', popover-trigger='mouseenter')
|  DEF: {{user.stats.def}}
td
a.btn.btn-primary(ng-show='user.stats.points', ng-click='allocate("def")') +
a.btn.btn-primary(ng-show='user.stats.points', ng-click='allocate("con")') +
tr
td
i.icon-question-sign(popover-title='Perception', popover='Perception increases the likelihood of drops, Gold bonuses, and critical hit chances', popover-trigger='mouseenter')