Skip to content

Commit

Permalink
Add Infernum's Scroll which refreshes your daily quest (#301)
Browse files Browse the repository at this point in the history
  • Loading branch information
Iapetus-11 authored Jul 2, 2024
1 parent 8c00807 commit b341834
Show file tree
Hide file tree
Showing 9 changed files with 58 additions and 29 deletions.
7 changes: 7 additions & 0 deletions bot/cogs/commands/econ.py
Original file line number Diff line number Diff line change
Expand Up @@ -1738,6 +1738,13 @@ async def use_item(self, ctx: Ctx, *, thing):
await ctx.reply_embed(ctx.l.econ.use.use_time_pearl)
return

if thing == "infernum's scroll":
await self.db.remove_item(ctx.author.id, "Infernum's Scroll", 1)
await self.db.delete_user_daily_quest(ctx.author.id)

await ctx.reply_embed(ctx.l.econ.use.use_infernums_scroll)
return

await ctx.reply_embed(ctx.l.econ.use.stupid_6)

@commands.command(name="honey", aliases=["harvesthoney", "horny"])
Expand Down
23 changes: 15 additions & 8 deletions bot/cogs/core/mobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,16 +342,15 @@ async def _spawn_event(self, ctx: Ctx):

await ctx.send_embed(
random.choice(ctx.l.mobs_mech.found).format(
balls_won,
self.d.emojis.slimeball,
f"{balls_won}{self.d.emojis.slimeball}"
),
)
# if mob is skeleton determine if it should drop bone meal
elif mob_key == "skeleton" and random.randint(0, 20 - (looting_level * 3)) == 1:
await self.db.add_item(user.id, "Bone Meal", 512, 1)

await ctx.send_embed(
random.choice(ctx.l.mobs_mech.found).format(1, self.d.emojis.bone_meal),
random.choice(ctx.l.mobs_mech.found).format(f"1{self.d.emojis.bone_meal}"),
)
# if mob is enderman determine if it should drop enderpearl
elif mob_key == "enderman" and random.randint(0, 30 - (looting_level * 3)) == 1:
Expand All @@ -361,11 +360,10 @@ async def _spawn_event(self, ctx: Ctx):

await ctx.send_embed(
random.choice(ctx.l.mobs_mech.found).format(
pearls_won,
self.d.emojis.ender_pearl,
f"{pearls_won}{self.d.emojis.ender_pearl}"
),
)
# mob should just drop emeralds
# mob should just drop normal rewards
else:
# calculate emeralds won based off difficulty
if difficulty == "easy":
Expand All @@ -382,15 +380,24 @@ async def _spawn_event(self, ctx: Ctx):
)

ems_won = int((ems_won if ems_won > 0 else 1) * difficulty_multi)

# increase ems won depending on looting_level
ems_won = int(ems_won * ({0: 1, 1: 1.25, 2: 1.75}[looting_level]))

reward_info: list[tuple[str, int]] = [
(self.d.emojis.emerald, ems_won),
]

if random.randint(0, 40 - (looting_level * 3)) == 1:
reward_info.append((self.d.emojis.infernums_scroll, 1))
await self.db.add_item(user.id, "Infernum's Scroll", 512, 1, False, True)

await self.db.balance_add(user.id, ems_won)
await self.db.update_lb(user.id, "week_emeralds", 1, "add")

await ctx.send_embed(
random.choice(ctx.l.mobs_mech.found).format(ems_won, self.d.emojis.emerald),
random.choice(ctx.l.mobs_mech.found).format(
" + ".join([f"{amount}{emoji}" for emoji, amount in reward_info])
),
)

