Spaces:
Building
Building
Update app.py
Browse files
app.py
CHANGED
@@ -100,7 +100,7 @@ async def perform_roll(interaction: discord.Interaction):
|
|
100 |
|
101 |
# Calculate the index based on luck
|
102 |
max_index = len(sorted_pets) - 1
|
103 |
-
index = int(max_index * (luck_multiplier - 1) /
|
104 |
|
105 |
# Select a random pet from the start of the list to the calculated index
|
106 |
rolled_pet = random.choice(sorted_pets[:index+1])
|
@@ -166,11 +166,11 @@ async def perform_roll(interaction: discord.Interaction):
|
|
166 |
return
|
167 |
|
168 |
current_luck = luck_multipliers.get(user_id, 1)
|
169 |
-
new_luck = min(current_luck
|
170 |
luck_multipliers[user_id] = new_luck
|
171 |
luck_expiration[user_id] = time.time() + 1800 # 30 minutes
|
172 |
|
173 |
-
luck_percentage = (new_luck -
|
174 |
await interaction.response.send_message(f"Your luck has been increased to x{luck_percentage}% for 30 minutes!", ephemeral=True)
|
175 |
|
176 |
increase_luck_button.callback = increase_luck_callback
|
|
|
100 |
|
101 |
# Calculate the index based on luck
|
102 |
max_index = len(sorted_pets) - 1
|
103 |
+
index = int(max_index * (luck_multiplier - 1) / 9) # Assuming max luck is 10
|
104 |
|
105 |
# Select a random pet from the start of the list to the calculated index
|
106 |
rolled_pet = random.choice(sorted_pets[:index+1])
|
|
|
166 |
return
|
167 |
|
168 |
current_luck = luck_multipliers.get(user_id, 1)
|
169 |
+
new_luck = min(current_luck + 1, 1000) # Cap at 10x
|
170 |
luck_multipliers[user_id] = new_luck
|
171 |
luck_expiration[user_id] = time.time() + 1800 # 30 minutes
|
172 |
|
173 |
+
luck_percentage = (new_luck - 10) * 100
|
174 |
await interaction.response.send_message(f"Your luck has been increased to x{luck_percentage}% for 30 minutes!", ephemeral=True)
|
175 |
|
176 |
increase_luck_button.callback = increase_luck_callback
|