From 51a45b5a4267ab9f7803e8bdb8f22b126ee51093 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Fri, 4 Feb 2022 17:50:21 +0200 Subject: [PATCH] sdf --- files/classes/treasure.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/files/classes/treasure.py b/files/classes/treasure.py index d45ed5759..f6deff814 100644 --- a/files/classes/treasure.py +++ b/files/classes/treasure.py @@ -1,6 +1,5 @@ import random - class Treasure: special_min = 100 special_max = 1000 @@ -21,20 +20,16 @@ class Treasure: amount = random.randint(self.special_min, self.special_max) elif is_standard: amount = random.randint(self.standard_min, self.standard_max) - - # Mimic: 25% chance - if random.randint(1, 100) > 75: - amount = -amount + if random.randint(1, 100) > 75: amount = -amount if amount != 0: user = from_comment.author user.coins += amount - if user.coins < 0: - user.coins = 0 + if user.coins < 0: user.coins = 0 from_comment.treasure_amount = str(amount) self.db.add(user) self.db.add(from_comment) - self.db.commit() + self.db.commit() \ No newline at end of file