diff --git a/bot/cogs/core/quests.py b/bot/cogs/core/quests.py index 4213380a..acbac72d 100644 --- a/bot/cogs/core/quests.py +++ b/bot/cogs/core/quests.py @@ -41,7 +41,9 @@ def __init__(self, bot: VillagerBotCluster): def db(self) -> "Database": return typing.cast("Database", self.bot.get_cog("Database")) - def get_quest_embed(self, loc: CustomContext | commands.Context | discord.User, quest: UserQuest): + def get_quest_embed( + self, loc: CustomContext | commands.Context | discord.User, quest: UserQuest + ): lang = self.bot.l["en"] if isinstance(loc, CustomContext | commands.Context): lang = loc.l @@ -118,7 +120,13 @@ async def get_random_quest_to_store(self, user_id: int) -> typing.TypedDict( quest_key: str = random.choice(list(self.d.normalized_quests.keys())) quest_def = self.d.normalized_quests[quest_key] - while quest_def.required_item and await self.db.fetch_item(user_id, quest_def.required_item) is None: + while ( + quest_def.required_item + and all( + await self.db.fetch_item(user_id, required_item) is None + for required_item in quest_def.required_item.split(' | ') + ) + ): quest_key: str = random.choice(list(self.d.normalized_quests.keys())) quest_def = self.d.normalized_quests[quest_key] diff --git a/common/data/data.json b/common/data/data.json index d7261395..244df5cb 100644 --- a/common/data/data.json +++ b/common/data/data.json @@ -2747,6 +2747,7 @@ }, "difficulty_eval_multi": "2 if pickaxe_level > 4 else 1", "acceptance_eval": "value >= target", + "required_item": "Iron Sword | Gold Sword | Diamond Sword | Netherite Sword", "reward_item": "emerald", "emoji": "stevegun" }, @@ -2759,6 +2760,7 @@ }, "difficulty_eval_multi": "2 if pickaxe_level > 4 else 1", "acceptance_eval": "value >= target", + "required_item": "Diamond Sword | Netherite Sword", "reward_item": "emerald", "emoji": "stevegun" }, @@ -2771,6 +2773,7 @@ }, "difficulty_eval_multi": "2 if pickaxe_level > 4 else 1", "acceptance_eval": "value >= target", + "required_item": "Gold Sword | Diamond Sword | Netherite Sword", "reward_item": "emerald", "emoji": "stevegun" }