mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
feat(client): Display if gear gets class multiplier in notes
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
"equipmentType" : "Type",
|
||||
"klass": "Class",
|
||||
"groupBy": "Group By <%= type %>",
|
||||
"classBonus": "(This item matches your class, so it gets an additional 1.5 stat multiplier.)",
|
||||
|
||||
"weapon": "weapon",
|
||||
"weaponCapitalized" : "Weapon",
|
||||
|
||||
@@ -63,7 +63,7 @@ habitrpg.controller("InventoryCtrl",
|
||||
var item = Content.gear.flat[key];
|
||||
|
||||
var bonusMultiplier = 1;
|
||||
if (item.klass === User.user.stats.class || item.specialClass === User.user.stats.class) {
|
||||
if (_isClassItem(item)) {
|
||||
bonusMultiplier = 1.5;
|
||||
}
|
||||
|
||||
@@ -317,6 +317,12 @@ habitrpg.controller("InventoryCtrl",
|
||||
});
|
||||
};
|
||||
|
||||
$scope.classBonusNotes = function (item) {
|
||||
if (_isClassItem(item)) {
|
||||
return window.env.t('classBonus');
|
||||
}
|
||||
};
|
||||
|
||||
$scope.hasAllTimeTravelerItems = function() {
|
||||
return ($scope.hasAllTimeTravelerItemsOfType('mystery') &&
|
||||
$scope.hasAllTimeTravelerItemsOfType('pets') &&
|
||||
@@ -358,5 +364,11 @@ habitrpg.controller("InventoryCtrl",
|
||||
var selection = Math.floor(random);
|
||||
return env.t(kind + selection);
|
||||
}
|
||||
|
||||
function _isClassItem(item) {
|
||||
var userClass = user.stats.class;
|
||||
|
||||
return item.klass === userClass || item.specialClass === userClass;
|
||||
}
|
||||
}
|
||||
]);
|
||||
|
||||
@@ -26,7 +26,7 @@ mixin equipmentButton(type)
|
||||
button.customize-option(class='shop_{{::item.key}}',
|
||||
ng-class='{selectableInventory: user.items.gear.#{type}[item.type] == item.key}',
|
||||
ng-click='equip(item.key, "#{type}")',
|
||||
popover='{{::item.notes()}}', popover-title='{{::item.text()}}',
|
||||
popover='{{::item.notes()}} {{::classBonusNotes(item)}}', popover-title='{{::item.text()}}',
|
||||
popover-trigger='mouseenter', popover-placement='right',
|
||||
popover-append-to-body='true')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user