Skip to content

Commit

Permalink
universe radii for quake
Browse files Browse the repository at this point in the history
  • Loading branch information
DigiDuncan committed Dec 3, 2023
1 parent 3ce3735 commit f70297d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 6 additions & 2 deletions sizebot/cogs/quake.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
import discord
from discord.ext import commands

from sizebot.lib.constants import colors
from sizebot.lib.constants import colors, emojis
from sizebot.lib.fakeplayer import FakePlayer
from sizebot.lib.quake import breath_joules, joules_to_mag, jump_joules, mag_to_name, mag_to_radius, poke_joules, step_joules, stomp_joules
from sizebot.lib.units import SV
from sizebot.lib.userdb import load_or_fake
from sizebot.lib.errors import UserMessedUpException

EARTH_RAD = 10_018_570
UNI_RAD = 4.4E26
QuakeType = typing.Literal["step", "stomp", "jump", "poke", "breath", "breathe"]

class QuakeCog(commands.Cog):
Expand Down Expand Up @@ -51,9 +52,12 @@ async def earthquake(self, ctx, quake_type: typing.Optional[QuakeType] = "step",
print_mag = max(mag, Decimal(0.0))
if rad < EARTH_RAD:
print_rad = f"{rad:,.1mu}"
else:
elif rad < UNI_RAD:
e_rad = rad / EARTH_RAD
print_rad = f"{e_rad:,.2} 🌎"
else:
u_rad = rad / UNI_RAD
print_rad = f"{u_rad:,.2} {emojis.universe}"
e = Embed(
title=f"Earthquake generated by {userdata.nickname} {verb}",
description=f"{userdata.nickname} is {userdata.height:,.3mu} tall, and weighs {userdata.weight:,.3mu}.",
Expand Down
1 change: 1 addition & 0 deletions sizebot/data/constants.ini
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ run_program = "<:run:788307532577636372>"
star = "<:favorite:788307532228722699>"
info = "<:info:788307532586287114>"
error = "<:error:788307532278923275>"
universe = "<:universe_ball:1180685289094660167>"

[colors]
red = 0xFF1F00
Expand Down

0 comments on commit f70297d

Please sign in to comment.