From c52fb861ae0fa414c93f87736b0fc46e4613bc68 Mon Sep 17 00:00:00 2001 From: DigiDuncan Date: Wed, 29 Nov 2023 16:13:00 -0500 Subject: [PATCH] clean up StatBox --- changelogs/3.8.md | 2 +- sizebot/lib/proportions.py | 9 +-------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/changelogs/3.8.md b/changelogs/3.8.md index 263162bf..0148ba75 100644 --- a/changelogs/3.8.md +++ b/changelogs/3.8.md @@ -44,7 +44,7 @@ It seems every update I add a giant feature no one is going to use. From scale e 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! This was a hard desicion for me for a lot of reasons. -Firstly, I wanted to ensure I was always *in* the servers that had SizeBot; partially so I could help support it, and partially so I knew my efforts were going towards communities that I could help directly. However, now, my involvement with any communities has become largely diminished, and it feels disingenious to continue pretending as if there's much difference between servers I'm in and server's I'm not. +Firstly, I wanted to ensure I was always *in* the servers that had SizeBot; partially so I could help support it, and partially so I knew my efforts were going towards communities that I could help directly. However, now, my involvement with any communities has become largely diminished, and it feels disingenious to continue pretending as if there's much difference between servers I'm in and servers I'm not. Secondly, I want the service I've built here to not be linked to me, strictly. I'm not the only one who works or has worked on SizeBot, and I hope that it's usefulness exceed what I alone can do. Thirdly, I want communities that I would never have thought of; artist groups, D&D guilds, game designers; to be able to use and suggest features for the bot. I am but one person, and my imagination alone shouldn't be the limit for this bot's capabilites. diff --git a/sizebot/lib/proportions.py b/sizebot/lib/proportions.py index 082acbe1..583018be 100644 --- a/sizebot/lib/proportions.py +++ b/sizebot/lib/proportions.py @@ -158,7 +158,7 @@ def __init__(self, user: User, stats: list[StatValue] = None): sv = s.set(self.user) self.stats.append(sv) found_stats[sv.stat.sets] = sv.value - # FInd the everything else + # Find the everything else loops = 0 while len(all_stats) != len(found_stats): loops += 1 @@ -173,9 +173,6 @@ def __init__(self, user: User, stats: list[StatValue] = None): @property def scaled(self) -> StatBox: - # TODO: THIS DOES NOT WORK. - # .as_dict() is for the base user, so when it goes to do the calculations, it's not using the new one. - # This only affects equations with power = 0. scaled_stat_box = self.partial_scaled_dict new_stats = [] for s in self.stats: @@ -188,10 +185,6 @@ def get(self, stat_name: str) -> StatValue | None: g = (s for s in self.stats if s.stat.sets == stat_name) return next(g, None) - @property - def as_dict(self) -> dict: - return {s.stat.sets: s.value for s in self.stats if s.value is not None} - @property def partial_scaled_dict(self) -> dict: known_stats = {}