mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
removed a bunch of commented code
This commit is contained in:
@@ -127,7 +127,7 @@ const quests = {
|
|||||||
text: t('questAtom3Text'),
|
text: t('questAtom3Text'),
|
||||||
notes: t('questAtom3Notes'),
|
notes: t('questAtom3Notes'),
|
||||||
group: 'questGroupAtom',
|
group: 'questGroupAtom',
|
||||||
previous: 'atom1',
|
previous: 'atom2',
|
||||||
prereqQuests: [
|
prereqQuests: [
|
||||||
'atom1',
|
'atom1',
|
||||||
'atom2',
|
'atom2',
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import _mapValues from 'lodash/mapValues';
|
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 keys from 'lodash/keys';
|
||||||
import i18n from '../i18n';
|
import i18n from '../i18n';
|
||||||
import content from '../content/index';
|
import content from '../content/index';
|
||||||
@@ -10,53 +10,16 @@ import isPinned from './isPinned';
|
|||||||
import isFreeRebirth from './isFreeRebirth';
|
import isFreeRebirth from './isFreeRebirth';
|
||||||
import getOfficialPinnedItems from './getOfficialPinnedItems';
|
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) {
|
function lockQuest (quest, user) {
|
||||||
// masterclasser requirement
|
// checks series quests, including Masterclasser
|
||||||
// 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
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
|
|
||||||
// level requirements
|
if (quest.prereqQuests) {
|
||||||
// if (quest.lvl && user.stats.lvl < quest.lvl) return true;
|
if (!user.achievements.quests) return true;
|
||||||
|
const achievedQuestKeys = keys(user.achievements.quests);
|
||||||
// unlockCondition requirements for Lunar Battle
|
if (intersection(quest.prereqQuests, achievedQuestKeys) !== quest.prereqQuests) {
|
||||||
// fix this bc we shouldn't be hard coding in specific quests
|
return true;
|
||||||
// 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];
|
|
||||||
// }
|
|
||||||
|
|
||||||
// checks quest & user level against quest level
|
// checks quest & user level against quest level
|
||||||
if (quest.lvl && user.stats.lvl < quest.lvl) return true;
|
if (quest.lvl && user.stats.lvl < quest.lvl) return true;
|
||||||
@@ -68,24 +31,13 @@ function lockQuest (quest, user) {
|
|||||||
&& user.loginIncentives < quest.unlockCondition.incentiveThreshold
|
&& user.loginIncentives < quest.unlockCondition.incentiveThreshold
|
||||||
) return true;
|
) return true;
|
||||||
|
|
||||||
// checks series quests, including Masterclasser
|
if (user.achievements.quests) {
|
||||||
if (quest.prereqQuests) {
|
return quest.previous
|
||||||
if (!user.achievements.quests) return true;
|
&& !user.achievements.quests[quest.previous];
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 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
|
// then if we've passed all the checks, at the end
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// return quest.previous; //what was at the end of the function before
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function isItemSuggested (officialPinnedItems, itemInfo) {
|
function isItemSuggested (officialPinnedItems, itemInfo) {
|
||||||
|
|||||||
Reference in New Issue
Block a user