forked from rDrama/rDrama
1
0
Fork 0
rDrama/files/helpers/treasure.py

29 lines
729 B
Python
Raw Normal View History

2022-02-14 20:29:36 +00:00
import random
special_min = 100
2022-03-17 08:59:44 +00:00
special_max = 200
2022-02-14 20:29:36 +00:00
standard_min = 10
standard_max = 100
def check_for_treasure(in_text, from_comment):
if '!slots' not in in_text and '!blackjack' not in in_text and '!wordle' not in in_text:
seed = random.randint(1, 1000)
is_special = seed == 1000
is_standard = seed >= 990
amount = 0
if is_special:
amount = random.randint(special_min, special_max)
elif is_standard:
amount = random.randint(standard_min, standard_max)
2022-04-03 15:34:21 +00:00
if random.randint(1, 100) > 90:
2022-04-03 20:17:55 +00:00
user = from_comment.author
2022-04-03 15:34:21 +00:00
if amount > user.coins: amount = user.coins
amount = -amount
2022-02-14 20:29:36 +00:00
if amount != 0:
user = from_comment.author
user.coins += amount
from_comment.treasure_amount = str(amount)