mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 23:27:26 +01:00
Adventure Guide Prep (#11883)
* WIP(adventure): prereqs * WIP(drops): new modal * WIP(adventure): analytics fixes etc * feat(adventure): random egg+potion on 2nd task * fix(lint): noworkies * fix(modal): correctly construct classes * fix(tests): expectations and escape * fix(first-drops): address comments * fix(first-drops): don't give random drops until first drops * fix(drops): remove more Level 3 references * refactor(drops): no need for cloning * refactor(drops): unnecessary export * fix(first-drops): force sync * fix(first-drops): move to server * fix(first-drops): escape in case we get here with >0 items * fix(lint): line length * fix(pet-food): remove unused string
This commit is contained in:
@@ -1051,6 +1051,7 @@ export default {
|
||||
const tmp = response.data.data._tmp || {};
|
||||
const { crit } = tmp;
|
||||
const { drop } = tmp;
|
||||
const { firstDrops } = tmp;
|
||||
const { quest } = tmp;
|
||||
|
||||
if (crit) {
|
||||
@@ -1068,6 +1069,15 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
if (firstDrops) {
|
||||
if (!user.items.eggs[firstDrops.egg]) Vue.set(user.items.eggs, firstDrops.egg, 0);
|
||||
if (!user.items.hatchingPotions[firstDrops.hatchingPotion]) {
|
||||
Vue.set(user.items.hatchingPotions, firstDrops.hatchingPotion, 0);
|
||||
}
|
||||
user.items.eggs[firstDrops.egg] += 1;
|
||||
user.items.hatchingPotions[firstDrops.hatchingPotion] += 1;
|
||||
}
|
||||
|
||||
if (drop) {
|
||||
let dropText;
|
||||
let dropNotes;
|
||||
@@ -1088,7 +1098,7 @@ export default {
|
||||
}
|
||||
|
||||
if (!user.items[type][drop.key]) {
|
||||
Vue.set(user, `items.${type}.${drop.key}`, 0);
|
||||
Vue.set(user.items[type], drop.key, 0);
|
||||
}
|
||||
user.items[type][drop.key] += 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user