Fix logic for calculating spawn chance
All checks were successful
Build and push / changes (push) Successful in 4s
Build and push / Lint-Python (push) Successful in 6s
Build and push / Build-and-Push-Docker (push) Successful in 19s
Build and push / sync-argocd-app (push) Successful in 3s

This commit is contained in:
Luke R 2024-11-06 09:16:48 -08:00
parent 6f0114e0d2
commit 7fe15d4a8a
2 changed files with 2 additions and 5 deletions

View File

@ -175,10 +175,7 @@ class Tarkov(commands.Cog):
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( value="\n".join(f"{k}: {v['spawnChance']}" for k, v in value.items()),
f"{k}: **{str(round(v['spawnChance'],2))}%**"
for k, v in value.items()
),
inline=False, inline=False,
) )
embed.set_footer(text=f"Pulled from the api") embed.set_footer(text=f"Pulled from the api")

View File

@ -75,7 +75,7 @@ def tarkov_boss_info():
"escorts": sum( "escorts": sum(
escort["amount"][0]["count"] for escort in boss["escorts"] escort["amount"][0]["count"] for escort in boss["escorts"]
), ),
"spawnChance": f"**{str(round(boss['spawnChance'],2))}%**", "spawnChance": f"**{str(round(boss['spawnChance'] * 100, 2))}%**",
"picture": boss["boss"]["imagePortraitLink"], "picture": boss["boss"]["imagePortraitLink"],
} }
for boss in level["bosses"] for boss in level["bosses"]