feat: added world zero cog

This commit is contained in:
Seaswimmer 2023-08-06 21:48:18 -04:00
parent 28c9373fdd
commit c86f0aee2c
No known key found for this signature in database
GPG key ID: 5019678FD9CF50D8
3 changed files with 44 additions and 0 deletions

5
worldzero/__init__.py Normal file
View file

@ -0,0 +1,5 @@
from .worldzero import WorldZero
def setup(bot):
bot.add_cog(WorldZero(bot))

8
worldzero/info.json Normal file
View file

@ -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."
}

31
worldzero/worldzero.py Normal file
View file

@ -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)