From 6b4f94ba7bf25bcc83f6f57214724fc5e6b6e8ff Mon Sep 17 00:00:00 2001 From: Keres Date: Sun, 6 Oct 2024 14:58:41 +1000 Subject: [PATCH] hasMonsterRequirements fix --- src/mahoji/mahojiSettings.ts | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/src/mahoji/mahojiSettings.ts b/src/mahoji/mahojiSettings.ts index 39a8fab145..9dac22e37c 100644 --- a/src/mahoji/mahojiSettings.ts +++ b/src/mahoji/mahojiSettings.ts @@ -231,9 +231,12 @@ export async function hasMonsterRequirements(user: MUser, monster: KillableMonst if (monster.requiredQuests) { const incompleteQuest = monster.requiredQuests.find(quest => !user.user.finished_quest_ids.includes(quest)); if (incompleteQuest) { - return `You need to have completed the ${bold( - quests.find(i => i.id === incompleteQuest)!.name - )} quest to kill ${monster.name}.`; + return [ + false, + `You need to have completed the ${bold( + quests.find(i => i.id === incompleteQuest)!.name + )} quest to kill ${monster.name}.` + ]; } } @@ -242,12 +245,15 @@ export async function hasMonsterRequirements(user: MUser, monster: KillableMonst const equippedInThisSet = set.items.find(item => user.gear[set.gearSetup].hasEquipped(item.itemID)); if (set.required && !equippedInThisSet) { - return `You need one of these items equipped in your ${set.gearSetup} setup to kill ${ - monster.name - }: ${set.items - .map(i => i.itemID) - .map(itemNameFromID) - .join(', ')}.`; + return [ + false, + `You need one of these items equipped in your ${set.gearSetup} setup to kill ${ + monster.name + }: ${set.items + .map(i => i.itemID) + .map(itemNameFromID) + .join(', ')}.` + ]; } } } @@ -297,7 +303,10 @@ export async function hasMonsterRequirements(user: MUser, monster: KillableMonst if (monster.diaryRequirement) { const [hasDiary, _, diaryGroup] = await userhasDiaryTier(user, monster.diaryRequirement); if (!hasDiary) { - return `${user.minionName} is missing the ${diaryGroup.name} ${monster.diaryRequirement[1]} diary to kill ${monster.name}.`; + return [ + false, + `${user.minionName} is missing the ${diaryGroup.name} ${monster.diaryRequirement[1]} diary to kill ${monster.name}.` + ]; } }