Files
habitica/website/common/script/libs/getDebuffPotionItems.js
Xaz16 aedabd2266 Fix
- Rewrite exports of debuffPotion functions
- Force clear debuffPotions in setDebuffPotionItems to make the same behavior as in develop branch
- Change class of debuffPotion items to shop_{key}
- Resolve lint warnings
2019-10-29 00:27:41 +03:00

22 lines
499 B
JavaScript

import { TRANSFORMATION_DEBUFFS_LIST } from '../constants';
export default function getDebuffPotionItems (user) {
const items = [];
const userBuffs = user.stats.buffs;
if (user) {
for (const key in TRANSFORMATION_DEBUFFS_LIST) {
if (userBuffs[key]) {
const debuff = TRANSFORMATION_DEBUFFS_LIST[key];
const item = {
path: `spells.special.${debuff}`,
type: 'debuffPotion',
};
items.push(item);
}
}
}
return items;
}