Optionally you can look up the spawns for a specific boss
All checks were successful
Build and push / changes (push) Successful in 4s
Build and push / Lint-Python (push) Successful in 1s
Build and push / Build-and-Push-Docker (push) Successful in 2m55s
Build and push / sync-argocd-app (push) Successful in 2s
Build and push / post-status-to-discord (push) Successful in 33s

This commit is contained in:
Luke R 2024-11-18 11:49:19 -08:00
parent 8426f00911
commit fde5e85d51

View File

@ -112,7 +112,7 @@ class Tarkov(commands.Cog):
# Loop through the dataset # Loop through the dataset
for entry in response: for entry in response:
trader_name = entry["name"] trader_name = entry["name"]
if trader_name in ["BTR Driver", "Lightkeeper"]: if trader_name in ["Lightkeeper"]:
break break
# Convert to datetime object # Convert to datetime object
@ -128,95 +128,26 @@ class Tarkov(commands.Cog):
) )
await ctx.send_followup(embed=embed) await ctx.send_followup(embed=embed)
@tarkov.command(
guild_ids=core_utils.my_guilds,
name="lottery",
description="Loadout lottery",
)
async def make_loadout(self, ctx: commands.Context):
weapons = tarkov.request_wiki("Weapons", "Weapons")
armors = tarkov.request_wiki("Armor_vests", "Armor vests")
helmet = tarkov.request_wiki("Headwear", "Headwear")
tarkov.request_wiki("Chest_rigs", "Chest rigs")
backpacks = tarkov.request_wiki("Backpacks", "Backpacks")
gun_mods_trader_level = [
"Use it as it comes from a trader",
tarkov.allowed_level_roll(),
]
tarkov.allowed_level_roll()
embed = discord.Embed(
title="🎲🎰 Loadout Lottery 🎰🎲",
description="Your loadout sir",
color=discord.Color.red(),
type="rich",
)
embed.set_thumbnail(url="https://i.ytimg.com/vi/8He5q7qOzNw/maxresdefault.jpg")
embed.add_field(
name="Armor",
inline=False,
value=random.choice(armors),
)
# if "plate carrier" in armors.lower():
# message += f"\nChest rig: {random.choice(chest_rigs)}"
# embed.add_field(
# name="Armor Trader Level",
# inline=False,
# value=armor_trader_level,
# )
embed.add_field(
name="Weapon",
inline=False,
value=random.choice(weapons),
)
embed.add_field(
name="Ammo Trader level",
inline=False,
value=tarkov.allowed_level_roll()
+ ", "
+ f"{str(random.randint(1,5))} magazines",
)
embed.add_field(
name="Gun mods trader level",
inline=False,
value=random.choice(gun_mods_trader_level),
)
embed.add_field(
name="Helmet",
inline=False,
value=random.choice(helmet),
)
embed.add_field(
name="Backpack",
inline=False,
value=random.choice(backpacks),
)
embed.add_field(name="Ears", inline=False, value=tarkov.allowed_level_roll())
embed.add_field(
name="Throwables", inline=False, value=tarkov.allowed_level_roll()
)
embed.add_field(name="Meds", inline=False, value=tarkov.allowed_level_roll())
await ctx.defer()
await ctx.send_followup(embed=embed)
@tarkov.command( @tarkov.command(
guild_ids=core_utils.my_guilds, guild_ids=core_utils.my_guilds,
name="spawns", name="spawns",
description="Boss spawn chances per map", description="Boss spawn chances per map",
) )
async def boss_spawns(self, ctx: commands.Context): async def boss_spawns(
self,
ctx: commands.Context,
boss_name: discord.Option(
str,
autocomplete=discord.utils.basic_autocomplete(get_all_bosses),
description="The boss you want to look up",
required=False,
),
):
await ctx.defer() await ctx.defer()
embed = discord.Embed( embed = discord.Embed(
description="-------", color=discord.Color.blue(), type="rich" description="-------",
color=discord.Color.blue(),
type="rich",
) )
embed.set_author(name="🎲 Boss Spawn chances by map 🎲") embed.set_author(name="🎲 Boss Spawn chances by map 🎲")
@ -224,12 +155,25 @@ class Tarkov(commands.Cog):
levels = tarkov.get_tarkov_boss_info() levels = tarkov.get_tarkov_boss_info()
if not boss_name:
for key, value in levels.items(): for key, value in levels.items():
embed.add_field( embed.add_field(
name=key, name=key,
value="\n".join(f"{k}: {v['spawnChance']}" for k, v in value.items()), value="\n".join(
f"{k}: {v['spawnChance']}" for k, v in value.items()
),
inline=False, inline=False,
) )
else:
for key, value in levels.items():
if boss_name in value:
embed.add_field(
name=key,
value=f"{boss_name}: {value[boss_name]['spawnChance']}",
inline=False,
)
# break
embed.set_footer(text="Pulled from the api") embed.set_footer(text="Pulled from the api")
await ctx.send_followup(embed=embed) await ctx.send_followup(embed=embed)