classes #943 reroll sets you on your new class's item track. Handling of two-handed staves

This commit is contained in:
Tyler Renelle
2013-12-06 10:51:15 -07:00
parent 3e5c213694
commit 8216828514
3 changed files with 26 additions and 3 deletions

View File

@@ -182,7 +182,13 @@ habitrpg.controller("InventoryCtrl", ['$rootScope', '$scope', 'User', 'API_URL',
$scope.equip = function(user, item, costume) {
var equipTo = costume ? 'costume' : 'equipped';
User.set('items.gear.' + equipTo + '.' + item.type, item.key);
if (~user.items.gear[equipTo].weapon.indexOf('wizard') && item.type == 'shield')
return Notification.text('Staves are two-handed');
var setVars = {};
setVars['items.gear.' + equipTo + '.' + item.type] = item.key;
if (item.klass == 'wizard')
setVars['items.gear.' + equipTo + '.shield'] = 'warrior_shield_0';
User.setMultiple(setVars);
}
}