|
1 |
| -import math |
2 | 1 | from bot.utils.helpers import generate_estimated_yield
|
3 | 2 | from config.settings import DEBUG
|
4 | 3 |
|
5 | 4 |
|
6 | 5 | # Calculate profit based on user inputs and real-time prices
|
7 | 6 | def calculate_custom_profit(prices, herbs, farming_level, patches, weiss, trollheim, hosidius, fortis, compost, kandarin_diary, kourend, magic_secateurs, farming_cape, bottomless_bucket, attas):
|
8 | 7 | # Constants and multipliers
|
9 |
| - compost_chance_reduction = {'None': 1, 'Compost': 2, 'Supercompost': 5, 'Ultracompost': 10} |
10 | 8 | compost_life_value = {'None': 0, 'Compost': 1, 'Supercompost': 2, 'Ultracompost': 3}
|
11 | 9 | item_bonus = 0.1 if magic_secateurs else 0
|
12 | 10 | item_bonus += 0.05 if farming_cape else 0
|
13 | 11 | kandarin_bonus = float(kandarin_diary.split('%')[0]) / 100 if kandarin_diary != 'None' else 0
|
14 | 12 | kourend_bonus = 0.05 if kourend else 0
|
15 |
| - diary_bonus = kandarin_bonus + kourend_bonus |
16 |
| - compost_bonus = compost_chance_reduction.get(compost, 1) |
| 13 | + diary_bonus = kandarin_bonus + kourend_bonus |
17 | 14 | compost_life = compost_life_value.get(compost, 0)
|
18 | 15 | attas_bonus = 0.05 if attas else 0 # Assuming animaType can be checked similarly
|
19 | 16 |
|
@@ -54,7 +51,7 @@ def calculate_custom_profit(prices, herbs, farming_level, patches, weiss, trollh
|
54 | 51 | # Calculate expected yield using detailed mechanics
|
55 | 52 | expected_yield_unprotected = generate_estimated_yield(
|
56 | 53 | farming_level, low_cts, high_cts, harvest_lives, item_bonus, diary_bonus, attas_bonus)
|
57 |
| - |
| 54 | + |
58 | 55 | # Calculate total yield and profit for unprotected patches
|
59 | 56 | total_yield_unprotected = expected_yield_unprotected * unprotected_patches
|
60 | 57 |
|
|
0 commit comments