Skip to content

Commit

Permalink
hasMonsterRequirements fix
Browse files Browse the repository at this point in the history
  • Loading branch information
DaughtersOfNyx committed Oct 6, 2024
1 parent 43a6c04 commit 6b4f94b
Showing 1 changed file with 19 additions and 10 deletions.
29 changes: 19 additions & 10 deletions src/mahoji/mahojiSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}.`
];
}
}

Expand All @@ -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(', ')}.`
];
}
}
}
Expand Down Expand Up @@ -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}.`
];
}
}

Expand Down

0 comments on commit 6b4f94b

Please sign in to comment.