Skip to content

Commit

Permalink
start StatBox
Browse files Browse the repository at this point in the history
  • Loading branch information
DigiDuncan committed Nov 26, 2023
1 parent 4b0f2d6 commit d9a5fd0
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions sizebot/lib/proportions.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ def __init__(self, name: str,
self.userkey = userkey
self.default_from = default_from

def set(self, user):
def set(self, user: User):
value = None
if self.userkey is not None:
value = user.stats[self.userkey]
if self.default_from is not None and value is None:
value = self.default_from(user.baseheight)
value = self.default_from(user.stats)
return StatValue(self, value)

def scale_value(self, value, scale):
Expand All @@ -75,7 +75,7 @@ def __str__(self):
return f"{self.stat.name}: {self.value}"


allStats = [
all_stats = [
Stat("Height", sets="height", power=1, userkey="baseheight"),
Stat("Weight", sets="weight", power=3, userkey="baseweight"),
Stat("Gender", sets="gender", userkey="gender"),
Expand Down Expand Up @@ -126,6 +126,10 @@ def __str__(self):
]


class StatBox:
def __init__(self, user: User):
self.stats = [s.set(user) for s in all_stats]


def change_user(guildid: int, userid: int, changestyle: str, amount: SV):
changestyle = changestyle.lower()
Expand Down

0 comments on commit d9a5fd0

Please sign in to comment.