Fix: Inconsistent Quest Unlock Behavior (#13734)

* remove quest refactoring, created new branch for that task

* remove quest refactoring, created new branch for that task

* More trying to figure out how buying a quest actually works

* rolling back changes

* updated shops/quests/index.vue to disable clicking on locked quests

* removed console.log(item)

* misc fixes per review comments

* changes as requested

* incorporated quest refactors updates

* removing a couple lines of code
This commit is contained in:
Natalie L
2022-05-05 17:51:47 -04:00
committed by GitHub
parent de4ebbac7b
commit 5e12b7b042
6 changed files with 101 additions and 85 deletions

View File

@@ -2,17 +2,15 @@ import defaults from 'lodash/defaults';
import each from 'lodash/each';
import sortBy from 'lodash/sortBy';
import t from './translation';
import {
USER_CAN_OWN_QUEST_CATEGORIES,
QUEST_GENERIC,
QUEST_MASTERCLASSER,
QUEST_PETS,
QUEST_POTIONS,
QUEST_SEASONAL,
QUEST_SERIES,
QUEST_TIME_TRAVEL,
QUEST_WORLD,
} from './constants';
import { USER_CAN_OWN_QUEST_CATEGORIES } from './constants';
import QUEST_GENERIC from './quests/generic';
import QUEST_MASTERCLASSER from './quests/masterclasser';
import QUEST_PETS from './quests/pets';
import QUEST_POTIONS from './quests/potions';
import QUEST_SEASONAL from './quests/seasonal';
import QUEST_SERIES from './quests/series';
import QUEST_TIME_TRAVEL from './quests/timeTravel';
import QUEST_WORLD from './quests/world';
const userCanOwnQuestCategories = USER_CAN_OWN_QUEST_CATEGORIES;
const questGeneric = QUEST_GENERIC;

View File

@@ -335,5 +335,4 @@ const QUEST_POTIONS = {
},
},
};
export default QUEST_POTIONS;

View File

@@ -33,9 +33,6 @@ const QUEST_SEASONAL = {
gp: 20,
exp: 100,
},
canBuy () {
return this.event && moment().isBetween(this.event.start, this.event.end);
},
},
evilsanta2: {
event: CURRENT_EVENT && CURRENT_EVENT.season === 'winter' ? CURRENT_EVENT : null,
@@ -66,9 +63,6 @@ const QUEST_SEASONAL = {
gp: 20,
exp: 100,
},
canBuy () {
return this.event && moment().isBetween(this.event.start, this.event.end);
},
},
// spring
egg: {
@@ -131,8 +125,45 @@ const QUEST_SEASONAL = {
gp: 0,
exp: 0,
},
canBuy () {
return this.event && moment().isBetween(this.event.start, this.event.end);
},
waffle: {
text: t('questWaffleText'),
notes: t('questWaffleNotes'),
completion: t('questWaffleCompletion'),
value: 4,
category: 'hatchingPotion',
event: CURRENT_EVENT && CURRENT_EVENT.season === 'spring' ? CURRENT_EVENT : null,
boss: {
name: t('questWaffleBoss'),
hp: 500,
str: 2,
rage: {
title: t('questWaffleRageTitle'),
description: t('questWaffleRageDescription'),
value: 50,
progressDrain: 0.5,
effect: t('questWaffleRageEffect'),
},
},
drop: {
items: [
{
type: 'hatchingPotions',
key: 'Dessert',
text: t('questWaffleDropDessertPotion'),
}, {
type: 'hatchingPotions',
key: 'Dessert',
text: t('questWaffleDropDessertPotion'),
}, {
type: 'hatchingPotions',
key: 'Dessert',
text: t('questWaffleDropDessertPotion'),
},
],
gp: 40,
exp: 500,
unlock: t('questWaffleUnlockText'),
},
},
virtualpet: {
@@ -178,49 +209,6 @@ const QUEST_SEASONAL = {
unlock: t('questVirtualPetUnlockText'),
},
},
waffle: {
text: t('questWaffleText'),
notes: t('questWaffleNotes'),
completion: t('questWaffleCompletion'),
value: 4,
category: 'hatchingPotion',
event: CURRENT_EVENT && CURRENT_EVENT.season === 'spring' ? CURRENT_EVENT : null,
boss: {
name: t('questWaffleBoss'),
hp: 500,
str: 2,
rage: {
title: t('questWaffleRageTitle'),
description: t('questWaffleRageDescription'),
value: 50,
progressDrain: 0.5,
effect: t('questWaffleRageEffect'),
},
},
drop: {
items: [
{
type: 'hatchingPotions',
key: 'Dessert',
text: t('questWaffleDropDessertPotion'),
}, {
type: 'hatchingPotions',
key: 'Dessert',
text: t('questWaffleDropDessertPotion'),
}, {
type: 'hatchingPotions',
key: 'Dessert',
text: t('questWaffleDropDessertPotion'),
},
],
gp: 40,
exp: 500,
unlock: t('questWaffleUnlockText'),
},
canBuy () {
return this.event && moment().isBetween(this.event.start, this.event.end);
},
},
};
export default QUEST_SEASONAL;