await self.db.update_lb(user.id, "mobs_killed", 1, "add")
Expand Down
11 changes: 6 additions & 5 deletions bot/data/text/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1321,11 +1321,11 @@
"You ran into a vicious {0}!"
],
"found": [
"Wow look at that! You found {}{} just right there on the ground!",
"Through the white smoke from the slain mob you spot {}{}!",
"The mob drops {}{}!",
"You glance at the ground and see {}{}!",
"You find {}{} next to the fallen mob!"
"Wow look at that! You found {} just right there on the ground!",
"Through the white smoke from the slain mob you spot {}!",
"The mob drops {}!",
"You glance at the ground and see {}!",
"You find {} next to the fallen mob!"
],
"lost": {
"creeper": [
Expand Down Expand Up @@ -2032,6 +2032,7 @@
"beaker_of_slime_undo": "You've converted {0}x **Beaker Of Slime** into {0}x **Slime Ball**!",
"use_shield_pearl": "You've used a **Shield Pearl** and are now invincible against pillagers for the next month.",
"use_time_pearl": "You've used a **Time Pearl** which has skipped time forwards two days.",
"use_infernums_scroll": "You've used **Infernum's Scroll**, your daily quest has been re-rolled :game_die:",
"present": [
"You opened your present and found 1x **{}** (Worth {}{})!",
"You tore off the wrapping paper as fast as you could and got 1x **{}** (Worth {}{})!",
Expand Down
11 changes: 6 additions & 5 deletions bot/data/text/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -1321,11 +1321,11 @@
"¡Te encontraste con un vil {0}!"
],
"found": [
"¡Wow, mira eso! Encontraste {}{} justo ahí en el suelo",
"¡A través del humo blanco del monstruo asesinado se ven {}{}!",
"¡El monstruo deja caer {}{}!",
"¡Miras al suelo y ves {}{}!",
"¡Encuentras {}{} junto al monstruo caído!"
"¡Wow, mira eso! Encontraste {} justo ahí en el suelo",
"¡A través del humo blanco del monstruo asesinado se ven {}!",
"¡El monstruo deja caer {}!",
"¡Miras al suelo y ves {}!",
"¡Encuentras {} junto al monstruo caído!"
],
"lost": {
"creeper": [
Expand Down Expand Up @@ -2032,6 +2032,7 @@
"beaker_of_slime_undo": "¡Has convertido {0}x **Recipiente(s) de Slime** en {0}x **Bola(s) de Slime**!",
"use_shield_pearl": "Has usado una **Escudo de Perla** y ahora eres invencible a los saqueadores por todo el mes.",
"use_time_pearl": "Usaste una **Perla del Tiempo** la cuál adelantó el tiempo 2 días.",
"use_infernums_scroll": "Has usado **Infernum's Scroll**, tu misión diaria ha sido reiniciada :game_die:",
"present": [
"¡Abriste tu regalo y encontraste 1x **{}** (Vale {}{})!",
"¡Arrancaste el papel de regalo tan rápido como pudiste y conseguiste 1x **{}** (Vale {}{})!",
Expand Down
11 changes: 6 additions & 5 deletions bot/data/text/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -1321,11 +1321,11 @@
"Tu as rencontré un {0} vicieux !"
],
"found": [
"Wow regarde ça ! Tu as trouvé {}{} juste là sur le sol",
"A travers la fumée blanche du monstre vaincu tu aperçois {}{}!",
"Le monstre laisse tomber {}{}",
"Tu regardes par terre et vois {}{}",
"Tu trouves {}{} à côté du monstre tombé au combat"
"Wow regarde ça ! Tu as trouvé {} juste là sur le sol",
"A travers la fumée blanche du monstre vaincu tu aperçois {}!",
"Le monstre laisse tomber {}",
"Tu regardes par terre et vois {}",
"Tu trouves {} à côté du monstre tombé au combat"
],
"lost": {
"creeper": [
Expand Down Expand Up @@ -2032,6 +2032,7 @@
"beaker_of_slime_undo": "Tu as transformé {0}x **Beaker Of Slime** en {0}x **Slime Ball** !",
"use_shield_pearl": "Tu as utilisé une **Shield Pearl** qui te rend invincible au pillages pendant un mois.",
"use_time_pearl": "**Tu as utilisé une **Time Pearl** qui t'as téléportée deux jours dans le futur.",
"use_infernums_scroll": "Vous avez utilisé le **Infernum's Scroll**, votre quête quotidienne a été réinitialisée :game_die:",
"present": [
"Tu ouvre ton cadeau et trouve 1x **{}** (Valant {}{})!",
"Tu déchiquettes le papier cadeau aussi vite que tu le peux et obtiens 1x **{}** (Valant {}{})!",
Expand Down
11 changes: 6 additions & 5 deletions bot/data/text/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -1321,11 +1321,11 @@
"Você se deparou com um {0} vicioso!"
],
"found": [
"Uau, olha isso! Você encontrou {}{} bem ali no chão!",
"Através da fumaça branca dos monstros que matou você avista {}{}!",
"O monstro deixou cair {}{}!",
"Você olha para o chão e vê {}{}!",
"Você encontra {}{} ao lado de monstros caídos!"
"Uau, olha isso! Você encontrou {} bem ali no chão!",
"Através da fumaça branca dos monstros que matou você avista {}!",
"O monstro deixou cair {}!",
"Você olha para o chão e vê {}!",
"Você encontra {} ao lado de monstros caídos!"
],
"lost": {
"creeper": [
Expand Down Expand Up @@ -2032,6 +2032,7 @@
"beaker_of_slime_undo": "Você converteu {0}x **Copos de Slime** em {0}x **Bolas de Slime**!",
"use_shield_pearl": "Você usou um **Shield Pearl** e agora está invencível contra saqueadores pelo próximo mês.",
"use_time_pearl": "Você usou uma **Time Pearl** que avançou dois dias no tempo.",
"use_infernums_scroll": "Você usou o **Infernum's Scroll**, sua missão diária foi alterada :game_die:",
"present": [
"Você abriu o seu presente e encontrou 1x **{}** (Vale {}{})!",
"Você rasgou o papel de embrulho o mais rápido que pôde e conseguiu 1x **{}** (Vale {}{})!",
Expand Down
1 change: 1 addition & 0 deletions bot/models/translation.py
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,7 @@ class Econ_Use(ImmutableBaseModel):
beaker_of_slime_undo: str
use_shield_pearl: str
use_time_pearl: str
use_infernums_scroll: str
present: list[str]
barrel_item: list[str]
barrel_ems: list[str]
Expand Down
11 changes: 10 additions & 1 deletion common/data/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -1325,6 +1325,13 @@
"rarity": 16384,
"sticky": false,
"tags": ["mine", "fish", "4july"]
},
{
"item": "Infernum's Scroll",
"sell_price": 512,
"rarity": 8192,
"sticky": false,
"tags": ["mine"]
}
],
"rpt_ignore": [
Expand Down Expand Up @@ -1545,6 +1552,7 @@
"bomb": "\uD83D\uDCA3",
"firecracker": "\uD83E\uDDE8",
"scroll": "\uD83D\uDCDC",
"infernums_scroll": "<:infernums_scroll:1257669297770205306>",
"farming": {
"growing": {
"emerald_fruit": "<:emerald_fruit_growing:927292976756031551>",
Expand Down Expand Up @@ -1810,7 +1818,8 @@
"Hot Dog": "hot_dog",
"Komodo 30000 SuperNova Aerial Firework": "bomb",
"Firecracker": "firecracker",
"Declaration Of Independence": "scroll"
"Declaration Of Independence": "scroll",
"Infernum's Scroll": "infernums_scroll"
},
"farming": {
"emojis": {
Expand Down
1 change: 1 addition & 0 deletions common/models/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ class ProgressBarSetEmojis(ImmutableBaseModel):
bomb: str
firecracker: str
scroll: str
infernums_scroll: str
farming: FarmingEmojis
reees: list[str]
fish: FishEmojis
Expand Down

0 comments on commit b341834

Please sign in to comment.