mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
23 lines
501 B
JavaScript
23 lines
501 B
JavaScript
import { TRANSFORMATION_DEBUFFS_LIST } from '../constants';
|
|
|
|
module.exports = function getDebuffPotionItems (user) {
|
|
const items = [];
|
|
const userBuffs = user.stats.buffs;
|
|
|
|
if (user) {
|
|
for (let key in TRANSFORMATION_DEBUFFS_LIST) {
|
|
if (userBuffs[key]) {
|
|
let debuff = TRANSFORMATION_DEBUFFS_LIST[key];
|
|
const item = {
|
|
path: `spells.special.${debuff}`,
|
|
type: 'debuffPotion',
|
|
};
|
|
items.push(item);
|
|
}
|
|
}
|
|
|
|
|
|
return items;
|
|
}
|
|
};
|