|
|
@@ -3,7 +3,7 @@ import discord
|
|
|
import random
|
|
|
from typing import Optional
|
|
|
from query.channel import get_games
|
|
|
-from query.user import is_ignored, get_level, get_xp, level_up
|
|
|
+from query.user import is_ignored, get_level, get_xp, level_up, get_ability_points_spent, increment_all_coin, get_coin
|
|
|
from local_settings import COMMAND_PREFIX
|
|
|
|
|
|
def setup(bot: commands.Bot):
|
|
|
@@ -42,10 +42,12 @@ class Games(commands.Cog):
|
|
|
await ctx.send(f"`{user}` is not playing.")
|
|
|
else:
|
|
|
xp_spent, total_xp = await get_xp(self.bot.pg, user.id)
|
|
|
+ ability_points_spent = await get_ability_points_spent(self.bot.pg, user.id)
|
|
|
+ coin = await get_coin(self.bot.pg, user.id)
|
|
|
if ctx.author == user:
|
|
|
- await ctx.send(f"You rank at level {level}. ({xp_spent}/{total_xp})")
|
|
|
+ await ctx.send(f"You rank at level {level}. (exp {xp_spent}/{total_xp} | abp {ability_points_spent}/{level * 3} | coin {coin})")
|
|
|
else:
|
|
|
- await ctx.send(f"`{user}` ranks at level {level}. ({xp_spent}/{total_xp})")
|
|
|
+ await ctx.send(f"`{user}` ranks at level **{level}**. (**{xp_spent}**/{total_xp} | abp {ability_points_spent}/{level * 3}) | coin {coin}")
|
|
|
|
|
|
@commands.command(
|
|
|
description="Check the experience points for a player.",
|
|
|
@@ -64,10 +66,20 @@ class Games(commands.Cog):
|
|
|
|
|
|
if not user:
|
|
|
xp_spent, total_xp = await get_xp(self.bot.pg, ctx.author.id)
|
|
|
- await ctx.send(f"You have spent {xp_spent} experience points of your {total_xp} total.")
|
|
|
+ level = await get_level(self.bot.pg, ctx.author.id)
|
|
|
+ threshold = (level + 1) * 50 + xp_spent
|
|
|
+ if threshold < total_xp - xp_spent:
|
|
|
+ await ctx.send(f"You have spent {xp_spent} experience points of your {total_xp} total and can gain 3 ability points for {threshold} xp.")
|
|
|
+ else:
|
|
|
+ await ctx.send(f"You have spent {xp_spent} experience points of your {total_xp} total and require {threshold - (total_xp - xp_spent)} xp to `{COMMAND_PREFIX}levelup`.")
|
|
|
else:
|
|
|
xp_spent, total_xp = await get_xp(self.bot.pg, user.id)
|
|
|
- await ctx.send(f"`{user}` has spent {xp_spent} of {total_xp} experience points.")
|
|
|
+ level = await get_level(self.bot.pg, user.id)
|
|
|
+ threshold = (level + 1) * 50 + xp_spent
|
|
|
+ if threshold < total_xp - xp_spent:
|
|
|
+ await ctx.send(f"`{user}` has spent {xp_spent} of {total_xp} experience points and can level up for {threshold} xp.")
|
|
|
+ else:
|
|
|
+ await ctx.send(f"`{user}` has spent {xp_spent} of {total_xp} experience points and requires {threshold - (total_xp - xp_spent)} xp to level up.")
|
|
|
|
|
|
@commands.command(
|
|
|
description="Attempt to gain a level.",
|
|
|
@@ -92,7 +104,8 @@ class Games(commands.Cog):
|
|
|
await ctx.send(f"Not yet, you require {threshold - xp_available} more XP to level up.")
|
|
|
else:
|
|
|
await level_up(self.bot.pg, ctx.author.id, threshold)
|
|
|
- await ctx.send(f"You have climbed the ranks for {threshold} XP, leaving you {xp_available - threshold} remaining.")
|
|
|
+ await ctx.send(f"You have gained three ability points climbed the ranks for {threshold} XP, leaving you {xp_available - threshold} remaining.")
|
|
|
+ await increment_all_coin(self.bot.pg)
|
|
|
|
|
|
|
|
|
@commands.command(
|