mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
classes: small tweaks
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user