mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 06:37:23 +01:00
removed a bunch of commented code
This commit is contained in:
@@ -127,7 +127,7 @@ const quests = {
|
||||
text: t('questAtom3Text'),
|
||||
notes: t('questAtom3Notes'),
|
||||
group: 'questGroupAtom',
|
||||
previous: 'atom1',
|
||||
previous: 'atom2',
|
||||
prereqQuests: [
|
||||
'atom1',
|
||||
'atom2',
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import _mapValues from 'lodash/mapValues';
|
||||
import intersection from 'lodash/intersection'; // there's probably other ways to do this, but, quick way to hit what I'm thinking of
|
||||
import intersection from 'lodash/intersection';
|
||||
import keys from 'lodash/keys';
|
||||
import i18n from '../i18n';
|
||||
import content from '../content/index';
|
||||
@@ -10,53 +10,16 @@ import isPinned from './isPinned';
|
||||
import isFreeRebirth from './isFreeRebirth';
|
||||
import getOfficialPinnedItems from './getOfficialPinnedItems';
|
||||
|
||||
// function userAbleToStartMasterclasser (user) {
|
||||
// return (
|
||||
// user.achievements.quests.dilatoryDistress3
|
||||
// && user.achievements.quests.mayhemMistiflying3
|
||||
// && user.achievements.quests.stoikalmCalamity3
|
||||
// && user.achievements.quests.taskwoodsTerror3
|
||||
// );
|
||||
// }
|
||||
|
||||
function lockQuest (quest, user) {
|
||||
// masterclasser requirement
|
||||
// roll this into other series checks
|
||||
// if (quest.key === 'lostMasterclasser1') {
|
||||
// return !userAbleToStartMasterclasser(user);
|
||||
// }
|
||||
// if (
|
||||
// quest.key === 'lostMasterclasser2'
|
||||
// || quest.key === 'lostMasterclasser3'
|
||||
// || quest.key === 'lostMasterclasser4'
|
||||
// ) {
|
||||
// return !(userAbleToStartMasterclasser(user) && user.achievements.quests[quest.previous]);
|
||||
// }
|
||||
// if (quest.key === 'lostMasterclasser1') {
|
||||
// return !(
|
||||
// user.achievements.quests.dilatoryDistress3
|
||||
// && user.achievements.quests.mayhemMistiflying3
|
||||
// && user.achievements.quests.stoikalmCalamity3
|
||||
// && user.achievements.quests.taskwoodsTerror3
|
||||
// );
|
||||
// }
|
||||
// checks series quests, including Masterclasser
|
||||
|
||||
// level requirements
|
||||
// if (quest.lvl && user.stats.lvl < quest.lvl) return true;
|
||||
|
||||
// unlockCondition requirements for Lunar Battle
|
||||
// fix this bc we shouldn't be hard coding in specific quests
|
||||
// if (
|
||||
// quest.unlockCondition
|
||||
// && (quest.key === 'moon1' || quest.key === 'moon2' || quest.key === 'moon3')
|
||||
// ) {
|
||||
// return user.loginIncentives < quest.unlockCondition.incentiveThreshold;
|
||||
// }
|
||||
|
||||
// checks to make sure previous quest in chain is completed
|
||||
// if (user.achievements.quests) {
|
||||
// return quest.previous && !user.achievements.quests[quest.previous];
|
||||
// }
|
||||
if (quest.prereqQuests) {
|
||||
if (!user.achievements.quests) return true;
|
||||
const achievedQuestKeys = keys(user.achievements.quests);
|
||||
if (intersection(quest.prereqQuests, achievedQuestKeys) !== quest.prereqQuests) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// checks quest & user level against quest level
|
||||
if (quest.lvl && user.stats.lvl < quest.lvl) return true;
|
||||
@@ -68,24 +31,13 @@ function lockQuest (quest, user) {
|
||||
&& user.loginIncentives < quest.unlockCondition.incentiveThreshold
|
||||
) return true;
|
||||
|
||||
// checks series quests, including Masterclasser
|
||||
if (quest.prereqQuests) {
|
||||
if (!user.achievements.quests) return true;
|
||||
|
||||
const achievedQuestKeys = keys(user.achievements.quests);
|
||||
// console.log(achievedQuestKeys); // this is returning all quests in array even if value = 0
|
||||
if (intersection(quest.prereqQuests, achievedQuestKeys) !== quest.prereqQuests) return true;
|
||||
if (user.achievements.quests) {
|
||||
return quest.previous
|
||||
&& !user.achievements.quests[quest.previous];
|
||||
}
|
||||
|
||||
// OR THIS
|
||||
// if (intersection(quest.prereqQuests, keys(user.quest.achievements)) !== quest.prereqQuests) {
|
||||
// return true;
|
||||
// }
|
||||
|
||||
// then if we've passed all the checks, at the end
|
||||
return false;
|
||||
|
||||
// return quest.previous; //what was at the end of the function before
|
||||
}
|
||||
|
||||
function isItemSuggested (officialPinnedItems, itemInfo) {
|
||||
|
||||
Reference in New Issue
Block a user