View File

@@ -36,11 +36,10 @@ const QUEST_SERIES = {
notes: t('questAtom2Notes'),
completion: t('questAtom2Completion'),
group: 'questGroupAtom',
prerequisite: {
lvl: 15,
atom1: true,
},
previous: 'atom1',
prereqQuests: [
'atom1',
],
value: 4,
lvl: 15,
category: 'unlockable',
@@ -67,12 +66,11 @@ const QUEST_SERIES = {
notes: t('questAtom3Notes'),
group: 'questGroupAtom',
previous: 'atom2',
prereqQuests: [
'atom1',
'atom2',
],
completion: t('questAtom3Completion'),
prerequisite: {
lvl: 15,
atom1: true,
atom2: true,
},
value: 4,
lvl: 15,
category: 'unlockable',
@@ -135,6 +133,9 @@ const QUEST_SERIES = {
group: 'questGroupGoldenknight',
value: 4,
previous: 'goldenknight1',
prereqQuests: [
'goldenknight1',
],
lvl: 40,
category: 'unlockable',
boss: {
@@ -161,6 +162,10 @@ const QUEST_SERIES = {
group: 'questGroupGoldenknight',
completion: t('questGoldenknight3Completion'),
previous: 'goldenknight2',
prereqQuests: [
'goldenknight1',
'goldenknight2',
],
value: 4,
lvl: 40,
category: 'unlockable',
@@ -237,6 +242,9 @@ const QUEST_SERIES = {
group: 'questGroupMoon',
completion: t('questMoon2Completion'),
previous: 'moon1',
prereqQuests: [
'moon1',
],
value: 4,
category: 'unlockable',
unlockCondition: {
@@ -267,6 +275,10 @@ const QUEST_SERIES = {
group: 'questGroupMoon',
completion: t('questMoon3Completion'),
previous: 'moon2',
prereqQuests: [
'moon1',
'moon2',
],
value: 4,
category: 'unlockable',
unlockCondition: {
@@ -326,6 +338,9 @@ const QUEST_SERIES = {
value: 4,
lvl: 60,
previous: 'moonstone1',
prereqQuests: [
'moonstone1',
],
category: 'unlockable',
boss: {
name: t('questMoonstone2Boss'),
@@ -351,6 +366,10 @@ const QUEST_SERIES = {
group: 'questGroupMoonstone',
completion: t('questMoonstone3Completion'),
previous: 'moonstone2',
prereqQuests: [
'moonstone1',
'moonstone2',
],
value: 4,
lvl: 60,
category: 'unlockable',
@@ -438,6 +457,9 @@ const QUEST_SERIES = {
lvl: 30,
category: 'unlockable',
previous: 'vice1',
prereqQuests: [
'vice1',
],
collect: {
lightCrystal: {
text: t('questVice2CollectLightCrystal'),
@@ -463,6 +485,10 @@ const QUEST_SERIES = {
group: 'questGroupVice',
completion: t('questVice3Completion'),
previous: 'vice2',
prereqQuests: [
'vice1',
'vice2',
],
value: 4,
lvl: 30,
category: 'unlockable',