Skip to content

Instantly share code, notes, and snippets.

@lorne-luo
Last active December 19, 2018 21:56
Show Gist options
  • Save lorne-luo/475fa8b842ae3d4872adf31340891e98 to your computer and use it in GitHub Desktop.
Save lorne-luo/475fa8b842ae3d4872adf31340891e98 to your computer and use it in GitHub Desktop.
Wows XP Calculator
def xp(exp_flag, free_exp_flag, exp=4000, first_victory=0.5, is_premium=True):
premium_ratio = 1.5 if is_premium else 1
xp_ratio = 1 + exp_flag + 0.07
if first_victory:
xp_ratio += first_victory
base_exp = exp * premium_ratio * xp_ratio
return int(base_exp), int(base_exp * 0.05 * (1 + 0.2 + free_exp_flag))
# XP Free Captain
# Spring Sky 2 7.77
# Mosaic 4
#
# Zulu Hotel 0.5
# Dragon 3.33
# ESCL 0.5
# Scylla 0.5 1.5
# Basilisk 0.75
# Red Dragon 1 1
# Leviathan 0.5 2 1
# Hydra 0.5 2.5 1.5
# Papa 3
# Ouroboros 7.77
def max(exp=4200, exp_flag=2 + 0.5 + 0.5 + 0.75 + 1 + 0.5 + 0.5, free_exp_flag=7.77 + 2 + 2.5 + 3 + 7.77):
return xp(exp_flag, free_exp_flag, exp)
def cal(lines, premiums):
line_dict = {
5: (300, 0),
6: (700, 0),
7: (1450, 0),
8: (2450, 0),
9: (2450, 50),
10: (2450, 150),
}
premium_dict = {
2: (300, 0),
3: (300, 0),
4: (300, 0),
5: (400, 0),
6: (500, 0),
7: (1000, 0),
8: (0, 200),
9: (0, 200),
10: (0, 200),
}
coal = steel = 0
for l in lines:
coal += line_dict[l][0]
steel += line_dict[l][1]
for l in premiums:
coal += premium_dict[l][0]
steel += premium_dict[l][1]
print(coal,steel)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment