diff --git a/.gitignore b/.gitignore index 14dba18..f2e64de 100644 --- a/.gitignore +++ b/.gitignore @@ -162,7 +162,6 @@ cython_debug/ # token /discordtoken #images -/Reuse/images Reuse/images/legend.png Reuse/images/player_weapons_used.png Reuse/images/leaderboard.png diff --git a/Reuse/getLeaderboard.py b/Reuse/getLeaderboard.py index 29bb03a..5504ea1 100644 --- a/Reuse/getLeaderboard.py +++ b/Reuse/getLeaderboard.py @@ -13,6 +13,8 @@ def getleaderboard(board:str, weaponid="", server="", mapid = "", gamemodeid = " board = "max_distance" if(board.lower() == "kd"): + if(weaponid != ""): + handler = lambda p : response[p]['kills'] / max(response[p]["deaths_while_equipped"], 1) handler = lambda p : response[p]['kills'] / max(response[p]["deaths"], 1) elif(board.lower() == "avgd"): handler = lambda p : response[p]['total_distance'] / max(response[p]["kills"], 1) diff --git a/Reuse/getWeapon.py b/Reuse/getWeapon.py index eec2a1a..2464662 100644 --- a/Reuse/getWeapon.py +++ b/Reuse/getWeapon.py @@ -44,7 +44,8 @@ def getweaponid(givenweapon): "p2016": "mp_weapon_semipistol", "arc grenade": "mp_weapon_grenade_emp", "hemlok": "mp_weapon_hemlok", - "phase shift": "phase_shift" + "phase shift": "phase_shift", + "double barrel shotgun": "mp_weapon_shotgun_doublebarrel" } weaponid = "" diff --git a/Reuse/images/mp_weapon_shotgun_doublebarrel.png b/Reuse/images/mp_weapon_shotgun_doublebarrel.png new file mode 100644 index 0000000..2346f7a Binary files /dev/null and b/Reuse/images/mp_weapon_shotgun_doublebarrel.png differ diff --git a/slashcogs/slashleaderboard.py b/slashcogs/slashleaderboard.py index 38177ef..9778e6b 100644 --- a/slashcogs/slashleaderboard.py +++ b/slashcogs/slashleaderboard.py @@ -52,7 +52,7 @@ class SlashLeaderboard(commands.Cog): @leaderboard.autocomplete("weapon") async def autocomplete_weapon(self, interaction: discord.Interaction, current: str) -> list[app_commands.Choice[str]]: data = [] - weaponlist = ['execution', 'car', 'charge rifle', 'double take', 'epg', 'volt', 'lstar', 'r97', 'r-201', 'smart pistol', 'kraber', 'flatline', 're-45 auto', 'alternator', 'frag grenade', 'g2', 'spitfire', 'smr', 'softball', 'firestar', 'melee', 'mastiff', 'mgl', 'r-101', 'wingman', 'invalid', 'thunderbolt', 'dmr', 'electric smoke', 'cold war', 'satchel', 'eva-8 auto', 'mozambique', 'wingman elite', 'gravity star', 'pulse blade', 'archer', 'outOfBounds', 'mind crime', 'devotion', 'fall', 'p2016', 'arc grenade', 'hemlok', 'phase shift'] + weaponlist = ['execution', 'car', 'charge rifle', 'double take', 'epg', 'volt', 'lstar', 'r97', 'r-201', 'smart pistol', 'kraber', 'flatline', 're-45 auto', 'alternator', 'frag grenade', 'g2', 'spitfire', 'smr', 'softball', 'firestar', 'melee', 'mastiff', 'mgl', 'r-101', 'wingman', 'invalid', 'thunderbolt', 'dmr', 'electric smoke', 'cold war', 'satchel', 'eva-8 auto', 'mozambique', 'wingman elite', 'gravity star', 'pulse blade', 'archer', 'outOfBounds', 'mind crime', 'devotion', 'fall', 'p2016', 'arc grenade', 'hemlok', 'phase shift', 'double barrel shotgun'] for weapon_choice in weaponlist: if(current.lower() in weapon_choice.lower()): data.append(app_commands.Choice(name=weapon_choice, value=weapon_choice)) diff --git a/slashcogs/slashstats.py b/slashcogs/slashstats.py index a400a53..a7af776 100644 --- a/slashcogs/slashstats.py +++ b/slashcogs/slashstats.py @@ -79,7 +79,7 @@ class SlashStats(commands.Cog): @stats.autocomplete("weapon") async def autocomplete_weapon(self, interaction: discord.Interaction, current: str) -> list[app_commands.Choice[str]]: data = [] - weaponlist = ['execution', 'car', 'charge rifle', 'double take', 'epg', 'volt', 'lstar', 'r97', 'r-201', 'smart pistol', 'kraber', 'flatline', 're-45 auto', 'alternator', 'frag grenade', 'g2', 'spitfire', 'smr', 'softball', 'firestar', 'melee', 'mastiff', 'mgl', 'r-101', 'wingman', 'invalid', 'thunderbolt', 'dmr', 'electric smoke', 'cold war', 'satchel', 'eva-8 auto', 'mozambique', 'wingman elite', 'gravity star', 'pulse blade', 'archer', 'outOfBounds', 'mind crime', 'devotion', 'fall', 'p2016', 'arc grenade', 'hemlok', 'phase shift'] + weaponlist = ['execution', 'car', 'charge rifle', 'double take', 'epg', 'volt', 'lstar', 'r97', 'r-201', 'smart pistol', 'kraber', 'flatline', 're-45 auto', 'alternator', 'frag grenade', 'g2', 'spitfire', 'smr', 'softball', 'firestar', 'melee', 'mastiff', 'mgl', 'r-101', 'wingman', 'invalid', 'thunderbolt', 'dmr', 'electric smoke', 'cold war', 'satchel', 'eva-8 auto', 'mozambique', 'wingman elite', 'gravity star', 'pulse blade', 'archer', 'outOfBounds', 'mind crime', 'devotion', 'fall', 'p2016', 'arc grenade', 'hemlok', 'phase shift', 'double barrel shotgun'] for weapon_choice in weaponlist: if(current.lower() in weapon_choice.lower()): data.append(app_commands.Choice(name=weapon_choice, value=weapon_choice))