mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-14 21:27:23 +01:00
- 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
22 lines
499 B
JavaScript
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;
|
|
}
|