-
Notifications
You must be signed in to change notification settings - Fork 0
/
strategies.py
38 lines (34 loc) · 1.79 KB
/
strategies.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
from tools import success, calculate_chance_narrow
def heist_optimal_high_level(casing_needed, challenge_level, suspicion_gain, casing_loss, casing=0, actions=0) -> int:
if casing >= casing_needed:
if success(calculate_chance_narrow(challenge_level, casing)):
return actions
else:
casing -= casing_loss
# suspicion can be lowered with the help of friends at the cost of 1 Action / 4 CP
actions += .25 * suspicion_gain
return heist_optimal_high_level(casing_needed, challenge_level, suspicion_gain, casing_loss, casing, actions)
elif casing >= casing_needed - 9:
# The decoy
actions += 3
casing += 9
return heist_optimal_high_level(casing_needed, challenge_level, suspicion_gain, casing_loss, casing, actions)
else:
# Set your gang of hoodlums to business
actions += 5
casing += 18
return heist_optimal_high_level(casing_needed, challenge_level, suspicion_gain, casing_loss, casing, actions)
def heist_suboptimal_high_level(casing_needed, challenge_level, suspicion_gain, casing_loss, casing=0, actions=0) -> int:
if casing >= casing_needed:
if success(calculate_chance_narrow(challenge_level, casing)):
return actions
else:
casing -= casing_loss
# suspicion can be lowered with the help of friends at the cost of 1 Action / 4 CP
actions += .25 * suspicion_gain
return heist_suboptimal_high_level(casing_needed, challenge_level, suspicion_gain, casing_loss, casing, actions)
else:
# Set your gang of hoodlums to business
actions += 5
casing += 18
return heist_suboptimal_high_level(casing_needed, challenge_level, suspicion_gain, casing_loss, casing, actions)