diff --git a/worldzero/__init__.py b/worldzero/__init__.py new file mode 100644 index 0000000..418b5a2 --- /dev/null +++ b/worldzero/__init__.py @@ -0,0 +1,5 @@ +from .worldzero import WorldZero + + +def setup(bot): + bot.add_cog(WorldZero(bot)) diff --git a/worldzero/info.json b/worldzero/info.json new file mode 100644 index 0000000..a240057 --- /dev/null +++ b/worldzero/info.json @@ -0,0 +1,8 @@ +{ + "author" : ["SeaswimmerTheFsh"], + "install_msg" : "Thank you for installing World Zero!\nYou can find the source code of this cog here: https://github.com/SeaswimmerTheFsh/GalaxyCogs", + "name" : "World Zero", + "short" : "This cog is meant to provide random functions for my crippling World Zero addiction!", + "description" : "This cog is meant to provide random functions for my crippling World Zero addiction!", + "end_user_data_statement" : "This cog does not store any End User Data." +} diff --git a/worldzero/worldzero.py b/worldzero/worldzero.py new file mode 100644 index 0000000..a215873 --- /dev/null +++ b/worldzero/worldzero.py @@ -0,0 +1,31 @@ +from redbot.core import commands +import discord + +class WorldZero(commands.Cog): + """This cog is meant to provide random functions for my crippling World Zero addiction! + Developed by SeaswimmerTheFsh.""" + + def __init__(self, bot): + self.bot = bot + + @commands.group(name="worldzero", invoke_without_command=True, aliases=['wz']) + async def worldzero(self, ctx: commands.Context): + """Tells the user that this command doesn't do anything currently.""" + await ctx.send("This command doesn't do anything currently, have you tried a subcommand?\nCurrent subcommands:\n`-worldzero upgrade` - Checks what the attack power/defense power of an item will be after upgrading it.") + + @worldzero.command(name="upgrade") + async def worldzero_upgrade(self, ctx: commands.Context, power_amount: str, upgrade_amount: str): + """Checks what the attack power/defense power of an item will be after upgrading it.""" + try: + stat_int = int(f"{power_amount}".replace(",", "")) + upgrade_int = int(f"{upgrade_amount}".replace(",", "")) + except ValueError: + await ctx.send(content="Please input a number!") + return + math = round(stat_int + ((stat_int/15)*upgrade_int)) + output_from = f'{stat_int:,}' + output_to = f'{math:,}' + embed = discord.Embed(color=await self.bot.get_embed_color(None)) + embed.add_field(name="Default Power", value=f"{output_from}", inline=False) + embed.add_field(name="Upgraded Power", value=f"{output_to}", inline=False) + await ctx.send(embed=embed)