mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-07-22 05:44:16 +00:00
classes #943 more general solution to two-handed weapons habitrpg-shared#41da82f
This commit is contained in:
parent
8216828514
commit
b852d9a9f2
1 changed files with 5 additions and 3 deletions
|
|
@ -182,11 +182,13 @@ habitrpg.controller("InventoryCtrl", ['$rootScope', '$scope', 'User', 'API_URL',
|
|||
|
||||
$scope.equip = function(user, item, costume) {
|
||||
var equipTo = costume ? 'costume' : 'equipped';
|
||||
if (~user.items.gear[equipTo].weapon.indexOf('wizard') && item.type == 'shield')
|
||||
return Notification.text('Staves are two-handed');
|
||||
if (item.type == 'shield') {
|
||||
var weapon = Items.items.gear.flat[user.items.gear[equipTo].weapon];
|
||||
if (weapon && weapon.twoHanded) return Notification.text(weapon.text + ' is two-handed');
|
||||
}
|
||||
var setVars = {};
|
||||
setVars['items.gear.' + equipTo + '.' + item.type] = item.key;
|
||||
if (item.klass == 'wizard')
|
||||
if (item.twoHanded)
|
||||
setVars['items.gear.' + equipTo + '.shield'] = 'warrior_shield_0';
|
||||
User.setMultiple(setVars);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue