Skip to content

Commit

Permalink
more descriptive quakes
Browse files Browse the repository at this point in the history
  • Loading branch information
DigiDuncan committed Dec 8, 2023
1 parent 68316c7 commit 9651153
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 2 additions & 0 deletions changelogs/3.8.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ The good news? **SizeBot is now public!** I'll talk later about what this means,
## SizeAPI
It seems every update I add a giant feature no one is going to use. From scale emojis to fake users, and now: **SizeAPI!**

[TO BE WRITTEN]

## Public?!
That's right, SizeBot is now public! Anyone can now add SizeBot to their server and mess around with it. Whether you're an RP group, a public community, a D&D guild, an artist looking for references, or just want to do funny math in the privacy of you're own server dang it, SizeBot is now available!

Expand Down
12 changes: 8 additions & 4 deletions sizebot/lib/quake.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,17 @@ def mag_to_name(mag: float) -> str:
elif mag < 22: # 21 - 23
return "earth-cracking"
elif mag < 25: # 23 - 25
return "earth-crumbling"
d = 10 ** (mag - 22)
return f"earth-crumbling x{d:,.0f}"
elif mag < 32: # 25 - 32
return "sun-shattering"
d = 10 ** (mag - 25)
return f"sun-shattering x{d:,.0f}"
elif mag < 63: # 32 - 63
return "galaxy-collapsing"
d = 10 ** (mag - 32)
return f"galaxy-collapsing x{d:,.0f}"
else: # 63+
return "universe-ending"
d = 10 ** (mag - 63)
return f"universe-ending x{d:,.0f}"

def scale_to_joules(user: User, g: float, factor: float) -> Decimal:
return (Decimal(user.weight / 1000) / 2) * (Decimal(g) * Decimal(user.scale)) * Decimal(factor)
Expand Down

0 comments on commit 9651153

Please sign in to comment.