From 8c0cc75093e7b547501a5ffb7de2554ea57c0679 Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh <102361830+SeaswimmerTheFsh@users.noreply.github.com> Date: Wed, 5 Apr 2023 22:42:08 -0400 Subject: [PATCH] added insurance command and subcommands --- galaxy/galaxy.py | 134 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 134 insertions(+) diff --git a/galaxy/galaxy.py b/galaxy/galaxy.py index 1712e0d..5ac1dad 100644 --- a/galaxy/galaxy.py +++ b/galaxy/galaxy.py @@ -118,6 +118,140 @@ class Galaxy(commands.Cog): await ctx.send(embed=embed) await ctx.message.delete() + @commands.group(autohelp=True) + async def insurance(self, ctx: commands.Context): + """Calculates insurance.""" + + @insurance.command() + async def miner(self, ctx: commands.Context, cost: int): + """Calculates insurance for miners.""" + insurance_amount = cost * 0.7 + output = (f'{insurance_amount:,}') + cost_output = (f'{cost:,}') + ship_class = "Miner" + embed = discord.Embed(title="Insurance Cost", color=await self.bot.get_embed_color(None)) + embed.add_field(name="Ship Class", content={ship_class}) + embed.add_field(name="Ship Cost", content={cost_output}) + embed.add_field(name="Insurance Amount", content={output}) + await ctx.send(embed=embed) + + @insurance.command() + async def freighter(self, ctx: commands.Context, cost: int): + """Calculates insurance for freighters.""" + insurance_amount = cost * 0.65 + output = (f'{insurance_amount:,}') + cost_output = (f'{cost:,}') + ship_class = "Freighter" + embed = discord.Embed(title="Insurance Cost", color=await self.bot.get_embed_color(None)) + embed.add_field(name="Ship Class", content={ship_class}) + embed.add_field(name="Ship Cost", content={cost_output}) + embed.add_field(name="Insurance Amount", content={output}) + await ctx.send(embed=embed) + + @insurance.command() + async def frigate(self, ctx: commands.Context, cost: int): + """Calculates insurance for frigates.""" + insurance_amount = cost * 0.6 + output = (f'{insurance_amount:,}') + cost_output = (f'{cost:,}') + ship_class = "Frigate" + embed = discord.Embed(title="Insurance Cost", color=await self.bot.get_embed_color(None)) + embed.add_field(name="Ship Class", content={ship_class}) + embed.add_field(name="Ship Cost", content={cost_output}) + embed.add_field(name="Insurance Amount", content={output}) + await ctx.send(embed=embed) + + @insurance.command() + async def destroyer(self, ctx: commands.Context, cost: int): + """Calculates insurance for destroyers.""" + insurance_amount = cost * 0.55 + output = (f'{insurance_amount:,}') + cost_output = (f'{cost:,}') + ship_class = "Destroyer" + embed = discord.Embed(title="Insurance Cost", color=await self.bot.get_embed_color(None)) + embed.add_field(name="Ship Class", content={ship_class}) + embed.add_field(name="Ship Cost", content={cost_output}) + embed.add_field(name="Insurance Amount", content={output}) + await ctx.send(embed=embed) + + @insurance.command() + async def cruiser(self, ctx: commands.Context, cost: int): + """Calculates insurance for cruisers.""" + insurance_amount = cost * 0.7 + output = (f'{insurance_amount:,}') + cost_output = (f'{cost:,}') + ship_class = "Cruiser" + embed = discord.Embed(title="Insurance Cost", color=await self.bot.get_embed_color(None)) + embed.add_field(name="Ship Class", content={ship_class}) + embed.add_field(name="Ship Cost", content={cost_output}) + embed.add_field(name="Insurance Amount", content={output}) + await ctx.send(embed=embed) + + @insurance.command() + async def battlecruiser(self, ctx: commands.Context, cost: int): + """Calculates insurance for battlecruisers.""" + insurance_amount = cost * 0.4 + output = (f'{insurance_amount:,}') + cost_output = (f'{cost:,}') + ship_class = "Battlecruiser" + embed = discord.Embed(title="Insurance Cost", color=await self.bot.get_embed_color(None)) + embed.add_field(name="Ship Class", content={ship_class}) + embed.add_field(name="Ship Cost", content={cost_output}) + embed.add_field(name="Insurance Amount", content={output}) + await ctx.send(embed=embed) + + @insurance.command() + async def battleship(self, ctx: commands.Context, cost: int): + """Calculates insurance for battleships.""" + insurance_amount = cost * 0.35 + output = (f'{insurance_amount:,}') + cost_output = (f'{cost:,}') + ship_class = "Battleship" + embed = discord.Embed(title="Insurance Cost", color=await self.bot.get_embed_color(None)) + embed.add_field(name="Ship Class", content={ship_class}) + embed.add_field(name="Ship Cost", content={cost_output}) + embed.add_field(name="Insurance Amount", content={output}) + await ctx.send(embed=embed) + + @insurance.command() + async def dreadnought(self, ctx: commands.Context, cost: int): + """Calculates insurance for Dreadnoughts.""" + insurance_amount = cost * 0.3 + output = (f'{insurance_amount:,}') + cost_output = (f'{cost:,}') + ship_class = "Dreadnought" + embed = discord.Embed(title="Insurance Cost", color=await self.bot.get_embed_color(None)) + embed.add_field(name="Ship Class", content={ship_class}) + embed.add_field(name="Ship Cost", content={cost_output}) + embed.add_field(name="Insurance Amount", content={output}) + await ctx.send(embed=embed) + + @insurance.command() + async def carrier(self, ctx: commands.Context, cost: int): + """Calculates insurance for carriers.""" + insurance_amount = cost * 0.3 + output = (f'{insurance_amount:,}') + cost_output = (f'{cost:,}') + ship_class = "Carrier" + embed = discord.Embed(title="Insurance Cost", color=await self.bot.get_embed_color(None)) + embed.add_field(name="Ship Class", content={ship_class}) + embed.add_field(name="Ship Cost", content={cost_output}) + embed.add_field(name="Insurance Amount", content={output}) + await ctx.send(embed=embed) + + @insurance.command() + async def supercapital(self, ctx: commands.Context, cost: int): + """Calculates insurance for Super Capitals.""" + insurance_amount = cost * 0.25 + output = (f'{insurance_amount:,}') + cost_output = (f'{cost:,}') + ship_class = "Super Capital" + embed = discord.Embed(title="Insurance Cost", color=await self.bot.get_embed_color(None)) + embed.add_field(name="Ship Class", content={ship_class}) + embed.add_field(name="Ship Cost", content={cost_output}) + embed.add_field(name="Insurance Amount", content={output}) + await ctx.send(embed=embed) + @commands.command(aliases=["wh"]) async def warehouse(self, ctx: commands.Context, lvlfrom: int = 1, lvlto: int = 38): """Calculates the total cost to upgrade your warehouse from a level to a level."""